diff --git a/CHANGELOG.md b/CHANGELOG.md index a8ad18b1..7d7a6fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,12 @@ Contains bug fixes. Contains all the PRs that improved the code without changing the behaviours. --> +## [v1.0.0-rc.1] + +### Removed + +- [#399](https://github.com/archway-network/archway/pull/399) - Removing the upgrade handler for v1 release + ## [v0.6.0] ### Added diff --git a/app/app_upgrades.go b/app/app_upgrades.go index b7076069..17abb5f5 100644 --- a/app/app_upgrades.go +++ b/app/app_upgrades.go @@ -6,20 +6,11 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/archway-network/archway/app/upgrades" - upgrade_0_3 "github.com/archway-network/archway/app/upgrades/03" - upgrade_0_4 "github.com/archway-network/archway/app/upgrades/04" - upgrade_0_5_2 "github.com/archway-network/archway/app/upgrades/052" - upgrade_0_6 "github.com/archway-network/archway/app/upgrades/06" ) // UPGRADES -var Upgrades = []upgrades.Upgrade{ - upgrade_0_3.Upgrade, // v0.3.0 - upgrade_0_4.Upgrade, // v0.4.0 - upgrade_0_5_2.Upgrade, // v0.5.2 - upgrade_0_6.Upgrade, // v0.6.0 -} +var Upgrades = []upgrades.Upgrade{} func (app *ArchwayApp) setupUpgrades() { app.setUpgradeHandlers() diff --git a/app/upgrades/03/upgrades.go b/app/upgrades/03/upgrades.go deleted file mode 100644 index a2b4743c..00000000 --- a/app/upgrades/03/upgrades.go +++ /dev/null @@ -1,22 +0,0 @@ -package upgrade03 - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/archway-network/archway/app/upgrades" -) - -const Name = "v0.3.0" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: Name, - CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, cfg, fromVM) - } - }, - StoreUpgrades: storetypes.StoreUpgrades{}, -} diff --git a/app/upgrades/04/upgrades.go b/app/upgrades/04/upgrades.go deleted file mode 100644 index 49578572..00000000 --- a/app/upgrades/04/upgrades.go +++ /dev/null @@ -1,22 +0,0 @@ -package upgrade04 - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/archway-network/archway/app/upgrades" -) - -const Name = "v0.4.0" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: Name, - CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, cfg, fromVM) - } - }, - StoreUpgrades: storetypes.StoreUpgrades{}, -} diff --git a/app/upgrades/052/precision_test.go b/app/upgrades/052/precision_test.go deleted file mode 100644 index b85e9a80..00000000 --- a/app/upgrades/052/precision_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build precision_test - -// NOTE: this test is run as a separate build tag as it modifies a global -// variable that is used in other tests. In a concurrent environment this -// might cause unforeseen issues, so we isolate it. -package upgrade052_test - -import ( - "testing" - - e2eTesting "github.com/archway-network/archway/e2e/testing" - archway "github.com/archway-network/archway/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" -) - -func TestPrecisionBreakages(t *testing.T) { - attoPrec := archway.DefaultPowerReduction - microPrecision := sdk.NewInt(1_000_000) - stake := func(shouldPass bool, errContains string) { - chainBad := e2eTesting.NewTestChain(t, 1, - e2eTesting.WithGenDefaultCoinBalance(attoPrec.MulRaw(1_000_000_000).String()), - e2eTesting.WithBondAmount(attoPrec.MulRaw(1).String()), - e2eTesting.WithDefaultFeeAmount(attoPrec.MulRaw(1).String()), - e2eTesting.WithValidatorsNum(2), - ) - acc := chainBad.GetAccount(1) - - _, _, _, err := chainBad.SendMsgs(acc, shouldPass, []sdk.Msg{ - &stakingtypes.MsgDelegate{ - DelegatorAddress: acc.Address.String(), - ValidatorAddress: sdk.ValAddress(chainBad.GetCurrentValSet().Validators[0].Address).String(), - Amount: sdk.NewCoin("stake", attoPrec.MulRaw(100_000_000)), - }, - }) - if !shouldPass { - require.ErrorContains(t, err, errContains) - } - } - // setup bad power reduction - sdk.DefaultPowerReduction = microPrecision - stake(false, "Int64() out of bound") - // fix power reduction - sdk.DefaultPowerReduction = attoPrec - stake(true, "") -} diff --git a/app/upgrades/052/upgrades.go b/app/upgrades/052/upgrades.go deleted file mode 100644 index 699bbca8..00000000 --- a/app/upgrades/052/upgrades.go +++ /dev/null @@ -1,22 +0,0 @@ -package upgrade052 - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - "github.com/archway-network/archway/app/upgrades" -) - -const Name = "v0.5.2" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: Name, - CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, cfg, fromVM) - } - }, - StoreUpgrades: storetypes.StoreUpgrades{}, -} diff --git a/app/upgrades/06/upgrades.go b/app/upgrades/06/upgrades.go deleted file mode 100644 index 64400d80..00000000 --- a/app/upgrades/06/upgrades.go +++ /dev/null @@ -1,25 +0,0 @@ -package upgrade06 - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types" - - "github.com/archway-network/archway/app/upgrades" -) - -const Name = "v0.6.0" - -var Upgrade = upgrades.Upgrade{ - UpgradeName: Name, - CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, cfg, fromVM) - } - }, - StoreUpgrades: storetypes.StoreUpgrades{ - Added: []string{ibcfeetypes.ModuleName}, - }, -}