From 61c6ddfe491abfa5c33825caa490cfb3a716a9ca Mon Sep 17 00:00:00 2001 From: Arnaud Mimart <33665250+amimart@users.noreply.github.com> Date: Thu, 18 Jan 2024 21:29:35 +0100 Subject: [PATCH] fix(app): do not try to migrate consensus params --- app/app.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/app/app.go b/app/app.go index b45f7851..d8f4f719 100644 --- a/app/app.go +++ b/app/app.go @@ -11,7 +11,6 @@ import ( "path/filepath" "sort" "strings" - "sync" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" @@ -243,7 +242,6 @@ type App struct { // module configurator configurator module.Configurator - once sync.Once } // New returns a reference to an initialized blockchain app. @@ -926,24 +924,6 @@ func (app *App) setPostHandler() { func (app *App) Name() string { return app.BaseApp.Name() } func (app *App) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { - // when skipping sdk 47 for sdk 50, the upgrade handler is called too late in BaseApp - // this is a hack to ensure that the migration is executed when needed and not panics - app.once.Do(func() { - ctx := app.NewUncachedContext(false, tmproto.Header{}) - if _, err := app.ConsensusParamsKeeper.Params(ctx, &consensusparamtypes.QueryParamsRequest{}); err != nil { - // prevents panic: consensus key is nil: collections: not found: key 'no_key' of type - // github.com/cosmos/gogoproto/tendermint.types.ConsensusParams - // sdk 47: - // Migrate Tendermint consensus parameters from x/params module to a dedicated x/consensus module. - // see https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/simapp/upgrades.go#L66 - baseAppLegacySS := app.GetSubspace(baseapp.Paramspace) - err := baseapp.MigrateParams(sdk.UnwrapSDKContext(ctx), baseAppLegacySS, app.ConsensusParamsKeeper.ParamsStore) - if err != nil { - panic(err) - } - } - }) - return app.BaseApp.FinalizeBlock(req) }