diff --git a/app/app.go b/app/app.go index aecafcd9..60a4aa1e 100644 --- a/app/app.go +++ b/app/app.go @@ -162,6 +162,7 @@ import ( v420 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_2_0" v422 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_2_2" v424 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_2_4" + v425 "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app/upgrades/v4_2_5" "github.com/rakyll/statik/fs" // unnamed import of statik for swagger UI support @@ -1210,6 +1211,14 @@ func (app *MigalooApp) setupUpgradeHandlers() { app.configurator, ), ) + app.UpgradeKeeper.SetUpgradeHandler( + v425.UpgradeName, + v425.CreateUpgradeHandler( + app.mm, + app.StakingKeeper, + app.configurator, + ), + ) // When a planned update height is reached, the old binary will panic // writing on disk the height and name of the update that triggered it @@ -1223,7 +1232,7 @@ func (app *MigalooApp) setupUpgradeHandlers() { return } - if upgradeInfo.Name == v424.UpgradeName { + if upgradeInfo.Name == v425.UpgradeName { storeUpgrades := &storetypes.StoreUpgrades{ Added: []string{}, Deleted: []string{}, diff --git a/app/upgrades/v4_2_5/constants.go b/app/upgrades/v4_2_5/constants.go new file mode 100644 index 00000000..2b8b726a --- /dev/null +++ b/app/upgrades/v4_2_5/constants.go @@ -0,0 +1,7 @@ +package v4 + +// UpgradeName defines the on-chain upgrade name for the Migaloo v4.2.5 upgrade. +// this upgrade includes the fix for pfm +const ( + UpgradeName = "v4.2.5" +) diff --git a/app/upgrades/v4_2_5/upgrades.go b/app/upgrades/v4_2_5/upgrades.go new file mode 100644 index 00000000..90f968c0 --- /dev/null +++ b/app/upgrades/v4_2_5/upgrades.go @@ -0,0 +1,19 @@ +package v4 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +// CreateUpgradeHandler that migrates the chain from v4.2.4 to v4.2.5 +func CreateUpgradeHandler( + mm *module.Manager, + _ *stakingKeeper.Keeper, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, configurator, fromVM) + } +} diff --git a/go.mod b/go.mod index 09f28c0f..91f920a9 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( require ( cosmossdk.io/errors v1.0.1 - github.com/CosmWasm/wasmvm v1.5.4 + github.com/CosmWasm/wasmvm v1.5.5 github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3 github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.1.1 github.com/golang/protobuf v1.5.4 diff --git a/go.sum b/go.sum index c652d9b6..c8de22df 100644 --- a/go.sum +++ b/go.sum @@ -211,8 +211,8 @@ github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRr github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/CosmWasm/wasmd v0.46.0 h1:78kmiobbVE8JWBcM+ssxiFV2cS+4l9lmZQqPAQ0mA04= github.com/CosmWasm/wasmd v0.46.0/go.mod h1:BZFz+CFGdLNGomshb3IeccFyD4R+XbnS/mXpytOUyTA= -github.com/CosmWasm/wasmvm v1.5.4 h1:Opqy65ubJ8bMsT08dn85VjRdsLJVPIAgIXif92qOMGc= -github.com/CosmWasm/wasmvm v1.5.4/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= +github.com/CosmWasm/wasmvm v1.5.5 h1:XlZI3xO5iUhiBqMiyzsrWEfUtk5gcBMNYIdHnsTB+NI= +github.com/CosmWasm/wasmvm v1.5.5/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= diff --git a/scripts/upgrade_test.sh b/scripts/upgrade_test.sh index 5c3a7974..b6adcd13 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.2.2 +OLD_VERSION=v4.2.4 UPGRADE_WAIT=${UPGRADE_WAIT:-20} HOME=mytestnet ROOT=$(pwd) DENOM=uwhale CHAIN_ID=localmigaloo -SOFTWARE_UPGRADE_NAME="v4.2.4" +SOFTWARE_UPGRADE_NAME="v4.2.5" ADDITIONAL_PRE_SCRIPTS=${ADDITIONAL_PRE_SCRIPTS:-""} ADDITIONAL_AFTER_SCRIPTS=${ADDITIONAL_AFTER_SCRIPTS:-""}