diff --git a/app/app.go b/app/app.go index e261158a..544b1945 100644 --- a/app/app.go +++ b/app/app.go @@ -155,10 +155,11 @@ import ( appparams "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/params" // unnamed import of statik for swagger UI support + v3_0_2 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v3_0_2" + v42 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_2" + v45 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_5" "github.com/rakyll/statik/fs" - v4 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_1_4" - // unnamed import of statik for swagger UI support _ "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/client/docs/statik" ) @@ -1144,8 +1145,29 @@ func RegisterSwaggerAPI(rtr *mux.Router) { // Setup Upgrade Handler func (app *MigalooApp) setupUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( - v4.UpgradeName, - v4.CreateUpgradeHandler( + v3_0_2.UpgradeName, + v3_0_2.CreateUpgradeHandler(app.mm, app.configurator), + ) + + // !! ATTENTION !! + // v4 upgrade handler + // !! WHEN UPGRADING TO SDK v0.47 MAKE SURE TO INCLUDE THIS + // source: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md#xconsensus + app.UpgradeKeeper.SetUpgradeHandler( + v42.UpgradeName, + v42.CreateUpgradeHandler( + app.mm, + app.configurator, + app.IBCKeeper.ClientKeeper, + app.ParamsKeeper, + app.ConsensusParamsKeeper, + app.ICAControllerKeeper, + app.AccountKeeper, + ), + ) + app.UpgradeKeeper.SetUpgradeHandler( + v45.UpgradeName, + v45.CreateUpgradeHandler( app.mm, app.configurator, ), @@ -1163,10 +1185,7 @@ func (app *MigalooApp) setupUpgradeHandlers() { return } - if upgradeInfo.Name == v4.UpgradeName { - // !! ATTENTION !! - // !! WHEN UPGRADING TO SDK v0.47 MAKE SURE TO INCLUDE THIS - // source: https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md + if upgradeInfo.Name == v45.UpgradeName { storeUpgrades := &storetypes.StoreUpgrades{ Added: []string{}, Deleted: []string{}, diff --git a/app/upgrades/v4_1_3/upgrades.go b/app/upgrades/v4_1_3/upgrades.go deleted file mode 100644 index 484cee2b..00000000 --- a/app/upgrades/v4_1_3/upgrades.go +++ /dev/null @@ -1,51 +0,0 @@ -package v4 - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - clientkeeper "github.com/cosmos/ibc-go/v7/modules/core/02-client/keeper" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" -) - -// CreateUpgradeHandler that migrates the chain from v3.0.2 to v4.1.3 -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - clientKeeper clientkeeper.Keeper, - paramsKeeper paramskeeper.Keeper, - consensusParamsKeeper consensuskeeper.Keeper, - icacontrollerKeeper icacontrollerkeeper.Keeper, - accountKeeper authkeeper.AccountKeeper, -) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // READ: https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/UPGRADING.md#xconsensus - baseAppLegacySS := paramsKeeper.Subspace(baseapp.Paramspace). - WithKeyTable(paramstypes.ConsensusParamsKeyTable()) - baseapp.MigrateParams(ctx, baseAppLegacySS, &consensusParamsKeeper) - - // READ: https://github.com/cosmos/ibc-go/blob/v7.2.0/docs/migrations/v7-to-v7_1.md#chains - params := clientKeeper.GetParams(ctx) - params.AllowedClients = append(params.AllowedClients, ibcexported.Localhost) - clientKeeper.SetParams(ctx, params) - - // READ: https://github.com/terra-money/core/issues/166 - icacontrollerKeeper.SetParams(ctx, icacontrollertypes.DefaultParams()) - - // Burning module permissions - moduleAccI := accountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) - moduleAcc := moduleAccI.(*authtypes.ModuleAccount) - moduleAcc.Permissions = []string{authtypes.Burner} - accountKeeper.SetModuleAccount(ctx, moduleAcc) - - return mm.RunMigrations(ctx, configurator, fromVM) - } -} diff --git a/app/upgrades/v4_1_4/constants.go b/app/upgrades/v4_1_4/constants.go deleted file mode 100644 index 545347fb..00000000 --- a/app/upgrades/v4_1_4/constants.go +++ /dev/null @@ -1,7 +0,0 @@ -package v4 - -// UpgradeName defines the on-chain upgrade name for the Migaloo v4.1.2 upgrade. -// this upgrade includes the fix for pfm -const ( - UpgradeName = "v4.1.4" -) diff --git a/app/upgrades/v4_1_3/constants.go b/app/upgrades/v4_1_5/constants.go similarity index 75% rename from app/upgrades/v4_1_3/constants.go rename to app/upgrades/v4_1_5/constants.go index 36db1968..2ed64552 100644 --- a/app/upgrades/v4_1_3/constants.go +++ b/app/upgrades/v4_1_5/constants.go @@ -1,7 +1,7 @@ package v4 -// UpgradeName defines the on-chain upgrade name for the Migaloo v4.1.2 upgrade. +// UpgradeName defines the on-chain upgrade name for the Migaloo v4.1.5 upgrade. // this upgrade includes the fix for pfm const ( - UpgradeName = "v4.1.2" + UpgradeName = "v4.1.5" ) diff --git a/app/upgrades/v4_1_4/upgrades.go b/app/upgrades/v4_1_5/upgrades.go similarity index 86% rename from app/upgrades/v4_1_4/upgrades.go rename to app/upgrades/v4_1_5/upgrades.go index 5ee052e8..8e930abe 100644 --- a/app/upgrades/v4_1_4/upgrades.go +++ b/app/upgrades/v4_1_5/upgrades.go @@ -6,7 +6,7 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -// CreateUpgradeHandler that migrates the chain from v4.1.3 to v4.1.4 +// CreateUpgradeHandler that migrates the chain from v4.1.2 to v4.1.5 func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, diff --git a/go.mod b/go.mod index 93edcbf5..bf0c7c4b 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/cosmos/cosmos-sdk v0.47.10 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017 - github.com/cosmos/ibc-go/v7 v7.3.2 + github.com/cosmos/ibc-go/v7 v7.4.0 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/prometheus/client_golang v1.18.0 diff --git a/go.sum b/go.sum index 3beea0c1..9cbe2fcc 100644 --- a/go.sum +++ b/go.sum @@ -365,8 +365,8 @@ github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1 h1:02RCbih5lQ8aGdDMSvxhTn github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1/go.mod h1:LvVkEXTORVgd87W2Yu7ZY3acKKeTMq/txdTworn8EZI= github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017 h1:/m++TlQ4CfCZs+7vGFDQNdlnkvSNKFoLbjzmWOT7m10= github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20231017170841-8fd49ec0f017/go.mod h1:JwHFbo1oX/ht4fPpnPvmhZr+dCkYK1Vihw+vZE9umR4= -github.com/cosmos/ibc-go/v7 v7.3.2 h1:FeUDcBX7VYY0e0iRmcVkPPUjYfAqIc//QuHXo8JHz9c= -github.com/cosmos/ibc-go/v7 v7.3.2/go.mod h1:IMeOXb7gwpZ+/nOG5BuUkdW4weM1ezvN4PQPws4uzOI= +github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M= +github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/scripts/upgrade_test.sh b/scripts/upgrade_test.sh index 4e429ed4..33398ba1 100755 --- a/scripts/upgrade_test.sh +++ b/scripts/upgrade_test.sh @@ -3,13 +3,13 @@ # the upgrade is a fork, "true" otherwise FORK=${FORK:-"false"} -OLD_VERSION=v4.1.3 +OLD_VERSION=v4.1.4 UPGRADE_WAIT=${UPGRADE_WAIT:-20} HOME=mytestnet ROOT=$(pwd) DENOM=uwhale CHAIN_ID=localmigaloo -SOFTWARE_UPGRADE_NAME="v4.1.4" +SOFTWARE_UPGRADE_NAME="v4.1.5" ADDITIONAL_PRE_SCRIPTS=${ADDITIONAL_PRE_SCRIPTS:-""} ADDITIONAL_AFTER_SCRIPTS=${ADDITIONAL_AFTER_SCRIPTS:-""}