-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reject BlobTxs larger than 2 MiB (#4084)
## Overview Directly checks transaction sizes even before they're decoded and removes them if they exceed configured threshold. We should add MaxTxSize constraint in ProcessProposal directly and consider removing the AnteHandler in v4. Issue tracking this work: #4087 ## Testing - Check tx test asserts with logs that the expected error gets hit - Getting logs from prepare proposal was more challenging so i'm inserting a screenshot of application logs when the tests are run. <img width="887" alt="Screenshot 2024-12-06 at 12 27 03" src="https://github.com/user-attachments/assets/bb701834-5a3d-4eef-85f2-07074ae18a27"> <img width="837" alt="Screenshot 2024-12-06 at 12 27 20" src="https://github.com/user-attachments/assets/651d9b87-3d65-43f4-a1a0-3874e03db455"> ## Proposal for improving robustness of our test suites - [ ] Open an issue to assert all logs in our integration tests. --------- Co-authored-by: Rootul P <[email protected]> (cherry picked from commit 3751aac) # Conflicts: # .github/CODEOWNERS # .github/auto_request_review.yml # .github/mergify.yml # .github/workflows/lint.yml # .github/workflows/pr-review-requester.yml # .github/workflows/test.yml # Makefile # app/app.go # app/benchmarks/README.md # app/benchmarks/results.md # app/check_tx.go # app/square_size.go # app/test/big_blob_test.go # app/test/check_tx_test.go # app/test/consistent_apphash_test.go # app/test/prepare_proposal_test.go # app/test/process_proposal_test.go # app/test/upgrade_test.go # cmd/celestia-appd/cmd/start.go # docs/architecture/adr-011-optimistic-blob-size-independent-inclusion-proofs-and-pfb-fraud-proofs.md # docs/architecture/adr-015-namespace-id-size.md # docs/architecture/adr-021-restricted-block-size.md # docs/maintainers/prebuilt-binaries.md # docs/maintainers/release-guide.md # docs/release-notes/release-notes.md # go.mod # go.sum # pkg/appconsts/chain_ids.go # pkg/appconsts/overrides.go # pkg/appconsts/v1/app_consts.go # pkg/appconsts/v2/app_consts.go # pkg/appconsts/v3/app_consts.go # pkg/appconsts/versioned_consts.go # pkg/appconsts/versioned_consts_test.go # scripts/single-node.sh # specs/src/cat_pool.md # specs/src/data_square_layout.md # specs/src/parameters_v1.md # specs/src/parameters_v2.md # specs/src/parameters_v3.md # test/e2e/benchmark/benchmark.go # test/e2e/benchmark/throughput.go # test/e2e/major_upgrade_v2.go # test/e2e/major_upgrade_v3.go # test/e2e/minor_version_compatibility.go # test/e2e/readme.md # test/e2e/simple.go # test/e2e/testnet/node.go # test/e2e/testnet/setup.go # test/e2e/testnet/testnet.go # test/e2e/testnet/txsimNode.go # test/e2e/testnet/util.go # test/interchain/go.mod # test/interchain/go.sum # test/util/blobfactory/payforblob_factory.go # test/util/blobfactory/test_util.go # test/util/testnode/comet_node_test.go # test/util/testnode/config.go # x/blob/ante/blob_share_decorator.go # x/blob/ante/max_total_blob_size_ante.go # x/tokenfilter/README.md
- Loading branch information
1 parent
b9d48a6
commit b5ddfd4
Showing
64 changed files
with
1,287 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,20 @@ jobs: | |
|
||
# hadolint lints the Dockerfile | ||
hadolint: | ||
<<<<<<< HEAD | ||
uses: celestiaorg/.github/.github/workflows/[email protected] | ||
======= | ||
uses: celestiaorg/.github/.github/workflows/[email protected] | ||
>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | ||
with: | ||
dockerfile: "docker/Dockerfile" | ||
|
||
yamllint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
<<<<<<< HEAD | ||
- uses: celestiaorg/.github/.github/actions/[email protected] | ||
======= | ||
- uses: celestiaorg/.github/.github/actions/[email protected] | ||
>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,11 @@ on: | |
jobs: | ||
auto-request-review: | ||
name: Auto request reviews | ||
<<<<<<< HEAD | ||
uses: celestiaorg/.github/.github/workflows/[email protected] | ||
======= | ||
uses: celestiaorg/.github/.github/workflows/[email protected] | ||
>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | ||
secrets: inherit | ||
# write access for issues and pull requests is needed because the called | ||
# workflow requires write access to issues and pull requests and the | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,11 @@ jobs: | |
run: make test-coverage | ||
|
||
- name: Upload coverage.txt | ||
<<<<<<< HEAD | ||
uses: codecov/[email protected] | ||
======= | ||
uses: codecov/[email protected] | ||
>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | ||
with: | ||
file: ./coverage.txt | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package errors | ||
|
||
import ( | ||
"cosmossdk.io/errors" | ||
) | ||
|
||
const AppErrorsCodespace = "app" | ||
|
||
// general application errors | ||
var ( | ||
ErrTxExceedsMaxSize = errors.Register(AppErrorsCodespace, 11142, "exceeds max tx size limit") | ||
) |
Oops, something went wrong.