Skip to content

Commit 883991e

Browse files
alexander-seicursoragentmasih
authored
Add governance switches that stop CosmWasm contracts in two stages (#4564)
The wasm module has governance params for code upload and instantiation but none for execution: `Keeper.execute` runs without any permission check, so turning `MsgExecuteContract` off, or stopping contracts altogether, currently takes a code change. This adds two bool wasm params, set with ordinary param-change proposals, that stop contracts in two stages. The first is `msgExecuteContractDisabled`. While it is true, `msgServer.ExecuteContract` returns `ErrMsgExecuteContractDisabled` (wasm code 31) before it touches the contract. Every `MsgExecuteContract` reaches that handler, whether it arrives in a transaction, inside an authz `MsgExec`, or from a contract that dispatches it, so the check lives only there. `NewMsgServerImpl` and `wasm.NewHandler` now take the `*Keeper` and build the default permission keeper themselves, which is what all their callers already passed. Calls that do not go through `MsgExecuteContract` keep working: the EVM wasmd precompile, solo claims, gov `ExecuteContractProposal`, sudo, migrate, instantiate and queries. A contract reached through the precompile still runs, but an execute it dispatches to another contract is refused. `Keeper.msgExecuteContractDisabled` reads the param without charging gas and treats a missing key as false, so executions cost the same gas as today and replays of blocks from before the param existed keep their outcome. The second, `contractExecutionDisabled`, stops every contract from running. While it is true, `Keeper.instantiate`, `execute`, `migrate` and `Sudo` return `ErrContractExecutionDisabled` (wasm code 32) before they charge gas or touch state. Every path that runs contract code goes through one of those four, and `reply` only runs inside them, so nothing runs whatever the origin: `MsgExecuteContract` with or without authz, contract-dispatched messages, the EVM wasmd precompile, solo claims and wasm gov proposals all fail. Queries still answer, so pointer reads keep working, and code upload stays under `uploadAccess`. While it is on, solo claims of CW20 and CW721 assets fail, ERC20 and ERC721 pointers to CW tokens cannot transfer, and governance cannot run a final migrate or sudo without turning it off first. Both params are read through the same gas-free `Keeper.getFlagParam`. Sei's gov keeper refuses a param-change proposal for a key that is not stored yet, so the wasm module moves to consensus version 2 and `Migrator.Migrate1to2` stores both keys as false at whichever upgrade first ships this. That write and the version bump are app-hash breaking at that upgrade; nothing else changes until governance sets a param. The v6.8 upgrade tests seed wasm at 1 in the v6.7 version map and require it to reach 2 with both params stored as false, in process, against a persisted v6.7 database, and across a live v6.7 to v6.8 upgrade. CheckTx does not run messages, so a disabled `MsgExecuteContract` still lands in a block and fails there with its fee charged. Keeper tests cover each path with each param off and on, the gov proposals and the migration; for `contractExecutionDisabled` they run every entry point and origin and require a refused call to leave every store unchanged. An app test delivers the direct and authz forms through real blocks, and the wasmd precompile test requires its execute and instantiate to revert while its query answers. --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Masih H. Derkani <m@derkani.org>
1 parent 1c4385d commit 883991e

20 files changed

Lines changed: 927 additions & 101 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
3030

3131
## Unreleased
3232
sei-chain
33+
* [#4564](https://github.com/sei-protocol/sei-chain/pull/4564) Add two wasm params governance can set to stop CosmWasm contracts in stages. While `msgExecuteContractDisabled` is true, every `MsgExecuteContract` fails, whether sent directly, wrapped in an authz `MsgExec` or dispatched by a contract; the EVM wasmd precompile, solo claims and wasm gov proposals still execute. While `contractExecutionDisabled` is true, no contract runs: every instantiation, execution, migration and sudo call fails, whatever its origin, including the EVM wasmd and solo precompiles and wasm gov proposals; queries still work. The wasm module moves to consensus version 2 and stores both params as false at the upgrade. App-hash breaking at the upgrade height.
3334
* [#4563](https://github.com/sei-protocol/sei-chain/pull/4563) Delete the retired feegrant store at the v6.8 upgrade: v6.7 kept it mounted for historical state access, and from the upgrade height v6.8 nodes no longer serve feegrant state at any height, so that history needs a v6.7 or older node. App-hash breaking at the upgrade height.
3435
* [#4549](https://github.com/sei-protocol/sei-chain/pull/4549) Keep the tokenfactory `burn_tokens` Wasm message working after v6.8: a contract can still burn a `factory/` denom it created from its own balance, so the Silo and Eris liquid staking hubs and the Wormhole token translator keep their redemption paths. Minting and every other tokenfactory message stay removed.
3536
* [#4536](https://github.com/sei-protocol/sei-chain/pull/4536) Remove the tokenfactory module behind the v6.8 upgrade: module, store, params, protobuf schema, CLI, wasm bindings, the bank `factory/` denom transfer allowlist and tooling are gone; only the tokenfactory Msg types remain decodable so historical blocks still trace. Existing `factory/` balances stay in bank but can no longer be minted or burned, and denoms that had a transfer allowlist become freely transferable. The upgrade deletes at most 1,000 allowlists from the bank store and leaves any beyond that in place, unenforced. App-hash breaking at the upgrade height.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
package app_test
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"testing"
7+
"time"
8+
9+
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
10+
"github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/signing"
11+
"github.com/sei-protocol/sei-chain/sei-cosmos/x/authz"
12+
wasmkeeper "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/keeper"
13+
wasmtypes "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types"
14+
"github.com/sei-protocol/sei-chain/testutil/processblock"
15+
"github.com/stretchr/testify/require"
16+
)
17+
18+
// TestMsgExecuteContractDisabledInDeliverTx delivers a CW20 transfer as a MsgExecuteContract
19+
// sent directly and as one wrapped in an authz MsgExec, with the wasm
20+
// msgExecuteContractDisabled and contractExecutionDisabled params off and each on.
21+
func TestMsgExecuteContractDisabledInDeliverTx(t *testing.T) {
22+
specs := map[string]struct {
23+
msgExecuteContractDisabled bool
24+
contractExecutionDisabled bool
25+
expCode uint32
26+
expCodespace string
27+
expReceived string
28+
}{
29+
"params off": {expReceived: "200"},
30+
"msgExecuteContractDisabled on": {
31+
msgExecuteContractDisabled: true,
32+
expCode: wasmtypes.ErrMsgExecuteContractDisabled.ABCICode(),
33+
expCodespace: wasmtypes.ModuleName,
34+
expReceived: "0",
35+
},
36+
"contractExecutionDisabled on": {
37+
contractExecutionDisabled: true,
38+
expCode: wasmtypes.ErrContractExecutionDisabled.ABCICode(),
39+
expCodespace: wasmtypes.ModuleName,
40+
expReceived: "0",
41+
},
42+
}
43+
for name, spec := range specs {
44+
t.Run(name, func(t *testing.T) {
45+
a := processblock.NewTestApp(t)
46+
p := processblock.CommonPreset(a)
47+
granter := p.Admin
48+
grantee := a.NewSignableAccount("grantee")
49+
a.FundAccount(grantee, 100000000)
50+
recipient := a.NewAccount()
51+
cw20 := instantiateCW20(t, a, granter)
52+
executeContract := authz.NewGenericAuthorization(sdk.MsgTypeURL(&wasmtypes.MsgExecuteContract{}))
53+
require.NoError(t, a.AuthzKeeper.SaveGrant(a.Ctx(), grantee, granter, executeContract, time.Now().Add(time.Hour)))
54+
params := a.WasmKeeper.GetParams(a.Ctx())
55+
params.MsgExecuteContractDisabled = spec.msgExecuteContractDisabled
56+
params.ContractExecutionDisabled = spec.contractExecutionDisabled
57+
a.WasmKeeper.SetParams(a.Ctx(), params)
58+
59+
transfer := &wasmtypes.MsgExecuteContract{
60+
Sender: granter.String(),
61+
Contract: cw20.String(),
62+
Msg: []byte(fmt.Sprintf(`{"transfer":{"recipient":"%s","amount":"100"}}`, recipient)),
63+
}
64+
exec := authz.NewMsgExec(grantee, []sdk.Msg{transfer})
65+
results := a.RunBlockDetailed([]signing.Tx{
66+
p.AdminSign(a, transfer),
67+
a.Sign(grantee, 10000000, &exec),
68+
})
69+
70+
require.Len(t, results, 2)
71+
for _, result := range results {
72+
require.Equal(t, spec.expCode, result.Code, result.Log)
73+
require.Equal(t, spec.expCodespace, result.Codespace)
74+
}
75+
balance, err := a.WasmKeeper.QuerySmart(a.Ctx(), cw20, []byte(fmt.Sprintf(`{"balance":{"address":"%s"}}`, recipient)))
76+
require.NoError(t, err)
77+
require.JSONEq(t, fmt.Sprintf(`{"balance":"%s"}`, spec.expReceived), string(balance))
78+
})
79+
}
80+
}
81+
82+
// instantiateCW20 deploys a CW20 whose whole supply belongs to holder.
83+
func instantiateCW20(t *testing.T, a *processblock.App, holder sdk.AccAddress) sdk.AccAddress {
84+
t.Helper()
85+
code, err := os.ReadFile("../contracts/wasm/cw20_base.wasm")
86+
require.NoError(t, err)
87+
contractKeeper := wasmkeeper.NewDefaultPermissionKeeper(&a.WasmKeeper)
88+
codeID, err := contractKeeper.Create(a.Ctx(), holder, code, nil)
89+
require.NoError(t, err)
90+
initMsg := fmt.Sprintf(`{"name":"test","symbol":"TEST","decimals":6,"initial_balances":[{"address":"%s","amount":"1000"}]}`, holder)
91+
cw20, _, err := contractKeeper.Instantiate(a.Ctx(), codeID, holder, holder, []byte(initMsg), "cw20", sdk.NewCoins())
92+
require.NoError(t, err)
93+
return cw20
94+
}

‎app/upgrade_v68_offline_target_test.go‎

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/sei-protocol/sei-chain/sei-db/state_db/sc/memiavl"
2929
abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types"
3030
tmproto "github.com/sei-protocol/sei-chain/sei-tendermint/proto/tendermint/types"
31+
wasmtypes "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types"
3132
minttypes "github.com/sei-protocol/sei-chain/x/mint/types"
3233
"github.com/stretchr/testify/require"
3334
"google.golang.org/protobuf/encoding/protowire"
@@ -37,6 +38,7 @@ const v68OfflineUpgradeName = "v6.8"
3738

3839
const (
3940
v68OfflineAuthVersionAfter uint64 = 4
41+
v68OfflineWasmVersionAfter uint64 = 2
4042
v68OfflinePostUpgradeFee int64 = 200000
4143
v68OfflineLegacyVestingTypes = "/cosmos.vesting.v1beta1."
4244
)
@@ -137,9 +139,9 @@ func applyV68OfflineUpgradeCrashReplay(t *testing.T, root string, artifact offli
137139
// is recorded, the retired module versions and stores are gone, the vesting
138140
// accounts are rewritten, the retired IBC proposal reads back as a text
139141
// proposal, the upgraded IBC client record, the denom allowlists and the
140-
// tokenfactory parameters are pruned, the IBC voucher balance and supply are
141-
// intact and spendable, every delegation is indexed by validator, and nothing
142-
// else in the retained stores changed.
142+
// tokenfactory parameters are pruned, the wasm flag parameters are stored, the
143+
// IBC voucher balance and supply are intact and spendable, every delegation is
144+
// indexed by validator, and nothing else in the retained stores changed.
143145
func requireV68OfflineMigrated(t *testing.T, testApp *App, artifact offlineUpgradeArtifact) {
144146
t.Helper()
145147
requireV68OfflineAppliedName(t, testApp, artifact)
@@ -150,6 +152,7 @@ func requireV68OfflineMigrated(t *testing.T, testApp *App, artifact offlineUpgra
150152
requireV68OfflineUpgradedIBCStatePruned(t, testApp, artifact.Retained)
151153
requireV68OfflineDenomAllowListsPruned(t, testApp, artifact.Stores[banktypes.StoreKey])
152154
requireV68OfflineTokenfactoryParamsPruned(t, testApp, artifact.Stores[paramstypes.StoreKey])
155+
requireV68OfflineWasmFlagsStored(t, testApp, artifact.Stores[paramstypes.StoreKey])
153156
requireV68OfflineVoucher(t, testApp, artifact.Retained)
154157
requireV68OfflineDelegationIndex(t, testApp)
155158
requireOfflineUpgradeRetainedStoresExcept(t, testApp, artifact.Stores, v68OfflineTouchedKey(t, artifact))
@@ -272,6 +275,7 @@ func requireV68OfflineVersionMap(t *testing.T, testApp *App, before []string) {
272275
}
273276
versions := testApp.UpgradeKeeper.GetModuleVersionMap(offlineUpgradeReadContext(testApp, testApp.LastBlockHeight()))
274277
require.Equal(t, v68OfflineAuthVersionAfter, versions[authtypes.ModuleName])
278+
require.Equal(t, v68OfflineWasmVersionAfter, versions[wasmtypes.ModuleName])
275279
}
276280

277281
func requireV68OfflineStoresDeleted(t *testing.T, testApp *App) {
@@ -399,6 +403,26 @@ func requireV68OfflineNoTokenfactoryParams(t *testing.T, testApp *App) {
399403
require.False(t, iterator.Valid(), "v6.8 left a tokenfactory parameter in the params store")
400404
}
401405

406+
// v68OfflineWasmFlagKeys are the params-store keys of the wasm
407+
// msgExecuteContractDisabled and contractExecutionDisabled parameters.
408+
var v68OfflineWasmFlagKeys = [][]byte{
409+
[]byte(wasmtypes.ModuleName + "/" + string(wasmtypes.ParamStoreKeyMsgExecuteContractDisabled)),
410+
[]byte(wasmtypes.ModuleName + "/" + string(wasmtypes.ParamStoreKeyContractExecutionDisabled)),
411+
}
412+
413+
// requireV68OfflineWasmFlagsStored requires the source phase's params snapshot
414+
// to lack every wasm flag parameter and the committed params store to hold each
415+
// as false.
416+
func requireV68OfflineWasmFlagsStored(t *testing.T, testApp *App, sourceParams map[string]string) {
417+
t.Helper()
418+
store := testApp.CommitMultiStore().GetCommitKVStore(testApp.GetKey(paramstypes.StoreKey))
419+
for _, key := range v68OfflineWasmFlagKeys {
420+
_, recorded := sourceParams[encodeOfflineUpgradeKey(key)]
421+
require.False(t, recorded, "the source phase already stored %s", key)
422+
require.Equal(t, []byte("false"), store.Get(key), "v6.8 did not store %s as false", key)
423+
}
424+
}
425+
402426
func requireV68OfflineVoucher(t *testing.T, testApp *App, retained offlineUpgradeRetainedState) {
403427
t.Helper()
404428
ctx, _ := offlineUpgradeReadContext(testApp, testApp.LastBlockHeight()).CacheContext()

‎app/upgrade_v68_test.go‎

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
stakingtypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/staking/types"
2929
upgradetypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/upgrade/types"
3030
abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types"
31+
wasmtypes "github.com/sei-protocol/sei-chain/sei-wasmd/x/wasm/types"
3132
"github.com/sei-protocol/sei-chain/testutil/processblock"
3233
"github.com/sei-protocol/sei-chain/testutil/processblock/msgs"
3334
"github.com/sei-protocol/sei-chain/upgradetest"
@@ -41,12 +42,13 @@ import (
4142
// transfer allowlists tokenfactory kept in the bank store, and its parameters in
4243
// the params store. Vesting owned no store: its state is the accounts it wrote
4344
// to the auth account store, which the auth 3 to 4 migration rewrites as the
44-
// base accounts they embed. These tests cover the rewrite of every vesting
45-
// account type, spending a balance a schedule had locked, the messages the
46-
// removed modules served, the allowlist and parameter pruning, genesis export
47-
// over the migrated store, and the handler itself. The handler also starts the
48-
// staking delegation-by-validator index backfill, which the staking EndBlocker
49-
// completes.
45+
// base accounts they embed. The wasm 1 to 2 migration stores the
46+
// msgExecuteContractDisabled and contractExecutionDisabled parameters as false.
47+
// These tests cover the rewrite of every vesting account type, spending a
48+
// balance a schedule had locked, the messages the removed modules served, the
49+
// allowlist and parameter pruning, the stored wasm parameters, genesis export
50+
// over the migrated store, and the handler itself. The handler also starts the staking delegation-by-validator
51+
// index backfill, which the staking EndBlocker completes.
5052

5153
// v68RemovedStoreModules are the module version map entries the v6.8 handler
5254
// deletes along with their stores.
@@ -66,6 +68,10 @@ const (
6668
// on either side of the upgrade.
6769
v68AuthVersionBefore uint64 = 3
6870
v68AuthVersion uint64 = 4
71+
// v68WasmVersionBefore and v68WasmVersion are the wasm consensus versions
72+
// on either side of the upgrade.
73+
v68WasmVersionBefore uint64 = 1
74+
v68WasmVersion uint64 = 2
6975
// v68GovVersion is the gov consensus version after the upgrade, which also
7076
// runs the gov 3 to 4 migration.
7177
v68GovVersion uint64 = 4
@@ -74,6 +80,13 @@ const (
7480
v68PostUpgradeSendAmount = "6868usei"
7581
)
7682

83+
// v68WasmFlagKeys are the params-store keys of the wasm
84+
// msgExecuteContractDisabled and contractExecutionDisabled parameters.
85+
var v68WasmFlagKeys = [][]byte{
86+
[]byte(wasmtypes.ModuleName + "/" + string(wasmtypes.ParamStoreKeyMsgExecuteContractDisabled)),
87+
[]byte(wasmtypes.ModuleName + "/" + string(wasmtypes.ParamStoreKeyContractExecutionDisabled)),
88+
}
89+
7790
var v68PostUpgradeBankReceiver = sdk.AccAddress{
7891
0x68, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7992
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -118,15 +131,16 @@ type v68VestingFixture struct {
118131
}
119132

120133
// seedV67VersionMap records in the version map what every chain upgrading from
121-
// v6.7 carries: auth and tokenfactory at their v6.7 consensus versions, oracle,
122-
// and vesting.
134+
// v6.7 carries: auth, tokenfactory and wasm at their v6.7 consensus versions,
135+
// oracle, and vesting.
123136
func seedV67VersionMap(t *testing.T, a *processblock.App) {
124137
t.Helper()
125138
versionMap := a.UpgradeKeeper.GetModuleVersionMap(a.Ctx())
126139
versionMap[authtypes.ModuleName] = v68AuthVersionBefore
127140
versionMap[retiredoracle.ModuleName] = 1
128141
versionMap[retiredtokenfactory.ModuleName] = v68TokenfactoryVersionBefore
129142
versionMap[v68VestingModule] = 1
143+
versionMap[wasmtypes.ModuleName] = v68WasmVersionBefore
130144
a.UpgradeKeeper.SetModuleVersionMap(a.Ctx(), versionMap)
131145
}
132146

@@ -263,13 +277,16 @@ func TestV68RewritesVestingAccountsAsBaseAccounts(t *testing.T) {
263277
require.NotContains(t, versionsAfter, retiredtokenfactory.ModuleName)
264278
require.NotContains(t, versionsAfter, v68VestingModule)
265279
require.Equal(t, v68AuthVersion, versionsAfter[authtypes.ModuleName])
280+
require.Equal(t, v68WasmVersion, versionsAfter[wasmtypes.ModuleName])
266281
delete(versionsBefore, retiredoracle.ModuleName)
267282
delete(versionsBefore, retiredtokenfactory.ModuleName)
268283
delete(versionsBefore, v68VestingModule)
269284
delete(versionsBefore, authtypes.ModuleName)
270285
delete(versionsAfter, authtypes.ModuleName)
286+
delete(versionsBefore, wasmtypes.ModuleName)
287+
delete(versionsAfter, wasmtypes.ModuleName)
271288
require.Equal(t, versionsBefore, versionsAfter,
272-
"v6.8 changed a module version other than removing oracle, tokenfactory and vesting and moving auth")
289+
"v6.8 changed a module version other than removing oracle, tokenfactory and vesting and moving auth and wasm")
273290
}
274291

275292
// TestV68ConvertedAccountSpendsTheBalanceItsScheduleLocked delivers a bank send
@@ -670,6 +687,24 @@ func TestV68PrunesTokenfactoryParams(t *testing.T) {
670687
"v6.8 changed the params store beyond deleting the tokenfactory subspace")
671688
}
672689

690+
// TestV68StoresTheWasmFlags pins that v6.8 stores the wasm
691+
// msgExecuteContractDisabled and contractExecutionDisabled parameters as false
692+
// in a params store that lacks them, as v6.7 left it.
693+
func TestV68StoresTheWasmFlags(t *testing.T) {
694+
a := newV68Chain(t)
695+
seedV67VersionMap(t, a)
696+
store := a.Ctx().KVStore(a.GetKey(paramstypes.StoreKey))
697+
for _, key := range v68WasmFlagKeys {
698+
store.Delete(key)
699+
}
700+
701+
applyV68(t, a)
702+
703+
for _, key := range v68WasmFlagKeys {
704+
require.Equal(t, []byte("false"), store.Get(key), "v6.8 did not store %s as false", key)
705+
}
706+
}
707+
673708
// TestV68RewritesRetiredIBCProposals pins that a stored proposal whose content
674709
// type lives under an IBC protobuf package reads back as a text proposal with
675710
// the original title and description, with its status, deposits and votes
@@ -807,8 +842,9 @@ func TestV68CrossVersion(t *testing.T) {
807842
}
808843

809844
// seedV67State records the v6.7 version map, which carries oracle, tokenfactory
810-
// and vesting with auth at consensus version 3, requires v6.7 to serve the
811-
// vesting command, and delivers a bank send before the upgrade.
845+
// and vesting with auth at consensus version 3 and wasm at 1, requires v6.7 to
846+
// serve the vesting command and to store neither wasm flag parameter, and
847+
// delivers a bank send before the upgrade.
812848
func seedV67State(t *testing.T, chain *upgradetest.CrossVersion) {
813849
require.Equal(t, v68UpgradeName, chain.UpgradeName(t))
814850

@@ -818,8 +854,12 @@ func seedV67State(t *testing.T, chain *upgradetest.CrossVersion) {
818854
"v6.7 module version map does not carry tokenfactory")
819855
require.Equal(t, uint64(1), versions[v68VestingModule], "v6.7 module version map does not carry vesting")
820856
require.Equal(t, v68AuthVersionBefore, versions[authtypes.ModuleName])
857+
require.Equal(t, v68WasmVersionBefore, versions[wasmtypes.ModuleName])
821858
require.NotEmpty(t, chain.QueryStore(t, upgradetypes.StoreKey, v68ModuleVersionKey(v68VestingModule)),
822859
"v6.7 upgrade store is missing the vesting version-map entry")
860+
for _, key := range v68WasmFlagKeys {
861+
require.Empty(t, chain.QueryStore(t, paramstypes.StoreKey, key), "v6.7 already stores %s", key)
862+
}
823863
chain.Record(t, "module_versions", versions)
824864

825865
vestingCommand := chain.Seid("", "tx", v68VestingModule)
@@ -860,13 +900,17 @@ func verifyV68State(t *testing.T, chain *upgradetest.CrossVersion) {
860900
delete(want, v68VestingModule)
861901
want[authtypes.ModuleName] = v68AuthVersion
862902
want[govtypes.ModuleName] = v68GovVersion
903+
want[wasmtypes.ModuleName] = v68WasmVersion
863904
after := v68ModuleVersions(t, chain)
864905
chain.Record(t, "module_versions_after", after)
865906
require.Equal(t, want, after,
866-
"v6.8 changed the version map beyond removing oracle, tokenfactory and vesting, moving auth to %d and moving gov to %d",
867-
v68AuthVersion, v68GovVersion)
907+
"v6.8 changed the version map beyond removing oracle, tokenfactory and vesting, moving auth to %d, gov to %d and wasm to %d",
908+
v68AuthVersion, v68GovVersion, v68WasmVersion)
868909
require.Empty(t, chain.QueryStore(t, upgradetypes.StoreKey, v68ModuleVersionKey(v68VestingModule)),
869910
"v6.8 upgrade store still carries the vesting version-map entry")
911+
for _, key := range v68WasmFlagKeys {
912+
require.Equal(t, []byte("false"), chain.QueryStore(t, paramstypes.StoreKey, key), "v6.8 did not store %s as false", key)
913+
}
870914

871915
oracleCommand := chain.Seid("", "q", retiredoracle.ModuleName)
872916
require.Error(t, oracleCommand.Err)

0 commit comments

Comments
 (0)