Skip to content

Commit

Permalink
chore(release): prepare v14.0.0 release (#1794)
Browse files Browse the repository at this point in the history
* move all upgrade logic from rc1, rc2, and rc5 into v14.0.0 handler

* add logic to enable vesting extension during upgrade

* update changelog

* add assertion to test

* update release date in changelog
  • Loading branch information
MalteHerrmann committed Sep 19, 2023
1 parent f11bcb4 commit 392d906
Show file tree
Hide file tree
Showing 16 changed files with 229 additions and 412 deletions.
45 changes: 8 additions & 37 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,44 +35,21 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [v14.0.0-rc5] - 2023-09-14
## [v14.0.0] - 2023-09-19

### State Machine Breaking

- (vesting) [#1754](https://github.com/evmos/evmos/pull/1754) Implement further vesting module refactors.

### Improvements

- (cli) [#1786](https://github.com/evmos/evmos/pull/1786) Add `block` CLI command to query a block from local db.
- (gov) [#1791](https://github.com/evmos/evmos/pull/1791) Extend maximum proposal metadata length.

## [v14.0.0-rc4] - 2023-08-30

### State Machine Breaking

- (evm) [#1727](https://github.com/evmos/evmos/pull/1727) Return an error when calling inactive EVM extensions
- (deps) [#1732](https://github.com/evmos/evmos/pull/1732) Bump ibc-go version with error message fix.
- (vesting) [#1730](https://github.com/evmos/evmos/pull/1730) Remove smart contract conversion to `ClawbackVestingAccount`

## [v14.0.0-rc3] - 2023-08-22

### Improvements

- (cli) [#1714](https://github.com/evmos/evmos/pull/1714) Use empty string as default value in `chain-id` flag to use the chain id from the genesis file when not specified.

### Bug Fixes

- (proto) [#1713](https://github.com/evmos/evmos/pull/1713) Add proto file for v1 vesting module account
- (deps) [#1718](https://github.com/evmos/evmos/pull/1718) Update rosetta types import.

## [v14.0.0-rc2] - 2023-08-21

### State Machine Breaking

- (deps) [#1662](https://github.com/evmos/evmos/pull/1662) Bump Cosmos-SDK to v0.47.4 and ibc-go to v7.2.0.

### Improvements

- (gov) [#1791](https://github.com/evmos/evmos/pull/1791) Extend maximum proposal metadata length.
- (cli) [#1786](https://github.com/evmos/evmos/pull/1786) Add `block` CLI command to query a block from local db.
- (cli) [#1714](https://github.com/evmos/evmos/pull/1714) Use empty string as default value in `chain-id` flag to use the chain id from the genesis file when not specified.
- (ics20) [#1688](https://github.com/evmos/evmos/pull/1688) Change authorization names to `grantee` / `granter` in the `ICS20` precompile
- (staking) [#1702](https://github.com/evmos/evmos/pull/1702) Change authorization names to `grantee` / `granter` in the `staking` precompile
- (mod) [#1674](https://github.com/evmos/evmos/pull/1674) Update `evmos` module name to `evmos/v14`
Expand All @@ -82,16 +59,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
- (vesting) [#1708](https://github.com/evmos/evmos/pull/1708) Minor improvements to `vesting` module
- (vesting) [#1709](https://github.com/evmos/evmos/pull/1709) Add clawed back coins to `MsgClawbackResponse`
- (cli) [#1706](https://github.com/evmos/evmos/pull/1706) Update `DefaultGasAdjustment` factor used in transactions.

### Bug Fixes

- (e2e) [#1678](https://github.com/evmos/evmos/pull/1678) Fix e2e tests after recent changes to `evmosd start` default flags
- (evm) [#1703](https://github.com/evmos/evmos/pull/1703) Prevent panic on uint64 conversion in EVM keeper `ApplyMessageWithConfig` function.

## [v14.0.0-rc1] - 2023-08-01

### Improvements

- (vesting)[#1672](https://github.com/evmos/evmos/pull/1672) Port `vesting` precompile code and refactor integration tests
- (vesting)[#1667](https://github.com/evmos/evmos/pull/1667) Add support for vesting precompile in the `evm` module
- (vesting) Refactor vesting flow
Expand All @@ -101,6 +68,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

- (proto) [#1713](https://github.com/evmos/evmos/pull/1713) Add proto file for v1 vesting module account
- (deps) [#1718](https://github.com/evmos/evmos/pull/1718) Update rosetta types import.
- (e2e) [#1678](https://github.com/evmos/evmos/pull/1678) Fix e2e tests after recent changes to `evmosd start` default flags
- (evm) [#1703](https://github.com/evmos/evmos/pull/1703) Prevent panic on uint64 conversion in EVM keeper `ApplyMessageWithConfig` function.
- (vesting) Fix vesting bug.
- (rpc) [#1650](https://github.com/evmos/evmos/pull/1650) Fix racing conditions on RPC PubSub logic
- (rpc) [#1655](https://github.com/evmos/evmos/pull/1655) Avoid channel get changed when concurrent subscribe happens.
Expand Down
30 changes: 4 additions & 26 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ import (
v12 "github.com/evmos/evmos/v14/app/upgrades/v12"
v13 "github.com/evmos/evmos/v14/app/upgrades/v13"
v14 "github.com/evmos/evmos/v14/app/upgrades/v14"
"github.com/evmos/evmos/v14/app/upgrades/v14rc2"
"github.com/evmos/evmos/v14/app/upgrades/v14rc5"
v8 "github.com/evmos/evmos/v14/app/upgrades/v8"
v81 "github.com/evmos/evmos/v14/app/upgrades/v8_1"
v82 "github.com/evmos/evmos/v14/app/upgrades/v8_2"
Expand Down Expand Up @@ -1304,23 +1302,16 @@ func (app *Evmos) setupUpgradeHandlers() {
),
)

// v14 upgrade handler
app.UpgradeKeeper.SetUpgradeHandler(
v14.UpgradeName,
v14.CreateUpgradeHandler(
app.mm, app.configurator,
),
)

// !! ATTENTION !!
// v14rc2 upgrade handler
// v14 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(
v14rc2.UpgradeName,
v14rc2.CreateUpgradeHandler(
v14.UpgradeName,
v14.CreateUpgradeHandler(
app.mm, app.configurator,
app.BankKeeper,
app.EvmKeeper,
app.StakingKeeper,
app.VestingKeeper,
app.ConsensusParamsKeeper,
Expand All @@ -1330,15 +1321,6 @@ func (app *Evmos) setupUpgradeHandlers() {
),
)

// v14rc4 upgrade handler
app.UpgradeKeeper.SetUpgradeHandler(
v14rc5.UpgradeName,
v14rc5.CreateUpgradeHandler(
app.mm, app.configurator,
app.EvmKeeper,
),
)

// 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
// This will read that value, and execute the preparations for the upgrade.
Expand Down Expand Up @@ -1384,8 +1366,6 @@ func (app *Evmos) setupUpgradeHandlers() {
case v13.UpgradeName:
// no store upgrades
case v14.UpgradeName:
// no store upgrades
case v14rc2.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
Expand All @@ -1396,8 +1376,6 @@ func (app *Evmos) setupUpgradeHandlers() {
},
}
// !! ATTENTION !!
case v14rc5.UpgradeName:
// no store upgrades
}

if storeUpgrades != nil {
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v14/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v14

const (
// UpgradeName is the shared upgrade plan name for mainnet
UpgradeName = "v14.0.0-rc1"
UpgradeName = "v14.0.0"
// UpgradeInfo defines the binaries that will be used for the upgrade
UpgradeInfo = `'{"binaries":{"darwin/arm64":"https://github.com/evmos/evmos/releases/download/v14.0.0-rc1/evmos_14.0.0-rc1_Darwin_arm64.tar.gz","darwin/amd64":"https://github.com/evmos/evmos/releases/download/v14.0.0-rc1/evmos_14.0.0-rc1_Darwin_amd64.tar.gz","linux/arm64":"https://github.com/evmos/evmos/releases/download/v14.0.0-rc1/evmos_14.0.0-rc1_Linux_arm64.tar.gz","linux/amd64":"https://github.com/evmos/evmos/releases/download/v14.0.0-rc1/evmos_14.0.0-rc1_Linux_amd64.tar.gz","windows/x86_64":"https://github.com/evmos/evmos/releases/download/v14.0.0-rc1/evmos_14.0.0-rc1_Windows_x86_64.zip"}}'`
UpgradeInfo = `'{"binaries":{"darwin/arm64":"https://github.com/evmos/evmos/releases/download/v14.0.0/evmos_14.0.0_Darwin_arm64.tar.gz","darwin/amd64":"https://github.com/evmos/evmos/releases/download/v14.0.0/evmos_14.0.0_Darwin_amd64.tar.gz","linux/arm64":"https://github.com/evmos/evmos/releases/download/v14.0.0/evmos_14.0.0_Linux_arm64.tar.gz","linux/amd64":"https://github.com/evmos/evmos/releases/download/v14.0.0/evmos_14.0.0_Linux_amd64.tar.gz","windows/x86_64":"https://github.com/evmos/evmos/releases/download/v14.0.0/evmos_14.0.0_Windows_x86_64.zip"}}'`
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

package v14rc2
package v14

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package v14rc2_test
package v14_test

import (
"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/evmos/evmos/v14/app/upgrades/v14rc2"
"github.com/evmos/evmos/v14/app/upgrades/v14"
"github.com/evmos/evmos/v14/crypto/ethsecp256k1"
"github.com/evmos/evmos/v14/testutil"
testutiltx "github.com/evmos/evmos/v14/testutil/tx"
Expand Down Expand Up @@ -33,7 +33,7 @@ func (s *UpgradesTestSuite) TestUpdateMigrateNativeMultisigs() {

var (
migratedBalances sdk.Coins
migrationTarget = v14rc2.NewTeamPremintWalletAcc
migrationTarget = v14.NewTeamPremintWalletAcc
oldMultisigs = make([]string, 0, len(affectedAccounts))
)

Expand All @@ -59,7 +59,7 @@ func (s *UpgradesTestSuite) TestUpdateMigrateNativeMultisigs() {
// Check validator shares before migration
expectedSharesMap := s.getDelegationSharesMap()

err := v14rc2.MigrateNativeMultisigs(s.ctx, s.app.BankKeeper, s.app.StakingKeeper, migrationTarget, oldMultisigs...)
err := v14.MigrateNativeMultisigs(s.ctx, s.app.BankKeeper, s.app.StakingKeeper, migrationTarget, oldMultisigs...)
s.Require().NoError(err, "failed to migrate native multisigs")

// Check that the multisigs have been updated
Expand Down Expand Up @@ -91,7 +91,7 @@ func (s *UpgradesTestSuite) TestInstantUnbonding() {
delegation, found := s.app.StakingKeeper.GetDelegation(s.ctx, s.address.Bytes(), s.validators[0].GetOperator())
s.Require().True(found, "delegation not found")

unbondAmount, err := v14rc2.InstantUnbonding(s.ctx, s.app.BankKeeper, s.app.StakingKeeper, delegation, s.bondDenom)
unbondAmount, err := v14.InstantUnbonding(s.ctx, s.app.BankKeeper, s.app.StakingKeeper, delegation, s.bondDenom)
s.Require().NoError(err, "failed to unbond")
s.Require().Equal(unbondAmount, math.NewInt(1e18), "expected different unbond amount")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
package v14rc2_test
package v14_test

import (
"testing"
Expand Down
160 changes: 160 additions & 0 deletions app/upgrades/v14/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,181 @@
package v14

import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations"
"github.com/ethereum/go-ethereum/common"
vestingprecompile "github.com/evmos/evmos/v14/precompiles/vesting"
"github.com/evmos/evmos/v14/utils"
evmkeeper "github.com/evmos/evmos/v14/x/evm/keeper"
evmtypes "github.com/evmos/evmos/v14/x/evm/types"
feemarkettypes "github.com/evmos/evmos/v14/x/feemarket/types"
vestingkeeper "github.com/evmos/evmos/v14/x/vesting/keeper"
)

const (
// newTeamPremintWallet is the new vesting team multisig
newTeamPremintWallet = "0x83ef4C096F9A9daC61081121CCE30578fe437182"
// newTeamStrategicReserve is the new strategic reserve multisig
newTeamStrategicReserve = "0x29fDcB7b64B84fD54D0fB0E04A8f6B062046fc6F"
// OldFunder1 is one of the old vesting funders to be replaced
OldFunder1 = "evmos1sgjgup7wz3qyfcqqpr66jlm9qpk3j63ajupc9l"
// OldFunder2 is the other old vesting funder to be replaced
OldFunder2 = "evmos1xp38jqcjf2s7wyuyh3fwrjukuj4ny54k2yaq97"
// oldTeamPremintWallet is the old team premint wallet
oldTeamPremintWallet = "evmos1sgjgup7wz3qyfcqqpr66jlm9qpk3j63ajupc9l"
// VestingAddrByFunder1 is the vesting account funded by OldFunder1
VestingAddrByFunder1 = "evmos1pxjncpsu2rd3hjxgswkqaenrpu3v5yxurzm7jp"
)

var (
// VestingAddrsByFunder2 is a slice of vesting accounts funded by OldFunder1
VestingAddrsByFunder2 = []string{
"evmos12aqyq9d4k7a8hzh5av2xgxp0njan48498dvj2s",
"evmos1rtj2r4eaz0v68mxjt5jleynm85yjfu2uxm7pxx",
}

// OldStrategicReserves is a list of old multisigs to be replaced
OldStrategicReserves = []string{
"evmos1z8ynrnhdn4l69mu6v6ckjr4wukcacd0e7j0akn", // Strategic Reserve 1
"evmos1w2rl60wr9sxjv60qsh9v8aratk0x2r3v78utzt", // Strategic Reserve 2
"evmos1fgg4xaakwmrxdk9my6uc8nxeatf7u35uaal529", // Strategic Reserve 3
"evmos15xm3h3fgjrkqtkr79t7rj9spq3qlzuheae5vss", // Strategic Reserve 4
"evmos15l8jnxynhldtydknzla2xpv8uxg00xgmg2enst", // Strategic Reserve 5
}

newTeamPremintWalletAddr = common.HexToAddress(newTeamPremintWallet)
NewTeamPremintWalletAcc = sdk.AccAddress(newTeamPremintWalletAddr.Bytes())
newTeamStrategicReserveAddr = common.HexToAddress(newTeamStrategicReserve)
NewTeamStrategicReserveAcc = sdk.AccAddress(newTeamStrategicReserveAddr.Bytes())
)

// CreateUpgradeHandler creates an SDK upgrade handler for v13
func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
bk bankkeeper.Keeper,
ek *evmkeeper.Keeper,
sk stakingkeeper.Keeper,
vk vestingkeeper.Keeper,
ck consensuskeeper.Keeper,
clientKeeper ibctmmigrations.ClientKeeper,
pk paramskeeper.Keeper,
cdc codec.BinaryCodec,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
logger := ctx.Logger().With("upgrade", UpgradeName)

// !! ATTENTION !!
// v14 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
// !! If not migrating to v0.47 in this upgrade,
// !! make sure to move it to the corresponding upgrade
// Migrate Tendermint consensus parameters from x/params module to a
// dedicated x/consensus module.

// Set param key table for params module migration
for _, subspace := range pk.GetSubspaces() {
var keyTable paramstypes.KeyTable
switch subspace.Name() {
case authtypes.ModuleName:
keyTable = authtypes.ParamKeyTable() //nolint:staticcheck
case banktypes.ModuleName:
keyTable = banktypes.ParamKeyTable() //nolint:staticcheck,nolintlint
case stakingtypes.ModuleName:
keyTable = stakingtypes.ParamKeyTable()
case minttypes.ModuleName:
keyTable = minttypes.ParamKeyTable() //nolint:staticcheck
case distrtypes.ModuleName:
keyTable = distrtypes.ParamKeyTable() //nolint:staticcheck,nolintlint
case slashingtypes.ModuleName:
keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck
case govtypes.ModuleName:
keyTable = govv1.ParamKeyTable() //nolint:staticcheck
case crisistypes.ModuleName:
keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck
case ibctransfertypes.ModuleName:
keyTable = ibctransfertypes.ParamKeyTable()
case evmtypes.ModuleName:
keyTable = evmtypes.ParamKeyTable() //nolint:staticcheck
case feemarkettypes.ModuleName:
keyTable = feemarkettypes.ParamKeyTable()
default:
continue
}
if !subspace.HasKeyTable() {
subspace.WithKeyTable(keyTable)
}
}

baseAppLegacySS := pk.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())

baseapp.MigrateParams(ctx, baseAppLegacySS, &ck)

// Include this when migrating to ibc-go v7 (optional)
// source: https://github.com/cosmos/ibc-go/blob/v7.2.0/docs/migrations/v6-to-v7.md
// prune expired tendermint consensus states to save storage space
if _, err := ibctmmigrations.PruneExpiredConsensusStates(ctx, cdc, clientKeeper); err != nil {
return nil, err
}
// !! ATTENTION !!

if utils.IsMainnet(ctx.ChainID()) {
logger.Debug("adding vesting EVM extension to active precompiles")
if err := EnableVestingExtension(ctx, ek); err != nil {
// log error instead of aborting the upgrade
logger.Error("error while enabling vesting extension", "error", err)
}

logger.Debug("updating vesting funders to new team multisig")
if err := UpdateVestingFunders(ctx, vk, NewTeamPremintWalletAcc); err != nil {
logger.Error("error while updating vesting funders", "error", err)
}

logger.Debug("migrating strategic reserves")
if err := MigrateNativeMultisigs(ctx, bk, sk, NewTeamStrategicReserveAcc, OldStrategicReserves...); err != nil {
logger.Error("error while migrating native multisigs", "error", err)
}

logger.Debug("migrating team premint wallet")
if err := MigrateNativeMultisigs(ctx, bk, sk, NewTeamPremintWalletAcc, oldTeamPremintWallet); err != nil {
logger.Error("error while migrating team premint wallet", "error", err)
}
}

// Leave modules are as-is to avoid running InitGenesis.
logger.Debug("running module migrations ...")
return mm.RunMigrations(ctx, configurator, vm)
}
}

// EnableVestingExtension appends the address of the vesting EVM extension
// to the list of active precompiles.
func EnableVestingExtension(ctx sdk.Context, evmKeeper *evmkeeper.Keeper) error {
// Get the list of active precompiles from the genesis state
params := evmKeeper.GetParams(ctx)
activePrecompiles := params.ActivePrecompiles
activePrecompiles = append(activePrecompiles, vestingprecompile.Precompile{}.Address().String())
params.ActivePrecompiles = activePrecompiles

return evmKeeper.SetParams(ctx, params)
}

0 comments on commit 392d906

Please sign in to comment.