From c32792f2264c4e04f53ff31164ed5f06be9c2b35 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Thu, 20 Mar 2025 14:00:10 +0100 Subject: [PATCH 1/5] feat: readd timeout info durations to InitChainer and EndBlocker --- app/app.go | 54 ++++++++++++++++++++++++------- app/test/integration_test.go | 4 +-- go.mod | 6 ++-- go.sum | 12 +++---- pkg/appconsts/versioned_consts.go | 3 +- test/util/malicious/app_test.go | 4 +-- 6 files changed, 58 insertions(+), 25 deletions(-) diff --git a/app/app.go b/app/app.go index b25b35e6ef..cf10c2b9d9 100644 --- a/app/app.go +++ b/app/app.go @@ -3,6 +3,7 @@ package app import ( "fmt" "io" + "os" "time" "cosmossdk.io/client/v2/autocli" @@ -45,6 +46,7 @@ import ( servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/types/msgservice" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -78,6 +80,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/gogoproto/proto" "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" @@ -488,6 +491,20 @@ func New( // app.SetMigrateStoreFn(app.migrateCommitStore) // app.SetMigrateModuleFn(app.migrateModules) + protoFiles, err := proto.MergedRegistry() + if err != nil { + panic(err) + } + err = msgservice.ValidateProtoAnnotations(protoFiles) + if err != nil { + // Once we switch to using protoreflect-based antehandlers, we might + // want to panic here instead of logging a warning. + _, err := fmt.Fprintln(os.Stderr, err.Error()) + if err != nil { + fmt.Println("could not write to stderr") + } + } + app.encodingConfig = encodingConfig if err := app.LoadLatestVersion(); err != nil { panic(err) @@ -515,6 +532,7 @@ func (app *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { if err != nil { return sdk.EndBlock{}, err } + currentVersion, err := app.AppVersion(ctx) if err != nil { return sdk.EndBlock{}, err @@ -542,9 +560,9 @@ func (app *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { } } - // TODO: check if needed, it is no more there - // res.Timeouts.TimeoutCommit = app.getTimeoutCommit(currentVersion) - // res.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose(currentVersion) + res.TimeoutInfo.TimeoutCommit = app.TimeoutCommit() + res.TimeoutInfo.TimeoutPropose = app.TimeoutPropose() + return res, nil } @@ -554,12 +572,21 @@ func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci. if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { return nil, err } + versionMap := app.ModuleManager.GetVersionMap() if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, versionMap); err != nil { return nil, err } - return app.ModuleManager.InitGenesis(ctx, app.AppCodec(), genesisState) + res, err := app.ModuleManager.InitGenesis(ctx, app.AppCodec(), genesisState) + if err != nil { + return nil, err + } + + res.TimeoutInfo.TimeoutCommit = app.TimeoutCommit() + res.TimeoutInfo.TimeoutPropose = app.TimeoutPropose() + + return res, nil } // DefaultGenesis returns the default genesis state @@ -751,14 +778,19 @@ func (app *App) NewProposalContext(header tmproto.Header) sdk.Context { return ctx } -// getTimeoutCommit returns the timeoutCommit if a user has overridden it via the -// --timeout-commit flag. Otherwise, it returns the default timeout commit based -// on the app version. -// TODO: is this still needed? -// nolint:unused -func (app *App) getTimeoutCommit(_ uint64) time.Duration { +// TimeoutCommit returns the timeout commit duration to be used on the next block. +// It returns the user specified value as overridden by the --timeout-commit flag, otherwise +// the default timeout commit value for the current app version. +func (app *App) TimeoutCommit() time.Duration { if app.timeoutCommit != 0 { return app.timeoutCommit } - return appconsts.DefaultTimeoutCommit + + return appconsts.TimeoutCommit +} + +// TimeoutPropose returns the timeout propose duration to be used on the next block. +// It returns the default timeout propose value for the current app version. +func (app *App) TimeoutPropose() time.Duration { + return appconsts.TimeoutPropose } diff --git a/app/test/integration_test.go b/app/test/integration_test.go index 11aa8b028c..cc73c0e617 100644 --- a/app/test/integration_test.go +++ b/app/test/integration_test.go @@ -257,7 +257,7 @@ func (s *IntegrationTestSuite) TestShareInclusionProof() { uint64(shareRange.End), ) require.NoError(t, err) - require.NoError(t, blobProof.ShareProof.Validate(blockRes.Block.DataRootHash)) + require.NoError(t, blobProof.ShareProof.Validate(blockRes.Block.DataHash)) } } @@ -269,7 +269,7 @@ func ExtendBlockTest(t *testing.T, block *coretypes.Block) { dah, err := da.NewDataAvailabilityHeader(eds) require.NoError(t, err) // TODO: verify why dataHash and dataRootHash are not equivalent - if !assert.Equal(t, dah.Hash(), block.Data.DataRootHash.Bytes()) { + if !assert.Equal(t, dah.Hash(), block.Data.Hash().Bytes()) { // save block to json file for further debugging if this occurs b, err := json.MarshalIndent(block, "", " ") require.NoError(t, err) diff --git a/go.mod b/go.mod index 8e107d45b5..7b4a9fbfd3 100644 --- a/go.mod +++ b/go.mod @@ -284,10 +284,10 @@ require ( ) replace ( - cosmossdk.io/x/upgrade => github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250212120257-926f94b828d0 - github.com/cometbft/cometbft => github.com/01builders/cometbft v0.0.0-20250303123948-a2b8ce5ddfe5 + cosmossdk.io/x/upgrade => github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250319133838-1b362cac2207 + github.com/cometbft/cometbft => github.com/celestiaorg/celestia-core v0.38.11-0.20250320105812-ec71e5a427b1 // Celestia SDK fork: https://github.com/01builders/cosmos-sdk/tree/release/v0.50.x-celestia - github.com/cosmos/cosmos-sdk => github.com/01builders/cosmos-sdk v0.0.0-20250305130717-630a3c965f8a + github.com/cosmos/cosmos-sdk => github.com/01builders/cosmos-sdk v0.0.0-20250319133838-1b362cac2207 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/go.sum b/go.sum index 24d8996e45..961d5d63e9 100644 --- a/go.sum +++ b/go.sum @@ -219,12 +219,10 @@ cosmossdk.io/x/tx v0.13.8/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/01builders/cometbft v0.0.0-20250303123948-a2b8ce5ddfe5 h1:a9BSBSO2Ub0eiotuIiFmgT7Bzf1lnhdmPPIhD4yy1tc= -github.com/01builders/cometbft v0.0.0-20250303123948-a2b8ce5ddfe5/go.mod h1:o2x5x8cXRuJOdx4PfzF6lbxjq5/VbK0PnRDWRLsMLNM= -github.com/01builders/cosmos-sdk v0.0.0-20250305130717-630a3c965f8a h1:Iey/DTc8q2ZHDTzHIYizI9/Wia5iKhPCeCrdcDKlgHs= -github.com/01builders/cosmos-sdk v0.0.0-20250305130717-630a3c965f8a/go.mod h1:hrWEFMU1eoXqLJeE6VVESpJDQH67FS1nnMrQIjO2daw= -github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250212120257-926f94b828d0 h1:LeWCjDAA4mBpuOXfpWzl9povApUc9dIXh6TTOcFlywU= -github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250212120257-926f94b828d0/go.mod h1:GdR2F3YQhICk8j5cEHOoSBdsIkKBDUcznPfjgnDHg5U= +github.com/01builders/cosmos-sdk v0.0.0-20250319133838-1b362cac2207 h1:d5FE6KG1FCIPcAOU84B3oIDTbzhz2lETGj0YPOGpoyE= +github.com/01builders/cosmos-sdk v0.0.0-20250319133838-1b362cac2207/go.mod h1:MaOUsycdmz1vVrRFNd4UQtN0SpWmRQM2EVAHYsBkaNA= +github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250319133838-1b362cac2207 h1:kMHYazURf8cCnUxGhSqqZgWmv00z/H3Pop4mrh6FwWs= +github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250319133838-1b362cac2207/go.mod h1:X+dl0bOcSYGCpt6Xf+gxtJmWDR6Wl7D74kb95Q/Mi2Q= github.com/01builders/nova v0.0.0-20250307104540-3cbceaa92bfd h1:/O6Yax76DDfejHtHH0fVae2+hS5bBygjd/NBhcu8btI= github.com/01builders/nova v0.0.0-20250307104540-3cbceaa92bfd/go.mod h1:Klw38zsWBHx2Lf9PgwrW7ejrRvpQxpdvzoUPJ9gow/w= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -338,6 +336,8 @@ github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFos github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8wrLMjhu260RuigXylC3pWoDu4OVumPHeojnk= github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7/go.mod h1:1EF5MfOxVf0WC51Gb7pJ6bcZxnXKNAf9pqWtjgPBAYc= +github.com/celestiaorg/celestia-core v0.38.11-0.20250320105812-ec71e5a427b1 h1:1OcJAqUOaDcYhhXRdQKbEFLb5zOd9NXjZNJztPpOkd8= +github.com/celestiaorg/celestia-core v0.38.11-0.20250320105812-ec71e5a427b1/go.mod h1:o2x5x8cXRuJOdx4PfzF6lbxjq5/VbK0PnRDWRLsMLNM= 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.3 h1:ORmcBoSW+67iPKF0yIGKwWMefphk5hvy08KklmCT0aw= diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 31442b9dc5..fe2c96cdfb 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -16,9 +16,10 @@ var ( DefaultTxSizeCostPerByte = v4.TxSizeCostPerByte DefaultGasPerBlobByte = v4.GasPerBlobByte DefaultVersion = v4.Version - DefaultTimeoutCommit = v4.TimeoutCommit DefaultUpgradeHeightDelay = v4.UpgradeHeightDelay DefaultMaxTxSize = v4.MaxTxSize + TimeoutCommit = v4.TimeoutCommit + TimeoutPropose = v4.TimeoutPropose ) func GetTimeoutCommit(_ uint64) time.Duration { diff --git a/test/util/malicious/app_test.go b/test/util/malicious/app_test.go index 5254afe316..c947e21fa9 100644 --- a/test/util/malicious/app_test.go +++ b/test/util/malicious/app_test.go @@ -106,7 +106,7 @@ func TestMaliciousTestNode(t *testing.T) { dah, err := da.NewDataAvailabilityHeader(eds) require.NoError(t, err) - require.Equal(t, block.Block.DataRootHash.Bytes(), dah.Hash()) + require.Equal(t, block.Block.DataHash.Bytes(), dah.Hash()) correctSquare, err := square.Construct(block.Block.Txs.ToSliceOfBytes(), appconsts.DefaultSquareSizeUpperBound, @@ -119,5 +119,5 @@ func TestMaliciousTestNode(t *testing.T) { goodDah, err := da.NewDataAvailabilityHeader(goodEds) require.NoError(t, err) - require.NotEqual(t, block.Block.DataRootHash.Bytes(), goodDah.Hash()) + require.NotEqual(t, block.Block.DataHash.Bytes(), goodDah.Hash()) } From 1468a3be0c4e7ad292f660332ebccc25f961caec Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Thu, 20 Mar 2025 17:04:58 +0100 Subject: [PATCH 2/5] test: plumb timeout commit flag to app in testing --- test/util/testnode/comet_node.go | 1 + test/util/testnode/config.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/util/testnode/comet_node.go b/test/util/testnode/comet_node.go index 481726e88d..932fa296ca 100644 --- a/test/util/testnode/comet_node.go +++ b/test/util/testnode/comet_node.go @@ -28,6 +28,7 @@ func NewCometNode(baseDir string, config *UniversalTestingConfig) (*node.Node, s } config.AppOptions.Set(flags.FlagHome, baseDir) + config.AppOptions.Set(TimeoutCommitFlag, config.TmConfig.Consensus.TimeoutCommit) app := config.AppCreator(logger, db, nil, config.AppOptions) nodeKey, err := p2p.LoadOrGenNodeKey(config.TmConfig.NodeKeyFile()) diff --git a/test/util/testnode/config.go b/test/util/testnode/config.go index 2ab42ae500..711803f776 100644 --- a/test/util/testnode/config.go +++ b/test/util/testnode/config.go @@ -26,6 +26,8 @@ const ( mebibyte = 1_048_576 // bytes DefaultValidatorAccountName = "validator" DefaultInitialBalance = genesis.DefaultInitialBalance + // TimeoutCommit is a flag that can be used to override the timeout_commit. + TimeoutCommitFlag = "timeout-commit" ) type UniversalTestingConfig struct { @@ -171,7 +173,7 @@ func DefaultAppCreator(opts ...AppCreationOptions) srvtypes.AppCreator { log.NewNopLogger(), dbm.NewMemDB(), nil, // trace store - 0, // timeout commit + appOptions.Get(TimeoutCommitFlag).(time.Duration), // timeout commit simtestutil.EmptyAppOptions{}, baseAppOptions..., ) From 7fc97a67dbdaecfe8bb0cdc4cf271cdb7ac052c7 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Fri, 21 Mar 2025 15:26:02 +0100 Subject: [PATCH 3/5] chore: add comment in go mod --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 35930ca7a2..cf2d36afbb 100644 --- a/go.mod +++ b/go.mod @@ -287,6 +287,7 @@ replace ( cosmossdk.io/x/upgrade => github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250319133838-1b362cac2207 github.com/cometbft/cometbft => github.com/celestiaorg/celestia-core v0.38.11-0.20250321105625-57e36546e8a3 // marko/core_changes_v3 // Celestia SDK fork: https://github.com/01builders/cosmos-sdk/tree/release/v0.50.x-celestia + // NOTE: temporary until upstreamed to celestiaorg https://github.com/01builders/cosmos-sdk/pull/11 github.com/cosmos/cosmos-sdk => github.com/01builders/cosmos-sdk v0.0.0-20250319133838-1b362cac2207 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 From 0e829ab78793ce5dc8d7fa9aee0cbb821999bd32 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 2 Apr 2025 09:41:37 +0200 Subject: [PATCH 4/5] chore: lockin deps --- go.mod | 6 ++++-- go.sum | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5dd6e59864..9911147eb5 100644 --- a/go.mod +++ b/go.mod @@ -295,8 +295,10 @@ require ( ) replace ( - cosmossdk.io/x/upgrade => github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250319133838-1b362cac2207 - github.com/cometbft/cometbft => github.com/celestiaorg/celestia-core v0.38.11-0.20250321105625-57e36546e8a3 // marko/core_changes_v3 + // x/upgrade: release/v0.50.x-celestia + cosmossdk.io/x/upgrade => github.com/celestiaorg/cosmos-sdk/x/upgrade v0.0.0-20250402072731-9d04f7ac424a + // celestia-core: release/v0.38.x-celestia + github.com/cometbft/cometbft => github.com/celestiaorg/celestia-core v0.38.11-0.20250331172655-bbd3b9bdd1ee // cosmos-sdk: release/v0.50.x-celestia github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v0.50.0-beta.0.0.20250402072731-9d04f7ac424a github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/go.sum b/go.sum index 48e13acad7..efaa433e65 100644 --- a/go.sum +++ b/go.sum @@ -227,8 +227,6 @@ cosmossdk.io/x/tx v0.13.8/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250319133838-1b362cac2207 h1:kMHYazURf8cCnUxGhSqqZgWmv00z/H3Pop4mrh6FwWs= -github.com/01builders/cosmos-sdk/x/upgrade v0.0.0-20250319133838-1b362cac2207/go.mod h1:X+dl0bOcSYGCpt6Xf+gxtJmWDR6Wl7D74kb95Q/Mi2Q= github.com/01builders/nova v0.0.0-20250326081858-46ef7ddcb5c6 h1:ZA5LyV5zG3FWibjit2EfLNJQGq6Tj8FJpfXaORJ0Pq0= github.com/01builders/nova v0.0.0-20250326081858-46ef7ddcb5c6/go.mod h1:BDQ0uO2y0Y7ohX6XQOIi32EtfqlcqNOdJIdacFVdXOU= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= @@ -356,12 +354,14 @@ github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFos github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8wrLMjhu260RuigXylC3pWoDu4OVumPHeojnk= github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7/go.mod h1:1EF5MfOxVf0WC51Gb7pJ6bcZxnXKNAf9pqWtjgPBAYc= -github.com/celestiaorg/celestia-core v0.38.11-0.20250321105625-57e36546e8a3 h1:Mmnos7MeeEwfv2ebffp9VfXQ5NyOqopsfhUwniCNRBo= -github.com/celestiaorg/celestia-core v0.38.11-0.20250321105625-57e36546e8a3/go.mod h1:o2x5x8cXRuJOdx4PfzF6lbxjq5/VbK0PnRDWRLsMLNM= +github.com/celestiaorg/celestia-core v0.38.11-0.20250331172655-bbd3b9bdd1ee h1:3GKW72AzYooZD7pzikSQeI9VUDw3qD5y4gWFXVZbkvg= +github.com/celestiaorg/celestia-core v0.38.11-0.20250331172655-bbd3b9bdd1ee/go.mod h1:PiU80T/t0z8FPlz7DRZgvrBux0jJiqxFi9lNBFdGUps= github.com/celestiaorg/celestia-core v1.45.0-tm-v0.34.35 h1:T21AhezjcByAlWDHmiVbpg743Uqk/dqBzJkQsAnbQf8= github.com/celestiaorg/celestia-core v1.45.0-tm-v0.34.35/go.mod h1:fQ46s1hYFTGFBsHsuGsbxDZ720ZPQow5Iyqw+yErZSo= github.com/celestiaorg/cosmos-sdk v0.50.0-beta.0.0.20250402072731-9d04f7ac424a h1:18hxmk72O7Pwu/ADTopXFrYPDmCgT3e63KupO8XSoCE= github.com/celestiaorg/cosmos-sdk v0.50.0-beta.0.0.20250402072731-9d04f7ac424a/go.mod h1:dBrR8kP1lYEf0E8F5xAnnCRxOewwm+8ceSq+nWPeu/U= +github.com/celestiaorg/cosmos-sdk/x/upgrade v0.0.0-20250402072731-9d04f7ac424a h1:15Q4O8EMqPtqn7d24SyG1z/1MAXznBfIpyn2M48EWlw= +github.com/celestiaorg/cosmos-sdk/x/upgrade v0.0.0-20250402072731-9d04f7ac424a/go.mod h1:R0bq8esgfPxsVm1q0k7p9nhg1fEpcUeXp5+6AcftGLQ= 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.3 h1:ORmcBoSW+67iPKF0yIGKwWMefphk5hvy08KklmCT0aw= From baceb819274b756b71b29c90687922e8fdeefd78 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 2 Apr 2025 14:30:51 +0200 Subject: [PATCH 5/5] chore: add Info override to set TimeoutInfo --- app/app.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/app.go b/app/app.go index b741be78ac..4d9e8c5d41 100644 --- a/app/app.go +++ b/app/app.go @@ -514,6 +514,20 @@ func New( // Name returns the name of the App func (app *App) Name() string { return app.BaseApp.Name() } +// Info implements the abci interface. It overrides baseapp's Info method, essentially becoming a decorator +// in order to assign TimeoutInfo values in the response. +func (app *App) Info(req *abci.RequestInfo) (*abci.ResponseInfo, error) { + res, err := app.BaseApp.Info(req) + if err != nil { + return nil, err + } + + res.TimeoutInfo.TimeoutCommit = app.TimeoutCommit() + res.TimeoutInfo.TimeoutPropose = app.TimeoutPropose() + + return res, nil +} + // PreBlocker application updates every pre block func (app *App) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { return app.ModuleManager.PreBlock(ctx)