Skip to content

Commit

Permalink
update consensus params in upgrade handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Jun 17, 2024
1 parent c531526 commit 1a0daa1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@ func (app *App) registerUpgrade0_4_0(upgradeInfo upgradetypes.Plan) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
sdkCtx.Logger().Info("Upgrade handler execution", "name", planName)

// enable vote extensions after upgrade
consensusParams := sdkCtx.ConsensusParams()
consensusParams.Abci.VoteExtensionsEnableHeight = plan.Height
msg := consensustypes.MsgUpdateParams{
Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(),
Block: consensusParams.Block,
Evidence: consensusParams.Evidence,
Validator: consensusParams.Validator,
Abci: consensusParams.Abci,
}
app.ConsensusParamsKeeper.UpdateParams(ctx, &msg)

Check failure on line 221 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `app.ConsensusParamsKeeper.UpdateParams` is not checked (errcheck)

Check failure on line 221 in app/upgrades.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `app.ConsensusParamsKeeper.UpdateParams` is not checked (errcheck)

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
)
Expand Down

0 comments on commit 1a0daa1

Please sign in to comment.