From 6bf1a7e8f2e6c048b2fe56a13b1edb9aa48fa557 Mon Sep 17 00:00:00 2001 From: Edward Kim Date: Tue, 17 Jan 2023 15:53:09 -0500 Subject: [PATCH] Added block height guards for the version map update --- app/app.go | 5 ++--- types/alias.go | 1 + types/fork/height.go | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index 3dc5032c4..6fa9b6865 100644 --- a/app/app.go +++ b/app/app.go @@ -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()) } diff --git a/types/alias.go b/types/alias.go index 6a1b1ff7e..4268b523d 100644 --- a/types/alias.go +++ b/types/alias.go @@ -40,6 +40,7 @@ const ( BombayChainID = "bombay-12" SwapDisableForkHeight = fork.SwapDisableForkHeight SwapEnableForkHeight = fork.SwapEnableForkHeight + VersionMapEnableHeight = fork.VersionMapEnableHeight ) // functions aliases diff --git a/types/fork/height.go b/types/fork/height.go index 6b120d17f..332252cd7 100644 --- a/types/fork/height.go +++ b/types/fork/height.go @@ -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