-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(app.go
): turn off IBC modules
#2572
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughWalkthroughThe recent changes involve the strategic removal of Inter-Blockchain Communication (IBC) functionalities across various application components. This includes deactivating related modules, handlers, and documentation, indicating a shift in focus away from cross-chain operations. The decision appears to be a response to ongoing development challenges or a preparatory step for future enhancements, streamlining the application by reducing dependencies on IBC. Changes
Sequence Diagram(s)sequenceDiagram
participant A as User
participant B as Application
participant C as IBC Module
A->>B: Initiate Request
B->>C: Process IBC Request
C-->>B: Response
B-->>A: Return Response
sequenceDiagram
participant A as User
participant B as Application
A->>B: Initiate Request
B-->>A: Return Response
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2572 +/- ##
===========================================
+ Coverage 46.73% 46.80% +0.06%
===========================================
Files 465 465
Lines 30889 30820 -69
===========================================
- Hits 14436 14425 -11
+ Misses 15597 15539 -58
Partials 856 856
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (6)
app/app.go (6)
Commented-out module manager initializations are still present.
The following commented-out module manager initializations are still present in the
app/app.go
file and need to be fully removed to avoid confusion or potential issues:
capability.NewAppModule
ibc.NewAppModule
transfer.NewAppModule
ibccrosschain.NewAppModule
Please ensure these references are completely removed from the codebase.
Analysis chain
Line range hint
687-732
:
LGTM! But verify the module manager initialization usage in the codebase.The code changes are approved.
However, ensure that all references to the commented-out module manager initializations are removed from the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the commented-out module manager initializations are removed from the codebase. # Test: Search for the module manager initialization usage. Expect: No references to the commented-out module manager initializations. rg --type go -A 5 $'capability.NewAppModule' rg --type go -A 5 $'ibc.NewAppModule' rg --type go -A 5 $'transfer.NewAppModule' rg --type go -A 5 $'ibccrosschain.NewAppModule'Length of output: 2164
Ensure removal of commented-out initializations from test utilities.
The commented-out initializations are still referenced in
testutil/keeper/keeper.go
. Please remove or update these references to ensure consistency and avoid potential issues.
testutil/keeper/keeper.go
#!/bin/bash # Description: Verify all references to the commented-out initializations in test files and other parts of the codebase. # Test: Search for the initialization usage in the test files and other parts of the codebase. rg --type go -A 5 $'capabilitykeeper.NewKeeper' testutil/ rg --type go -A 5 $'ibckeeper.NewKeeper' testutil/ rg --type go -A 5 $'ibctransferkeeper.NewKeeper' testutil/ rg --type go -A 5 $'ibccrosschainkeeper.NewKeeper' testutil/Analysis chain
Line range hint
390-620
:
LGTM! But verify the initialization usage in the codebase.The code changes are approved.
However, ensure that all references to the commented-out initializations are removed from the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the commented-out initializations are removed from the codebase. # Test: Search for the initialization usage. Expect: No references to the commented-out initializations. rg --type go -A 5 $'capabilitykeeper.NewKeeper' rg --type go -A 5 $'ibckeeper.NewKeeper' rg --type go -A 5 $'ibctransferkeeper.NewKeeper' rg --type go -A 5 $'ibccrosschainkeeper.NewKeeper'Length of output: 2142
Remove all references to the commented-out module order settings.
The following files contain references to the commented-out module order settings. These references should be removed to ensure consistency and avoid potential issues:
app/setup_handlers.go
- Lines: 1715707436
app/init_genesis.go
- Lines: 1715707436
app/app.go
- Lines: 1715707436
testutil/keeper/keeper.go
- Lines: 1715707436
Please remove or update these references to maintain a clean and consistent codebase.
Analysis chain
Line range hint
744-792
:
LGTM! But verify the module order setting usage in the codebase.The code changes are approved.
However, ensure that all references to the commented-out module order settings are removed from the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the commented-out module order settings are removed from the codebase. # Test: Search for the module order setting usage. Expect: No references to the commented-out module order settings. rg --type go -A 5 $'capabilitytypes.ModuleName' rg --type go -A 5 $'ibcexported.ModuleName' rg --type go -A 5 $'ibctransfertypes.ModuleName' rg --type go -A 5 $'ibccrosschaintypes.ModuleName'Length of output: 10238
225-227
: Action Required: Remove Unnecessary References to Commented-Out Module Account PermissionsThe codebase still contains multiple references to the commented-out module account permissions (
ibctransfertypes.ModuleName
andibccrosschaintypes.ModuleName
). These references should be reviewed and removed if they are no longer necessary to avoid potential issues.Locations to review:
testutil/keeper/keeper.go
app/app.go
app/setup_handlers.go
app/init_genesis.go
Please ensure that all unnecessary references are removed to maintain code integrity and avoid potential runtime errors.
Analysis chain
LGTM! But verify the module account permission usage in the codebase.
The code changes are approved.
However, ensure that all references to the commented-out module account permissions are removed from the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the commented-out module account permissions are removed from the codebase. # Test: Search for the module account permission usage. Expect: No references to the commented-out module account permissions. rg --type go -A 5 $'ibctransfertypes.ModuleName' rg --type go -A 5 $'ibccrosschaintypes.ModuleName'Length of output: 6728
273-301
: Remove or refactor references to commented-out variablesThe variables
CapabilityKeeper
,IBCKeeper
,TransferKeeper
,ScopedIBCKeeper
,ScopedTransferKeeper
, andIBCCrosschainKeeper
have been commented out inapp/app.go
. However, these variables are still being referenced in the codebase. Please remove or refactor these references to avoid potential issues.
testutil/keeper/crosschain.go
- Line:
*sdkKeepers.CapabilityKeeper
testutil/keeper/keeper.go
- Lines:
CapabilityKeeper
,IBCKeeper
,TransferKeeper
,ScopedIBCKeeper
,ScopedTransferKeeper
testutil/keeper/ibccrosschain.go
- Line:
sdkKeepers.CapabilityKeeper.ScopeToModule(types.ModuleName)
app/ante/handler_options.go
- Line:
IBCKeeper
app/app.go
- Lines:
//CapabilityKeeper *capabilitykeeper.Keeper
,//IBCKeeper *ibckeeper.Keeper
,//TransferKeeper ibctransferkeeper.Keeper
,//ScopedIBCKeeper capabilitykeeper.ScopedKeeper
,//ScopedTransferKeeper capabilitykeeper.ScopedKeeper
,//IBCCrosschainKeeper ibccrosschainkeeper.Keeper
Please ensure all references to the commented-out variables are removed or properly refactored.
Analysis chain
LGTM! But verify the variable usage in the codebase.
The code changes are approved.
However, ensure that all references to the commented-out variables are removed from the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the commented-out variables are removed from the codebase. # Test: Search for the variable usage. Expect: No references to the commented-out variables. rg --type go -A 5 $'CapabilityKeeper' rg --type go -A 5 $'IBCKeeper' rg --type go -A 5 $'TransferKeeper' rg --type go -A 5 $'ScopedIBCKeeper' rg --type go -A 5 $'ScopedTransferKeeper' rg --type go -A 5 $'IBCCrosschainKeeper'Length of output: 31159
118-134
: Action Required: Remove or Comment Out References to Commented-Out ImportsThe following files still reference the commented-out imports related to IBC modules and capability modules. Please remove or comment out these references to ensure consistency and avoid potential issues:
x/ibccrosschain/ibc_module.go
- Line 2:
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
- Line 7:
chanCap *capabilitytypes.Capability,
testutil/keeper/ibccrosschain.go
- Line 2:
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
- Line 12:
capabilityKeeper capabilitykeeper.Keeper,
- Line 20:
capabilityKeeper.ScopeToModule(types.ModuleName)
testutil/keeper/keeper.go
- Line 2:
capabilitymodule "github.com/cosmos/cosmos-sdk/x/capability"
- Line 3:
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
- Line 4:
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
- Line 12:
CapabilityKeeper *capabilitykeeper.Keeper
- Line 13:
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
- Line 14:
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
- Line 32:
capabilityKeeper capabilitykeeper.Keeper,
- Line 40:
capabilityKeeper.ScopeToModule(ibcexported.ModuleName)
- Line 50:
capabilityKeeper capabilitykeeper.Keeper,
- Line 56:
capabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
- Line 75:
capabilityKeeper := CapabilityKeeper(cdc, db, ss)
- Line 85:
*capabilityKeeper,
- Line 90:
*capabilityKeeper,
- Line 100:
capabilitymodule.InitGenesis(ctx, *sdkk.CapabilityKeeper, *capabilitytypes.DefaultGenesis())
app/setup_handlers.go
- Line 2:
// capabilitytypes.ModuleName,
- Line 3:
// ibcexported.ModuleName,
- Line 4:
// ibctransfertypes.ModuleName,
app/app.go
- Line 2:
// "github.com/cosmos/cosmos-sdk/x/capability"
- Line 3:
// capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
- Line 4:
// capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
- Line 5:
// "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
- Line 6:
// transferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
- Line 7:
// transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
- Line 8:
// ibccore "github.com/cosmos/ibc-go/v7/modules/core"
- Line 9:
// ibctypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
- Line 10:
// ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
- Line 11:
// ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
- Line 12:
// "github.com/zeta-chain/zetacore/x/ibccrosschain"
- Line 13:
// ibccrosschainkeeper "github.com/zeta-chain/zetacore/x/ibccrosschain/keeper"
- Line 14:
// ibccrosschaintypes "github.com/zeta-chain/zetacore/x/ibccrosschain/types"
- Line 20:
//capability.AppModuleBasic{},
- Line 32:
//CapabilityKeeper *capabilitykeeper.Keeper
- Line 37:
//ScopedIBCKeeper capabilitykeeper.ScopedKeeper
- Line 38:
//ScopedTransferKeeper capabilitykeeper.ScopedKeeper
- Line 39:
//ScopedIBCCrosschainKeeper capabilitykeeper.ScopedKeeper
- Line 45:
//capabilitytypes.StoreKey,
- Line 50:
//capabilitytypes.MemStoreKey,
- Line 55:
//app.CapabilityKeeper = capabilitykeeper.NewKeeper(
- Line 56:
// appCodec,
- Line 57:
// keys[capabilitytypes.StoreKey],
- Line 58:
// memKeys[capabilitytypes.MemStoreKey],
- Line 60:
//scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
- Line 61:
//scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
- Line 70:
//app.IBCKeeper = ibckeeper.NewKeeper(
- Line 71:
// appCodec,
- Line 72:
// keys[ibcexported.StoreKey],
- Line 73:
// app.GetSubspace(ibcexported.ModuleName),
- Line 74:
// app.StakingKeeper,
- Line 75:
// app.UpgradeKeeper,
- Line 76:
// scopedIBCKeeper,
- Line 80:
//ibcRouter := porttypes.NewRouter()
- Line 82:
//app.TransferKeeper = ibctransferkeeper.NewKeeper(
- Line 83:
// appCodec,
- Line 84:
// keys[ibctransfertypes.StoreKey],
- Line 85:
// app.GetSubspace(ibctransfertypes.ModuleName),
- Line 86:
// app.IBCKeeper.ChannelKeeper,
- Line 87:
// app.IBCKeeper.ChannelKeeper,
- Line 88:
// &app.IBCKeeper.PortKeeper,
- Line 89:
// app.AccountKeeper,
- Line 90:
// app.BankKeeper,
- Line 91:
// scopedTransferKeeper,
- Line 93:
//ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack)
- Line 100:
//scopedIBCCrosschainKeeper := app.CapabilityKeeper.ScopeToModule(ibccrosschaintypes.ModuleName)
- Line 101:
//app.ScopedIBCCrosschainKeeper = scopedIBCCrosschainKeeper
- Line 103:
//app.IBCCrosschainKeeper = *ibccrosschainkeeper.NewKeeper(
- Line 104:
// appCodec,
- Line 105:
// keys[ibccrosschaintypes.StoreKey],
- Line 106:
// keys[ibccrosschaintypes.MemStoreKey],
- Line 107:
// &app.CrosschainKeeper,
- Line 108:
// app.TransferKeeper,
- Line 110:
//ibcRouter.AddRoute(ibccrosschaintypes.ModuleName, ibccrosschain.NewIBCModule(app.IBCCrosschainKeeper))
- Line 112:
//app.CrosschainKeeper.SetIBCCrosschainKeeper(app.IBCCrosschainKeeper)
- Line 120:
//ibc.NewAppModule(app.IBCKeeper),
- Line 121:
//transfer.NewAppModule(app.TransferKeeper),
- Line 125:
//ibccrosschain.NewAppModule(appCodec, app.IBCCrosschainKeeper),
- Line 130:
//ibcexported.ModuleName,
- Line 131:
//ibctransfertypes.ModuleName,
- Line 135:
//ibccrosschaintypes.ModuleName,
- Line 140:
//ibcexported.ModuleName,
- Line 141:
//ibctransfertypes.ModuleName,
- Line 145:
//ibccrosschaintypes.ModuleName,
app/init_genesis.go
- Line 2:
//capabilitytypes.ModuleName,
- Line 3:
//ibcexported.ModuleName,
- Line 4:
//ibctransfertypes.ModuleName,
- Line 5:
//ibccrosschaintypes.ModuleName,
app/ante/handler_options.go
- Line 2:
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
- Line 3:
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
- Line 10:
IBCKeeper *ibckeeper.Keeper
- Line 20:
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
Please ensure that these references are removed or commented out to maintain code consistency and avoid potential issues.
Analysis chain
LGTM! But verify the import usage in the codebase.
The code changes are approved.
However, ensure that all references to the commented-out imports are removed from the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the commented-out imports are removed from the codebase. # Test: Search for the import usage. Expect: No references to the commented-out imports. rg --type go -A 5 $'capability' rg --type go -A 5 $'ibc' rg --type go -A 5 $'ibccrosschain'Length of output: 82626
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (7)
- app/app.go (21 hunks)
- app/init_genesis.go (3 hunks)
- app/setup_handlers.go (3 hunks)
- changelog.md (1 hunks)
- docs/cli/zetacored/zetacored_query.md (2 hunks)
- docs/cli/zetacored/zetacored_tx.md (2 hunks)
- docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal.md (1 hunks)
Files skipped from review due to trivial changes (3)
- app/setup_handlers.go
- docs/cli/zetacored/zetacored_query.md
- docs/cli/zetacored/zetacored_tx.md
Additional context used
Path-based instructions (2)
app/init_genesis.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.app/app.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
GitHub Check: codecov/patch
app/app.go
[warning] 360-360: app/app.go#L360
Added line #L360 was not covered by tests
[warning] 362-362: app/app.go#L362
Added line #L362 was not covered by tests
Additional comments not posted (4)
app/init_genesis.go (1)
Line range hint
37-56
:
LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
InitGenesisModuleList
do not depend on the commented-out IBC modules.Verification successful
Verified: The function calls to
InitGenesisModuleList
do not depend on the commented-out IBC modules.
app/app.go
: The function is used to set the order of module initialization without referencing the commented-out IBC modules.cmd/zetacored/parse_genesis.go
: The function is used to iterate over the module list for import operations, and there are no dependencies on the commented-out IBC modules.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `InitGenesisModuleList` do not depend on the commented-out IBC modules. # Test: Search for the function usage. Expect: No dependency on the commented-out IBC modules. rg --type go -A 5 $'InitGenesisModuleList'Length of output: 1359
Script:
#!/bin/bash # Description: Gather more context around the usage of InitGenesisModuleList in app/app.go and cmd/zetacored/parse_genesis.go # Extract 20 lines before and after the usage in app/app.go rg --type go -A 20 -B 20 'InitGenesisModuleList' app/app.go # Extract 20 lines before and after the usage in cmd/zetacored/parse_genesis.go rg --type go -A 20 -B 20 'InitGenesisModuleList' cmd/zetacored/parse_genesis.goLength of output: 2628
docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal.md (1)
Line range hint
1-1
:
LGTM! But verify the subcommand usage in the codebase.The code changes are approved.
However, ensure that all references to
ibc-upgrade
andupdate-client
subcommands are removed from the codebase.Verification successful
All references to
ibc-upgrade
andupdate-client
subcommands have been successfully removed from the codebase.
- No occurrences of
ibc-upgrade
andupdate-client
were found across all file types.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `ibc-upgrade` and `update-client` subcommands are removed from the codebase. # Test: Search for the subcommand usage. Expect: No references to `ibc-upgrade` and `update-client`. rg --type md -A 5 $'ibc-upgrade' rg --type md -A 5 $'update-client'Length of output: 65
Script:
#!/bin/bash # Description: Verify all references to `ibc-upgrade` and `update-client` subcommands are removed from the codebase. # Test: Search for the subcommand usage across all file types. Expect: No references to `ibc-upgrade` and `update-client`. rg -A 5 'ibc-upgrade' rg -A 5 'update-client'Length of output: 45
Tools
Markdownlint
78-78: Column: 42
Hard tabs(MD010, no-hard-tabs)
79-79: Column: 136
Hard tabs(MD010, no-hard-tabs)
80-80: Column: 114
Hard tabs(MD010, no-hard-tabs)
81-81: Column: 122
Hard tabs(MD010, no-hard-tabs)
app/app.go (1)
191-210
: LGTM! But verify the module basic manager usage in the codebase.The code changes are approved.
However, ensure that all references to the commented-out module basic managers are removed from the codebase.
Verification successful
Verification Successful: No issues found with the commented-out module basic managers.
The commented-out module basic managers are only present in the
app/app.go
file, and there are no other references to them in the codebase. This ensures that the changes are isolated and do not impact other parts of the codebase.
capability.AppModuleBasic
ibc.AppModuleBasic
ibctm.AppModuleBasic
transfer.AppModuleBasic
ibccrosschain.AppModuleBasic
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to the commented-out module basic managers are removed from the codebase. # Test: Search for the module basic manager usage. Expect: No references to the commented-out module basic managers. rg --type go -A 5 $'capability.AppModuleBasic' rg --type go -A 5 $'ibc.AppModuleBasic' rg --type go -A 5 $'ibctm.AppModuleBasic' rg --type go -A 5 $'transfer.AppModuleBasic' rg --type go -A 5 $'ibccrosschain.AppModuleBasic'Length of output: 1469
changelog.md (1)
70-70
: LGTM!The changelog entry clearly documents the disabling of the IBC modules as part of PR 2572.
Description
Comment out all IBC modules logic from
app.go
to not import the module.Remove the module addition from upgrade script
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores