Skip to content

Commit 2b4efde

Browse files
authored
feat: Replace ibc-go 9.0.2 with release/10.0.x (#2125)
1 parent 4e7c441 commit 2b4efde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+261
-530
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# docker build . -t cosmwasm/wasmd:latest
22
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
33

4-
FROM golang:1.23-alpine3.19 AS go-builder
4+
FROM golang:1.23.6-alpine AS go-builder
55

66
# this comes from standard alpine nightly file
77
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile

app/ante.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package app
33
import (
44
"errors"
55

6-
ibcante "github.com/cosmos/ibc-go/v9/modules/core/ante"
7-
"github.com/cosmos/ibc-go/v9/modules/core/keeper"
6+
ibcante "github.com/cosmos/ibc-go/v10/modules/core/ante"
7+
"github.com/cosmos/ibc-go/v10/modules/core/keeper"
88

99
corestoretypes "cosmossdk.io/core/store"
1010
circuitante "cosmossdk.io/x/circuit/ante"

app/app.go

Lines changed: 30 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,27 @@ import (
1313
dbm "github.com/cosmos/cosmos-db"
1414
"github.com/cosmos/gogoproto/proto"
1515
ibccallbacks "github.com/cosmos/ibc-go/modules/apps/callbacks"
16-
"github.com/cosmos/ibc-go/modules/capability"
17-
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
18-
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
19-
ica "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts"
20-
icacontroller "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller"
21-
icacontrollerkeeper "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/keeper"
22-
icacontrollertypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types"
23-
icahost "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host"
24-
icahostkeeper "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host/keeper"
25-
icahosttypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host/types"
26-
icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types"
27-
ibcfee "github.com/cosmos/ibc-go/v9/modules/apps/29-fee"
28-
ibcfeekeeper "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/keeper"
29-
ibcfeetypes "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types"
30-
"github.com/cosmos/ibc-go/v9/modules/apps/transfer"
31-
ibctransferkeeper "github.com/cosmos/ibc-go/v9/modules/apps/transfer/keeper"
32-
ibctransfertypes "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types"
33-
ibc "github.com/cosmos/ibc-go/v9/modules/core"
34-
ibcclienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
35-
ibcconnectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types"
36-
porttypes "github.com/cosmos/ibc-go/v9/modules/core/05-port/types"
37-
ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported"
38-
ibckeeper "github.com/cosmos/ibc-go/v9/modules/core/keeper"
39-
ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint"
16+
ica "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts"
17+
icacontroller "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller"
18+
icacontrollerkeeper "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/keeper"
19+
icacontrollertypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/controller/types"
20+
icahost "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host"
21+
icahostkeeper "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/keeper"
22+
icahosttypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/host/types"
23+
icatypes "github.com/cosmos/ibc-go/v10/modules/apps/27-interchain-accounts/types"
24+
ibcfee "github.com/cosmos/ibc-go/v10/modules/apps/29-fee"
25+
ibcfeekeeper "github.com/cosmos/ibc-go/v10/modules/apps/29-fee/keeper"
26+
ibcfeetypes "github.com/cosmos/ibc-go/v10/modules/apps/29-fee/types"
27+
"github.com/cosmos/ibc-go/v10/modules/apps/transfer"
28+
ibctransferkeeper "github.com/cosmos/ibc-go/v10/modules/apps/transfer/keeper"
29+
ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
30+
ibc "github.com/cosmos/ibc-go/v10/modules/core"
31+
ibcclienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
32+
ibcconnectiontypes "github.com/cosmos/ibc-go/v10/modules/core/03-connection/types"
33+
porttypes "github.com/cosmos/ibc-go/v10/modules/core/05-port/types"
34+
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
35+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
36+
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
4037
"github.com/spf13/cast"
4138

4239
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
@@ -195,14 +192,12 @@ type WasmApp struct {
195192
interfaceRegistry types.InterfaceRegistry
196193

197194
// keys to access the substores
198-
keys map[string]*storetypes.KVStoreKey
199-
tkeys map[string]*storetypes.TransientStoreKey
200-
memKeys map[string]*storetypes.MemoryStoreKey
195+
keys map[string]*storetypes.KVStoreKey
196+
tkeys map[string]*storetypes.TransientStoreKey
201197

202198
// keepers
203199
AccountKeeper authkeeper.AccountKeeper
204200
BankKeeper bankkeeper.BaseKeeper
205-
CapabilityKeeper *capabilitykeeper.Keeper
206201
StakingKeeper *stakingkeeper.Keeper
207202
SlashingKeeper slashingkeeper.Keeper
208203
MintKeeper mintkeeper.Keeper
@@ -226,13 +221,6 @@ type WasmApp struct {
226221
TransferKeeper ibctransferkeeper.Keeper
227222
WasmKeeper wasmkeeper.Keeper
228223

229-
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
230-
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
231-
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
232-
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
233-
ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper
234-
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
235-
236224
// the module manager
237225
ModuleManager *module.Manager
238226
BasicModuleManager module.BasicManager
@@ -321,13 +309,12 @@ func NewWasmApp(
321309
evidencetypes.StoreKey, circuittypes.StoreKey,
322310
authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey,
323311
// non sdk store keys
324-
capabilitytypes.StoreKey, ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
312+
ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
325313
wasmtypes.StoreKey, icahosttypes.StoreKey,
326314
icacontrollertypes.StoreKey,
327315
)
328316

329317
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
330-
memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
331318

332319
// register streaming services
333320
if err := bApp.RegisterStreamingServices(appOpts, keys); err != nil {
@@ -342,7 +329,6 @@ func NewWasmApp(
342329
interfaceRegistry: interfaceRegistry,
343330
keys: keys,
344331
tkeys: tkeys,
345-
memKeys: memKeys,
346332
}
347333

348334
app.ParamsKeeper = initParamsKeeper(
@@ -361,20 +347,6 @@ func NewWasmApp(
361347
)
362348
bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore)
363349

364-
// add capability keeper and ScopeToModule for ibc module
365-
app.CapabilityKeeper = capabilitykeeper.NewKeeper(
366-
appCodec,
367-
keys[capabilitytypes.StoreKey],
368-
memKeys[capabilitytypes.MemStoreKey],
369-
)
370-
371-
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
372-
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
373-
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
374-
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
375-
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)
376-
app.CapabilityKeeper.Seal()
377-
378350
// add keepers
379351

380352
app.AccountKeeper = authkeeper.NewAccountKeeper(
@@ -513,10 +485,9 @@ func NewWasmApp(
513485

514486
app.IBCKeeper = ibckeeper.NewKeeper(
515487
appCodec,
516-
keys[ibcexported.StoreKey],
488+
runtime.NewKVStoreService(keys[ibcexported.StoreKey]),
517489
app.GetSubspace(ibcexported.ModuleName),
518490
app.UpgradeKeeper,
519-
scopedIBCKeeper,
520491
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
521492
)
522493

@@ -574,48 +545,42 @@ func NewWasmApp(
574545

575546
// IBC Fee Module keeper
576547
app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
577-
appCodec, keys[ibcfeetypes.StoreKey],
548+
appCodec, runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]),
578549
app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
579550
app.IBCKeeper.ChannelKeeper,
580-
app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,
551+
app.AccountKeeper, app.BankKeeper,
581552
)
582553

583554
// Create Transfer Keepers
584555
app.TransferKeeper = ibctransferkeeper.NewKeeper(
585556
appCodec,
586-
keys[ibctransfertypes.StoreKey],
557+
runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
587558
app.GetSubspace(ibctransfertypes.ModuleName),
588559
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
589560
app.IBCKeeper.ChannelKeeper,
590-
app.IBCKeeper.PortKeeper,
591561
app.AccountKeeper,
592562
app.BankKeeper,
593-
scopedTransferKeeper,
594563
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
595564
)
596565

597566
app.ICAHostKeeper = icahostkeeper.NewKeeper(
598567
appCodec,
599-
keys[icahosttypes.StoreKey],
568+
runtime.NewKVStoreService(keys[icahosttypes.StoreKey]),
600569
app.GetSubspace(icahosttypes.SubModuleName),
601570
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
602571
app.IBCKeeper.ChannelKeeper,
603-
app.IBCKeeper.PortKeeper,
604572
app.AccountKeeper,
605-
scopedICAHostKeeper,
606573
app.MsgServiceRouter(),
607574
app.GRPCQueryRouter(), // set grpc router for ica host
608575
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
609576
)
610577

611578
app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
612579
appCodec,
613-
keys[icacontrollertypes.StoreKey],
580+
runtime.NewKVStoreService(keys[icacontrollertypes.StoreKey]),
614581
app.GetSubspace(icacontrollertypes.SubModuleName),
615582
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
616583
app.IBCKeeper.ChannelKeeper,
617-
app.IBCKeeper.PortKeeper,
618-
scopedICAControllerKeeper,
619584
app.MsgServiceRouter(),
620585
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
621586
)
@@ -637,8 +602,6 @@ func NewWasmApp(
637602
distrkeeper.NewQuerier(app.DistrKeeper),
638603
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
639604
app.IBCKeeper.ChannelKeeper,
640-
app.IBCKeeper.PortKeeper,
641-
scopedWasmKeeper,
642605
app.TransferKeeper,
643606
app.MsgServiceRouter(),
644607
app.GRPCQueryRouter(),
@@ -733,7 +696,6 @@ func NewWasmApp(
733696
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
734697
circuit.NewAppModule(appCodec, app.CircuitKeeper),
735698
// non sdk modules
736-
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
737699
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
738700
ibc.NewAppModule(app.IBCKeeper),
739701
transfer.NewAppModule(app.TransferKeeper),
@@ -779,7 +741,6 @@ func NewWasmApp(
779741
genutiltypes.ModuleName,
780742
authz.ModuleName,
781743
// additional non simd modules
782-
capabilitytypes.ModuleName,
783744
ibctransfertypes.ModuleName,
784745
ibcexported.ModuleName,
785746
icatypes.ModuleName,
@@ -795,7 +756,6 @@ func NewWasmApp(
795756
feegrant.ModuleName,
796757
group.ModuleName,
797758
// additional non simd modules
798-
capabilitytypes.ModuleName,
799759
ibctransfertypes.ModuleName,
800760
ibcexported.ModuleName,
801761
icatypes.ModuleName,
@@ -812,7 +772,6 @@ func NewWasmApp(
812772
// NOTE: wasm module should be at the end as it can call other module functionality direct or via message dispatching during
813773
// genesis phase. For example bank transfer, auth account check, staking, ...
814774
genesisModuleOrder := []string{
815-
capabilitytypes.ModuleName,
816775
// simd modules
817776
authtypes.ModuleName, banktypes.ModuleName,
818777
distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
@@ -869,7 +828,6 @@ func NewWasmApp(
869828
// initialize stores
870829
app.MountKVStores(keys)
871830
app.MountTransientStores(tkeys)
872-
app.MountMemoryStores(memKeys)
873831

874832
// initialize BaseApp
875833
app.SetInitChainer(app.InitChainer)
@@ -890,12 +848,6 @@ func NewWasmApp(
890848
}
891849
}
892850

893-
app.ScopedIBCKeeper = scopedIBCKeeper
894-
app.ScopedTransferKeeper = scopedTransferKeeper
895-
app.ScopedWasmKeeper = scopedWasmKeeper
896-
app.ScopedICAHostKeeper = scopedICAHostKeeper
897-
app.ScopedICAControllerKeeper = scopedICAControllerKeeper
898-
899851
// In v0.46, the SDK introduces _postHandlers_. PostHandlers are like
900852
// antehandlers, but are run _after_ the `runMsgs` execution. They are also
901853
// defined as a chain, and have the same signature as antehandlers.
@@ -1094,13 +1046,6 @@ func (app *WasmApp) GetTKey(storeKey string) *storetypes.TransientStoreKey {
10941046
return app.tkeys[storeKey]
10951047
}
10961048

1097-
// GetMemKey returns the MemStoreKey for the provided mem key.
1098-
//
1099-
// NOTE: This is solely used for testing purposes.
1100-
func (app *WasmApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey {
1101-
return app.memKeys[storeKey]
1102-
}
1103-
11041049
// GetSubspace returns a param subspace for a given module name.
11051050
//
11061051
// NOTE: This is solely to be used for testing purposes.

app/test_support.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package app
22

33
import (
4-
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
5-
ibckeeper "github.com/cosmos/ibc-go/v9/modules/core/keeper"
4+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
65

76
"github.com/cosmos/cosmos-sdk/baseapp"
87
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
@@ -16,10 +15,6 @@ func (app *WasmApp) GetIBCKeeper() *ibckeeper.Keeper {
1615
return app.IBCKeeper
1716
}
1817

19-
func (app *WasmApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper {
20-
return app.ScopedIBCKeeper
21-
}
22-
2318
func (app *WasmApp) GetBaseApp() *baseapp.BaseApp {
2419
return app.BaseApp
2520
}

app/upgrades.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func (app *WasmApp) RegisterUpgradeHandlers() {
4040
AccountKeeper: &app.AccountKeeper,
4141
ParamsKeeper: &app.ParamsKeeper,
4242
ConsensusParamsKeeper: &app.ConsensusParamsKeeper,
43-
CapabilityKeeper: app.CapabilityKeeper,
4443
IBCKeeper: app.IBCKeeper,
4544
Codec: app.appCodec,
4645
GetStoreKey: app.GetKey,

app/upgrades/types.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ package upgrades
33
import (
44
"context"
55

6-
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
7-
ibckeeper "github.com/cosmos/ibc-go/v9/modules/core/keeper"
6+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
87

98
storetypes "cosmossdk.io/store/types"
109
upgradetypes "cosmossdk.io/x/upgrade/types"
@@ -22,7 +21,6 @@ type AppKeepers struct {
2221
ConsensusParamsKeeper *consensusparamkeeper.Keeper
2322
Codec codec.Codec
2423
GetStoreKey func(storeKey string) *storetypes.KVStoreKey
25-
CapabilityKeeper *capabilitykeeper.Keeper
2624
IBCKeeper *ibckeeper.Keeper
2725
}
2826
type ModuleManager interface {

0 commit comments

Comments
 (0)