Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(upgrade): add drs validation to allow gov based upgrades #182

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
"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 @@
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))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}
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))

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
}
return resp
}

Expand Down
Loading