Skip to content

Commit

Permalink
Added block height guards for the version map update
Browse files Browse the repository at this point in the history
  • Loading branch information
edk208 committed Jan 17, 2023
1 parent 24eb873 commit 6bf1a7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/app.go
Expand Up @@ -626,9 +626,8 @@ func (app *TerraApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) a
}
}

// check if version map in upgrade keeper is nil
vm := app.UpgradeKeeper.GetModuleVersionMap(ctx)
if len(vm) == 0 {
// trigger SetModuleVersionMap in upgrade keeper at the VersionMapEnableHeight
if ctx.BlockHeight() == core.VersionMapEnableHeight {
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
}

Expand Down
1 change: 1 addition & 0 deletions types/alias.go
Expand Up @@ -40,6 +40,7 @@ const (
BombayChainID = "bombay-12"
SwapDisableForkHeight = fork.SwapDisableForkHeight
SwapEnableForkHeight = fork.SwapEnableForkHeight
VersionMapEnableHeight = fork.VersionMapEnableHeight
)

// functions aliases
Expand Down
2 changes: 2 additions & 0 deletions types/fork/height.go
Expand Up @@ -4,3 +4,5 @@ package fork
const SwapDisableForkHeight = 7607790
// SwapEnableForkHeight - renable IBC only, block height is approximately December 5th, 2022
const SwapEnableForkHeight = 10542500
// VersionMapEnableHeight - set the version map to enable software upgrades, approximately February 14, 2023
const VersionMapEnableHeight = 11543150

0 comments on commit 6bf1a7e

Please sign in to comment.