Skip to content

Commit b2ec2f6

Browse files
fix(runtime): fix option order (backport #21769) (#21771)
Co-authored-by: Julien Robert <[email protected]>
1 parent 9a0a76f commit b2ec2f6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
5151

5252
### Bug Fixes
5353

54+
* (runtime) [#21769](https://github.com/cosmos/cosmos-sdk/pull/21769) Fix baseapp options ordering to avoid overwriting options set by modules.
5455
* (types/mempool) [#21494](https://github.com/cosmos/cosmos-sdk/pull/21494) `GetSigners` function in priority nonce mempool returns an slide of the correct length.
5556
* (x/consensus) [#21493](https://github.com/cosmos/cosmos-sdk/pull/21493) Fix regression that prevented to upgrade to > v0.50.7 without consensus version params.
5657
* (baseapp) [#21256](https://github.com/cosmos/cosmos-sdk/pull/21256) Halt height will not commit the block indicated, meaning that if halt-height is set to 10, only blocks until 9 (included) will be committed. This is to go back to the original behavior before a change was introduced in v0.50.0.

runtime/builder.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,18 @@ func (a *AppBuilder) Build(db dbm.DB, traceStore io.Writer, baseAppOptions ...fu
2929
baseAppOptions = append(baseAppOptions, option)
3030
}
3131

32+
// set routers first in case they get modified by other options
33+
baseAppOptions = append(
34+
[]func(*baseapp.BaseApp){
35+
func(bApp *baseapp.BaseApp) {
36+
bApp.SetMsgServiceRouter(a.app.msgServiceRouter)
37+
bApp.SetGRPCQueryRouter(a.app.grpcQueryRouter)
38+
},
39+
},
40+
baseAppOptions...,
41+
)
42+
3243
bApp := baseapp.NewBaseApp(a.app.config.AppName, a.app.logger, db, nil, baseAppOptions...)
33-
bApp.SetMsgServiceRouter(a.app.msgServiceRouter)
34-
bApp.SetGRPCQueryRouter(a.app.grpcQueryRouter)
3544
bApp.SetCommitMultiStoreTracer(traceStore)
3645
bApp.SetVersion(version.Version)
3746
bApp.SetInterfaceRegistry(a.app.interfaceRegistry)

0 commit comments

Comments
 (0)