From 1510160b2a263811e3d4d2a4c1b3531566da6111 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 24 May 2022 18:12:51 -0700 Subject: [PATCH] chore: upgrade sdk with app version fix for state-sync (#1570) Closes: #XXX ## What is the purpose of the change Upgrade SDK with the app version change and set the app version in the upgrade handler ## Testing and Verifying - e2e test for state sync is in progress: https://github.com/osmosis-labs/osmosis/pull/1572 - upgrade itself is verified by the existing e2e test - needs manual testing ## Documentation and Release Note - Does this pull request introduce a new feature or user-facing behavior changes? yes - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? yes - How is the feature or change documented? not applicable --- CHANGELOG.md | 1 + app/upgrades/v9/upgrades.go | 8 ++++++++ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 651c47d29cf..c2b9feab5c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +* [#1570](https://github.com/osmosis-labs/osmosis/pull/1570) upgrade sdk with app version fix for state-sync * [#1554](https://github.com/osmosis-labs/osmosis/pull/1554) local dev environment * [#1535](https://github.com/osmosis-labs/osmosis/pull/1535) upgrade wasmd to v0.27.0.rc3-osmo and ibc-go to v3 * [#1435] `x/tokenfactory` create denom fee for spam resistance diff --git a/app/upgrades/v9/upgrades.go b/app/upgrades/v9/upgrades.go index 8103fffd67f..773ca2437de 100644 --- a/app/upgrades/v9/upgrades.go +++ b/app/upgrades/v9/upgrades.go @@ -20,6 +20,8 @@ import ( "github.com/osmosis-labs/osmosis/v7/app/keepers" ) +const preUpgradeAppVersion = 8 + func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -27,6 +29,12 @@ func CreateUpgradeHandler( ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ExecuteProp214(ctx, keepers.GAMMKeeper) + + // We set the app version to pre-upgrade because it will be incremented by one + // after the upgrade is applied by the handler. + if err := keepers.UpgradeKeeper.SetAppVersion(ctx, preUpgradeAppVersion); err != nil { + return nil, err + } // Add Interchain Accounts host module // set the ICS27 consensus version so InitGenesis is not run diff --git a/go.mod b/go.mod index 40a05f68865..675632ee331 100644 --- a/go.mod +++ b/go.mod @@ -272,7 +272,7 @@ replace ( // branch: v0.27.0.rc3-osmo, current tag: v0.27.0.rc3-osmo github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58 // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk v0.45.0x-osmo-v7 - github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220517190359-30ebc413ddff + github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220524162204-830f277f8259 // Use Osmosis fast iavl github.com/cosmos/iavl => github.com/osmosis-labs/iavl v0.17.3-osmo-v7 // use cosmos-compatible protobufs diff --git a/go.sum b/go.sum index 49538c6b7c4..be81fce9ae8 100644 --- a/go.sum +++ b/go.sum @@ -1024,8 +1024,8 @@ github.com/ory/dockertest/v3 v3.8.1 h1:vU/8d1We4qIad2YM0kOwRVtnyue7ExvacPiw1yDm1 github.com/ory/dockertest/v3 v3.8.1/go.mod h1:wSRQ3wmkz+uSARYMk7kVJFDBGm8x5gSxIhI7NDc+BAQ= github.com/osmosis-labs/bech32-ibc v0.3.0-rc1 h1:frHKHEdPfzoK2iMF2GeWKudLLzUXz+6GJcdZ/TMcs2k= github.com/osmosis-labs/bech32-ibc v0.3.0-rc1/go.mod h1:X5/FZHMPL+B3ufuVyY2/koxVjd4hIwyTLjYP1DZwppQ= -github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220517190359-30ebc413ddff h1:GwNR/GMCSfZsllKo0ZX/tE+sucumAA5K96M7bteZzKI= -github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220517190359-30ebc413ddff/go.mod h1:pMiEr6WR7drhXAXK1FOdAKPazWCi7b+WOyWOF4O0OXY= +github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220524162204-830f277f8259 h1:myaa05LG9MtkqvE9jErU0qWZPENOwc7kiqmFLeG3cTs= +github.com/osmosis-labs/cosmos-sdk v0.45.1-0.20220524162204-830f277f8259/go.mod h1:pMiEr6WR7drhXAXK1FOdAKPazWCi7b+WOyWOF4O0OXY= github.com/osmosis-labs/iavl v0.17.3-osmo-v7 h1:6KcADC/WhL7yDmNQxUIJt2XmzNt4FfRmq9gRke45w74= github.com/osmosis-labs/iavl v0.17.3-osmo-v7/go.mod h1:lJEOIlsd3sVO0JDyXWIXa9/Ur5FBscP26zJx0KxHjto= github.com/osmosis-labs/wasmd v0.27.0-rc2.0.20220517191021-59051aa18d58 h1:15l3Iss2oCGCeJRi2g3CuCnqmEjpAr3Le7cDnoN/LS0=