Skip to content

Commit

Permalink
Problem: fixes in ibc-go v5.1 are not included (#765)
Browse files Browse the repository at this point in the history
* Problem: fixes in ibc-go v5.1 are not included

Solution:
- make a breaking change to upgrade to ibc-go `v5.1.0`.
- will do v1.0.0 upgrade on both testnet and mainnet.

* Update CHANGELOG.md

Signed-off-by: yihuang <huang@crypto.com>

* fix lint

* include cache fix in tendermint

* update sdk

* Update CHANGELOG.md

Signed-off-by: yihuang <huang@crypto.com>

* Update CHANGELOG.md

Signed-off-by: yihuang <huang@crypto.com>

* make different plan name v1.0.0-testnet3 for testnet3

Signed-off-by: yihuang <huang@crypto.com>
Co-authored-by: mmsqe <mavis@crypto.com>
  • Loading branch information
yihuang and mmsqe authored Nov 13, 2022
1 parent eba04a0 commit a6f5bbc
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 234 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

*Nov 9, 2022*
## v1.0.0-rc3

### State Machine Breaking

- [#765](https://github.com/crypto-org-chain/cronos/pull/765) Upgrade ibc-go to [v5.1.0](https://github.com/cosmos/ibc-go/releases/tag/v5.1.0) and related dependencies.

*Nov 10, 2022*

## v1.0.0-rc2

Expand Down
20 changes: 9 additions & 11 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ import (
)

func (app *App) RegisterUpgradeHandlers(experimental bool) {
// `v0.9.0` is only used for testnet upgrade, skipped for dry-run and mainnet upgrade.
planNameTestnet := "v0.9.0"
app.UpgradeKeeper.SetUpgradeHandler(planNameTestnet, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})

// dry-run and mainnet will use `v1.0.0` upgrade plan directly, which will clears the `extra_eips` parameters.
planNameMainnet := "v1.0.0"
app.UpgradeKeeper.SetUpgradeHandler(planNameMainnet, func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
upgradeHandlerV1 := func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
m, err := app.mm.RunMigrations(ctx, app.configurator, fromVM)
if err != nil {
return m, err
Expand All @@ -31,7 +23,13 @@ func (app *App) RegisterUpgradeHandlers(experimental bool) {
params.ExtraEIPs = []int64{}
app.EvmKeeper.SetParams(ctx, params)
return m, nil
})
}
// `v1.0.0` upgrade plan will clear the `extra_eips` parameters, and upgrade ibc-go to v5.1.
planName := "v1.0.0"
app.UpgradeKeeper.SetUpgradeHandler(planName, upgradeHandlerV1)
// testnet3 should use `v1.0.0-testnet3` instead, it won't re-add the feeibc store, which is added in `v0.9.0` upgrade.
planNameTestnet3 := "v1.0.0-testnet3"
app.UpgradeKeeper.SetUpgradeHandler(planNameTestnet3, upgradeHandlerV1)

gravityPlanName := "v0.8.0-gravity-alpha3"
if experimental {
Expand All @@ -46,7 +44,7 @@ func (app *App) RegisterUpgradeHandlers(experimental bool) {
}

if !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
if upgradeInfo.Name == planNameTestnet || upgradeInfo.Name == planNameMainnet {
if upgradeInfo.Name == planName {
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{ibcfeetypes.StoreKey},
}
Expand Down
29 changes: 15 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.18
require (
cosmossdk.io/math v1.0.0-beta.3
github.com/armon/go-metrics v0.4.1
github.com/cosmos/cosmos-sdk v0.46.5-0.20221109093801-2899dcf82f16
github.com/cosmos/ibc-go/v5 v5.0.1
github.com/cosmos/cosmos-sdk v0.46.5-0.20221111074045-68e54fa5b868
github.com/cosmos/ibc-go/v5 v5.1.0
github.com/ethereum/go-ethereum v1.10.19
github.com/evmos/ethermint v0.6.1-0.20221101220534-a8ea4eceb6d9
github.com/gogo/protobuf v1.3.3
Expand All @@ -19,19 +19,19 @@ require (
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.1
github.com/tendermint/tendermint v0.34.22
github.com/tendermint/tendermint v0.34.23
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55
google.golang.org/grpc v1.50.1
google.golang.org/protobuf v1.28.1
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8
gopkg.in/yaml.v2 v2.4.0
)

require (
cloud.google.com/go v0.102.1 // indirect
cloud.google.com/go v0.104.0 // indirect
cloud.google.com/go/compute v1.7.0 // indirect
cloud.google.com/go/iam v0.4.0 // indirect
cloud.google.com/go/storage v1.22.1 // indirect
cloud.google.com/go/storage v1.23.0 // indirect
cosmossdk.io/errors v1.0.0-beta.7 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -96,7 +96,7 @@ require (
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/googleapis/gax-go/v2 v2.5.1 // indirect
github.com/googleapis/go-type-adapters v1.0.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -121,7 +121,7 @@ require (
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/lib/pq v1.10.6 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
Expand All @@ -145,7 +145,7 @@ require (
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.34.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/tsdb v0.7.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/regen-network/cosmos-proto v0.3.1 // indirect
Expand Down Expand Up @@ -173,13 +173,13 @@ require (
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.1.0 // indirect
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.93.0 // indirect
google.golang.org/api v0.97.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand All @@ -191,8 +191,8 @@ require (
replace (
// ics23 patch for dragonberry
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.5-0.20221109093801-2899dcf82f16
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.13-0.20221108065429-afacc02b8738
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.5-0.20221111074045-68e54fa5b868
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.19-deepcopy-jumptable
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.20.1-cronos

// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
Expand All @@ -202,6 +202,7 @@ replace (

// TODO: remove when gravity update dependencies
github.com/peggyjv/gravity-bridge/module/v2 => github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20220815102151-48275db7e1ee
github.com/tendermint/tendermint => github.com/tendermint/tendermint v0.34.24-0.20221110131553-ec471ba27efd

// TODO: remove after fixed https://github.com/cosmos/cosmos-sdk/issues/11364
github.com/zondax/hid => github.com/zondax/hid v0.9.0
Expand Down
Loading

0 comments on commit a6f5bbc

Please sign in to comment.