-
Notifications
You must be signed in to change notification settings - Fork 610
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
Add ICA controller #7839
Add ICA controller #7839
Conversation
WalkthroughThe update integrates Interchain Accounts (ICA) controller functionality into the application, enhancing cross-chain account management. It involves adjusting keeper configurations, updating modules for ICA control, and enabling ICA controllers in upgrades. Changes
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 Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (3)
- app/keepers/keepers.go (9 hunks)
- app/modules.go (1 hunks)
- app/upgrades/v24/upgrades.go (2 hunks)
Additional comments: 12
app/upgrades/v24/upgrades.go (2)
- 7-7: The addition of the
icacontrollertypes
import is necessary for the ICA controller functionality. Looks good.- 50-52: Enabling ICA controllers by setting default parameters is a standard approach. Ensure that this operation is idempotent and does not negatively impact the upgrade process.
app/modules.go (1)
- 168-168: Modification to include
app.ICAControllerKeeper
as an argument in theica.NewAppModule
function call is necessary for ICA integration. Ensure that bothICAControllerKeeper
andICAHostKeeper
are correctly initialized and passed.Verification successful
To accurately verify the initialization and correct passing of
ICAControllerKeeper
andICAHostKeeper
to theica.NewAppModule
function, we need to inspect the relevant code sections. Let's proceed with searching for the initialization of these keepers and their usage in theica.NewAppModule
function call.
The script output provides evidence of the initialization and correct passing of
ICAControllerKeeper
andICAHostKeeper
to theica.NewAppModule
function call withinapp/modules.go
. Specifically, it shows:
- The initialization of
ICAControllerKeeper
inapp/keepers/keepers.go
, where it is assigned a new keeper instance.- The initialization of
ICAHostKeeper
in the same file, following a similar pattern.- The usage of both
ICAControllerKeeper
andICAHostKeeper
in theica.NewAppModule
function call withinapp/modules.go
, confirming that they are passed correctly to this function.Given this information, it can be concluded that the initialization and correct passing of
ICAControllerKeeper
andICAHostKeeper
to theica.NewAppModule
function are verified as per the review comment.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the initialization and correct passing of ICAControllerKeeper and ICAHostKeeper # This script is a placeholder for the actual verification steps which would depend on the specific implementation details of the ICAControllerKeeper and ICAHostKeeper. echo "Ensure that ICAControllerKeeper and ICAHostKeeper are correctly initialized and passed to the ica.NewAppModule function."Length of output: 250
Script:
#!/bin/bash # Search for the initialization of ICAControllerKeeper echo "Searching for ICAControllerKeeper initialization..." rg "ICAControllerKeeper" --context 5 # Search for the initialization of ICAHostKeeper echo "Searching for ICAHostKeeper initialization..." rg "ICAHostKeeper" --context 5 # Search for the usage of ICAControllerKeeper and ICAHostKeeper in ica.NewAppModule function call echo "Searching for usage in ica.NewAppModule function call..." rg "ica.NewAppModule" --context 5Length of output: 15474
app/keepers/keepers.go (9)
- 41-43: The addition of new imports for the ICA controller from the
ibc-go/v7
module is correctly done. These imports are essential for the integration of the ICA controller functionality into the Osmosis architecture.- 131-136: The addition of
ScopedICAControllerKeeper
to the scoped keepers is correctly implemented. This change is necessary for managing the capabilities and interactions of interchain accounts within theCapabilityKeeper
.- 149-149: The initialization of the
ICAControllerKeeper
and its integration into the IBC router is correctly adjusted. This step is crucial for enabling the ICA controller's functionality within the Osmosis application modules.- 308-317: The detailed setup for the
ICAControllerKeeper
including its codec, store key, subspace, and scoped keeper is correctly implemented. This setup is essential for the operational functionality of the ICA controller within the app.- 319-326: The initialization of the ICA module with the mock module as the authentication module on the controller side is correctly done. This setup is part of the foundational work required for enabling ICA functionalities.
- 344-351: The addition of the ICA controller and host modules to the IBC router is correctly implemented. This change ensures that the ICA functionalities are properly routed within the IBC framework, enabling seamless interchain account management.
- 700-700: The scoping of the
ICAControllerKeeper
within theCapabilityKeeper
is correctly done. This step is necessary for ensuring that the ICA controller's capabilities are properly managed and isolated within the app's architecture.- 739-739: The subspace for the
ICAControllerKeeper
is correctly initialized with its parameter key table. This initialization is crucial for managing the parameters related to the ICA controller's functionality.- 853-853: The addition of the
ICAControllerKeeper
store key to the list of KV store keys is correctly done. This inclusion is necessary for ensuring that the ICA controller's data is properly stored and managed within the app's state.
app/keepers/keepers.go
Outdated
|
||
// RecvPacket, message that originates from core IBC and goes down to app, the flow is: | ||
// channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket | ||
var icaHostStack porttypes.IBCModule |
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.
There's an opportunity to merge the variable declaration with the assignment on the next line to improve code conciseness.
- var icaControllerStack porttypes.IBCModule
- icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, *appKeepers.ICAControllerKeeper)
+ icaControllerStack := icacontroller.NewIBCMiddleware(nil, *appKeepers.ICAControllerKeeper)
Note: The original code initializes icaControllerStack
with a zero value and then assigns it. The suggested change initializes it directly with the return value of NewIBCMiddleware
, making the code more concise. Additionally, the original code incorrectly passes icaControllerStack
as an argument to itself before it's fully initialized. The corrected code passes nil
to indicate that there's no prior middleware in the stack.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
var icaHostStack porttypes.IBCModule | |
icaControllerStack := icacontroller.NewIBCMiddleware(nil, *appKeepers.ICAControllerKeeper) |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- app/keepers/keepers.go (9 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/keepers/keepers.go
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.
💪
* added ica controller * lint * added store upgrade * changelog (cherry picked from commit 2f409fd)
* added ica controller * lint * added store upgrade * changelog (cherry picked from commit 2f409fd) Co-authored-by: Nicolas Lara <[email protected]>
What is the purpose of the change
Add the ICA controller to osmosis
Testing and Verifying
All existing tests should pass.
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)Summary by CodeRabbit
icacontrollertypes
module.ICAControllerKeeper
during upgrades.ScopedICAControllerKeeper
within theCapabilityKeeper
.ica.NewAppModule
function to includeapp.ICAControllerKeeper
.ScopedICAControllerKeeper
.ICAControllerKeeper
and integrated it into the IBC router.icacontrollertypes.StoreKey
in theStoreUpgrades
struct.