Skip to content

Commit

Permalink
feat(upgrade): add drs validation to allow gov based upgrades (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
srene authored Dec 10, 2024
1 parent 93d7626 commit 5a08f00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ import (
"github.com/dymensionxyz/dymension-rdk/x/rollappparams"
rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper"
rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types"

dymintversion "github.com/dymensionxyz/dymint/version"
)

const (
Expand Down Expand Up @@ -952,6 +954,13 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R
resp := app.mm.BeginBlock(ctx, req)
resp.ConsensusMessagesResponses = consensusResponses

drsVersion, err := dymintversion.GetDRSVersion()
if err != nil {
panic(fmt.Errorf("Unable to get DRS version from binary: %w", err))
}
if drsVersion != app.RollappParamsKeeper.Version(ctx) {
panic(fmt.Errorf("DRS version mismatch. rollapp DRS version: %d binary DRS version:%d", app.RollappParamsKeeper.Version(ctx), drsVersion))
}
return resp
}

Expand Down

0 comments on commit 5a08f00

Please sign in to comment.