From c7d6a437af0bb6f9fe74e8c52198889102a32f3e Mon Sep 17 00:00:00 2001 From: Tomas Tauber <2410580+tomtau@users.noreply.github.com> Date: Thu, 2 Sep 2021 17:26:25 +0800 Subject: [PATCH] Problem: testnet-croeseid-4 started on 0.43 Solution: added a custom empty upgrade handler to upgrade from 0.43 to 0.44 --- CHANGELOG.md | 10 ++++----- app/app.go | 36 +++---------------------------- integration_tests/test_upgrade.py | 2 ++ 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffb8b7369..1770af668 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # Changelog -*Septeber 2, 2021* +*Septeber 3, 2021* -## v3.1.0 -This version is identical to the v3.0.1, but updated the Cosmos SDK dependency to 0.44.0 which contains a consensus-breaking security patch. -*WARNING*: DO NOT upgrade to this binary yet; instructions are going to be published later -on https://crypto.org/docs/getting-started/upgrade_guide.html . +## v3.1.0-croeseid +This version is identical to the v3.0.1-croeseid, but updated the Cosmos SDK dependency to 0.44.0 which contains a consensus-breaking security patch. It contains the upgrade handler for the plan "croeseid-0.44" which is meant to signal an upgrade on the "testnet-croeseid-4" public testnet. +*WARNING*: DO NOT run this binary from "testnet-croeseid-4" genesis; you can upgrade to it after the upgrade block height has passed +as per instructions on https://crypto.org/docs/getting-started/croeseid-testnet.html . *August 26, 2021* diff --git a/app/app.go b/app/app.go index e65eac143..f79258f89 100644 --- a/app/app.go +++ b/app/app.go @@ -6,7 +6,6 @@ import ( "net/http" "os" "path/filepath" - "time" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" @@ -63,7 +62,6 @@ import ( ibcclient "github.com/cosmos/ibc-go/modules/core/02-client" ibcclientclient "github.com/cosmos/ibc-go/modules/core/02-client/client" ibcclienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types" - ibcconnectiontypes "github.com/cosmos/ibc-go/modules/core/03-connection/types" porttypes "github.com/cosmos/ibc-go/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper" @@ -459,34 +457,8 @@ func New( app.SetAnteHandler(anteHandler) app.SetEndBlocker(app.EndBlocker) - // FIXME: upgrade plan to v0.43 https://github.com/cosmos/cosmos-sdk/pull/9567/files - planName := "v3.0.0" - app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx sdk.Context, plan upgradetypes.Plan, _ module.VersionMap) (module.VersionMap, error) { - // a new param in 1.0.0 -- set to roundup(5x 7secs) as a safe choice - app.IBCKeeper.ConnectionKeeper.SetParams(ctx, ibcconnectiontypes.NewParams(uint64(40*time.Second))) - // 1st-time running in-store migrations, using 1 as fromVersion to - // avoid running InitGenesis. - fromVM := map[string]uint64{ - "auth": 1, - "bank": 1, - "capability": 1, - "crisis": 1, - "distribution": 1, - "evidence": 1, - "gov": 1, - "mint": 1, - "params": 1, - "slashing": 1, - "staking": 1, - "upgrade": 1, - "vesting": 1, - "ibc": 1, - "genutil": 1, - "transfer": 1, - "chainmain": 1, - "nft": 1, - "supply": 1, - } + planName := "croeseid-0.44" + app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { return app.mm.RunMigrations(ctx, app.configurator, fromVM) }) @@ -497,9 +469,7 @@ func New( } if upgradeInfo.Name == planName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { - storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{"authz", "feegrant"}, - } + storeUpgrades := storetypes.StoreUpgrades{} // configure store loader that checks if version == upgradeHeight and applies store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index f1fa8ae96..c7879e60a 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -173,6 +173,7 @@ def propose_and_pass(cluster, kind, proposal): return proposal +@pytest.mark.skip(reason="croeseid-4 started off 0.43") def test_manual_upgrade(cosmovisor_cluster): """ - do the upgrade test by replacing binary manually @@ -251,6 +252,7 @@ def test_manual_upgrade(cosmovisor_cluster): wait_for_block(cluster, target_height + 2, 600) +@pytest.mark.skip(reason="croeseid-4 started off 0.43") def test_manual_upgrade_all(cosmovisor_cluster): test_manual_upgrade(cosmovisor_cluster) cluster = cosmovisor_cluster