diff --git a/app/upgrades.go b/app/upgrades.go index a987f404..310e1a7b 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -10,8 +10,10 @@ import ( circuittypes "cosmossdk.io/x/circuit/types" ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" - // nft "cosmossdk.io/x/nft" upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/runtime" + consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + //runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" ) // RegisterUpgradeHandlers registers upgrade handlers. @@ -35,13 +37,30 @@ func (app *App) StickyFingers(_ upgradetypes.Plan) { app.Logger().Info(fmt.Sprintf("Module: %s, Version: %d", moduleName, version)) } - versionMap, err := app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) + // DEVNET-6 FIX: new consensus params keeper using the wrong key again and move the data into the consensus params keeper with the right key + storesvc := runtime.NewKVStoreService(app.GetKey("upgrade")) + consensuskeeper := consensuskeeper.NewKeeper( + app.appCodec, + storesvc, + app.AccountKeeper.GetAuthority(), + runtime.EventService{}, + ) + + params, err := consensuskeeper.ParamsStore.Get(ctx) + app.Logger().Info("Getting the params into the Consensus params keeper...") if err != nil { return nil, err } + + err = app.ConsensusParamsKeeper.ParamsStore.Set(ctx, params) + app.Logger().Info("Setting the params into the Consensus params keeper...") + if err != nil { + return nil, err + } + versionMap, err := app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) app.Logger().Info(fmt.Sprintf("post migrate version map: %v", versionMap)) - // return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) return versionMap, err + //return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, ) upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()