diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92f7c0775a..3b0739c52d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: run: make test-coverage - name: Upload coverage.txt - uses: codecov/codecov-action@v5.0.4 + uses: codecov/codecov-action@v5.0.7 with: file: ./coverage.txt diff --git a/Makefile b/Makefile index 8d106d4173..c734b1e596 100644 --- a/Makefile +++ b/Makefile @@ -28,16 +28,13 @@ 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 ?= -# Set this to override the upgrade height delay of the binary -OVERRIDE_UPGRADE_HEIGHT_DELAY ?= # 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) \ - -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) BUILD_FLAGS := -tags "ledger" -ldflags '$(ldflags)' diff --git a/app/benchmarks/README.md b/app/benchmarks/README.md index f7f720741b..95a610ded0 100644 --- a/app/benchmarks/README.md +++ b/app/benchmarks/README.md @@ -6,7 +6,7 @@ This package contains benchmarks for the ABCI methods with the following transac - IBC update client - PayForBlobs -## How to run +## How to Run To run the benchmarks, run the following in the root directory: @@ -20,8 +20,8 @@ The results are outlined in the [results](results.md) document. ## Key takeaways -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. +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 reached consensus, it will still be accepted since this rule is not consensus breaking. +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 [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. +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. diff --git a/app/benchmarks/results.md b/app/benchmarks/results.md index 9562a6a340..db8eed58f9 100644 --- a/app/benchmarks/results.md +++ b/app/benchmarks/results.md @@ -13,27 +13,27 @@ The benchmarks will be run using an in memory DB, then a local db, goleveldb. #### CheckTx -A single `checkTx` of a `sendMsg` message takes 0.0003585 **ns** to execute. And it uses 74374 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. +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. +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. +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. +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 1843040790 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. +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. +An `8MB` block containing 31645 `sendMsg` messages takes 5,17 s (5179850250 ns) to execute. The total gas used 1,843,040,790 gas. 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 +123,7 @@ Benchmarks of `DeliverTx` for a single PFB with different sizes: #### PrepareProposal: `BenchmarkPrepareProposal_PFB_Multi` -The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different sizes: +The benchmarks for `PrepareProposal` for 8MB blocks containing PFBs of different sizes: | Benchmark Name | Block Size (MB) | Number of Transactions | Prepare Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -147,7 +147,7 @@ The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different #### ProcessProposal: `BenchmarkProcessProposal_PFB_Multi` -The benchmarks for `ProcessProposal` for 8mb blocks containing PFBs of different sizes: +The benchmarks for `ProcessProposal` for 8MB blocks containing PFBs of different sizes: | Benchmark Name | Block Size (MB) | Number of Transactions | Process Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -217,7 +217,7 @@ The benchmarks of executing `deliverTx` on a single transaction containing an IB #### PrepareProposal: `BenchmarkIBC_PrepareProposal_Update_Client_Multi` -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: | 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 +238,7 @@ Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with #### ProcessProposal: `BenchmarkIBC_ProcessProposal_Update_Client_Multi` -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: | 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,27 +627,27 @@ Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with #### CheckTx -A single `checkTx` of a `sendMsg` message takes 0.0003071 **ns** to execute. And it uses 74374 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. +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. +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. +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. +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. +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. +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. +An `8MB` block containing 31645 `sendMsg` messages takes 5,21 s (5214205041 ns) to execute. The total gas used 1843040790 gas. ### `PFB` benchmarks @@ -701,7 +701,7 @@ Benchmarks of `DeliverTx` for a single PFB with different sizes: #### PrepareProposal: `BenchmarkPrepareProposal_PFB_Multi` -The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different sizes: +The benchmarks for `PrepareProposal` for 8MB blocks containing PFBs of different sizes: | Benchmark Name | Block Size (MB) | Number of Transactions | Prepare Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -725,7 +725,7 @@ The benchmarks for `PrepareProposal` for 8mb blocks containing PFBs of different #### ProcessProposal: `BenchmarkProcessProposal_PFB_Multi` -The benchmarks for `ProcessProposal` for 8mb blocks containing PFBs of different sizes: +The benchmarks for `ProcessProposal` for 8MB blocks containing PFBs of different sizes: | Benchmark Name | Block Size (MB) | Number of Transactions | Process Proposal Time (s) | Total Gas Used | Transaction Size (Bytes) | Transaction Size (MB) | |------------------------------------------------------------------------|-----------------|------------------------|---------------------------|-----------------|--------------------------|-----------------------| @@ -795,7 +795,7 @@ The benchmarks of executing `deliverTx` on a single transaction containing an IB #### PrepareProposal: `BenchmarkIBC_PrepareProposal_Update_Client_Multi` -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: | 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 +817,7 @@ Benchmarks of an `8mb` containing the maximum number of IBC `UpdateClient` with #### ProcessProposal: `BenchmarkIBC_ProcessProposal_Update_Client_Multi` -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: | 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/extend_block.go b/app/extend_block.go index f14a764b26..a9c1bbe072 100644 --- a/app/extend_block.go +++ b/app/extend_block.go @@ -25,8 +25,17 @@ func ExtendBlock(data coretypes.Data, appVersion uint64) (*rsmt2d.ExtendedDataSq return da.ExtendShares(share.ToBytes(dataSquare)) } -// EmptyBlock returns true if the given block data is considered empty by the +// IsEmptyBlock returns true if the given block data is considered empty by the // application at a given version. +// +// Deprecated: Use IsEmptyBlockRef for better performance with large data structures. func IsEmptyBlock(data coretypes.Data, _ uint64) bool { return len(data.Txs) == 0 } + +// IsEmptyBlockRef returns true if the application considers the given block data +// empty at a given version. +// This method passes the block data by reference for improved performance. +func IsEmptyBlockRef(data *coretypes.Data, _ uint64) bool { + return len(data.Txs) == 0 +} diff --git a/app/test/integration_test.go b/app/test/integration_test.go index aec6d86e46..7ee8e08d2d 100644 --- a/app/test/integration_test.go +++ b/app/test/integration_test.go @@ -275,13 +275,24 @@ func ExtendBlockTest(t *testing.T, block *coretypes.Block) { } } -func (s *IntegrationTestSuite) TestEmptyBlock() { +func (s *IntegrationTestSuite) TestIsEmptyBlock() { t := s.T() emptyHeights := []int64{1, 2, 3} for _, h := range emptyHeights { blockRes, err := s.cctx.Client.Block(s.cctx.GoContext(), &h) require.NoError(t, err) - require.True(t, app.IsEmptyBlock(blockRes.Block.Data, blockRes.Block.Header.Version.App)) + require.True(t, app.IsEmptyBlock(blockRes.Block.Data, blockRes.Block.Header.Version.App)) //nolint:staticcheck + ExtendBlockTest(t, blockRes.Block) + } +} + +func (s *IntegrationTestSuite) TestIsEmptyBlockRef() { + t := s.T() + emptyHeights := []int64{1, 2, 3} + for _, h := range emptyHeights { + blockRes, err := s.cctx.Client.Block(s.cctx.GoContext(), &h) + require.NoError(t, err) + require.True(t, app.IsEmptyBlockRef(&blockRes.Block.Data, blockRes.Block.Header.Version.App)) ExtendBlockTest(t, blockRes.Block) } } diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index e42449d747..899d2268c9 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -38,9 +38,6 @@ func TestAppUpgradeV3(t *testing.T) { t.Skip("skipping TestAppUpgradeV3 in short mode") } - appconsts.OverrideUpgradeHeightDelayStr = "1" - defer func() { appconsts.OverrideUpgradeHeightDelayStr = "" }() - testApp, genesis := SetupTestAppWithUpgradeHeight(t, 3) upgradeFromV1ToV2(t, testApp) @@ -104,7 +101,6 @@ func TestAppUpgradeV3(t *testing.T) { require.NoError(t, err) require.Equal(t, v3.Version, getUpgradeResp.Upgrade.AppVersion) - // brace yourselfs, this part may take a while initialHeight := int64(4) for height := initialHeight; height < initialHeight+appconsts.UpgradeHeightDelay(testApp.GetChainID(), v2.Version); height++ { appVersion := v2.Version @@ -259,6 +255,7 @@ 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(). + WithChainID("test"). 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 763f1b6cd5..de97d4dfa0 100644 --- a/cmd/celestia-appd/cmd/start.go +++ b/cmd/celestia-appd/cmd/start.go @@ -9,7 +9,6 @@ import ( "net" "net/http" "os" - "os/exec" "path/filepath" "runtime/pprof" "strings" @@ -580,6 +579,8 @@ sudo sysctl -p Then verify BBR is enabled: sysctl net.ipv4.tcp_congestion_control +or +cat /proc/sys/net/ipv4/tcp_congestion_control This node will get worse p2p performance using a different congestion control algorithm. If you need to bypass this check use the --force-no-bbr flag. @@ -594,16 +595,15 @@ If you need to bypass this check use the --force-no-bbr flag. return nil } - cmd := exec.Command("sysctl", "net.ipv4.tcp_congestion_control") - output, err := cmd.Output() + file, err := os.ReadFile("/proc/sys/net/ipv4/tcp_congestion_control") if err != nil { fmt.Print(warning) - return fmt.Errorf("failed to execute 'sysctl net.ipv4.tcp_congestion_control' %w", err) + return fmt.Errorf("failed to read file '/proc/sys/net/ipv4/tcp_congestion_control' %w", err) } - if !strings.Contains(string(output), "bbr") { + if !strings.Contains(string(file), "bbr") { fmt.Print(warning) - return fmt.Errorf("BBR not enabled because output %v does not contain 'bbr'", string(output)) + return fmt.Errorf("BBR not enabled because output %v does not contain 'bbr'", string(file)) } return nil diff --git a/docs/architecture/adr-015-namespace-id-size.md b/docs/architecture/adr-015-namespace-id-size.md index 3333c05f0d..6fa8af210b 100644 --- a/docs/architecture/adr-015-namespace-id-size.md +++ b/docs/architecture/adr-015-namespace-id-size.md @@ -50,7 +50,7 @@ Users will specify a version (1 byte) and a ID (28 bytes) in their PFB. Addition ### Criteria 1 -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. | Namespace ID size (bytes) | Criteria 1 | |---------------------------|------------| @@ -229,7 +229,6 @@ 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. -[^2]: [^3]: [^4]: diff --git a/go.mod b/go.mod index b7a77d1a16..6ddc9b7eb3 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/math v1.4.0 github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 github.com/celestiaorg/go-square v1.1.1 - github.com/celestiaorg/go-square/v2 v2.0.0 + github.com/celestiaorg/go-square/v2 v2.1.0 github.com/celestiaorg/knuu v0.16.1 github.com/celestiaorg/nmt v0.22.2 github.com/celestiaorg/rsmt2d v0.14.0 @@ -28,7 +28,7 @@ require ( github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/tendermint/tendermint v0.34.29 github.com/tendermint/tm-db v0.6.7 golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e @@ -36,7 +36,7 @@ require ( google.golang.org/grpc v1.68.0 google.golang.org/protobuf v1.35.2 gopkg.in/yaml.v2 v2.4.0 - k8s.io/apimachinery v0.31.2 + k8s.io/apimachinery v0.31.3 ) require ( @@ -260,5 +260,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.43.0-tm-v0.34.35 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.44.0-tm-v0.34.35 ) diff --git a/go.sum b/go.sum index eb3a044c6b..dc62f3ea98 100644 --- a/go.sum +++ b/go.sum @@ -317,14 +317,14 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7/go.mod h1:1EF5MfOxVf0WC51Gb7pJ6bcZxnXKNAf9pqWtjgPBAYc= github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 h1:h1Y4V3EMQ2mFmNtWt2sIhZIuyASInj1a9ExI8xOsTOw= github.com/celestiaorg/blobstream-contracts/v3 v3.1.0/go.mod h1:x4DKyfKOSv1ZJM9NwV+Pw01kH2CD7N5zTFclXIVJ6GQ= -github.com/celestiaorg/celestia-core v1.43.0-tm-v0.34.35 h1:L4GTm+JUXhB0a/nGPMq6jEqqe6THuYSQ8m2kUCtZYqw= -github.com/celestiaorg/celestia-core v1.43.0-tm-v0.34.35/go.mod h1:bFr0lAGwaJ0mOHSBmib5/ca5pbBf1yKWGPs93Td0HPw= +github.com/celestiaorg/celestia-core v1.44.0-tm-v0.34.35 h1:kwDEIe42SzXZ37jk7br9pArHU+UKOiXAkB+LSaIYPas= +github.com/celestiaorg/celestia-core v1.44.0-tm-v0.34.35/go.mod h1:bFr0lAGwaJ0mOHSBmib5/ca5pbBf1yKWGPs93Td0HPw= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.1 h1:Cy3p8WVspVcyOqHM8BWFuuYPwMitO1pYGe+ImILFZRA= github.com/celestiaorg/go-square v1.1.1/go.mod h1:1EXMErhDrWJM8B8V9hN7dqJ2kUTClfwdqMOmF9yQUa0= -github.com/celestiaorg/go-square/v2 v2.0.0 h1:U5QV8/de5lc7glosfgyHhcxbFwNuwU4+6aYZ2RgjM04= -github.com/celestiaorg/go-square/v2 v2.0.0/go.mod h1:y0BolG0tRM7UN1sAQyDDUkT+aMJPwFIjviVvnCB62C0= +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= 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/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= @@ -1255,8 +1255,8 @@ 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= -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= 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= @@ -2065,8 +2065,8 @@ 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= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= 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/overrides.go b/pkg/appconsts/overrides.go index 39c5f4c6d0..2404b3203f 100644 --- a/pkg/appconsts/overrides.go +++ b/pkg/appconsts/overrides.go @@ -6,5 +6,4 @@ package appconsts // Look at the Makefile to see how these are set. var ( OverrideSquareSizeUpperBoundStr string - OverrideUpgradeHeightDelayStr string ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 6034453598..57ff919bee 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -80,12 +80,8 @@ 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 { - if OverrideUpgradeHeightDelayStr != "" { - parsedValue, err := strconv.ParseInt(OverrideUpgradeHeightDelayStr, 10, 64) - if err != nil { - panic("Invalid OverrideUpgradeHeightDelayStr value") - } - return parsedValue + if chainID == "test" { + return 3 } switch v { case v1.Version: @@ -100,6 +96,5 @@ func UpgradeHeightDelay(chainID string, v uint64) int64 { return v2.UpgradeHeightDelay default: return v3.UpgradeHeightDelay - } } diff --git a/pkg/appconsts/versioned_consts_test.go b/pkg/appconsts/versioned_consts_test.go index 249dd99805..f85d05b163 100644 --- a/pkg/appconsts/versioned_consts_test.go +++ b/pkg/appconsts/versioned_consts_test.go @@ -118,6 +118,18 @@ func TestUpgradeHeightDelay(t *testing.T) { version: 3, expectedUpgradeHeightDelay: v3.UpgradeHeightDelay, }, + { + 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, + }, } for _, tc := range tests { diff --git a/test/interchain/go.mod b/test/interchain/go.mod index 2b6b52b585..9d1fddc9d7 100644 --- a/test/interchain/go.mod +++ b/test/interchain/go.mod @@ -3,7 +3,7 @@ module github.com/celestiaorg/celestia-app/test/interchain go 1.23.1 require ( - cosmossdk.io/math v1.3.0 + cosmossdk.io/math v1.4.0 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..56a0cd16bb 100644 --- a/test/interchain/go.sum +++ b/test/interchain/go.sum @@ -186,8 +186,8 @@ 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= -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= 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/testnode/comet_node_test.go b/test/util/testnode/comet_node_test.go index a011992f79..63222ca66e 100644 --- a/test/util/testnode/comet_node_test.go +++ b/test/util/testnode/comet_node_test.go @@ -16,6 +16,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" + tmconfig "github.com/tendermint/tendermint/config" tmrand "github.com/tendermint/tendermint/libs/rand" coretypes "github.com/tendermint/tendermint/rpc/core/types" ) @@ -34,6 +35,23 @@ type IntegrationTestSuite struct { cctx Context } +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 +} + func (s *IntegrationTestSuite) SetupSuite() { t := s.T() s.accounts = RandomAccounts(10) @@ -44,7 +62,8 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := DefaultConfig(). WithFundedAccounts(s.accounts...). - WithModifiers(genesis.SetBlobParams(ecfg.Codec, blobGenState.Params)) + WithModifiers(genesis.SetBlobParams(ecfg.Codec, blobGenState.Params)). + WithTendermintConfig(customTendermintConfig()) cctx, _, _ := NewNetwork(t, cfg) s.cctx = cctx diff --git a/test/util/testnode/config.go b/test/util/testnode/config.go index 76508f91d4..4c2f5346ae 100644 --- a/test/util/testnode/config.go +++ b/test/util/testnode/config.go @@ -150,20 +150,7 @@ func DefaultTendermintConfig() *tmconfig.Config { // node produces blocks. tmCfg.Consensus.TimeoutCommit = 1 * time.Millisecond - // 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 - - // set all the ports to random open ones + // Set all the ports to random open ones. 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())