Skip to content

Commit

Permalink
feat(upgrade): move drs check to begin blocker to allow gov software …
Browse files Browse the repository at this point in the history
…upgrades (#393)
  • Loading branch information
srene authored Dec 10, 2024
1 parent 8219370 commit f9bd1b6
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 (
// Force-load the tracer engines to trigger registration due to Go-Ethereum v1.10.15 changes
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"

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

const (
Expand Down Expand Up @@ -862,6 +864,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 f9bd1b6

Please sign in to comment.