From b5ddfd43c7f878f51e36f5732dc730f18d3e72ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nina=20/=20=E1=83=9C=E1=83=98=E1=83=9C=E1=83=90?= Date: Wed, 11 Dec 2024 18:38:23 +0100 Subject: [PATCH] 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: https://github.com/celestiaorg/celestia-app/issues/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. Screenshot 2024-12-06 at 12 27 03 Screenshot 2024-12-06 at 12 27 20 ## Proposal for improving robustness of our test suites - [ ] Open an issue to assert all logs in our integration tests. --------- Co-authored-by: Rootul P (cherry picked from commit 3751aacd3a0d54038761dd33df99eca462536609) # 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 --- .github/CODEOWNERS | 3 + .github/auto_request_review.yml | 9 + .github/mergify.yml | 11 + .github/workflows/lint.yml | 8 + .github/workflows/pr-review-requester.yml | 4 + .github/workflows/test.yml | 4 + Makefile | 7 + app/app.go | 4 + app/benchmarks/README.md | 12 ++ app/benchmarks/results.md | 80 ++++++++ app/check_tx.go | 17 ++ app/errors/errors.go | 12 ++ app/square_size.go | 4 + app/test/big_blob_test.go | 51 +++++ app/test/check_tx_test.go | 45 +++++ app/test/consistent_apphash_test.go | 15 ++ app/test/prepare_proposal_test.go | 15 ++ app/test/process_proposal_test.go | 9 + app/test/upgrade_test.go | 10 + cmd/celestia-appd/cmd/start.go | 21 ++ ...t-inclusion-proofs-and-pfb-fraud-proofs.md | 4 + .../architecture/adr-015-namespace-id-size.md | 7 + .../adr-021-restricted-block-size.md | 4 + docs/maintainers/prebuilt-binaries.md | 4 + docs/maintainers/release-guide.md | 8 + docs/release-notes/release-notes.md | 11 + go.mod | 28 +++ go.sum | 74 +++++++ pkg/appconsts/chain_ids.go | 5 + pkg/appconsts/overrides.go | 3 + pkg/appconsts/upgrade_heights.go | 13 ++ pkg/appconsts/v1/app_consts.go | 11 + pkg/appconsts/v2/app_consts.go | 9 + pkg/appconsts/v3/app_consts.go | 4 + pkg/appconsts/versioned_consts.go | 8 + pkg/appconsts/versioned_consts_test.go | 15 ++ scripts/single-node-upgrades.sh | 157 +++++++++++++++ scripts/single-node.sh | 87 ++++++++ specs/src/cat_pool.md | 16 ++ specs/src/data_square_layout.md | 4 + specs/src/parameters_v1.md | 8 + specs/src/parameters_v2.md | 9 + specs/src/parameters_v3.md | 18 ++ test/e2e/benchmark/benchmark.go | 13 ++ test/e2e/benchmark/throughput.go | 9 + test/e2e/major_upgrade_v2.go | 8 + test/e2e/major_upgrade_v3.go | 8 + test/e2e/minor_version_compatibility.go | 8 + test/e2e/readme.md | 8 + test/e2e/simple.go | 8 + test/e2e/testnet/node.go | 73 +++++++ test/e2e/testnet/setup.go | 11 + test/e2e/testnet/testnet.go | 188 ++++++++++++++++++ test/e2e/testnet/txsimNode.go | 22 ++ test/e2e/testnet/util.go | 18 ++ test/interchain/go.mod | 4 + test/interchain/go.sum | 5 + test/util/blobfactory/payforblob_factory.go | 7 + test/util/blobfactory/test_util.go | 4 + test/util/testnode/comet_node_test.go | 29 +++ test/util/testnode/config.go | 4 + x/blob/ante/blob_share_decorator.go | 4 + x/blob/ante/max_total_blob_size_ante.go | 4 + x/tokenfilter/README.md | 4 + 64 files changed, 1287 insertions(+) create mode 100644 app/errors/errors.go create mode 100644 pkg/appconsts/upgrade_heights.go create mode 100755 scripts/single-node-upgrades.sh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7097d57c6b..d70ae25579 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,6 +9,7 @@ # global owners * @celestiaorg/celestia-core +<<<<<<< HEAD # directory owners # NOTE: the directory owners should include the global owners unless the global @@ -16,3 +17,5 @@ docs @liamsi @celestiaorg/celestia-core specs @liamsi @celestiaorg/celestia-core x/blobstream @rach-id @evan-forbes +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) diff --git a/.github/auto_request_review.yml b/.github/auto_request_review.yml index a00957c0e3..79f1ca09fd 100644 --- a/.github/auto_request_review.yml +++ b/.github/auto_request_review.yml @@ -1,11 +1,20 @@ # More info at https://github.com/necojackarc/auto-request-review reviewers: +<<<<<<< HEAD # The default reviewers defaults: # Example of Github Team. Github team must have write access to repo. # NOTE: This assigned the team itself, not members of the team. The Github # team auto PR assignment will then turn this into individuals - team:celestia-core # This is the Github Team +======= + defaults: + - cmwaters + - evan-forbes + - ninabarbakadze + - rach-id + - rootulp +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) options: ignore_draft: true diff --git a/.github/mergify.yml b/.github/mergify.yml index f32c3fafcf..091079b119 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -15,6 +15,17 @@ pull_request_rules: backport: branches: - v2.x +<<<<<<< HEAD +======= + - name: backport patches to v3.x branch + conditions: + - base=main + - label=backport:v3.x + actions: + backport: + branches: + - v3.x +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) - name: forward-port patches to main branch (v1.x) conditions: - base=v1.x diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c41d9dd8d6..69a268451c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,11 @@ jobs: # hadolint lints the Dockerfile hadolint: +<<<<<<< HEAD uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.6 +======= + uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.5.0 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) with: dockerfile: "docker/Dockerfile" @@ -37,4 +41,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 +<<<<<<< HEAD - uses: celestiaorg/.github/.github/actions/yamllint@v0.4.6 +======= + - uses: celestiaorg/.github/.github/actions/yamllint@v0.5.0 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) diff --git a/.github/workflows/pr-review-requester.yml b/.github/workflows/pr-review-requester.yml index 0e62d00940..de59fdc2b1 100644 --- a/.github/workflows/pr-review-requester.yml +++ b/.github/workflows/pr-review-requester.yml @@ -11,7 +11,11 @@ on: jobs: auto-request-review: name: Auto request reviews +<<<<<<< HEAD uses: celestiaorg/.github/.github/workflows/reusable_housekeeping.yml@v0.4.6 +======= + uses: celestiaorg/.github/.github/workflows/reusable_housekeeping.yml@v0.5.0 +>>>>>>> 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b135a91611..7774e07344 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,11 @@ jobs: run: make test-coverage - name: Upload coverage.txt +<<<<<<< HEAD uses: codecov/codecov-action@v4.6.0 +======= + uses: codecov/codecov-action@v5.1.1 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) with: file: ./coverage.txt diff --git a/Makefile b/Makefile index 8d106d4173..cbc17ad20d 100644 --- a/Makefile +++ b/Makefile @@ -28,16 +28,23 @@ PACKAGE_NAME := github.com/celestiaorg/celestia-app/v3 GOLANG_CROSS_VERSION ?= v1.23.1 # Set this to override the max square size of the binary OVERRIDE_MAX_SQUARE_SIZE ?= +<<<<<<< HEAD # Set this to override the upgrade height delay of the binary OVERRIDE_UPGRADE_HEIGHT_DELAY ?= +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) # process linker flags ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=celestia-app \ -X github.com/cosmos/cosmos-sdk/version.AppName=celestia-appd \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ +<<<<<<< HEAD -X github.com/celestiaorg/celestia-app/v3/pkg/appconsts.OverrideSquareSizeUpperBoundStr=$(OVERRIDE_MAX_SQUARE_SIZE) \ -X github.com/celestiaorg/celestia-app/v3/pkg/appconsts.OverrideUpgradeHeightDelayStr=$(OVERRIDE_UPGRADE_HEIGHT_DELAY) +======= + -X github.com/celestiaorg/celestia-app/v3/pkg/appconsts.OverrideSquareSizeUpperBoundStr=$(OVERRIDE_MAX_SQUARE_SIZE) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) BUILD_FLAGS := -tags "ledger" -ldflags '$(ldflags)' diff --git a/app/app.go b/app/app.go index b13e8f7f3f..0ee1c63fe7 100644 --- a/app/app.go +++ b/app/app.go @@ -476,6 +476,10 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo } else if shouldUpgrade, newVersion := app.SignalKeeper.ShouldUpgrade(ctx); shouldUpgrade { // Version changes must be increasing. Downgrades are not permitted if newVersion > currentVersion { +<<<<<<< HEAD +======= + app.BaseApp.Logger().Info("upgrading app version", "current version", currentVersion, "new version", newVersion) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) app.SetAppVersion(ctx, newVersion) app.SignalKeeper.ResetTally(ctx) } diff --git a/app/benchmarks/README.md b/app/benchmarks/README.md index f7f720741b..e80a069052 100644 --- a/app/benchmarks/README.md +++ b/app/benchmarks/README.md @@ -6,7 +6,11 @@ This package contains benchmarks for the ABCI methods with the following transac - IBC update client - PayForBlobs +<<<<<<< HEAD ## How to run +======= +## How to Run +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) To run the benchmarks, run the following in the root directory: @@ -20,8 +24,16 @@ The results are outlined in the [results](results.md) document. ## Key takeaways +<<<<<<< HEAD We decided to softly limit the number of messages contained in a block, via introducing the `MaxPFBMessages` and `MaxNonPFBMessages`, and checking against them in prepare proposal. This way, the default block construction mechanism will only propose blocks that respect these limitations. And if a block that doesn't respect them reached consensus, it will still be accepted since this rule is not consensus breaking. As specified in [results](results.md) document, those results were generated on 16 core 48GB RAM machine, and gave us certain thresholds. However, when we run the same experiments on the recommended validator setup, 4 cores 16GB RAM, the numbers were lower. These low numbers are what we used in the limits. +======= +We decided to softly limit the number of messages contained in a block, by introducing the `MaxPFBMessages` and `MaxNonPFBMessages`, and checking against them while preparing the proposal. + +This way, the default block construction mechanism will only propose blocks that respect these limitations. And if a block that doesn't respect them reaches consensus, it will still be accepted since this rule is not consensus breaking. + +As specified in the [results](results.md) document, those results were generated on a 16-core, 48GB RAM machine and gave us certain thresholds. However, when we ran the same experiments on the recommended validator setup, with a 4-core, 16GB RAM machine, the numbers were lower. These low numbers are what we used in the limits. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) diff --git a/app/benchmarks/results.md b/app/benchmarks/results.md index 9562a6a340..0d2c70563d 100644 --- a/app/benchmarks/results.md +++ b/app/benchmarks/results.md @@ -13,6 +13,7 @@ The benchmarks will be run using an in memory DB, then a local db, goleveldb. #### CheckTx +<<<<<<< HEAD A single `checkTx` of a `sendMsg` message takes 0.0003585 **ns** to execute. And it uses 74374 gas. The transactions in an `8mb` block containing 31645 `sendMsg` messages take 6,29 s (6293858682 ns) to run `checkTx` on all of them. The total gas used is 1884371034 gas. @@ -34,6 +35,29 @@ An `8mb` block containing 31645 `sendMsg` messages takes 5,04 s (5049140917 ns) A single `processProposal` of a `sendMsg` message takes 0.0002313 **ns** to execute. And it uses 101110 gas. An `8mb` block containing 31645 `sendMsg` messages takes 5,17 s (5179850250 ns) to execute. The total gas used 1,843,040,790 gas. +======= +A single `checkTx` of a `sendMsg` message takes 0.0003585 **ns** to execute and it uses 74374 gas. + +The transactions in an `8MB` block containing 31645 `sendMsg` messages take 6,29 s (6293858682 ns) to run `checkTx` on all of them. The total gas used is 1884371034 gas. + +#### DeliverTx + +A single `deliverTx` of a `sendMsg` message takes 0.0002890 **ns** to execute and it uses 103251 gas. + +The transactions in an `8MB` block containing 31645 `sendMsg` messages take 7,56 s (7564111078 ns) to run `deliverTx` on all of them. The total gas used is 2801272121 gas. + +#### PrepareProposal + +A single `prepareProposal` of a `sendMsg` message takes 0.0002801 **ns** to execute and it uses 101110 gas. + +An `8MB` block containing 31645 `sendMsg` messages takes 5,04 s (5049140917 ns) to execute. The total gas used is 1843040790 gas. + +#### ProcessProposal + +A single `processProposal` of a `sendMsg` message takes 0.0002313 **ns** to execute and it uses 101110 gas. + +An `8MB` block containing 31645 `sendMsg` messages takes 5,17 s (5179850250 ns) to execute. The total gas used 1,843,040,790 gas. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) For the processing time of a block full of `sendMsg`, we benchmarked how much time they take depending on the number of transactions, and we have the following results: @@ -123,7 +147,11 @@ Benchmarks of `DeliverTx` for a single PFB with different sizes: #### PrepareProposal: `BenchmarkPrepareProposal_PFB_Multi` +<<<<<<< HEAD The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different sizes: +======= +The benchmarks for `PrepareProposal` for 8MB blocks containing PFBs of different sizes: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Prepare Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -147,7 +175,11 @@ The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different #### ProcessProposal: `BenchmarkProcessProposal_PFB_Multi` +<<<<<<< HEAD The benchmarks for `ProcessProposal` for 8mb blocks containing PFBs of different sizes: +======= +The benchmarks for `ProcessProposal` for 8MB blocks containing PFBs of different sizes: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Process Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -217,7 +249,11 @@ The benchmarks of executing `deliverTx` on a single transaction containing an IB #### PrepareProposal: `BenchmarkIBC_PrepareProposal_Update_Client_Multi` +<<<<<<< HEAD Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with different number of signatures: +======= +Benchmarks of an `8MB` containing the maximum number of IBC `UpdateClient` with different number of signatures: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Number of Validators | Number of Verified Signatures | Prepare Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |-------------------------------------------------------------------------------|------------------|-------------------------|----------------------|-------------------------------|-----------------------------|------------------|----------------------------|------------------------| @@ -238,7 +274,11 @@ Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with #### ProcessProposal: `BenchmarkIBC_ProcessProposal_Update_Client_Multi` +<<<<<<< HEAD Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with different number of signatures: +======= +Benchmarks of an `8MB` containing the maximum number of IBC `UpdateClient` with different number of signatures: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Number of Validators | Number of Verified Signatures | Process Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |-------------------------------------------------------------------------------|-----------------|------------------------|----------------------|-------------------------------|---------------------------|----------------|--------------------------|-----------------------| @@ -627,6 +667,7 @@ Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with #### CheckTx +<<<<<<< HEAD A single `checkTx` of a `sendMsg` message takes 0.0003071 **ns** to execute. And it uses 74374 gas. The transactions in an `8mb` block containing 31645 `sendMsg` messages take 6,45 s (6455816060 ns) to run `checkTx` on all of them. The total gas used is 1884371034 gas. @@ -648,6 +689,29 @@ An `8mb` block containing 31645 `sendMsg` messages takes 5,2 s (5242159792 ns) t A single `processProposal` of a `sendMsg` message takes 0.0003010 **ns** to execute. And it uses 101110 gas. An `8mb` block containing 31645 `sendMsg` messages takes 5,21 s (5214205041 ns) to execute. The total gas used 1843040790 gas. +======= +A single `checkTx` of a `sendMsg` message takes 0.0003071 **ns** to execute and it uses 74374 gas. + +The transactions in an `8MB` block containing 31645 `sendMsg` messages take 6,45 s (6455816060 ns) to run `checkTx` on all of them. The total gas used is 1884371034 gas. + +#### DeliverTx + +A single `deliverTx` of a `sendMsg` message takes 0.0003948 **ns** to execute and it uses 103251 gas. + +The transactions in an `8MB` block containing 31645 `sendMsg` messages take 7,50 s (7506830940 ns) to run `deliverTx` on all of them. The total gas used is 2801272121 gas. + +#### PrepareProposal + +A single `prepareProposal` of a `sendMsg` message takes 0.0003943 **ns** to execute and it uses 101110 gas. + +An `8MB` block containing 31645 `sendMsg` messages takes 5,2 s (5242159792 ns) to execute. The total gas used 1843040790 gas. + +#### ProcessProposal + +A single `processProposal` of a `sendMsg` message takes 0.0003010 **ns** to execute and it uses 101110 gas. + +An `8MB` block containing 31645 `sendMsg` messages takes 5,21 s (5214205041 ns) to execute. The total gas used 1843040790 gas. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ### `PFB` benchmarks @@ -701,7 +765,11 @@ Benchmarks of `DeliverTx` for a single PFB with different sizes: #### PrepareProposal: `BenchmarkPrepareProposal_PFB_Multi` +<<<<<<< HEAD The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different sizes: +======= +The benchmarks for `PrepareProposal` for 8MB blocks containing PFBs of different sizes: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Prepare Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -725,7 +793,11 @@ The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different #### ProcessProposal: `BenchmarkProcessProposal_PFB_Multi` +<<<<<<< HEAD The benchmarks for `ProcessProposal` for 8mb blocks containing PFBs of different sizes: +======= +The benchmarks for `ProcessProposal` for 8MB blocks containing PFBs of different sizes: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Process Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -795,7 +867,11 @@ The benchmarks of executing `deliverTx` on a single transaction containing an IB #### PrepareProposal: `BenchmarkIBC_PrepareProposal_Update_Client_Multi` +<<<<<<< HEAD Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with different number of signatures: +======= +Benchmarks of an `8MB` containing the maximum number of IBC `UpdateClient` with different number of signatures: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Number of Validators | Number of Verified Signatures | Prepare Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |-------------------------------------------------------------------------------|-----------------|------------------------|----------------------|-------------------------------|---------------------------|----------------|--------------------------|-----------------------| @@ -817,7 +893,11 @@ Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with #### ProcessProposal: `BenchmarkIBC_ProcessProposal_Update_Client_Multi` +<<<<<<< HEAD Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with different number of signatures: +======= +Benchmarks of an `8MB` containing the maximum number of IBC `UpdateClient` with different number of signatures: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Benchmark Name | Block Size (MB) | Number of Transactions | Number of Validators | Number of Verified Signatures | Process Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |-------------------------------------------------------------------------------|-----------------|------------------------|----------------------|-------------------------------|---------------------------|----------------|--------------------------|-----------------------| diff --git a/app/check_tx.go b/app/check_tx.go index f76b37880f..7e0248b710 100644 --- a/app/check_tx.go +++ b/app/check_tx.go @@ -3,6 +3,12 @@ package app import ( "fmt" +<<<<<<< HEAD +======= + "cosmossdk.io/errors" + + apperr "github.com/celestiaorg/celestia-app/v3/app/errors" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" blobtypes "github.com/celestiaorg/celestia-app/v3/x/blob/types" blobtx "github.com/celestiaorg/go-square/v2/tx" @@ -15,6 +21,17 @@ import ( // transactions that contain blobs. func (app *App) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { tx := req.Tx +<<<<<<< HEAD +======= + + // all txs must be less than or equal to the max tx size limit + maxTxSize := appconsts.MaxTxSize(app.AppVersion()) + currentTxSize := len(tx) + if currentTxSize > maxTxSize { + return sdkerrors.ResponseCheckTxWithEvents(errors.Wrapf(apperr.ErrTxExceedsMaxSize, "tx size %d bytes is larger than the application's configured MaxTxSize of %d bytes for version %d", currentTxSize, maxTxSize, app.AppVersion()), 0, 0, []abci.Event{}, false) + } + +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // check if the transaction contains blobs btx, isBlob, err := blobtx.UnmarshalBlobTx(tx) if isBlob && err != nil { diff --git a/app/errors/errors.go b/app/errors/errors.go new file mode 100644 index 0000000000..9bbff18b42 --- /dev/null +++ b/app/errors/errors.go @@ -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") +) diff --git a/app/square_size.go b/app/square_size.go index 4ed7f0ac5d..d465ceaa23 100644 --- a/app/square_size.go +++ b/app/square_size.go @@ -10,7 +10,11 @@ func (app *App) MaxEffectiveSquareSize(ctx sdk.Context) int { // TODO: fix hack that forces the max square size for the first height to // 64. This is due to our fork of the sdk not initializing state before // BeginBlock of the first block. This is remedied in versions of the sdk +<<<<<<< HEAD // and comet that have full support of PreparePropsoal, although +======= + // and comet that have full support of PrepareProposal, although +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // celestia-app does not currently use those. see this PR for more details // https://github.com/cosmos/cosmos-sdk/pull/14505 if ctx.BlockHeader().Height <= 1 { diff --git a/app/test/big_blob_test.go b/app/test/big_blob_test.go index cede1ae65d..e870810536 100644 --- a/app/test/big_blob_test.go +++ b/app/test/big_blob_test.go @@ -7,6 +7,10 @@ import ( "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" +<<<<<<< HEAD +======= + apperrors "github.com/celestiaorg/celestia-app/v3/app/errors" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/pkg/user" "github.com/celestiaorg/celestia-app/v3/test/util/testfactory" @@ -55,7 +59,11 @@ func (s *BigBlobSuite) SetupSuite() { require.NoError(t, cctx.WaitForNextBlock()) } +<<<<<<< HEAD // TestErrBlobsTooLarge verifies that submitting a 2 MiB blob hits ErrBlobsTooLarge. +======= +// TestErrBlobsTooLarge verifies that submitting a ~1.9 MiB blob hits ErrBlobsTooLarge. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) func (s *BigBlobSuite) TestErrBlobsTooLarge() { t := s.T() @@ -67,8 +75,13 @@ func (s *BigBlobSuite) TestErrBlobsTooLarge() { } testCases := []testCase{ { +<<<<<<< HEAD name: "2 mebibyte blob", blob: newBlobWithSize(2 * mebibyte), +======= + name: "~ 1.9 MiB blob", + blob: newBlobWithSize(2_000_000), +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) want: blobtypes.ErrBlobsTooLarge.ABCICode(), }, } @@ -88,3 +101,41 @@ func (s *BigBlobSuite) TestErrBlobsTooLarge() { }) } } +<<<<<<< HEAD +======= + +// TestBlobExceedsMaxTxSize verifies that submitting a 2 MiB blob hits ErrTxExceedsMaxSize. +func (s *BigBlobSuite) TestBlobExceedsMaxTxSize() { + t := s.T() + + type testCase struct { + name string + blob *share.Blob + expectedCode uint32 + expectedErr string + } + testCases := []testCase{ + { + name: "2 MiB blob", + blob: newBlobWithSize(2097152), + expectedCode: apperrors.ErrTxExceedsMaxSize.ABCICode(), + expectedErr: apperrors.ErrTxExceedsMaxSize.Error(), + }, + } + + txClient, err := testnode.NewTxClientFromContext(s.cctx) + require.NoError(t, err) + + for _, tc := range testCases { + s.Run(tc.name, func() { + subCtx, cancel := context.WithTimeout(s.cctx.GoContext(), 30*time.Second) + defer cancel() + res, err := txClient.SubmitPayForBlob(subCtx, []*share.Blob{tc.blob}, user.SetGasLimitAndGasPrice(1e9, appconsts.DefaultMinGasPrice)) + require.Error(t, err) + require.Nil(t, res) + code := err.(*user.BroadcastTxError).Code + require.Equal(t, tc.expectedCode, code, err.Error(), tc.expectedErr) + }) + } +} +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) diff --git a/app/test/check_tx_test.go b/app/test/check_tx_test.go index aba7720547..e7dec546b2 100644 --- a/app/test/check_tx_test.go +++ b/app/test/check_tx_test.go @@ -11,6 +11,10 @@ import ( "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" +<<<<<<< HEAD +======= + apperr "github.com/celestiaorg/celestia-app/v3/app/errors" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/pkg/user" testutil "github.com/celestiaorg/celestia-app/v3/test/util" @@ -32,7 +36,11 @@ func TestCheckTx(t *testing.T) { ns1, err := share.NewV0Namespace(bytes.Repeat([]byte{1}, share.NamespaceVersionZeroIDSize)) require.NoError(t, err) +<<<<<<< HEAD accs := []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"} +======= + accs := []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m"} +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testApp, kr := testutil.SetupTestAppWithGenesisValSet(app.DefaultConsensusParams(), accs...) testApp.Commit() @@ -173,11 +181,19 @@ func TestCheckTx(t *testing.T) { expectedABCICode: abci.CodeTypeOK, }, { +<<<<<<< HEAD name: "10,000,000 byte blob", checkType: abci.CheckTxType_New, getTx: func() []byte { signer := createSigner(t, kr, accs[9], encCfg.TxConfig, 10) _, blobs := blobfactory.RandMsgPayForBlobsWithSigner(tmrand.NewRand(), signer.Account(accs[9]).Address().String(), 10_000_000, 1) +======= + name: "2,000,000 byte blob", + checkType: abci.CheckTxType_New, + getTx: func() []byte { + signer := createSigner(t, kr, accs[9], encCfg.TxConfig, 10) + _, blobs := blobfactory.RandMsgPayForBlobsWithSigner(tmrand.NewRand(), signer.Account(accs[9]).Address().String(), 2_000_000, 1) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) tx, _, err := signer.CreatePayForBlobs(accs[9], blobs, opts...) require.NoError(t, err) return tx @@ -217,6 +233,35 @@ func TestCheckTx(t *testing.T) { }, expectedABCICode: abci.CodeTypeOK, }, +<<<<<<< HEAD +======= + { + name: "v1 blob over 2MiB", + checkType: abci.CheckTxType_New, + getTx: func() []byte { + signer := createSigner(t, kr, accs[11], encCfg.TxConfig, 12) + blob, err := share.NewV1Blob(share.RandomBlobNamespace(), bytes.Repeat([]byte{1}, 2097152), signer.Account(accs[11]).Address()) + require.NoError(t, err) + blobTx, _, err := signer.CreatePayForBlobs(accs[11], []*share.Blob{blob}, opts...) + require.NoError(t, err) + return blobTx + }, + expectedABCICode: apperr.ErrTxExceedsMaxSize.ABCICode(), + }, + { + name: "v0 blob over 2MiB", + checkType: abci.CheckTxType_New, + getTx: func() []byte { + signer := createSigner(t, kr, accs[12], encCfg.TxConfig, 13) + blob, err := share.NewV0Blob(share.RandomBlobNamespace(), bytes.Repeat([]byte{1}, 2097152)) + require.NoError(t, err) + blobTx, _, err := signer.CreatePayForBlobs(accs[12], []*share.Blob{blob}, opts...) + require.NoError(t, err) + return blobTx + }, + expectedABCICode: apperr.ErrTxExceedsMaxSize.ABCICode(), + }, +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } for _, tt := range tests { diff --git a/app/test/consistent_apphash_test.go b/app/test/consistent_apphash_test.go index 9a108e4dd1..7aae498b16 100644 --- a/app/test/consistent_apphash_test.go +++ b/app/test/consistent_apphash_test.go @@ -62,6 +62,13 @@ type appHashTest struct { expectedAppHash []byte } +<<<<<<< HEAD +======= +func DefaultTxOpts() []user.TxOption { + return blobfactory.FeeTxOpts(10_000_000) +} + +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // TestConsistentAppHash executes all state machine messages on all app versions, generates an app hash, // and compares it against a previously generated hash from the same set of transactions. // App hashes across different commits should be consistent. @@ -377,7 +384,11 @@ func createEncodedBlobTx(t *testing.T, signer *user.Signer, accountAddresses []s blobTx := blobTx{ author: senderAcc.Name(), blobs: []*share.Blob{blob}, +<<<<<<< HEAD txOptions: blobfactory.DefaultTxOpts(), +======= + txOptions: DefaultTxOpts(), +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } encodedBlobTx, _, err := signer.CreatePayForBlobs(blobTx.author, blobTx.blobs, blobTx.txOptions...) require.NoError(t, err) @@ -429,7 +440,11 @@ func deterministicKeyRing(cdc codec.Codec) (keyring.Keyring, []types.PubKey) { func processSdkMessages(signer *user.Signer, sdkMessages []sdk.Msg) ([][]byte, error) { encodedTxs := make([][]byte, 0, len(sdkMessages)) for _, msg := range sdkMessages { +<<<<<<< HEAD encodedTx, err := signer.CreateTx([]sdk.Msg{msg}, blobfactory.DefaultTxOpts()...) +======= + encodedTx, err := signer.CreateTx([]sdk.Msg{msg}, DefaultTxOpts()...) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if err != nil { return nil, err } diff --git a/app/test/prepare_proposal_test.go b/app/test/prepare_proposal_test.go index f274d9da6a..add03859f8 100644 --- a/app/test/prepare_proposal_test.go +++ b/app/test/prepare_proposal_test.go @@ -51,7 +51,10 @@ func TestPrepareProposalPutsPFBsAtEnd(t *testing.T) { accnts[:numBlobTxs], infos[:numBlobTxs], testfactory.Repeat([]*share.Blob{protoBlob}, numBlobTxs), +<<<<<<< HEAD blobfactory.DefaultTxOpts()..., +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) normalTxs := testutil.SendTxsWithAccounts( @@ -109,7 +112,10 @@ func TestPrepareProposalFiltering(t *testing.T) { testfactory.RandomBlobNamespaces(tmrand.NewRand(), 3), [][]int{{100}, {1000}, {420}}, ), +<<<<<<< HEAD blobfactory.DefaultTxOpts()..., +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) // create 3 MsgSend transactions that are signed with valid account numbers @@ -173,6 +179,7 @@ func TestPrepareProposalFiltering(t *testing.T) { // 3 transactions over MaxTxSize limit largeTxs := coretypes.Txs(testutil.SendTxsWithAccounts(t, testApp, encConf.TxConfig, kr, 1000, accounts[0], accounts[:3], testutil.ChainID, user.SetMemo(largeString))).ToSliceOfBytes() +<<<<<<< HEAD // 3 blobTxs over MaxTxSize limit largeBlobTxs := blobfactory.ManyMultiBlobTx( t, @@ -189,6 +196,8 @@ func TestPrepareProposalFiltering(t *testing.T) { user.SetMemo(largeString), ) +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) type test struct { name string txs func() [][]byte @@ -243,9 +252,15 @@ func TestPrepareProposalFiltering(t *testing.T) { { name: "blobTxs and sendTxs that exceed MaxTxSize limit", txs: func() [][]byte { +<<<<<<< HEAD return append(largeTxs, largeBlobTxs...) // All txs are over MaxTxSize limit }, prunedTxs: append(largeTxs, largeBlobTxs...), +======= + return largeTxs // All txs are over MaxTxSize limit + }, + prunedTxs: largeTxs, +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) }, } diff --git a/app/test/process_proposal_test.go b/app/test/process_proposal_test.go index 33b1d406c5..4febc6feae 100644 --- a/app/test/process_proposal_test.go +++ b/app/test/process_proposal_test.go @@ -3,7 +3,10 @@ package app_test import ( "bytes" "fmt" +<<<<<<< HEAD "strings" +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "testing" "time" @@ -51,6 +54,7 @@ func TestProcessProposal(t *testing.T) { testfactory.RandomBlobNamespaces(tmrand.NewRand(), 4), [][]int{{100}, {1000}, {420}, {300}}, ), +<<<<<<< HEAD blobfactory.DefaultTxOpts()..., ) @@ -71,6 +75,8 @@ func TestProcessProposal(t *testing.T) { // transaction over the configured max tx size limit largeSendTx := testutil.SendTxsWithAccounts( t, testApp, enc, kr, 1000, accounts[0], accounts[1:2], testutil.ChainID, user.SetMemo(largeMemo), +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) // create 3 MsgSend transactions that are signed with valid account numbers @@ -349,6 +355,7 @@ func TestProcessProposal(t *testing.T) { appVersion: v3.Version, expectedResult: abci.ResponseProcessProposal_REJECT, }, +<<<<<<< HEAD { name: "blob txs larger than configured max tx size", input: validData(), @@ -369,6 +376,8 @@ func TestProcessProposal(t *testing.T) { appVersion: appconsts.LatestVersion, expectedResult: abci.ResponseProcessProposal_REJECT, }, +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } for _, tt := range tests { diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index e42449d747..271398c1ec 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -38,9 +38,12 @@ func TestAppUpgradeV3(t *testing.T) { t.Skip("skipping TestAppUpgradeV3 in short mode") } +<<<<<<< HEAD appconsts.OverrideUpgradeHeightDelayStr = "1" defer func() { appconsts.OverrideUpgradeHeightDelayStr = "" }() +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testApp, genesis := SetupTestAppWithUpgradeHeight(t, 3) upgradeFromV1ToV2(t, testApp) @@ -104,7 +107,10 @@ func TestAppUpgradeV3(t *testing.T) { require.NoError(t, err) require.Equal(t, v3.Version, getUpgradeResp.Upgrade.AppVersion) +<<<<<<< HEAD // brace yourselfs, this part may take a while +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) initialHeight := int64(4) for height := initialHeight; height < initialHeight+appconsts.UpgradeHeightDelay(testApp.GetChainID(), v2.Version); height++ { appVersion := v2.Version @@ -259,6 +265,10 @@ func SetupTestAppWithUpgradeHeight(t *testing.T, upgradeHeight int64) (*app.App, encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) testApp := app.New(log.NewNopLogger(), db, nil, 0, encCfg, upgradeHeight, util.EmptyAppOptions{}) genesis := genesis.NewDefaultGenesis(). +<<<<<<< HEAD +======= + WithChainID("test"). +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) WithValidators(genesis.NewDefaultValidator(testnode.DefaultValidatorAccountName)). WithConsensusParams(app.DefaultInitialConsensusParams()) genDoc, err := genesis.Export() diff --git a/cmd/celestia-appd/cmd/start.go b/cmd/celestia-appd/cmd/start.go index de97d4dfa0..406ad5fa89 100644 --- a/cmd/celestia-appd/cmd/start.go +++ b/cmd/celestia-appd/cmd/start.go @@ -14,6 +14,10 @@ import ( "strings" "time" +<<<<<<< HEAD +======= + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" @@ -117,6 +121,23 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. return err } +<<<<<<< HEAD +======= + switch clientCtx.ChainID { + case appconsts.ArabicaChainID: + serverCtx.Logger.Info(fmt.Sprintf("Since the chainID is %v, configuring the default v2 upgrade height to %v", appconsts.ArabicaChainID, appconsts.ArabicaUpgradeHeightV2)) + serverCtx.Viper.SetDefault(UpgradeHeightFlag, appconsts.ArabicaUpgradeHeightV2) + case appconsts.MochaChainID: + serverCtx.Logger.Info(fmt.Sprintf("Since the chainID is %v, configuring the default v2 upgrade height to %v", appconsts.MochaChainID, appconsts.MochaUpgradeHeightV2)) + serverCtx.Viper.SetDefault(UpgradeHeightFlag, appconsts.MochaUpgradeHeightV2) + case appconsts.MainnetChainID: + serverCtx.Logger.Info(fmt.Sprintf("Since the chainID is %v, configuring the default v2 upgrade height to %v", appconsts.MainnetChainID, appconsts.MainnetUpgradeHeightV2)) + serverCtx.Viper.SetDefault(UpgradeHeightFlag, appconsts.MainnetUpgradeHeightV2) + default: + serverCtx.Logger.Info(fmt.Sprintf("No default value exists for the v2 upgrade height when the chainID is %v", clientCtx.ChainID)) + } + +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) withTM, _ := cmd.Flags().GetBool(flagWithTendermint) if !withTM { serverCtx.Logger.Info("starting ABCI without Tendermint") diff --git a/docs/architecture/adr-011-optimistic-blob-size-independent-inclusion-proofs-and-pfb-fraud-proofs.md b/docs/architecture/adr-011-optimistic-blob-size-independent-inclusion-proofs-and-pfb-fraud-proofs.md index 599f28eb18..98086557d7 100644 --- a/docs/architecture/adr-011-optimistic-blob-size-independent-inclusion-proofs-and-pfb-fraud-proofs.md +++ b/docs/architecture/adr-011-optimistic-blob-size-independent-inclusion-proofs-and-pfb-fraud-proofs.md @@ -51,7 +51,11 @@ A PFB Fraud Proof = PFB Inclusion Proof + Blob Inclusion Proof After you verify the PFB Inclusion Proof you will get the: - index where the blob is located +<<<<<<< HEAD - how long the bob is +======= +- how long the blob is +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) - the commitment of the blob With the information that you now confirmed you can confirm the blob inclusion proof of the shares that start at the index for the given length. diff --git a/docs/architecture/adr-015-namespace-id-size.md b/docs/architecture/adr-015-namespace-id-size.md index 3333c05f0d..e89f83d4c7 100644 --- a/docs/architecture/adr-015-namespace-id-size.md +++ b/docs/architecture/adr-015-namespace-id-size.md @@ -50,7 +50,11 @@ Users will specify a version (1 byte) and a ID (28 bytes) in their PFB. Addition ### Criteria 1 +<<<<<<< HEAD The namespace ID must provide at least 72 bits of randomness [^2] to satisfy criteria 1. Since an 8 byte namespace ID can only provide 64 bits of randomness, it fail to meet this criteria. +======= +The namespace ID must provide at least 72 bits of randomness to satisfy criteria 1. Since an 8 byte namespace ID can only provide 64 bits of randomness, it fail to meet this criteria. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | Namespace ID size (bytes) | Criteria 1 | |---------------------------|------------| @@ -229,7 +233,10 @@ Note: to verify the number of SHA256 compression invocations, we analyzed the nu - [^1]: This assumes a user uses sufficient entropy to generate the namespace ID and isn't front-run by an adversary prior to actually using the namespace. +<<<<<<< HEAD [^2]: +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) [^3]: [^4]: diff --git a/docs/architecture/adr-021-restricted-block-size.md b/docs/architecture/adr-021-restricted-block-size.md index 6f372e5952..163ff695ee 100644 --- a/docs/architecture/adr-021-restricted-block-size.md +++ b/docs/architecture/adr-021-restricted-block-size.md @@ -106,7 +106,11 @@ func (app *App) GovMaxSquareSize(ctx sdk.Context) int { // TODO: fix hack that forces the max square size for the first height to // 64. This is due to tendermint not technically supposed to be calling // PrepareProposal when heights are not >= 1. This is remedied in versions +<<<<<<< HEAD // of the sdk and comet that have full support of PreparePropsoal, although +======= + // of the sdk and comet that have full support of PrepareProposal, although +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // celestia-app does not currently use those. see this PR for more // details https://github.com/cosmos/cosmos-sdk/pull/14505 if ctx.BlockHeader().Height == 0 { diff --git a/docs/maintainers/prebuilt-binaries.md b/docs/maintainers/prebuilt-binaries.md index 9be52d76bc..82919f60dc 100644 --- a/docs/maintainers/prebuilt-binaries.md +++ b/docs/maintainers/prebuilt-binaries.md @@ -13,7 +13,11 @@ Prebuilt binaries are attached to each release via [GoReleaser](https://goreleas ## Steps +<<<<<<< HEAD 1. [Optional] If you need to make any code changes to fix the issue that occured when CI tried to generate and attach the prebuilt binaries, then you likely need to skip validation when running GoReleaser locally. To skip validation, modify the Makefile command like so: +======= +1. [Optional] If you need to make any code changes to fix the issue that occurred when CI tried to generate and attach the prebuilt binaries, then you likely need to skip validation when running GoReleaser locally. To skip validation, modify the Makefile command like so: +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ```diff ## prebuilt-binary: Create prebuilt binaries and attach them to GitHub release. Requires Docker. diff --git a/docs/maintainers/release-guide.md b/docs/maintainers/release-guide.md index 698799235e..98a455fc45 100644 --- a/docs/maintainers/release-guide.md +++ b/docs/maintainers/release-guide.md @@ -15,7 +15,11 @@ The target audience for this guide is maintainers of this repo. In general, the 1. Choose a version tag based on [Semantic Versioning](https://semver.org/). Include the `-rc` suffix followed by the next integer. RCs start at 0. 1. Change the target branch to `v1.x` or `v2.x` based on the version you're releasing. 1. Click **Generate release notes**. +<<<<<<< HEAD 1. Toggle on the **Set as a pre-relase** checkbox. +======= +1. Toggle on the **Set as a pre-release** checkbox. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) 1. **Publish release**. ### After creating the release candidate @@ -32,7 +36,11 @@ Follow the [creating a release candidate](#creating-a-release-candidate) section - The version tag should not include the `-rc` suffix. - If the release targets a testnet, suffix the release with `-arabica` or `-mocha`. - The release notes should contain an **Upgrade Notice** section with notable changes for node operators or library consumers. +<<<<<<< HEAD - The release notes section should contain a link to https://github.com/celestiaorg/celestia-app/blob/main/docs/release-notes/release-notes.md where we capture breaking changes +======= +- The release notes section should contain a link to where we capture breaking changes +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) After creating the release: diff --git a/docs/release-notes/release-notes.md b/docs/release-notes/release-notes.md index 48e72f45ee..0891b8320e 100644 --- a/docs/release-notes/release-notes.md +++ b/docs/release-notes/release-notes.md @@ -9,10 +9,17 @@ This guide provides notes for major version releases. These notes may be helpful #### Enabling BBR and MCTCP Consensus node operators must enable the BBR (Bottleneck Bandwidth and Round-trip propagation time) congestion control algorithm. See [#3774](https://github.com/celestiaorg/celestia-app/pull/3774). +<<<<<<< HEAD if using linux in docker, kubernetes, a vm or baremetal, this can be done by calling ```sh make enable-bbr +======= +if using linux in docker, kubernetes, a vm or baremetal, this can be done by calling + +```sh +make enable-bbr +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ``` command on the host machine. @@ -54,7 +61,11 @@ You can track the tally of signalling by validators using the following query celestia-appd query signal tally 3 ``` +<<<<<<< HEAD Once 5/6+ of the voting power have signalled, the upgrade will be ready. There is a hard coded delay between confirmation of the upgrade and execution to the new state machine. +======= +Once 5/6+ of the voting power have signalled, the upgrade will be ready. There is a hard coded delay between confirmation of the upgrade and execution to the new state machine. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) To view the upcoming upgrade height use the following query: diff --git a/go.mod b/go.mod index 19ace11c8d..cc94eef9ce 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,11 @@ require ( github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 github.com/celestiaorg/go-square v1.1.1 github.com/celestiaorg/go-square/v2 v2.1.0 +<<<<<<< HEAD github.com/celestiaorg/knuu v0.16.1 +======= + github.com/celestiaorg/knuu v0.16.2 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/celestiaorg/nmt v0.22.2 github.com/celestiaorg/rsmt2d v0.14.0 github.com/cometbft/cometbft-db v1.0.1 @@ -17,7 +21,11 @@ require ( github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2 github.com/cosmos/ibc-go/v6 v6.2.2 +<<<<<<< HEAD github.com/ethereum/go-ethereum v1.14.11 +======= + github.com/ethereum/go-ethereum v1.14.12 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/gogo/protobuf v1.3.3 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 @@ -28,15 +36,25 @@ require ( github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 +<<<<<<< HEAD github.com/stretchr/testify v1.9.0 +======= + github.com/stretchr/testify v1.10.0 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/tendermint/tendermint v0.34.29 github.com/tendermint/tm-db v0.6.7 golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 google.golang.org/grpc v1.68.0 +<<<<<<< HEAD google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v2 v2.4.0 k8s.io/apimachinery v0.31.1 +======= + google.golang.org/protobuf v1.35.2 + gopkg.in/yaml.v2 v2.4.0 + k8s.io/apimachinery v0.31.3 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) require ( @@ -227,6 +245,7 @@ require ( go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect +<<<<<<< HEAD golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect @@ -234,6 +253,15 @@ require ( golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect golang.org/x/text v0.18.0 // indirect +======= + golang.org/x/crypto v0.29.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/term v0.26.0 // indirect + golang.org/x/text v0.20.0 // indirect +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.169.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect diff --git a/go.sum b/go.sum index be82422978..e7ec84d98f 100644 --- a/go.sum +++ b/go.sum @@ -325,8 +325,13 @@ github.com/celestiaorg/go-square v1.1.1 h1:Cy3p8WVspVcyOqHM8BWFuuYPwMitO1pYGe+Im github.com/celestiaorg/go-square v1.1.1/go.mod h1:1EXMErhDrWJM8B8V9hN7dqJ2kUTClfwdqMOmF9yQUa0= github.com/celestiaorg/go-square/v2 v2.1.0 h1:ECIvYEeHIWiIJGDCJxQNtzqm5DmnBly7XGhSpLsl+Lw= github.com/celestiaorg/go-square/v2 v2.1.0/go.mod h1:n3ztrh8CBjWOD6iWYMo3pPOlQIgzLK9yrnqMPcNo6g8= +<<<<<<< HEAD github.com/celestiaorg/knuu v0.16.1 h1:EOR/c9kvc0jZet/mma2qwAdlvEbl94bW9cC8FItkyBE= github.com/celestiaorg/knuu v0.16.1/go.mod h1:y20nUmVWVgbzxBKHqmbwp3C0ZJ9J9ovCg1ylHo85hdQ= +======= +github.com/celestiaorg/knuu v0.16.2 h1:OOl2xMf+5ryWtPcSF+M6gmw4YQPEh6lsCA/lTDl8fwI= +github.com/celestiaorg/knuu v0.16.2/go.mod h1:nB7IGCR984YKEDW+j5xHPOidYfbO4DoZI1rDKijvF5E= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4/go.mod h1:fzuHnhzj1pUygGz+1ZkB3uQbEUL4htqCGJ4Qs2LwMZA= github.com/celestiaorg/nmt v0.22.2 h1:JmOMtZL9zWAed1hiwb9DDs+ELcKp/ZQZ3rPverge/V8= @@ -518,8 +523,13 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= +<<<<<<< HEAD github.com/ethereum/go-ethereum v1.14.11 h1:8nFDCUUE67rPc6AKxFj7JKaOa2W/W1Rse3oS6LvvxEY= github.com/ethereum/go-ethereum v1.14.11/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E= +======= +github.com/ethereum/go-ethereum v1.14.12 h1:8hl57x77HSUo+cXExrURjU/w1VhL+ShCTJrTwcCQSe4= +github.com/ethereum/go-ethereum v1.14.12/go.mod h1:RAC2gVMWJ6FkxSPESfbshrcKpIokgQKsVKmAuqdekDY= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 h1:8NfxH2iXvJ60YRB8ChToFTUzl8awsc3cJ8CbLjGIl/A= github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= @@ -548,7 +558,10 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +<<<<<<< HEAD github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -625,8 +638,13 @@ github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +<<<<<<< HEAD github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +======= +github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= +github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -1236,8 +1254,11 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +<<<<<<< HEAD github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1258,8 +1279,13 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +<<<<<<< HEAD github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +======= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/supranational/blst v0.3.13 h1:AYeSxdOMacwu7FBmpfloBz5pbFXDmJL33RuwnKtmTjk= @@ -1295,8 +1321,11 @@ github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+l github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +<<<<<<< HEAD github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= @@ -1410,8 +1439,13 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +<<<<<<< HEAD golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +======= +golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= +golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1519,8 +1553,13 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +<<<<<<< HEAD golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +======= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1562,8 +1601,13 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +<<<<<<< HEAD golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +======= +golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= +golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1674,14 +1718,24 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +<<<<<<< HEAD golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +======= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +<<<<<<< HEAD golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +======= +golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= +golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1692,8 +1746,13 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +<<<<<<< HEAD golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +======= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1766,8 +1825,13 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +<<<<<<< HEAD golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= +======= +golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= +golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2017,8 +2081,13 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +<<<<<<< HEAD google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +======= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2070,8 +2139,13 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= +<<<<<<< HEAD k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +======= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= diff --git a/pkg/appconsts/chain_ids.go b/pkg/appconsts/chain_ids.go index 50c26932f9..2a62d58338 100644 --- a/pkg/appconsts/chain_ids.go +++ b/pkg/appconsts/chain_ids.go @@ -2,4 +2,9 @@ package appconsts const ( ArabicaChainID = "arabica-11" +<<<<<<< HEAD +======= + MochaChainID = "mocha-4" + MainnetChainID = "celestia" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) diff --git a/pkg/appconsts/overrides.go b/pkg/appconsts/overrides.go index 39c5f4c6d0..8378a0885d 100644 --- a/pkg/appconsts/overrides.go +++ b/pkg/appconsts/overrides.go @@ -6,5 +6,8 @@ package appconsts // Look at the Makefile to see how these are set. var ( OverrideSquareSizeUpperBoundStr string +<<<<<<< HEAD OverrideUpgradeHeightDelayStr string +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) diff --git a/pkg/appconsts/upgrade_heights.go b/pkg/appconsts/upgrade_heights.go new file mode 100644 index 0000000000..13ee0963f0 --- /dev/null +++ b/pkg/appconsts/upgrade_heights.go @@ -0,0 +1,13 @@ +package appconsts + +const ( + // ArabicaUpgradeHeightV2 is the block height at which the arabica-11 + // upgraded from app version 1 to 2. + ArabicaUpgradeHeightV2 = 1751707 + // MochaUpgradeHeightV2 is the block height at which the mocha-4 upgraded + // from app version 1 to 2. + MochaUpgradeHeightV2 = 2585031 + // MainnetUpgradeHeightV2 is the block height at which the celestia upgraded + // from app version 1 to 2. + MainnetUpgradeHeightV2 = 2371495 +) diff --git a/pkg/appconsts/v1/app_consts.go b/pkg/appconsts/v1/app_consts.go index 873d3ec18a..d5d263e367 100644 --- a/pkg/appconsts/v1/app_consts.go +++ b/pkg/appconsts/v1/app_consts.go @@ -6,10 +6,21 @@ const ( Version uint64 = 1 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 +<<<<<<< HEAD TimeoutPropose = time.Second * 10 TimeoutCommit = time.Second * 11 // UpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block // interval of 12 seconds, this is 7 days. +======= + // TimeoutPropose is deprecated because it was not a constant + // in v1, it was the default for a user-configurable timeout. + TimeoutPropose = time.Second * 10 + // TimeoutCommit is deprecated because it was not a constant + // in v1, it was the default for a user-configurable timeout. + TimeoutCommit = time.Second * 11 + // UpgradeHeightDelay is deprecated because v1 does not contain the signal + // module so this constant should not be used. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) UpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) diff --git a/pkg/appconsts/v2/app_consts.go b/pkg/appconsts/v2/app_consts.go index d02a97079b..a5512e0eb1 100644 --- a/pkg/appconsts/v2/app_consts.go +++ b/pkg/appconsts/v2/app_consts.go @@ -6,8 +6,17 @@ const ( Version uint64 = 2 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 +<<<<<<< HEAD TimeoutPropose = time.Second * 10 TimeoutCommit = time.Second * 11 +======= + // TimeoutPropose is deprecated because it was not a constant + // in v2, it was the default for a user-configurable timeout. + TimeoutPropose = time.Second * 10 + // TimeoutCommit is deprecated because it was not a constant + // in v2, it was the default for a user-configurable timeout. + TimeoutCommit = time.Second * 11 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // UpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block // interval of 12 seconds, this is 7 days. diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go index 3f9279518d..bdf02741e9 100644 --- a/pkg/appconsts/v3/app_consts.go +++ b/pkg/appconsts/v3/app_consts.go @@ -13,6 +13,10 @@ const ( TimeoutCommit = time.Millisecond * 4200 // UpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block +<<<<<<< HEAD // interval of 12 seconds, this is 7 days. +======= + // interval of 6 seconds, this is 7 days. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) UpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 6) // 7 days * 24 hours * 60 minutes * 60 seconds / 6 seconds per block = 100,800 blocks. ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 6034453598..c13a504e73 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -80,12 +80,17 @@ func GetTimeoutCommit(v uint64) time.Duration { // UpgradeHeightDelay returns the delay in blocks after a quorum has been reached that the chain should upgrade to the new version. func UpgradeHeightDelay(chainID string, v uint64) int64 { +<<<<<<< HEAD if OverrideUpgradeHeightDelayStr != "" { parsedValue, err := strconv.ParseInt(OverrideUpgradeHeightDelayStr, 10, 64) if err != nil { panic("Invalid OverrideUpgradeHeightDelayStr value") } return parsedValue +======= + if chainID == "test" { + return 3 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } switch v { case v1.Version: @@ -100,6 +105,9 @@ func UpgradeHeightDelay(chainID string, v uint64) int64 { return v2.UpgradeHeightDelay default: return v3.UpgradeHeightDelay +<<<<<<< HEAD +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } } diff --git a/pkg/appconsts/versioned_consts_test.go b/pkg/appconsts/versioned_consts_test.go index 249dd99805..75e7cd8940 100644 --- a/pkg/appconsts/versioned_consts_test.go +++ b/pkg/appconsts/versioned_consts_test.go @@ -118,6 +118,21 @@ func TestUpgradeHeightDelay(t *testing.T) { version: 3, expectedUpgradeHeightDelay: v3.UpgradeHeightDelay, }, +<<<<<<< HEAD +======= + { + name: "the upgrade delay for chainID 'test' should be 3 regardless of the version", + chainID: "test", + version: 3, + expectedUpgradeHeightDelay: 3, + }, + { + name: "the upgrade delay for chainID 'test' should be 3 regardless of the version", + chainID: "test", + version: 4, + expectedUpgradeHeightDelay: 3, + }, +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } for _, tc := range tests { diff --git a/scripts/single-node-upgrades.sh b/scripts/single-node-upgrades.sh new file mode 100755 index 0000000000..32dd577fb8 --- /dev/null +++ b/scripts/single-node-upgrades.sh @@ -0,0 +1,157 @@ +#!/bin/sh + +# This script starts a single node testnet on app version 1. Then it upgrades +# from v1 -> v2 -> v3. + +# Stop script execution if an error is encountered +set -o errexit +# Stop script execution if an undefined variable is used +set -o nounset + +if ! [ -x "$(command -v celestia-appd)" ] +then + echo "celestia-appd could not be found. Please install the celestia-appd binary using 'make install' and make sure the PATH contains the directory where the binary exists. By default, go will install the binary under '~/go/bin'" + exit 1 +fi + +# Constants +CHAIN_ID="test" +KEY_NAME="validator" +KEYRING_BACKEND="test" +FEES="500utia" +BROADCAST_MODE="block" + +VERSION=$(celestia-appd version 2>&1) +APP_HOME="${HOME}/.celestia-app" +GENESIS_FILE="${APP_HOME}/config/genesis.json" + +echo "celestia-app version: ${VERSION}" +echo "celestia-app home: ${APP_HOME}" +echo "celestia-app genesis file: ${GENESIS_FILE}" +echo "" + +createGenesis() { + echo "Initializing validator and node config files..." + celestia-appd init ${CHAIN_ID} \ + --chain-id ${CHAIN_ID} \ + --home "${APP_HOME}" \ + > /dev/null 2>&1 # Hide output to reduce terminal noise + + echo "Adding a new key to the keyring..." + celestia-appd keys add ${KEY_NAME} \ + --keyring-backend=${KEYRING_BACKEND} \ + --home "${APP_HOME}" \ + > /dev/null 2>&1 # Hide output to reduce terminal noise + + echo "Adding genesis account..." + celestia-appd add-genesis-account \ + "$(celestia-appd keys show ${KEY_NAME} -a --keyring-backend=${KEYRING_BACKEND} --home "${APP_HOME}")" \ + "1000000000000000utia" \ + --home "${APP_HOME}" + + echo "Creating a genesis tx..." + celestia-appd gentx ${KEY_NAME} 5000000000utia \ + --fees ${FEES} \ + --keyring-backend=${KEYRING_BACKEND} \ + --chain-id ${CHAIN_ID} \ + --home "${APP_HOME}" \ + > /dev/null 2>&1 # Hide output to reduce terminal noise + + echo "Collecting genesis txs..." + celestia-appd collect-gentxs \ + --home "${APP_HOME}" \ + > /dev/null 2>&1 # Hide output to reduce terminal noise + + # If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed + # https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272 + + # Override the default RPC server listening address + sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' "${APP_HOME}"/config/config.toml + + # Enable transaction indexing + sed -i'.bak' 's#"null"#"kv"#g' "${APP_HOME}"/config/config.toml + + # Persist ABCI responses + sed -i'.bak' 's#discard_abci_responses = true#discard_abci_responses = false#g' "${APP_HOME}"/config/config.toml + + # Override the genesis to use app version 1 and then upgrade to app version 2 later. + sed -i'.bak' 's/"app_version": *"[^"]*"/"app_version": "1"/' ${APP_HOME}/config/genesis.json + + # Override the log level to debug + # sed -i'.bak' 's#log_level = "info"#log_level = "debug"#g' "${APP_HOME}"/config/config.toml + + # Override the VotingPeriod from 1 week to 1 minute + sed -i'.bak' 's#"604800s"#"60s"#g' "${APP_HOME}"/config/genesis.json + + trace_type="local" + sed -i.bak -e "s/^trace_type *=.*/trace_type = \"$trace_type\"/" ${APP_HOME}/config/config.toml + + trace_pull_address=":26661" + sed -i.bak -e "s/^trace_pull_address *=.*/trace_pull_address = \"$trace_pull_address\"/" ${APP_HOME}/config/config.toml + + trace_push_batch_size=1000 + sed -i.bak -e "s/^trace_push_batch_size *=.*/trace_push_batch_size = \"$trace_push_batch_size\"/" ${APP_HOME}/config/config.toml + + echo "Tracing is set up with the ability to pull traced data from the node on the address http://127.0.0.1${trace_pull_address}" +} + +deleteCelestiaAppHome() { + echo "Deleting $APP_HOME..." + rm -r "$APP_HOME" +} + +startCelestiaApp() { + echo "Starting celestia-app..." + celestia-appd start \ + --home "${APP_HOME}" \ + --api.enable \ + --grpc.enable \ + --grpc-web.enable \ + --v2-upgrade-height 3 \ + --force-no-bbr # no need to require BBR usage on a local node. +} + +upgradeToV3() { + sleep 45 + echo "Submitting signal for v3..." + celestia-appd tx signal signal 3 \ + --keyring-backend=${KEYRING_BACKEND} \ + --home ${APP_HOME} \ + --from ${KEY_NAME} \ + --fees ${FEES} \ + --chain-id ${CHAIN_ID} \ + --broadcast-mode ${BROADCAST_MODE} \ + --yes \ + > /dev/null 2>&1 # Hide output to reduce terminal noise + + echo "Querying the tally for v3..." + celestia-appd query signal tally 3 + + echo "Submitting msg try upgrade..." + celestia-appd tx signal try-upgrade \ + --keyring-backend=${KEYRING_BACKEND} \ + --home ${APP_HOME} \ + --from ${KEY_NAME} \ + --fees ${FEES} \ + --chain-id ${CHAIN_ID} \ + --broadcast-mode ${BROADCAST_MODE} \ + --yes \ + > /dev/null 2>&1 # Hide output to reduce terminal noise + + echo "Querying for pending upgrade..." + celestia-appd query signal upgrade +} + +if [ -f $GENESIS_FILE ]; then + echo "Do you want to delete existing ${APP_HOME} and start a new local testnet? [y/n]" + read -r response + if [ "$response" = "y" ]; then + deleteCelestiaAppHome + createGenesis + fi +else + createGenesis +fi + +upgradeToV3 & # Start the upgrade process from v2 -> v3 in the background. +startCelestiaApp # Start celestia-app in the foreground. diff --git a/scripts/single-node.sh b/scripts/single-node.sh index b6a6e6486a..8b477f9087 100755 --- a/scripts/single-node.sh +++ b/scripts/single-node.sh @@ -1,6 +1,10 @@ #!/bin/sh +<<<<<<< HEAD # This script starts a single node testnet. +======= +# This script starts a single node testnet on app version 3. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) # Stop script execution if an error is encountered set -o errexit @@ -13,6 +17,7 @@ then exit 1 fi +<<<<<<< HEAD CHAIN_ID="test" KEY_NAME="validator" KEYRING_BACKEND="test" @@ -25,23 +30,47 @@ FEES="500utia" echo "celestia-app home: ${CELESTIA_APP_HOME}" echo "celestia-app version: ${CELESTIA_APP_VERSION}" +======= +# Constants +CHAIN_ID="test" +KEY_NAME="validator" +KEYRING_BACKEND="test" +FEES="500utia" + +VERSION=$(celestia-appd version 2>&1) +APP_HOME="${HOME}/.celestia-app" +GENESIS_FILE="${APP_HOME}/config/genesis.json" + +echo "celestia-app version: ${VERSION}" +echo "celestia-app home: ${APP_HOME}" +echo "celestia-app genesis file: ${GENESIS_FILE}" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) echo "" createGenesis() { echo "Initializing validator and node config files..." celestia-appd init ${CHAIN_ID} \ --chain-id ${CHAIN_ID} \ +<<<<<<< HEAD --home "${CELESTIA_APP_HOME}" \ +======= + --home "${APP_HOME}" \ +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) > /dev/null 2>&1 # Hide output to reduce terminal noise echo "Adding a new key to the keyring..." celestia-appd keys add ${KEY_NAME} \ --keyring-backend=${KEYRING_BACKEND} \ +<<<<<<< HEAD --home "${CELESTIA_APP_HOME}" \ +======= + --home "${APP_HOME}" \ +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) > /dev/null 2>&1 # Hide output to reduce terminal noise echo "Adding genesis account..." celestia-appd add-genesis-account \ +<<<<<<< HEAD "$(celestia-appd keys show ${KEY_NAME} -a --keyring-backend=${KEYRING_BACKEND} --home "${CELESTIA_APP_HOME}")" \ $COINS \ --home "${CELESTIA_APP_HOME}" @@ -52,17 +81,34 @@ createGenesis() { --keyring-backend=${KEYRING_BACKEND} \ --chain-id ${CHAIN_ID} \ --home "${CELESTIA_APP_HOME}" \ +======= + "$(celestia-appd keys show ${KEY_NAME} -a --keyring-backend=${KEYRING_BACKEND} --home "${APP_HOME}")" \ + "1000000000000000utia" \ + --home "${APP_HOME}" + + echo "Creating a genesis tx..." + celestia-appd gentx ${KEY_NAME} 5000000000utia \ + --fees ${FEES} \ + --keyring-backend=${KEYRING_BACKEND} \ + --chain-id ${CHAIN_ID} \ + --home "${APP_HOME}" \ +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) > /dev/null 2>&1 # Hide output to reduce terminal noise echo "Collecting genesis txs..." celestia-appd collect-gentxs \ +<<<<<<< HEAD --home "${CELESTIA_APP_HOME}" \ +======= + --home "${APP_HOME}" \ +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) > /dev/null 2>&1 # Hide output to reduce terminal noise # If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed # https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272 # Override the default RPC server listening address +<<<<<<< HEAD sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' "${CELESTIA_APP_HOME}"/config/config.toml # Enable transaction indexing @@ -88,18 +134,48 @@ createGenesis() { trace_push_batch_size=1000 sed -i.bak -e "s/^trace_push_batch_size *=.*/trace_push_batch_size = \"$trace_push_batch_size\"/" ${CELESTIA_APP_HOME}/config/config.toml +======= + sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' "${APP_HOME}"/config/config.toml + + # Enable transaction indexing + sed -i'.bak' 's#"null"#"kv"#g' "${APP_HOME}"/config/config.toml + + # Persist ABCI responses + sed -i'.bak' 's#discard_abci_responses = true#discard_abci_responses = false#g' "${APP_HOME}"/config/config.toml + + # Override the log level to debug + # sed -i'.bak' 's#log_level = "info"#log_level = "debug"#g' "${APP_HOME}"/config/config.toml + + # Override the VotingPeriod from 1 week to 1 minute + sed -i'.bak' 's#"604800s"#"60s"#g' "${APP_HOME}"/config/genesis.json + + trace_type="local" + sed -i.bak -e "s/^trace_type *=.*/trace_type = \"$trace_type\"/" ${APP_HOME}/config/config.toml + + trace_pull_address=":26661" + sed -i.bak -e "s/^trace_pull_address *=.*/trace_pull_address = \"$trace_pull_address\"/" ${APP_HOME}/config/config.toml + + trace_push_batch_size=1000 + sed -i.bak -e "s/^trace_push_batch_size *=.*/trace_push_batch_size = \"$trace_push_batch_size\"/" ${APP_HOME}/config/config.toml +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) echo "Tracing is set up with the ability to pull traced data from the node on the address http://127.0.0.1${trace_pull_address}" } deleteCelestiaAppHome() { +<<<<<<< HEAD echo "Deleting $CELESTIA_APP_HOME..." rm -r "$CELESTIA_APP_HOME" +======= + echo "Deleting $APP_HOME..." + rm -r "$APP_HOME" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } startCelestiaApp() { echo "Starting celestia-app..." celestia-appd start \ +<<<<<<< HEAD --home "${CELESTIA_APP_HOME}" \ --api.enable \ --grpc.enable \ @@ -110,6 +186,17 @@ startCelestiaApp() { if [ -f $GENESIS_FILE ]; then echo "Do you want to delete existing ${CELESTIA_APP_HOME} and start a new local testnet? [y/n]" +======= + --home "${APP_HOME}" \ + --api.enable \ + --grpc.enable \ + --grpc-web.enable \ + --force-no-bbr # no need to require BBR usage on a local node +} + +if [ -f $GENESIS_FILE ]; then + echo "Do you want to delete existing ${APP_HOME} and start a new local testnet? [y/n]" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) read -r response if [ "$response" = "y" ]; then deleteCelestiaAppHome diff --git a/specs/src/cat_pool.md b/specs/src/cat_pool.md index 22ad999aec..47086cb30a 100644 --- a/specs/src/cat_pool.md +++ b/specs/src/cat_pool.md @@ -41,7 +41,11 @@ Both `SeenTx` and `WantTx` contain the sha256 hash of the raw transaction bytes. Both messages are sent across a new channel with the ID: `byte(0x31)`. This enables cross compatibility as discussed in greater detail below. > **Note:** +<<<<<<< HEAD > The term `SeenTx` is used over the more common `HasTx` because the transaction pool contains sophisticated eviction logic. TTL's, higher priority transactions and reCheckTx may mean that a transaction pool *had* a transaction but does not have it any more. Semantically it's more appropriate to use `SeenTx` to imply not the presence of a transaction but that the node has seen it and dealt with it accordingly. +======= +> The term `SeenTx` is used over the more common `HasTx` because the transaction pool contains sophisticated eviction logic. TTLs, higher priority transactions and reCheckTx may mean that a transaction pool *had* a transaction but does not have it any more. Semantically it's more appropriate to use `SeenTx` to imply not the presence of a transaction but that the node has seen it and dealt with it accordingly. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ## Outbound logic @@ -53,14 +57,22 @@ A node in the protocol has two distinct modes: "broadcast" and "request/response A `SeenTx` is broadcasted to ALL nodes upon receiving a "new" transaction from a peer. The transaction pool does not need to track every unique inbound transaction, therefore "new" is identified as: - The node does not currently have the transaction +<<<<<<< HEAD - The node did not recently reject the transacton or has recently seen the same transaction committed (subject to the size of the cache) +======= +- The node did not recently reject the transaction or has recently seen the same transaction committed (subject to the size of the cache) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) - The node did not recently evict the transaction (subject to the size of the cache) Given this criteria, it is feasible, yet unlikely that a node receives two `SeenTx` messages from the same peer for the same transaction. A `SeenTx` MAY be sent for each transaction currently in the transaction pool when a connection with a peer is first established. This acts as a mechanism for syncing pool state across peers. +<<<<<<< HEAD The `SeenTx` message MUST only be broadcasted after validation and storage. Although it is possible that a node later drops a transaction under load shedding, a `SeenTx` should give as strong guarantees as possible that the node can be relied upon by others that don't yet have the transcation to obtain it. +======= +The `SeenTx` message MUST only be broadcasted after validation and storage. Although it is possible that a node later drops a transaction under load shedding, a `SeenTx` should give as strong guarantees as possible that the node can be relied upon by others that don't yet have the transaction to obtain it. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) > **Note:** > Inbound transactions submitted via the RPC do not trigger a `SeenTx` message as it is assumed that the node is the first to see the transaction and by gossiping it to others it is implied that the node has seen the transaction. @@ -88,7 +100,11 @@ Upon receiving a `SeenTx` message: - If the node does not have the transaction but recently evicted it, it MAY choose to rerequest the transaction if it has adequate resources now to process it. - If the node has not seen the transaction or does not have any pending requests for that transaction, it can do one of two things: - It MAY immediately request the tx from the peer with a `WantTx`. +<<<<<<< HEAD - If the node is connected to the peer specified in `FROM`, it is likely, from a non-byzantine peer, that the node will also shortly receive the transaction from the peer. It MAY wait for a `Txs` message for a bounded amount of time but MUST eventually send a `WantMsg` message to either the original peer or any other peer that *has* the specified transaction. +======= + - If the node is connected to the peer specified in `FROM`, it is likely, from a non-byzantine peer, that the node will also shortly receive the transaction from the peer. It MAY wait for a `Txs` message for a bounded amount of time but MUST eventually send a `WantTx` message to either the original peer or any other peer that *has* the specified transaction. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) Upon receiving a `WantTx` message: diff --git a/specs/src/data_square_layout.md b/specs/src/data_square_layout.md index 70e476250f..7c052f47fd 100644 --- a/specs/src/data_square_layout.md +++ b/specs/src/data_square_layout.md @@ -39,7 +39,11 @@ The order of blobs in a namespace is dictated by the priority of the PFBs that p Transactions can pay fees for a blob to be included in the same block as the transaction itself. It may seem natural to bundle the `MsgPayForBlobs` transaction that pays for a number of blobs with these blobs (which is the case in other blockchains with native execution, e.g. calldata in Ethereum transactions or OP_RETURN data in Bitcoin transactions), however this would mean that processes validating the state of the Celestia network would need to download all blob data. PayForBlob transactions must therefore only include a commitment to (i.e. some hash of) the blob they pay fees for. If implemented naively (e.g. with a simple hash of the blob, or a simple binary Merkle tree root of the blob), this can lead to a data availability problem, as there are no guarantees that the data behind these commitments is actually part of the block data. +<<<<<<< HEAD To that end, we impose some additional rules onto _blobs only_: blobs must be placed is a way such that both the transaction sender and the block producer can be held accountable—a necessary property for e.g. fee burning. Accountable in this context means that +======= +To that end, we impose some additional rules onto _blobs only_: blobs must be placed in a way such that both the transaction sender and the block producer can be held accountable—a necessary property for e.g. fee burning. Accountable in this context means that +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) 1. The transaction sender must pay sufficient fees for blob inclusion. 1. The block proposer cannot claim that a blob was included when it was not (which implies that a transaction and the blob it pays for must be included in the same block). In addition all blobs must be accompanied by a PayForBlob transaction. diff --git a/specs/src/parameters_v1.md b/specs/src/parameters_v1.md index 436b8cb471..877f223985 100644 --- a/specs/src/parameters_v1.md +++ b/specs/src/parameters_v1.md @@ -8,10 +8,18 @@ hardcoded in the application or they are blocked by the `x/paramfilter` module. ## Global parameters +<<<<<<< HEAD | Parameter | Default | Summary | Changeable via Governance | |-------------------|---------|------------------------------------------------------------------------------------------------------------------------|---------------------------| | MaxBlockSizeBytes | 100MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | | MaxSquareSize | 128 | Hardcoded maximum square size determined per shares per row or column for the original data square (not yet extended). | False | +======= +| Parameter | Value | Summary | Changeable via Governance | +|----------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------| +| SquareSizeUpperBound | 128 | Hardcoded maximum square size which limits the number of shares per row or column for the original data square (not yet extended). | False | +| SubtreeRootThreshold | 64 | See [ADR-013](https://github.com/celestiaorg/celestia-app/blob/main/docs/architecture/adr-013-non-interactive-default-rules-for-zero-padding.md) for more details. | False | +| MaxBlockSizeBytes | 100 MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ## Module parameters diff --git a/specs/src/parameters_v2.md b/specs/src/parameters_v2.md index ec93c9acda..8e784427f6 100644 --- a/specs/src/parameters_v2.md +++ b/specs/src/parameters_v2.md @@ -8,11 +8,20 @@ hardcoded in the application or they are blocked by the `x/paramfilter` module. ## Global parameters +<<<<<<< HEAD | Parameter | Default | Summary | Changeable via Governance | |--------------------|---------|------------------------------------------------------------------------------------------------------------------------|---------------------------| | MaxBlockSizeBytes | 100MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | | MaxSquareSize | 128 | Hardcoded maximum square size determined per shares per row or column for the original data square (not yet extended). | False | | UpgradeHeightDelay | 50400 | Height based delay after a successful `MsgTryUpgrade` has been submitted. | False | +======= +| Parameter | Value | Summary | Changeable via Governance | +|----------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------| +| SquareSizeUpperBound | 128 | Hardcoded maximum square size which limits the number of shares per row or column for the original data square (not yet extended). | False | +| SubtreeRootThreshold | 64 | See [ADR-013](https://github.com/celestiaorg/celestia-app/blob/main/docs/architecture/adr-013-non-interactive-default-rules-for-zero-padding.md) for more details. | False | +| UpgradeHeightDelay | 50400 blocks | Height based delay after a successful `MsgTryUpgrade` has been submitted. | False | +| MaxBlockSizeBytes | 100 MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ## Module parameters diff --git a/specs/src/parameters_v3.md b/specs/src/parameters_v3.md index 6f8d84fccb..eef9937da4 100644 --- a/specs/src/parameters_v3.md +++ b/specs/src/parameters_v3.md @@ -8,11 +8,23 @@ hardcoded in the application or they are blocked by the `x/paramfilter` module. ## Global parameters +<<<<<<< HEAD | Parameter | Default | Summary | Changeable via Governance | |--------------------|---------|------------------------------------------------------------------------------------------------------------------------|---------------------------| | MaxBlockSizeBytes | 100MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | | MaxSquareSize | 128 | Hardcoded maximum square size determined per shares per row or column for the original data square (not yet extended). | False | | UpgradeHeightDelay | 100800 | Height based delay after a successful `MsgTryUpgrade` has been submitted. | False | +======= +| Parameter | Value | Summary | Changeable via Governance | +|----------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------| +| SquareSizeUpperBound | 128 | Hardcoded maximum square size which limits the number of shares per row or column for the original data square (not yet extended). | False | +| SubtreeRootThreshold | 64 | See [ADR-013](https://github.com/celestiaorg/celestia-app/blob/main/docs/architecture/adr-013-non-interactive-default-rules-for-zero-padding.md) for more details. | False | +| MaxTxSize | 2 MiB | Maximum size of a transaction in bytes. | False | +| TimeoutPropose | 3500 ms | Specifies the time that validators wait during the proposal phase of the consensus process. See CometBFT [specs](https://github.com/celestiaorg/celestia-core/blob/v0.34.x-celestia/spec/consensus/consensus.md#propose-step-heighthroundr) for more details. | False | +| TimeoutCommit | 4200 ms | Specifies the duration that validators wait during the Commit phase of the consensus process. See CometBFT [specs](https://github.com/celestiaorg/celestia-core/blob/v0.34.x-celestia/spec/consensus/consensus.md#precommit-step-heighthroundr) for more details. | False | +| UpgradeHeightDelay | 100800 blocks | Height based delay after a successful `MsgTryUpgrade` has been submitted. | False | +| MaxBlockSizeBytes | 100 MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ## Module parameters @@ -22,9 +34,15 @@ hardcoded in the application or they are blocked by the `x/paramfilter` module. | auth.SigVerifyCostED25519 | 590 | Gas used to verify Ed25519 signature. | True | | auth.SigVerifyCostSecp256k1 | 1000 | Gas used to verify secp256k1 signature. | True | | auth.TxSigLimit | 7 | Max number of signatures allowed in a multisig transaction. | True | +<<<<<<< HEAD | auth.TxSizeCostPerByte | 10 | Gas used per transaction byte. | False | | bank.SendEnabled | true | Allow transfers. | False | | blob.GasPerBlobByte | 8 | Gas used per blob byte. | False | +======= +| auth.TxSizeCostPerByte | 10 | Gas used per transaction byte. | False | +| bank.SendEnabled | true | Allow transfers. | False | +| blob.GasPerBlobByte | 8 | Gas used per blob byte. | False | +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) | blob.GovMaxSquareSize | 64 | Governance parameter for the maximum square size of the original data square. | True | | consensus.block.MaxBytes | 1974272 bytes (~1.88 MiB) | Governance parameter for the maximum size of the protobuf encoded block. | True | | consensus.block.MaxGas | -1 | Maximum gas allowed per block (-1 is infinite). | True | diff --git a/test/e2e/benchmark/benchmark.go b/test/e2e/benchmark/benchmark.go index 5af7b8539e..5dc9f73cc0 100644 --- a/test/e2e/benchmark/benchmark.go +++ b/test/e2e/benchmark/benchmark.go @@ -24,7 +24,11 @@ type BenchmarkTest struct { // NewBenchmarkTest wraps around testnet.New to create a new benchmark test. // It may modify genesis consensus parameters based on manifest. +<<<<<<< HEAD func NewBenchmarkTest(name string, manifest *Manifest) (*BenchmarkTest, error) { +======= +func NewBenchmarkTest(logger *log.Logger, name string, manifest *Manifest) (*BenchmarkTest, error) { +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -42,8 +46,13 @@ func NewBenchmarkTest(name string, manifest *Manifest) (*BenchmarkTest, error) { log.Printf("Knuu initialized with scope %s", kn.Scope) +<<<<<<< HEAD testNet, err := testnet.New(kn, testnet.Options{ Grafana: testnet.GetGrafanaInfoFromEnvVar(), +======= + testNet, err := testnet.New(logger, kn, testnet.Options{ + Grafana: testnet.GetGrafanaInfoFromEnvVar(logger), +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ChainID: manifest.ChainID, GenesisModifiers: manifest.GetGenesisModifiers(), }) @@ -70,7 +79,11 @@ func (b *BenchmarkTest) SetupNodes() error { } } // obtain the GRPC endpoints of the validators +<<<<<<< HEAD gRPCEndpoints, err := b.RemoteGRPCEndpoints(ctx) +======= + gRPCEndpoints, err := b.RemoteGRPCEndpoints() +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to get validators GRPC endpoints", err) log.Println("validators GRPC endpoints", gRPCEndpoints) diff --git a/test/e2e/benchmark/throughput.go b/test/e2e/benchmark/throughput.go index 75bf1bdf6c..1e2b0ce70d 100644 --- a/test/e2e/benchmark/throughput.go +++ b/test/e2e/benchmark/throughput.go @@ -90,7 +90,11 @@ func TwoNodeSimple(logger *log.Logger) error { DisableBBR: true, } +<<<<<<< HEAD benchTest, err := NewBenchmarkTest(testName, &manifest) +======= + benchTest, err := NewBenchmarkTest(logger, testName, &manifest) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to create benchmark test", err) ctx, cancel := context.WithCancel(context.Background()) @@ -113,8 +117,13 @@ func TwoNodeSimple(logger *log.Logger) error { func runBenchmarkTest(logger *log.Logger, testName string, manifest Manifest) error { logger.Println("Running", testName) manifest.ChainID = manifest.summary() +<<<<<<< HEAD log.Println("ChainID: ", manifest.ChainID) benchTest, err := NewBenchmarkTest(testName, &manifest) +======= + logger.Println("ChainID: ", manifest.ChainID) + benchTest, err := NewBenchmarkTest(logger, testName, &manifest) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to create benchmark test", err) ctx, cancel := context.WithCancel(context.Background()) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index 3e44eb0bc3..6b7c5b01e2 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -35,7 +35,11 @@ func MajorUpgradeToV2(logger *log.Logger) error { logger.Printf("Knuu initialized with scope %s", kn.Scope) logger.Println("Creating testnet") +<<<<<<< HEAD testNet, err := testnet.New(kn, testnet.Options{}) +======= + testNet, err := testnet.New(logger, kn, testnet.Options{}) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to create testnet", err) defer testNet.Cleanup(ctx) @@ -60,7 +64,11 @@ func MajorUpgradeToV2(logger *log.Logger) error { } logger.Println("Creating txsim") +<<<<<<< HEAD endpoints, err := testNet.RemoteGRPCEndpoints(ctx) +======= + endpoints, err := testNet.RemoteGRPCEndpoints() +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to get remote gRPC endpoints", err) upgradeSchedule := map[int64]uint64{} err = testNet.CreateTxClient(ctx, "txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0], upgradeSchedule) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 35cb79b045..91ee960a56 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -34,7 +34,11 @@ func MajorUpgradeToV3(logger *log.Logger) error { logger.Printf("Knuu initialized with scope %s", kn.Scope) logger.Println("Creating testnet") +<<<<<<< HEAD testNet, err := testnet.New(kn, testnet.Options{}) +======= + testNet, err := testnet.New(logger, kn, testnet.Options{}) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to create testnet", err) defer testNet.Cleanup(ctx) @@ -60,7 +64,11 @@ func MajorUpgradeToV3(logger *log.Logger) error { } logger.Println("Creating txsim") +<<<<<<< HEAD endpoints, err := testNet.RemoteGRPCEndpoints(ctx) +======= + endpoints, err := testNet.RemoteGRPCEndpoints() +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to get remote gRPC endpoints", err) upgradeSchedule := map[int64]uint64{ upgradeHeightV3: v3.Version, diff --git a/test/e2e/minor_version_compatibility.go b/test/e2e/minor_version_compatibility.go index bb81d5e021..fb340f8885 100644 --- a/test/e2e/minor_version_compatibility.go +++ b/test/e2e/minor_version_compatibility.go @@ -50,7 +50,11 @@ func MinorVersionCompatibility(logger *log.Logger) error { kn.HandleStopSignal(ctx) logger.Printf("Knuu initialized with scope %s", kn.Scope) +<<<<<<< HEAD testNet, err := testnet.New(kn, testnet.Options{Seed: seed}) +======= + testNet, err := testnet.New(logger, kn, testnet.Options{Seed: seed}) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to create testnet", err) defer testNet.Cleanup(ctx) @@ -76,7 +80,11 @@ func MinorVersionCompatibility(logger *log.Logger) error { } logger.Println("Creating txsim") +<<<<<<< HEAD endpoints, err := testNet.RemoteGRPCEndpoints(ctx) +======= + endpoints, err := testNet.RemoteGRPCEndpoints() +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to get remote gRPC endpoints", err) upgradeSchedule := map[int64]uint64{} err = testNet.CreateTxClient(ctx, "txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0], upgradeSchedule) diff --git a/test/e2e/readme.md b/test/e2e/readme.md index ab0dbe8264..0933ec7a43 100644 --- a/test/e2e/readme.md +++ b/test/e2e/readme.md @@ -30,7 +30,11 @@ make test-e2e E2ESimple **Optional parameters**: +<<<<<<< HEAD - `KNUUU_TIMEOUT` can be used to override the default timeout of 60 minutes for the tests. +======= +- `KNUU_TIMEOUT` can be used to override the default timeout of 60 minutes for the tests. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ## Observation @@ -56,7 +60,11 @@ This will back up your default kubernetes configuration. If you use a different ### Install minikube +<<<<<<< HEAD Minikube is required to be installed on your machine. If you have a linux machine, follow the [minikube docs](https://kubernetes.io/fr/docs/tasks/tools/install-minikube/). If you're on macOS ARM, this [tutorial](https://devopscube.com/minikube-mac/) can be helpful to run it using qemu. +======= +Minikube is required to be installed on your machine. If you have a linux machine, follow the [minikube docs](https://kubernetes.io/docs/tasks/tools/install-minikube/). If you're on macOS ARM, this [tutorial](https://devopscube.com/minikube-mac/) can be helpful to run it using qemu. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ### Create namespace diff --git a/test/e2e/simple.go b/test/e2e/simple.go index 8dab0278eb..b2119408da 100644 --- a/test/e2e/simple.go +++ b/test/e2e/simple.go @@ -30,7 +30,11 @@ func E2ESimple(logger *log.Logger) error { kn.HandleStopSignal(ctx) logger.Printf("Knuu initialized with scope %s", kn.Scope) +<<<<<<< HEAD testNet, err := testnet.New(kn, testnet.Options{}) +======= + testNet, err := testnet.New(logger, kn, testnet.Options{}) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to create testnet", err) defer testNet.Cleanup(ctx) @@ -44,7 +48,11 @@ func E2ESimple(logger *log.Logger) error { testNet.CreateGenesisNodes(ctx, 4, latestVersion, 10000000, 0, testnet.DefaultResources, true)) logger.Println("Creating txsim") +<<<<<<< HEAD endpoints, err := testNet.RemoteGRPCEndpoints(ctx) +======= + endpoints, err := testNet.RemoteGRPCEndpoints() +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) testnet.NoError("failed to get remote gRPC endpoints", err) upgradeSchedule := map[int64]uint64{} err = testNet.CreateTxClient(ctx, "txsim", testnet.TxsimVersion, 10, "100-2000", 100, testnet.DefaultResources, endpoints[0], upgradeSchedule) diff --git a/test/e2e/testnet/node.go b/test/e2e/testnet/node.go index cf96ee905d..c2a1d19021 100644 --- a/test/e2e/testnet/node.go +++ b/test/e2e/testnet/node.go @@ -4,11 +4,18 @@ package testnet import ( "context" "fmt" +<<<<<<< HEAD +======= + "log" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "os" "path/filepath" serverconfig "github.com/cosmos/cosmos-sdk/server/config" +<<<<<<< HEAD "github.com/rs/zerolog/log" +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "github.com/tendermint/tendermint/config" "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/p2p" @@ -55,13 +62,22 @@ type Node struct { // FIXME: This does not work currently with the reverse proxy // grpcProxyHost string traceProxyHost string +<<<<<<< HEAD +======= + + logger *log.Logger +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } // PullRoundStateTraces retrieves the round state traces from a node. // It will save them to the provided path. func (n *Node) PullRoundStateTraces(path string) ([]trace.Event[schema.RoundState], error) { addr := n.AddressTracing() +<<<<<<< HEAD log.Info().Str("Address", addr).Msg("Pulling round state traces") +======= + n.logger.Println("Pulling round state traces", "address", addr) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) err := trace.GetTable(addr, schema.RoundState{}.Table(), path) if err != nil { @@ -74,7 +90,11 @@ func (n *Node) PullRoundStateTraces(path string) ([]trace.Event[schema.RoundStat // It will save them to the provided path. func (n *Node) PullBlockSummaryTraces(path string) ([]trace.Event[schema.BlockSummary], error) { addr := n.AddressTracing() +<<<<<<< HEAD log.Info().Str("Address", addr).Msg("Pulling block summary traces") +======= + n.logger.Println("Pulling block summary traces", "address", addr) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) err := trace.GetTable(addr, schema.BlockSummary{}.Table(), path) if err != nil { @@ -97,6 +117,10 @@ type Resources struct { func NewNode( ctx context.Context, +<<<<<<< HEAD +======= + logger *log.Logger, +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) name string, version string, startHeight int64, @@ -178,6 +202,10 @@ func NewNode( NetworkKey: networkKey, SelfDelegation: selfDelegation, sidecars: sidecars, +<<<<<<< HEAD +======= + logger: logger, +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) }, nil } @@ -199,11 +227,21 @@ func (n *Node) Init(ctx context.Context, genesis *types.GenesisDoc, peers []stri } // Initialize file directories +<<<<<<< HEAD rootDir := os.TempDir() nodeDir := filepath.Join(rootDir, n.Name) log.Info().Str("name", n.Name). Str("directory", nodeDir). Msg("Creating validator's config and data directories") +======= + tmpDir, err := os.MkdirTemp("", "e2e_test_") + if err != nil { + return fmt.Errorf("failed to create temp dir: %w", err) + } + defer os.RemoveAll(tmpDir) + nodeDir := filepath.Join(tmpDir, n.Name) + n.logger.Println("Creating validator's config and data directories", "name", n.Name, "directory", nodeDir) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) for _, dir := range []string{ filepath.Join(nodeDir, "config"), filepath.Join(nodeDir, "data"), @@ -214,7 +252,11 @@ func (n *Node) Init(ctx context.Context, genesis *types.GenesisDoc, peers []stri } // Create and write the config file +<<<<<<< HEAD cfg, err := MakeConfig(ctx, n, configOptions...) +======= + cfg, err := MakeConfig(n, peers, configOptions...) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if err != nil { return fmt.Errorf("making config: %w", err) } @@ -253,12 +295,15 @@ func (n *Node) Init(ctx context.Context, genesis *types.GenesisDoc, peers []stri pvStatePath := filepath.Join(nodeDir, "data", "priv_validator_state.json") (privval.NewFilePV(n.SignerKey, pvKeyPath, pvStatePath)).Save() +<<<<<<< HEAD addrBookFile := filepath.Join(nodeDir, "config", "addrbook.json") err = WriteAddressBook(peers, addrBookFile) if err != nil { return fmt.Errorf("writing address book: %w", err) } +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if err := n.Instance.Build().Commit(ctx); err != nil { return fmt.Errorf("committing instance: %w", err) } @@ -278,12 +323,18 @@ func (n *Node) Init(ctx context.Context, genesis *types.GenesisDoc, peers []stri // AddressP2P returns a P2P endpoint address for the node. This is used for // populating the address book. This will look something like: // 3314051954fc072a0678ec0cbac690ad8676ab98@61.108.66.220:26656 +<<<<<<< HEAD func (n Node) AddressP2P(ctx context.Context, withID bool) string { ip, err := n.Instance.Network().GetIP(ctx) if err != nil { panic(err) } addr := fmt.Sprintf("%v:%d", ip, p2pPort) +======= +func (n Node) AddressP2P(withID bool) string { + hostName := n.Instance.Network().HostName() + addr := fmt.Sprintf("%v:%d", hostName, p2pPort) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if withID { addr = fmt.Sprintf("%x@%v", n.NetworkKey.PubKey().Address().Bytes(), addr) } @@ -304,6 +355,7 @@ func (n Node) AddressRPC() string { // } // RemoteAddressGRPC retrieves the gRPC endpoint address of a node within the cluster. +<<<<<<< HEAD func (n Node) RemoteAddressGRPC(ctx context.Context) (string, error) { ip, err := n.Instance.Network().GetIP(ctx) if err != nil { @@ -319,18 +371,35 @@ func (n Node) RemoteAddressRPC(ctx context.Context) (string, error) { return "", err } return fmt.Sprintf("%s:%d", ip, rpcPort), nil +======= +func (n Node) RemoteAddressGRPC() (string, error) { + hostName := n.Instance.Network().HostName() + return fmt.Sprintf("%s:%d", hostName, grpcPort), nil +} + +// RemoteAddressRPC retrieves the RPC endpoint address of a node within the cluster. +func (n Node) RemoteAddressRPC() (string, error) { + hostName := n.Instance.Network().HostName() + return fmt.Sprintf("%s:%d", hostName, rpcPort), nil +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } func (n Node) AddressTracing() string { return n.traceProxyHost } +<<<<<<< HEAD func (n Node) RemoteAddressTracing(ctx context.Context) (string, error) { ip, err := n.Instance.Network().GetIP(ctx) if err != nil { return "", err } return fmt.Sprintf("http://%s:26661", ip), nil +======= +func (n Node) RemoteAddressTracing() (string, error) { + hostName := n.Instance.Network().HostName() + return fmt.Sprintf("http://%s:26661", hostName), nil +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } func (n Node) IsValidator() bool { @@ -338,7 +407,11 @@ func (n Node) IsValidator() bool { } func (n Node) Client() (*http.HTTP, error) { +<<<<<<< HEAD log.Debug().Str("RPC Address", n.AddressRPC()).Msg("Creating HTTP client for node") +======= + n.logger.Println("Creating HTTP client for node", "rpc_address", n.AddressRPC()) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return http.New(n.AddressRPC(), "/websocket") } diff --git a/test/e2e/testnet/setup.go b/test/e2e/testnet/setup.go index d7db215c34..d97f864b0a 100644 --- a/test/e2e/testnet/setup.go +++ b/test/e2e/testnet/setup.go @@ -1,7 +1,10 @@ package testnet import ( +<<<<<<< HEAD "context" +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "fmt" "strings" "time" @@ -13,15 +16,23 @@ import ( "github.com/tendermint/tendermint/p2p/pex" ) +<<<<<<< HEAD func MakeConfig(ctx context.Context, node *Node, opts ...Option) (*config.Config, error) { +======= +func MakeConfig(node *Node, peers []string, opts ...Option) (*config.Config, error) { +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) cfg := app.DefaultConsensusConfig() cfg.TxIndex.Indexer = "kv" cfg.Consensus.TimeoutPropose = config.DefaultConsensusConfig().TimeoutPropose cfg.Consensus.TimeoutCommit = config.DefaultConsensusConfig().TimeoutCommit cfg.Moniker = node.Name cfg.RPC.ListenAddress = "tcp://0.0.0.0:26657" +<<<<<<< HEAD cfg.P2P.ExternalAddress = fmt.Sprintf("tcp://%v", node.AddressP2P(ctx, false)) cfg.P2P.PersistentPeers = strings.Join(node.InitialPeers, ",") +======= + cfg.P2P.PersistentPeers = strings.Join(peers, ",") +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) cfg.Instrumentation.Prometheus = true for _, opt := range opts { diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index 7cc74fb011..e2a68cadff 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -5,6 +5,10 @@ import ( "context" "errors" "fmt" +<<<<<<< HEAD +======= + "log" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "os" "path/filepath" "time" @@ -16,7 +20,10 @@ import ( "github.com/celestiaorg/knuu/pkg/preloader" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" +<<<<<<< HEAD "github.com/rs/zerolog/log" +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) @@ -26,6 +33,7 @@ const ( ) type Testnet struct { +<<<<<<< HEAD seed int64 nodes []*Node genesis *genesis.Genesis @@ -33,6 +41,19 @@ type Testnet struct { grafana *GrafanaInfo txClients []*TxSim knuu *knuu.Knuu +======= + seed int64 + nodes []*Node + genesis *genesis.Genesis + keygen *keyGenerator + grafana *GrafanaInfo + txClients []*TxSim + knuu *knuu.Knuu + chainID string + genesisHash string + + logger *log.Logger +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } type Options struct { @@ -42,6 +63,7 @@ type Options struct { GenesisModifiers []genesis.Modifier } +<<<<<<< HEAD func New(knuu *knuu.Knuu, opts Options) (*Testnet, error) { opts.setDefaults() return &Testnet{ @@ -51,6 +73,20 @@ func New(knuu *knuu.Knuu, opts Options) (*Testnet, error) { keygen: newKeyGenerator(opts.Seed), grafana: opts.Grafana, knuu: knuu, +======= +func New(logger *log.Logger, knuu *knuu.Knuu, opts Options) (*Testnet, error) { + opts.setDefaults() + return &Testnet{ + seed: opts.Seed, + nodes: make([]*Node, 0), + genesis: genesis.NewDefaultGenesis().WithChainID(opts.ChainID).WithModifiers(opts.GenesisModifiers...), + keygen: newKeyGenerator(opts.Seed), + grafana: opts.Grafana, + knuu: knuu, + chainID: opts.ChainID, + genesisHash: "", + logger: logger, +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) }, nil } @@ -74,7 +110,11 @@ func (t *Testnet) SetConsensusMaxBlockSize(size int64) { func (t *Testnet) CreateGenesisNode(ctx context.Context, version string, selfDelegation, upgradeHeightV2 int64, resources Resources, disableBBR bool) error { signerKey := t.keygen.Generate(ed25519Type) networkKey := t.keygen.Generate(ed25519Type) +<<<<<<< HEAD node, err := NewNode(ctx, fmt.Sprintf("val%d", len(t.nodes)), version, 0, selfDelegation, nil, signerKey, networkKey, upgradeHeightV2, resources, t.grafana, t.knuu, disableBBR) +======= + node, err := NewNode(ctx, t.logger, fmt.Sprintf("val%d", len(t.nodes)), version, 0, selfDelegation, nil, signerKey, networkKey, upgradeHeightV2, resources, t.grafana, t.knuu, disableBBR) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if err != nil { return err } @@ -107,6 +147,7 @@ func (t *Testnet) CreateTxClients(ctx context.Context, name := fmt.Sprintf("txsim%d", i) err := t.CreateTxClient(ctx, name, version, sequences, blobRange, blobPerSequence, resources, grpcEndpoint, upgradeSchedule) if err != nil { +<<<<<<< HEAD log.Err(err).Str("name", name). Str("grpc endpoint", grpcEndpoint). Msg("txsim creation failed") @@ -116,6 +157,12 @@ func (t *Testnet) CreateTxClients(ctx context.Context, Str("name", name). Str("grpc endpoint", grpcEndpoint). Msg("txsim created") +======= + t.logger.Println("txsim creation failed", "name", name, "grpc_endpoint", grpcEndpoint, "error", err) + return err + } + t.logger.Println("txsim created", "name", name, "grpc_endpoint", grpcEndpoint) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } return nil } @@ -143,8 +190,17 @@ func (t *Testnet) CreateTxClient( grpcEndpoint string, upgradeSchedule map[int64]uint64, ) error { +<<<<<<< HEAD txsimKeyringDir := filepath.Join(os.TempDir(), name) defer os.RemoveAll(txsimKeyringDir) +======= + tmpDir, err := os.MkdirTemp("", "e2e_test_") + if err != nil { + return fmt.Errorf("failed to create temp dir: %w", err) + } + defer os.RemoveAll(tmpDir) + txsimKeyringDir := filepath.Join(tmpDir, name) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) config := encoding.MakeConfig(app.ModuleEncodingRegisters...).Codec txsimKeyring, err := keyring.New(app.Name, keyring.BackendTest, txsimKeyringDir, nil, config) @@ -182,29 +238,45 @@ func (t *Testnet) CreateTxClient( } } +<<<<<<< HEAD txsim, err := CreateTxClient(ctx, name, version, grpcEndpoint, t.seed, blobSequences, blobRange, blobPerSequence, 1, resources, txsimKeyringDir, t.knuu, upgradeSchedule) if err != nil { log.Err(err). Str("name", name). Msg("error creating txsim") +======= + txsim, err := CreateTxClient(ctx, t.logger, name, version, grpcEndpoint, t.seed, blobSequences, blobRange, blobPerSequence, 1, resources, remoteRootDir, t.knuu, upgradeSchedule) + if err != nil { + t.logger.Println("error creating txsim", "name", name, "error", err) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return err } err = txsim.Instance.Build().Commit(ctx) if err != nil { +<<<<<<< HEAD log.Err(err). Str("name", name). Msg("error committing txsim") +======= + t.logger.Println("error committing txsim", "name", name, "error", err) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return err } // copy over the keyring directory to the txsim instance +<<<<<<< HEAD err = txsim.Instance.Storage().AddFolder(txsimKeyringDir, txsimKeyringDir, "10001:10001") if err != nil { log.Err(err). Str("directory", txsimKeyringDir). Str("name", name). Msg("error adding keyring dir to txsim") +======= + err = txsim.Instance.Storage().AddFolder(txsimKeyringDir, remoteRootDir, "10001:10001") + if err != nil { + t.logger.Println("error adding keyring dir to txsim", "directory", txsimKeyringDir, "name", name, "error", err) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return err } @@ -216,6 +288,7 @@ func (t *Testnet) StartTxClients(ctx context.Context) error { for _, txsim := range t.txClients { err := txsim.Instance.Execution().StartAsync(ctx) if err != nil { +<<<<<<< HEAD log.Err(err). Str("name", txsim.Name). Msg("txsim failed to start") @@ -224,6 +297,12 @@ func (t *Testnet) StartTxClients(ctx context.Context) error { log.Info(). Str("name", txsim.Name). Msg("txsim started") +======= + t.logger.Println("txsim failed to start", "name", txsim.Name, "error", err) + return err + } + t.logger.Println("txsim started", "name", txsim.Name) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } // wait for txsims to start for _, txsim := range t.txClients { @@ -271,17 +350,25 @@ func (t *Testnet) CreateAccount(name string, tokens int64, txsimKeyringDir strin return nil, err } +<<<<<<< HEAD log.Info(). Str("name", name). Str("pk", pk.String()). Msg("txsim account created and added to genesis") +======= + t.logger.Println("txsim account created and added to genesis", "name", name, "pk", pk.String()) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return kr, nil } func (t *Testnet) CreateNode(ctx context.Context, version string, startHeight, upgradeHeight int64, resources Resources, disableBBR bool) error { signerKey := t.keygen.Generate(ed25519Type) networkKey := t.keygen.Generate(ed25519Type) +<<<<<<< HEAD node, err := NewNode(ctx, fmt.Sprintf("val%d", len(t.nodes)), version, startHeight, 0, nil, signerKey, networkKey, upgradeHeight, resources, t.grafana, t.knuu, disableBBR) +======= + node, err := NewNode(ctx, t.logger, fmt.Sprintf("val%d", len(t.nodes)), version, startHeight, 0, nil, signerKey, networkKey, upgradeHeight, resources, t.grafana, t.knuu, disableBBR) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if err != nil { return err } @@ -297,11 +384,19 @@ func (t *Testnet) Setup(ctx context.Context, configOpts ...Option) error { for _, node := range t.nodes { // nodes are initialized with the addresses of all other +<<<<<<< HEAD // nodes in their addressbook peers := make([]string, 0, len(t.nodes)-1) for _, peer := range t.nodes { if peer.Name != node.Name { peers = append(peers, peer.AddressP2P(ctx, true)) +======= + // nodes as trusted peers + peers := make([]string, 0, len(t.nodes)-1) + for _, peer := range t.nodes { + if peer.Name != node.Name { + peers = append(peers, peer.AddressP2P(true)) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } } @@ -333,10 +428,17 @@ func (t *Testnet) RPCEndpoints() []string { // RemoteGRPCEndpoints retrieves the gRPC endpoint addresses of the // testnet's validator nodes. +<<<<<<< HEAD func (t *Testnet) RemoteGRPCEndpoints(ctx context.Context) ([]string, error) { grpcEndpoints := make([]string, len(t.nodes)) for idx, node := range t.nodes { grpcEP, err := node.RemoteAddressGRPC(ctx) +======= +func (t *Testnet) RemoteGRPCEndpoints() ([]string, error) { + grpcEndpoints := make([]string, len(t.nodes)) + for idx, node := range t.nodes { + grpcEP, err := node.RemoteAddressGRPC() +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if err != nil { return nil, err } @@ -355,10 +457,17 @@ func (t *Testnet) GetGenesisValidators() []genesis.Validator { // RemoteRPCEndpoints retrieves the RPC endpoint addresses of the testnet's // validator nodes. +<<<<<<< HEAD func (t *Testnet) RemoteRPCEndpoints(ctx context.Context) ([]string, error) { rpcEndpoints := make([]string, len(t.nodes)) for idx, node := range t.nodes { grpcEP, err := node.RemoteAddressRPC(ctx) +======= +func (t *Testnet) RemoteRPCEndpoints() ([]string, error) { + rpcEndpoints := make([]string, len(t.nodes)) + for idx, node := range t.nodes { + grpcEP, err := node.RemoteAddressRPC() +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if err != nil { return nil, err } @@ -367,6 +476,11 @@ func (t *Testnet) RemoteRPCEndpoints(ctx context.Context) ([]string, error) { return rpcEndpoints, nil } +<<<<<<< HEAD +======= +const maxSyncAttempts = 20 + +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // WaitToSync waits for the started nodes to sync with the network and move // past the genesis block. func (t *Testnet) WaitToSync(ctx context.Context) error { @@ -378,12 +492,17 @@ func (t *Testnet) WaitToSync(ctx context.Context) error { } for _, node := range genesisNodes { +<<<<<<< HEAD log.Info().Str("name", node.Name).Msg( "waiting for node to sync") +======= + t.logger.Println("waiting for node to sync", "name", node.Name) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) client, err := node.Client() if err != nil { return fmt.Errorf("failed to initialize client for node %s: %w", node.Name, err) } +<<<<<<< HEAD for i := 0; i < 10; i++ { resp, err := client.Status(ctx) if err == nil { @@ -401,6 +520,25 @@ func (t *Testnet) WaitToSync(ctx context.Context) error { log.Info().Str("name", node.Name).Int("attempt", i).Msg( "node is not synced yet, waiting...") time.Sleep(time.Duration(i) * time.Second) +======= + var lastErr error + for i := 0; i < maxSyncAttempts; i++ { + resp, err := client.Status(ctx) + lastErr = err + if err == nil { + if resp != nil && resp.SyncInfo.LatestBlockHeight > 0 { + t.logger.Println("node has synced", "name", node.Name, "attempts", i, "latest_block_height", resp.SyncInfo.LatestBlockHeight) + break + } + t.logger.Println("node status retrieved but not synced yet, waiting...", "name", node.Name, "attempt", i) + } else { + t.logger.Println("error getting status, retrying...", "name", node.Name, "attempt", i, "error", err) + } + if i == maxSyncAttempts-1 { + return fmt.Errorf("timed out waiting for node %s to sync: %w", node.Name, lastErr) + } + time.Sleep(time.Second * time.Duration(1<>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } } return nil @@ -423,17 +561,28 @@ func (t *Testnet) StartNodes(ctx context.Context) error { } } +<<<<<<< HEAD log.Info().Msg("create endpoint proxies for genesis nodes") +======= + t.logger.Println("create endpoint proxies for genesis nodes") +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // wait for instances to be running for _, node := range genesisNodes { err := node.WaitUntilStartedAndCreateProxy(ctx) if err != nil { +<<<<<<< HEAD log.Err(err).Str("name", node.Name).Str("version", node.Version).Msg("failed to start and forward ports") return fmt.Errorf("node %s failed to start: %w", node.Name, err) } log.Info().Str("name", node.Name).Str("version", node.Version).Msg("started and ports forwarded") +======= + t.logger.Println("failed to start and create proxy", "name", node.Name, "version", node.Version, "error", err) + return fmt.Errorf("node %s failed to start: %w", node.Name, err) + } + t.logger.Println("started and created proxy", "name", node.Name, "version", node.Version) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } return nil } @@ -445,7 +594,11 @@ func (t *Testnet) Start(ctx context.Context) error { return err } // wait for nodes to sync +<<<<<<< HEAD log.Info().Msg("waiting for genesis nodes to sync") +======= + t.logger.Println("waiting for genesis nodes to sync") +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) err = t.WaitToSync(ctx) if err != nil { return err @@ -456,7 +609,11 @@ func (t *Testnet) Start(ctx context.Context) error { func (t *Testnet) Cleanup(ctx context.Context) { if err := t.knuu.CleanUp(ctx); err != nil { +<<<<<<< HEAD log.Err(err).Msg("failed to cleanup knuu") +======= + t.logger.Println("failed to cleanup knuu", "error", err) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } } @@ -472,6 +629,37 @@ func (t *Testnet) Genesis() *genesis.Genesis { return t.genesis } +<<<<<<< HEAD +======= +func (t *Testnet) ChainID() string { + return t.chainID +} + +func (t *Testnet) GenesisHash(ctx context.Context) (string, error) { + if t.genesisHash == "" { + if t.knuu == nil { + return "", errors.New("knuu is not initialized") + } + if len(t.nodes) == 0 { + return "", errors.New("no nodes available") + } + + client, err := t.nodes[0].Client() + if err != nil { + return "", fmt.Errorf("failed to get client: %w", err) + } + + height1 := int64(1) + block, err := client.Block(ctx, &height1) + if err != nil { + return "", fmt.Errorf("failed to get block: %w", err) + } + t.genesisHash = block.BlockID.Hash.String() + } + return t.genesisHash, nil +} + +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) func (o *Options) setDefaults() { if o.ChainID == "" { o.ChainID = DefaultChainID diff --git a/test/e2e/testnet/txsimNode.go b/test/e2e/testnet/txsimNode.go index c63062598b..8cf0865431 100644 --- a/test/e2e/testnet/txsimNode.go +++ b/test/e2e/testnet/txsimNode.go @@ -4,12 +4,19 @@ package testnet import ( "context" "fmt" +<<<<<<< HEAD +======= + "log" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) "strings" "github.com/celestiaorg/go-square/v2/share" "github.com/celestiaorg/knuu/pkg/instance" "github.com/celestiaorg/knuu/pkg/knuu" +<<<<<<< HEAD "github.com/rs/zerolog/log" +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) const ( @@ -28,6 +35,10 @@ type TxSim struct { // CreateTxClient returns a new TxSim instance. func CreateTxClient( ctx context.Context, +<<<<<<< HEAD +======= + logger *log.Logger, +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) name string, version string, endpoint string, @@ -46,6 +57,7 @@ func CreateTxClient( return nil, err } image := txsimDockerImageName(version) +<<<<<<< HEAD log.Info(). Str("name", name). Str("image", image). @@ -56,6 +68,12 @@ func CreateTxClient( Str("name", name). Str("image", image). Msg("failed to set image for tx client") +======= + logger.Println("setting image for tx client", "name", name, "image", image) + err = instance.Build().SetImage(ctx, image) + if err != nil { + logger.Println("failed to set image for tx client", "name", name, "image", image, "error", err) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return nil, err } err = instance.Resources().SetMemory(resources.MemoryRequest, resources.MemoryLimit) @@ -89,11 +107,15 @@ func CreateTxClient( return nil, err } +<<<<<<< HEAD log.Info(). Str("name", name). Str("image", image). Str("args", strings.Join(args, " ")). Msg("created tx client") +======= + logger.Println("created tx client", "name", name, "image", image, "args", strings.Join(args, " ")) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return &TxSim{ Name: name, diff --git a/test/e2e/testnet/util.go b/test/e2e/testnet/util.go index edf89aceda..998b958d72 100644 --- a/test/e2e/testnet/util.go +++ b/test/e2e/testnet/util.go @@ -1,9 +1,14 @@ package testnet import ( +<<<<<<< HEAD "os" "github.com/rs/zerolog/log" +======= + "log" + "os" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) type GrafanaInfo struct { @@ -12,17 +17,30 @@ type GrafanaInfo struct { Token string } +<<<<<<< HEAD func GetGrafanaInfoFromEnvVar() *GrafanaInfo { log.Info().Msg("Checking Grafana environment variables") +======= +func GetGrafanaInfoFromEnvVar(logger *log.Logger) *GrafanaInfo { + logger.Println("Checking Grafana environment variables") +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) if os.Getenv("GRAFANA_ENDPOINT") == "" || os.Getenv("GRAFANA_USERNAME") == "" || os.Getenv("GRAFANA_TOKEN") == "" { +<<<<<<< HEAD log.Info().Msg("No Grafana environment variables found") return nil } log.Info().Msg("Grafana environment variables found") +======= + logger.Println("No Grafana environment variables found") + return nil + } + + logger.Println("Grafana environment variables found") +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) return &GrafanaInfo{ Endpoint: os.Getenv("GRAFANA_ENDPOINT"), Username: os.Getenv("GRAFANA_USERNAME"), diff --git a/test/interchain/go.mod b/test/interchain/go.mod index 2b6b52b585..82b124863e 100644 --- a/test/interchain/go.mod +++ b/test/interchain/go.mod @@ -3,7 +3,11 @@ module github.com/celestiaorg/celestia-app/test/interchain go 1.23.1 require ( +<<<<<<< HEAD cosmossdk.io/math v1.3.0 +======= + cosmossdk.io/math v1.4.0 +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) github.com/cosmos/cosmos-sdk v0.46.16 github.com/strangelove-ventures/interchaintest/v6 v6.0.0 github.com/stretchr/testify v1.9.0 diff --git a/test/interchain/go.sum b/test/interchain/go.sum index c24352cb35..f62e994c0e 100644 --- a/test/interchain/go.sum +++ b/test/interchain/go.sum @@ -186,8 +186,13 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +<<<<<<< HEAD cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +======= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/test/util/blobfactory/payforblob_factory.go b/test/util/blobfactory/payforblob_factory.go index f9b05359bc..a217e11838 100644 --- a/test/util/blobfactory/payforblob_factory.go +++ b/test/util/blobfactory/payforblob_factory.go @@ -245,14 +245,21 @@ func ManyMultiBlobTx( accounts []string, accInfos []AccountInfo, blobs [][]*share.Blob, +<<<<<<< HEAD opts ...user.TxOption, +======= +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) ) [][]byte { t.Helper() txs := make([][]byte, len(accounts)) for i, acc := range accounts { signer, err := user.NewSigner(kr, enc, chainid, appconsts.LatestVersion, user.NewAccount(acc, accInfos[i].AccountNum, accInfos[i].Sequence)) require.NoError(t, err) +<<<<<<< HEAD txs[i], _, err = signer.CreatePayForBlobs(acc, blobs[i], opts...) +======= + txs[i], _, err = signer.CreatePayForBlobs(acc, blobs[i], DefaultTxOpts()...) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) require.NoError(t, err) } return txs diff --git a/test/util/blobfactory/test_util.go b/test/util/blobfactory/test_util.go index 0496ba1735..fb8c447c54 100644 --- a/test/util/blobfactory/test_util.go +++ b/test/util/blobfactory/test_util.go @@ -11,7 +11,11 @@ import ( ) func DefaultTxOpts() []user.TxOption { +<<<<<<< HEAD return FeeTxOpts(10_000_000) +======= + return FeeTxOpts(10_000_000_000) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) } func FeeTxOpts(gas uint64) []user.TxOption { diff --git a/test/util/testnode/comet_node_test.go b/test/util/testnode/comet_node_test.go index a011992f79..a9da868a15 100644 --- a/test/util/testnode/comet_node_test.go +++ b/test/util/testnode/comet_node_test.go @@ -16,6 +16,10 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" +<<<<<<< HEAD +======= + tmconfig "github.com/tendermint/tendermint/config" +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) tmrand "github.com/tendermint/tendermint/libs/rand" coretypes "github.com/tendermint/tendermint/rpc/core/types" ) @@ -34,6 +38,26 @@ type IntegrationTestSuite struct { cctx Context } +<<<<<<< HEAD +======= +func customTendermintConfig() *tmconfig.Config { + tmCfg := DefaultTendermintConfig() + // Override the mempool's MaxTxBytes to allow the testnode to accept a + // transaction that fills the entire square. Any blob transaction larger + // than the square size will still fail no matter what. + maxTxBytes := appconsts.DefaultUpperBoundMaxBytes + tmCfg.Mempool.MaxTxBytes = maxTxBytes + + // Override the MaxBodyBytes to allow the testnode to accept very large + // transactions and respond to queries with large responses (200 MiB was + // chosen only as an arbitrary large number). + tmCfg.RPC.MaxBodyBytes = 200 * mebibyte + + tmCfg.RPC.TimeoutBroadcastTxCommit = time.Minute + return tmCfg +} + +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) func (s *IntegrationTestSuite) SetupSuite() { t := s.T() s.accounts = RandomAccounts(10) @@ -44,7 +68,12 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := DefaultConfig(). WithFundedAccounts(s.accounts...). +<<<<<<< HEAD WithModifiers(genesis.SetBlobParams(ecfg.Codec, blobGenState.Params)) +======= + WithModifiers(genesis.SetBlobParams(ecfg.Codec, blobGenState.Params)). + WithTendermintConfig(customTendermintConfig()) +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) cctx, _, _ := NewNetwork(t, cfg) s.cctx = cctx diff --git a/test/util/testnode/config.go b/test/util/testnode/config.go index 76508f91d4..4f35cdc660 100644 --- a/test/util/testnode/config.go +++ b/test/util/testnode/config.go @@ -150,6 +150,7 @@ func DefaultTendermintConfig() *tmconfig.Config { // node produces blocks. tmCfg.Consensus.TimeoutCommit = 1 * time.Millisecond +<<<<<<< HEAD // Override the mempool's MaxTxBytes to allow the testnode to accept a // transaction that fills the entire square. Any blob transaction larger // than the square size will still fail no matter what. @@ -164,6 +165,9 @@ func DefaultTendermintConfig() *tmconfig.Config { tmCfg.RPC.TimeoutBroadcastTxCommit = time.Minute // set all the ports to random open ones +======= + // Set all the ports to random open ones. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) tmCfg.RPC.ListenAddress = fmt.Sprintf("tcp://127.0.0.1:%d", mustGetFreePort()) tmCfg.P2P.ListenAddress = fmt.Sprintf("tcp://127.0.0.1:%d", mustGetFreePort()) tmCfg.RPC.GRPCListenAddress = fmt.Sprintf("tcp://127.0.0.1:%d", mustGetFreePort()) diff --git a/x/blob/ante/blob_share_decorator.go b/x/blob/ante/blob_share_decorator.go index 90eb7780c6..4ddb2e808f 100644 --- a/x/blob/ante/blob_share_decorator.go +++ b/x/blob/ante/blob_share_decorator.go @@ -59,7 +59,11 @@ func (d BlobShareDecorator) getMaxSquareSize(ctx sdk.Context) int { // TODO: fix hack that forces the max square size for the first height to // 64. This is due to our fork of the sdk not initializing state before // BeginBlock of the first block. This is remedied in versions of the sdk +<<<<<<< HEAD // and comet that have full support of PreparePropsoal, although +======= + // and comet that have full support of PrepareProposal, although +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // celestia-app does not currently use those. see this PR for more details // https://github.com/cosmos/cosmos-sdk/pull/14505 if ctx.BlockHeader().Height <= 1 { diff --git a/x/blob/ante/max_total_blob_size_ante.go b/x/blob/ante/max_total_blob_size_ante.go index 3a9af081c1..013557d605 100644 --- a/x/blob/ante/max_total_blob_size_ante.go +++ b/x/blob/ante/max_total_blob_size_ante.go @@ -62,7 +62,11 @@ func (d MaxTotalBlobSizeDecorator) getMaxSquareSize(ctx sdk.Context) int { // TODO: fix hack that forces the max square size for the first height to // 64. This is due to our fork of the sdk not initializing state before // BeginBlock of the first block. This is remedied in versions of the sdk +<<<<<<< HEAD // and comet that have full support of PreparePropsoal, although +======= + // and comet that have full support of PrepareProposal, although +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) // celestia-app does not currently use those. see this PR for more details // https://github.com/cosmos/cosmos-sdk/pull/14505 if ctx.BlockHeader().Height <= 1 { diff --git a/x/tokenfilter/README.md b/x/tokenfilter/README.md index 3345d01900..d93ef5b7aa 100644 --- a/x/tokenfilter/README.md +++ b/x/tokenfilter/README.md @@ -7,7 +7,11 @@ their native token within their state machine. ## Context +<<<<<<< HEAD When tokens are transferred through the IBC transfer module, the denomination of that token is modified at each hop. It's more accurate to think of the tokens transferring to another network to actually remain held in escrow at the origin chain and the destination chain minting a "wrapped" equivalent. Thus tokens moved to a non-native state machine are beholdent to the security of both chains. The denomination is denoted as the path it's taken from the origin chain. To provide an example, imagine 3 chains: A, B and C with native tokens "a", "b", "c". With IBC's transfer module, when a user transfers token "a" from A to B, the wrapped token is prefixed with the source port and source channel (i.e. `portidone/channel-0/a`), this is Ba. If the token is further transferred to C it becomes BCa (or `portidtwo/channel-1/portidone/channel-0/a`). This token is now beholdent to the security of B, C and A. Also note that this is different if "a" were to go directly to C. In other words: `Ca != BCa`. +======= +When tokens are transferred through the IBC transfer module, the denomination of that token is modified at each hop. It's more accurate to think of the tokens transferring to another network to actually remain held in escrow at the origin chain and the destination chain minting a "wrapped" equivalent. Thus tokens moved to a non-native state machine are beholden to the security of both chains. The denomination is denoted as the path it's taken from the origin chain. To provide an example, imagine 3 chains: A, B and C with native tokens "a", "b", "c". With IBC's transfer module, when a user transfers token "a" from A to B, the wrapped token is prefixed with the source port and source channel (i.e. `portidone/channel-0/a`), this is Ba. If the token is further transferred to C it becomes BCa (or `portidtwo/channel-1/portidone/channel-0/a`). This token is now beholden to the security of B, C and A. Also note that this is different if "a" were to go directly to C. In other words: `Ca != BCa`. +>>>>>>> 3751aacd (fix: reject BlobTxs larger than 2 MiB (#4084)) This context is important in recognising when a native token is returning to its origin state machine. Each IBC packet contains metadata including the source port and channel. Therefore if the denomination of the token is prefixed with the same source port and channel as detailed in the packet, we can conclude that the denomination originally came from the receiving chain.