diff --git a/app/app.go b/app/app.go index 68b0bc16e..1b248bea1 100644 --- a/app/app.go +++ b/app/app.go @@ -8,9 +8,7 @@ import ( "net/http" "os" "path/filepath" - "sync" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/cosmos/gogoproto/proto" ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" @@ -269,7 +267,6 @@ type Canto struct { configurator module.Configurator tpsCounter *tpsCounter - once sync.Once } func init() { @@ -1265,23 +1262,6 @@ func (app *Canto) GetTxConfig() client.TxConfig { } func (app *Canto) 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) }