From 4a03197f3e78ef09952a5c52108513638c20255f Mon Sep 17 00:00:00 2001 From: inon-man <121477599+inon-man@users.noreply.github.com> Date: Sat, 18 Feb 2023 05:57:16 +0900 Subject: [PATCH] feat: panic at columbus genesis (#128) --- CHANGELOG.md | 1 + app/app.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba23d6c33..338b4fc8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (ante) [#103](https://github.com/classic-terra/core/pull/103) Add burn tax split logic * (ante) [#107](https://github.com/classic-terra/core/pull/107) Burn Tax Whitelist * (build) [#118](https://github.com/classic-terra/core/pull/118) localnet for Apple Silicon +* (app) [#128](https://github.com/classic-terra/core/pull/128) Panic at InitChainer for the Columbus mainnet ### Improvements * (build) [#93](https://github.com/classic-terra/core/pull/93) Use golang 1.18 and fix ad-hoc security vulnerabilities diff --git a/app/app.go b/app/app.go index 7a91fedb6..642b667a8 100644 --- a/app/app.go +++ b/app/app.go @@ -629,7 +629,7 @@ func (app *TerraApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) a } // trigger SetModuleVersionMap in upgrade keeper at the VersionMapEnableHeight - if ctx.BlockHeight() == core.VersionMapEnableHeight { + if ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() == core.VersionMapEnableHeight { app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) } @@ -647,6 +647,9 @@ func (app *TerraApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abc if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } + if ctx.ChainID() == core.ColumbusChainID { + panic("Must use v1.0.x for importing the columbus genesis (https://github.com/classic-terra/core/releases/)") + } app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) return app.mm.InitGenesis(ctx, app.appCodec, genesisState) }