From 1a999e2499b032268d83bbf87606b6a590ae990d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 18:37:40 -0700 Subject: [PATCH] chore: upgrade sdk with app version fix for state-sync (backport #1570) (#1574) * 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 (cherry picked from commit 1510160b2a263811e3d4d2a4c1b3531566da6111) # Conflicts: # app/upgrades/v9/upgrades.go * resolve conflicts Co-authored-by: Roman --- CHANGELOG.md | 1 + app/upgrades/v9/upgrades.go | 7 +++++++ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ba5237bcbd..e773ae1e066 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 7684dc485d6..fec23e4b810 100644 --- a/app/upgrades/v9/upgrades.go +++ b/app/upgrades/v9/upgrades.go @@ -8,6 +8,8 @@ import ( "github.com/osmosis-labs/osmosis/v9/app/keepers" ) +const preUpgradeAppVersion = 8 + func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -15,6 +17,11 @@ func CreateUpgradeHandler( ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, vm 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 + } return mm.RunMigrations(ctx, configurator, vm) } } diff --git a/go.mod b/go.mod index 2b960d71591..0569c6165ba 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=