-
Notifications
You must be signed in to change notification settings - Fork 103
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
feat(app)!: add ICA Host module with enabled false #1441
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1441 +/- ##
==========================================
- Coverage 78.45% 78.37% -0.08%
==========================================
Files 238 238
Lines 18448 18494 +46
==========================================
+ Hits 14473 14495 +22
- Misses 3130 3154 +24
Partials 845 845
|
// removeICAFromSimulation is a utility function that removes from genesis exporting due to a panic bug. | ||
// | ||
// TODO: remove after https://github.com/cosmos/ibc-go/issues/2151 is resolved | ||
func removeICAFromSimulation(app *regen.RegenApp) { | ||
remove := func(target string, mods []string) []string { | ||
for i, mod := range mods { | ||
if mod == target { | ||
return append(mods[:i], mods[i+1:]...) | ||
} | ||
} | ||
return mods | ||
} | ||
|
||
icaModName := ica.AppModule{}.Name() | ||
|
||
app.ModuleManager.OrderExportGenesis = remove(icaModName, app.ModuleManager.OrderExportGenesis) | ||
} |
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.
unfortunately ICA module does not implement AppModuleSimulation
so the module does initialize with any state during simulations. This in turn causes ExportGenesis
calls on the regen.App
to panic due to a bug described here cosmos/ibc-go#2151.
This is a temporary workaround until the above issue is resolved on the IBC-go repo, or a more preferable solution is found.
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.
Work around for now works for me.
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.
Nice! Excited to get this added. Tested adding a message via governance and querying params. We should have host disabled on upgrade and require a governance proposal to enable it. Would be nice to wire up the controller here as well and make sure it is also disabled upon upgrade.
app/app.go
Outdated
// TODO: decide if we want to be a controller chain. For now, we only setup the host. | ||
// this means actions can be executed on Regen Ledger from another chain. | ||
// however, until we add the controller, Regen Ledger accounts will not be able to execute messages | ||
// on other chains. |
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.
We should wire up the controlled and make sure it is disabled. This way it could be enabled via governance:
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.
Currently the command to query the controller is available but it produces the following error:
Error: rpc error: code = Unknown desc = value method github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper.Keeper.Params called using nil *Keeper pointer: panic
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.
yeah the controller is a lot more tricky than the host. it needs middleware, and in the demo i linked in discord, it appears the thing chain devs should be doing is creating their own x/intertx
module (the one in the demo says its experimental and not to use it in prod) ? but it also looks like it can be wired up using a new IBCFee
module.
the docs are also a bit confusing for chain devs, as the integration guide mentions an ICAAuth module that can be used for the controller's middleware, but that module doesn't appear to exist ??
we may just want to start w/ host for now and wait for them to update the docs to see what chaindevs should do for integrating controllers 🤷🏻
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.
Can we make this an issue rather than a todo? No need for the todo here but an issue to track would be great.
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.
We can throw it in the backlog. Probably not something we need for v5.0.
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.
// removeICAFromSimulation is a utility function that removes from genesis exporting due to a panic bug. | ||
// | ||
// TODO: remove after https://github.com/cosmos/ibc-go/issues/2151 is resolved | ||
func removeICAFromSimulation(app *regen.RegenApp) { | ||
remove := func(target string, mods []string) []string { | ||
for i, mod := range mods { | ||
if mod == target { | ||
return append(mods[:i], mods[i+1:]...) | ||
} | ||
} | ||
return mods | ||
} | ||
|
||
icaModName := ica.AppModule{}.Name() | ||
|
||
app.ModuleManager.OrderExportGenesis = remove(icaModName, app.ModuleManager.OrderExportGenesis) | ||
} |
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.
Work around for now works for me.
@@ -36,6 +37,7 @@ func (app *RegenApp) registerUpgradeHandlers() { | |||
storeUpgrades := storetypes.StoreUpgrades{ | |||
Added: []string{ | |||
group.ModuleName, | |||
icahosttypes.StoreKey, |
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.
We should probably have the host disabled upon upgrade and require a governance proposal to enable it.
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.
do you mean to edit the upgrade handler to directly set the host params to false? I don't think we can remove the key in the commented line there
in any case, the host submod will be disabled either way, however disabling it manually in the upgrade handler will at least make it's params queryable post-upgrade. wdyt, edit the handler or leave as is?
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.
I just left the comment here because it was the only line changed. I do mean setting the host param to false.
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.
Edit the handler. It will be queryable either way as long as the module is wired up. Currently the upgrade will set the host to enabled by default. We should require a governance proposal to enable it before adding messages.
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.
ah i missed the default genesis setting it to true, i'll set the params in the upgrade handler 👍🏻
tACK. Unfortunately the error still exists when querying controller params because the keeper is not implemented. Is there a way around this? |
I don't think so. all the cmd's are managed by the module itself. might just have to live with it until the ICA module matures 🤷🏻 |
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.
Meant to approve with the tACK above. Would be nice to get the controller set up but start with it disabled if we find time to dig in further or when the documentation is more up-to-date.
Description
TODO: do we want to setup the parameters manually in the upgrade, allowing us to enable ICA right off the bat with some predefined allowed messages, or should we it be initialized as an empty module and let governance enable/add messages?governance can enable and set the messages to be available for host chain execution.
Additionally, some tests/refactoring can be added to ensure this works in #1440
Closes: #1328
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change