diff --git a/protocol/app/upgrades/v5.0.0/upgrade.go b/protocol/app/upgrades/v5.0.0/upgrade.go index a37e3ab810..b7442debce 100644 --- a/protocol/app/upgrades/v5.0.0/upgrade.go +++ b/protocol/app/upgrades/v5.0.0/upgrade.go @@ -5,6 +5,7 @@ import ( "fmt" "math/big" + tenderminttypes "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" @@ -263,15 +264,12 @@ func voteExtensionsUpgrade( keeper consensusparamkeeper.Keeper, ) { currentParams, err := keeper.Params(ctx, &consensustypes.QueryParamsRequest{}) - if err != nil { + if err != nil || currentParams == nil || currentParams.Params == nil { panic(fmt.Sprintf("failed to retrieve existing consensus params in VE upgrade handler: %s", err)) } - if currentParams.Params.Abci.VoteExtensionsEnableHeight != 0 { - panic(fmt.Sprintf( - "unable to update VE Enable Height since its current value of %d is already non-zero", - currentParams.Params.Abci.VoteExtensionsEnableHeight)) + currentParams.Params.Abci = &tenderminttypes.ABCIParams{ + VoteExtensionsEnableHeight: ctx.BlockHeight() + VEEnableHeightDelta, } - currentParams.Params.Abci.VoteExtensionsEnableHeight = ctx.BlockHeight() + VEEnableHeightDelta _, err = keeper.UpdateParams(ctx, &consensustypes.MsgUpdateParams{ Authority: keeper.GetAuthority(), Block: currentParams.Params.Block,