From f320ac958e591c3ceacbca3a4fc4247a4a2ee29b Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Tue, 23 Apr 2024 10:09:36 -0400 Subject: [PATCH 1/7] Update go.mod --- go.mod | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index e5858f5b62..d9f7245fcf 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( cosmossdk.io/x/feegrant v0.1.0 cosmossdk.io/x/tx v0.13.2 cosmossdk.io/x/upgrade v0.1.1 - github.com/CosmWasm/wasmd v0.50.0 + github.com/CosmWasm/wasmd v0.51.0 github.com/CosmWasm/wasmvm v1.5.0 github.com/cometbft/cometbft v0.38.6 github.com/cometbft/cometbft-db v0.9.1 @@ -213,7 +213,8 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // This is required for https://github.com/provenance-io/provenance/issues/1414 // TODO[1760]: wasm: Put this CosmWasm/wasmd replace back with an updated version (or delete it). - // github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.30.0-pio-5 + //github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.30.0-pio-5 + github.com/CosmWasm/wasmd => /Users/mwitkowski/Work/provenance-io/wasmd github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.50.5-pio-3 // TODO[1760]: Update once async-icq creates tag with our changes https://github.com/cosmos/ibc-apps/pull/168 From 7b7f39cc111cb1941f384b5fe24c4a02b164593a Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Tue, 23 Apr 2024 12:57:46 -0400 Subject: [PATCH 2/7] Bump wasmd fork. --- go.mod | 5 ++--- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index d9f7245fcf..017f980e0e 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( cosmossdk.io/x/feegrant v0.1.0 cosmossdk.io/x/tx v0.13.2 cosmossdk.io/x/upgrade v0.1.1 - github.com/CosmWasm/wasmd v0.51.0 + github.com/CosmWasm/wasmd v0.50.0 github.com/CosmWasm/wasmvm v1.5.0 github.com/cometbft/cometbft v0.38.6 github.com/cometbft/cometbft-db v0.9.1 @@ -213,8 +213,7 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // This is required for https://github.com/provenance-io/provenance/issues/1414 // TODO[1760]: wasm: Put this CosmWasm/wasmd replace back with an updated version (or delete it). - //github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.30.0-pio-5 - github.com/CosmWasm/wasmd => /Users/mwitkowski/Work/provenance-io/wasmd + github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.50.0-pio-1 github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.50.5-pio-3 // TODO[1760]: Update once async-icq creates tag with our changes https://github.com/cosmos/ibc-apps/pull/168 diff --git a/go.sum b/go.sum index e0d26f6a2c..fc29404713 100644 --- a/go.sum +++ b/go.sum @@ -223,8 +223,6 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE= -github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= @@ -918,6 +916,8 @@ github.com/provenance-io/cosmos-sdk v0.50.5-pio-3 h1:QwJ4feMM43a9fu2YZ1oSHd1wqEI github.com/provenance-io/cosmos-sdk v0.50.5-pio-3/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1 h1:p+7pxHB0ukO2aow+M6uW9gHgeQl7YJyYGyMSKHZ5My8= github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1/go.mod h1:tObW9uxibh5Z22CtOaHVeTDotCSMyc/2B4MrYdaViBo= +github.com/provenance-io/wasmd v0.50.0-pio-1 h1:BXgF/pZiVVqnM3LyseJadH+VdGpRvumdNKTt8hFVZFg= +github.com/provenance-io/wasmd v0.50.0-pio-1/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= From aa2c0c588bcb689abf5a6b42491be5bd453f03b1 Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Tue, 23 Apr 2024 13:00:33 -0400 Subject: [PATCH 3/7] Remove todo. --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 017f980e0e..62985e99bb 100644 --- a/go.mod +++ b/go.mod @@ -212,7 +212,6 @@ replace ( // Use cosmos fork of keyring (because the SDK does). github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // This is required for https://github.com/provenance-io/provenance/issues/1414 - // TODO[1760]: wasm: Put this CosmWasm/wasmd replace back with an updated version (or delete it). github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.50.0-pio-1 github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.50.5-pio-3 From 0570f50418fb264b8c7ec10b1789ce454133545b Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Tue, 23 Apr 2024 13:01:29 -0400 Subject: [PATCH 4/7] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 050debdc0a..abd3f71e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760). * Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922). * Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926). +* Bump wasmd to `v0.50.0` [#1760](https://github.com/provenance-io/provenance/issues/1760). ### Improvements From b35d27835a4c5e0d2895bbf45b753634021c5f3c Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Wed, 24 Apr 2024 09:04:17 -0400 Subject: [PATCH 5/7] Update to provwasm that has updated AppModule constructor. Fix todos to supply the router. --- app/app.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- internal/provwasm/simulation.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index 02cead6870..ab0892d1ff 100644 --- a/app/app.go +++ b/app/app.go @@ -1016,7 +1016,7 @@ func New( oraclemodule.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper, app.IBCKeeper.ChannelKeeper), holdmodule.NewAppModule(appCodec, app.HoldKeeper), exchangemodule.NewAppModule(appCodec, app.ExchangeKeeper), - provwasm.NewWrapper(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper, nil, app.GetSubspace(wasmtypes.ModuleName)), // TODO[1760]: Need to pass router instead of nil + provwasm.NewWrapper(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper, pioMessageRouter, app.GetSubspace(wasmtypes.ModuleName)), // IBC ibc.NewAppModule(app.IBCKeeper), diff --git a/go.mod b/go.mod index 62985e99bb..8736372fe4 100644 --- a/go.mod +++ b/go.mod @@ -212,7 +212,7 @@ replace ( // Use cosmos fork of keyring (because the SDK does). github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // This is required for https://github.com/provenance-io/provenance/issues/1414 - github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.50.0-pio-1 + github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.50.0-pio-2 github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.50.5-pio-3 // TODO[1760]: Update once async-icq creates tag with our changes https://github.com/cosmos/ibc-apps/pull/168 diff --git a/go.sum b/go.sum index fc29404713..1052880816 100644 --- a/go.sum +++ b/go.sum @@ -916,8 +916,8 @@ github.com/provenance-io/cosmos-sdk v0.50.5-pio-3 h1:QwJ4feMM43a9fu2YZ1oSHd1wqEI github.com/provenance-io/cosmos-sdk v0.50.5-pio-3/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1 h1:p+7pxHB0ukO2aow+M6uW9gHgeQl7YJyYGyMSKHZ5My8= github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1/go.mod h1:tObW9uxibh5Z22CtOaHVeTDotCSMyc/2B4MrYdaViBo= -github.com/provenance-io/wasmd v0.50.0-pio-1 h1:BXgF/pZiVVqnM3LyseJadH+VdGpRvumdNKTt8hFVZFg= -github.com/provenance-io/wasmd v0.50.0-pio-1/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= +github.com/provenance-io/wasmd v0.50.0-pio-2 h1:vuRXQ7NvqEk0TZ/dDFEfojMTwCn/ItVDjMe3/jiCDbY= +github.com/provenance-io/wasmd v0.50.0-pio-2/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= diff --git a/internal/provwasm/simulation.go b/internal/provwasm/simulation.go index 71b6835444..022215e35e 100644 --- a/internal/provwasm/simulation.go +++ b/internal/provwasm/simulation.go @@ -45,7 +45,7 @@ type Wrapper struct { nk namekeeper.Keeper } -func NewWrapper(cdc codec.Codec, keeper *wasmkeeper.Keeper, validatorSetSource wasmkeeper.ValidatorSetSource, ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, router *baseapp.MsgServiceRouter, ss exported.Subspace) *Wrapper { +func NewWrapper(cdc codec.Codec, keeper *wasmkeeper.Keeper, validatorSetSource wasmkeeper.ValidatorSetSource, ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, router wasmkeeper.MessageRouter, ss exported.Subspace) *Wrapper { return &Wrapper{ cdc: cdc, wasm: wasm.NewAppModule(cdc, keeper, validatorSetSource, ak, bk, router, ss), From 29078111bf07dc8588235e6e30cb252198328d56 Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Wed, 24 Apr 2024 11:21:00 -0400 Subject: [PATCH 6/7] Update proposal handler to legacy one until gov changes are in. --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index ab0892d1ff..e0097a2671 100644 --- a/app/app.go +++ b/app/app.go @@ -694,7 +694,7 @@ func New( govRouter.AddRoute(govtypes.RouterKey, govtypesv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - // AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasm.EnableAllProposals)). // TODO[1760]: wasm + AddRoute(wasm.RouterKey, wasmkeeper.NewLegacyWasmProposalHandler(app.WasmKeeper, wasmtypes.EnableAllProposals)). // TODO[1760]: gov: Can probably remove with gov v1 AddRoute(nametypes.ModuleName, name.NewProposalHandler(app.NameKeeper)). AddRoute(markertypes.ModuleName, marker.NewProposalHandler(app.MarkerKeeper)). AddRoute(msgfeestypes.ModuleName, msgfees.NewProposalHandler(app.MsgFeesKeeper, app.InterfaceRegistry())) From 05808cd6639cb12a1144a090afd66b15c8ea4d45 Mon Sep 17 00:00:00 2001 From: Matthew Witkowski Date: Wed, 24 Apr 2024 12:03:20 -0400 Subject: [PATCH 7/7] Update simulation for wasm. --- internal/provwasm/simulation.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/provwasm/simulation.go b/internal/provwasm/simulation.go index 022215e35e..85f5a6cb68 100644 --- a/internal/provwasm/simulation.go +++ b/internal/provwasm/simulation.go @@ -8,6 +8,7 @@ import ( "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmsimulation "github.com/CosmWasm/wasmd/x/wasm/simulation" "github.com/CosmWasm/wasmd/x/wasm/types" sdkmath "cosmossdk.io/math" @@ -43,6 +44,7 @@ type Wrapper struct { ak authkeeper.AccountKeeperI bk bankkeeper.Keeper nk namekeeper.Keeper + wk *wasmkeeper.Keeper } func NewWrapper(cdc codec.Codec, keeper *wasmkeeper.Keeper, validatorSetSource wasmkeeper.ValidatorSetSource, ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, router wasmkeeper.MessageRouter, ss exported.Subspace) *Wrapper { @@ -52,6 +54,7 @@ func NewWrapper(cdc codec.Codec, keeper *wasmkeeper.Keeper, validatorSetSource w ak: ak, bk: bk, nk: nk, + wk: keeper, } } @@ -82,9 +85,8 @@ func (pw Wrapper) GenerateGenesisState(input *module.SimulationState) { } // ProposalContents doesn't return any content functions for governance proposals. -func (pw Wrapper) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - // return pw.wasm.ProposalContents(simState) // TODO[1760]: wasm: Find replacement for this or delete it. - return nil +func (pw Wrapper) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { + return wasmsimulation.ProposalMsgs(pw.bk, pw.wk) } // RandomizedParams returns empty list as the params don't change