Skip to content

Commit 45409d3

Browse files
Eric-Warehimegithub-actions
andauthored
refactor!: Upgrade ICS to IBCv10 (#2518)
* Upgrade ibc-go to main * Update module version * Updates * Update interchain test mod * Updates * Update ibc-go version * Update ccv types * Update mocks * Update * Go mod tidy * Updates * Almost all lints fixed * Update to ibcv10 * Go mod tidy * Update lints, make format * Fix lints * Update testing documentation * Mod tidy on interchain tests * Lint passes * Fix some tests * Test updates * Fix more tests * Fix integ tests * Update interchaintest * Update our interchaintest fork to cosmos --------- Co-authored-by: github-actions <[email protected]>
1 parent 03f0d85 commit 45409d3

File tree

228 files changed

+2269
-4263
lines changed

Some content is hidden

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

228 files changed

+2269
-4263
lines changed

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ linters:
88
disable-all: true
99
enable:
1010
- dogsled
11-
- exportloopref
1211
- gci
1312
- goconst
1413
- gocritic
@@ -33,6 +32,9 @@ issues:
3332
- text: 'Use of weak random number generator'
3433
linters:
3534
- gosec
35+
- text: 'G115:'
36+
linters:
37+
- gosec
3638
- text: 'ST1003:'
3739
linters:
3840
- stylecheck

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ sim-full-no-inactive-vals:
176176
### Linting ###
177177
###############################################################################
178178
golangci_lint_cmd=golangci-lint
179-
golangci_version=v1.60.1
179+
golangci_version=v1.64.5
180180

181181
lint:
182182
@echo "--> Running linter"

app/consumer-democracy/ante_handler.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package app
22

33
import (
4-
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
5-
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
4+
ibcante "github.com/cosmos/ibc-go/v10/modules/core/ante"
5+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
66

77
errorsmod "cosmossdk.io/errors"
88

99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1111
"github.com/cosmos/cosmos-sdk/x/auth/ante"
1212

13-
consumerante "github.com/cosmos/interchain-security/v6/app/consumer/ante"
14-
ibcconsumerkeeper "github.com/cosmos/interchain-security/v6/x/ccv/consumer/keeper"
13+
consumerante "github.com/cosmos/interchain-security/v7/app/consumer/ante"
14+
ibcconsumerkeeper "github.com/cosmos/interchain-security/v7/x/ccv/consumer/keeper"
1515
)
1616

1717
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC

app/consumer-democracy/app.go

Lines changed: 29 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ import (
1313
"github.com/cosmos/ibc-go/modules/capability"
1414
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
1515
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
16-
"github.com/cosmos/ibc-go/v8/modules/apps/transfer"
17-
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
18-
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
19-
ibc "github.com/cosmos/ibc-go/v8/modules/core"
20-
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
21-
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
22-
ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported"
23-
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
24-
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
25-
ibctesting "github.com/cosmos/ibc-go/v8/testing"
26-
ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types"
16+
"github.com/cosmos/ibc-go/v10/modules/apps/transfer"
17+
ibctransferkeeper "github.com/cosmos/ibc-go/v10/modules/apps/transfer/keeper"
18+
ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
19+
ibc "github.com/cosmos/ibc-go/v10/modules/core"
20+
ibcconnectiontypes "github.com/cosmos/ibc-go/v10/modules/core/03-connection/types"
21+
porttypes "github.com/cosmos/ibc-go/v10/modules/core/05-port/types"
22+
ibchost "github.com/cosmos/ibc-go/v10/modules/core/exported"
23+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
24+
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
25+
ibctesting "github.com/cosmos/ibc-go/v10/testing"
26+
// TODO eric
27+
// ibctestingtypes "github.com/cosmos/ibc-go/v10/testing/types"
2728
"github.com/spf13/cast"
2829

2930
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
@@ -38,7 +39,6 @@ import (
3839
"cosmossdk.io/x/feegrant"
3940
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
4041
feegrantmodule "cosmossdk.io/x/feegrant/module"
41-
4242
// add mint
4343
"cosmossdk.io/x/upgrade"
4444
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
@@ -109,13 +109,14 @@ import (
109109
tmjson "github.com/cometbft/cometbft/libs/json"
110110
tmos "github.com/cometbft/cometbft/libs/os"
111111

112-
appencoding "github.com/cosmos/interchain-security/v6/app/encoding"
113-
testutil "github.com/cosmos/interchain-security/v6/testutil/integration"
114-
consumer "github.com/cosmos/interchain-security/v6/x/ccv/consumer"
115-
consumerkeeper "github.com/cosmos/interchain-security/v6/x/ccv/consumer/keeper"
116-
consumertypes "github.com/cosmos/interchain-security/v6/x/ccv/consumer/types"
117-
ccvdistr "github.com/cosmos/interchain-security/v6/x/ccv/democracy/distribution"
118-
ccvstaking "github.com/cosmos/interchain-security/v6/x/ccv/democracy/staking"
112+
appencoding "github.com/cosmos/interchain-security/v7/app/encoding"
113+
testutil "github.com/cosmos/interchain-security/v7/testutil/integration"
114+
consumer "github.com/cosmos/interchain-security/v7/x/ccv/consumer"
115+
consumerkeeper "github.com/cosmos/interchain-security/v7/x/ccv/consumer/keeper"
116+
consumertypes "github.com/cosmos/interchain-security/v7/x/ccv/consumer/types"
117+
ccvdistr "github.com/cosmos/interchain-security/v7/x/ccv/democracy/distribution"
118+
ccvstaking "github.com/cosmos/interchain-security/v7/x/ccv/democracy/staking"
119+
ccvtypes "github.com/cosmos/interchain-security/v7/x/ccv/types"
119120
)
120121

121122
const (
@@ -438,37 +439,21 @@ func New(
438439
app.ConsumerKeeper = consumerkeeper.NewNonZeroKeeper(
439440
appCodec,
440441
keys[consumertypes.StoreKey],
441-
app.GetSubspace(consumertypes.ModuleName),
442442
)
443443

444444
app.IBCKeeper = ibckeeper.NewKeeper(
445445
appCodec,
446-
keys[ibchost.StoreKey],
446+
runtime.NewKVStoreService(keys[ibchost.StoreKey]),
447447
app.GetSubspace(ibchost.ModuleName),
448-
app.ConsumerKeeper,
449448
app.UpgradeKeeper,
450-
scopedIBCKeeper,
451-
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
452-
)
453-
454-
app.IBCKeeper = ibckeeper.NewKeeper(
455-
appCodec,
456-
keys[ibchost.StoreKey],
457-
app.GetSubspace(ibchost.ModuleName),
458-
&app.ConsumerKeeper,
459-
app.UpgradeKeeper,
460-
scopedIBCKeeper,
461449
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
462450
)
463451

464452
// Create CCV consumer and modules
465453
app.ConsumerKeeper = consumerkeeper.NewKeeper(
466454
appCodec,
467455
keys[consumertypes.StoreKey],
468-
app.GetSubspace(consumertypes.ModuleName),
469-
scopedIBCConsumerKeeper,
470456
app.IBCKeeper.ChannelKeeper,
471-
app.IBCKeeper.PortKeeper,
472457
app.IBCKeeper.ConnectionKeeper,
473458
app.IBCKeeper.ClientKeeper,
474459
app.SlashingKeeper,
@@ -501,14 +486,12 @@ func New(
501486

502487
app.TransferKeeper = ibctransferkeeper.NewKeeper(
503488
appCodec,
504-
keys[ibctransfertypes.StoreKey],
489+
runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
505490
app.GetSubspace(ibctransfertypes.ModuleName),
506491
app.IBCKeeper.ChannelKeeper,
507492
app.IBCKeeper.ChannelKeeper,
508-
app.IBCKeeper.PortKeeper,
509493
app.AccountKeeper,
510494
app.BankKeeper,
511-
scopedTransferKeeper,
512495
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
513496
)
514497
transferModule := transfer.NewAppModule(app.TransferKeeper)
@@ -517,7 +500,7 @@ func New(
517500
// create static IBC router, add transfer route, then set and seal it
518501
ibcRouter := porttypes.NewRouter()
519502
ibcRouter.AddRoute(ibctransfertypes.ModuleName, ibcmodule)
520-
ibcRouter.AddRoute(consumertypes.ModuleName, consumerModule)
503+
ibcRouter.AddRoute(ccvtypes.ConsumerPortID, consumerModule)
521504
app.IBCKeeper.SetRouter(ibcRouter)
522505

523506
// create evidence keeper with router
@@ -534,6 +517,9 @@ func New(
534517

535518
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
536519

520+
tmLightClientModule := ibctm.NewLightClientModule(appCodec, app.IBCKeeper.ClientKeeper.GetStoreProvider())
521+
app.IBCKeeper.ClientKeeper.AddRoute(ibctm.ModuleName, tmLightClientModule)
522+
537523
// NOTE: Any module instantiated in the module manager that is later modified
538524
// must be passed by reference here.
539525
app.MM = module.NewManager(
@@ -559,7 +545,7 @@ func New(
559545
params.NewAppModule(app.ParamsKeeper),
560546
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
561547
ibc.NewAppModule(app.IBCKeeper),
562-
ibctm.NewAppModule(),
548+
ibctm.NewAppModule(tmLightClientModule),
563549
transferModule,
564550
consumerModule,
565551
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
@@ -933,8 +919,8 @@ func (app *App) GetBaseApp() *baseapp.BaseApp {
933919
}
934920

935921
// GetStakingKeeper implements the TestingApp interface.
936-
func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper {
937-
return app.ConsumerKeeper
922+
func (app *App) GetStakingKeeper() *consumerkeeper.Keeper {
923+
return &app.ConsumerKeeper
938924
}
939925

940926
// GetIBCKeeper implements the TestingApp interface.

app/consumer/ante/disabled_modules_ante_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package ante_test
33
import (
44
"testing"
55

6-
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
6+
ibcclienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
77
"github.com/stretchr/testify/require"
88

99
evidencetypes "cosmossdk.io/x/evidence/types"
@@ -13,8 +13,8 @@ import (
1313
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
1414
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
1515

16-
"github.com/cosmos/interchain-security/v6/app/consumer/ante"
17-
appencoding "github.com/cosmos/interchain-security/v6/app/encoding"
16+
"github.com/cosmos/interchain-security/v7/app/consumer/ante"
17+
appencoding "github.com/cosmos/interchain-security/v7/app/encoding"
1818
)
1919

2020
func TestDisabledModulesDecorator(t *testing.T) {

app/consumer/ante/msg_filter_ante_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package ante_test
33
import (
44
"testing"
55

6-
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
6+
ibcclienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
77
"github.com/stretchr/testify/require"
88

99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
1111

12-
"github.com/cosmos/interchain-security/v6/app/consumer/ante"
13-
appencoding "github.com/cosmos/interchain-security/v6/app/encoding"
12+
"github.com/cosmos/interchain-security/v7/app/consumer/ante"
13+
appencoding "github.com/cosmos/interchain-security/v7/app/encoding"
1414
)
1515

1616
type consumerKeeper struct {

app/consumer/ante_handler.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package app
22

33
import (
4-
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
5-
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
4+
ibcante "github.com/cosmos/ibc-go/v10/modules/core/ante"
5+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
66

77
errorsmod "cosmossdk.io/errors"
88

99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1111
"github.com/cosmos/cosmos-sdk/x/auth/ante"
1212

13-
consumerante "github.com/cosmos/interchain-security/v6/app/consumer/ante"
14-
ibcconsumerkeeper "github.com/cosmos/interchain-security/v6/x/ccv/consumer/keeper"
13+
consumerante "github.com/cosmos/interchain-security/v7/app/consumer/ante"
14+
ibcconsumerkeeper "github.com/cosmos/interchain-security/v7/x/ccv/consumer/keeper"
1515
)
1616

1717
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC

0 commit comments

Comments
 (0)