-
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
Changes from 6 commits
0f4429b
3d6bd95
78f986f
39362a7
1c21e1e
0391896
7a5cb02
bf6f818
128fe83
615943e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import ( | |
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation" | ||
"github.com/cosmos/cosmos-sdk/x/simulation" | ||
ica "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts" | ||
|
||
regen "github.com/regen-network/regen-ledger/v4/app" | ||
) | ||
|
@@ -50,3 +51,21 @@ func simulateFromSeed(t *testing.T, app *regen.RegenApp, config simtypes.Config) | |
app.AppCodec(), | ||
) | ||
} | ||
|
||
// 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) | ||
} | ||
Comment on lines
+55
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unfortunately ICA module does not implement 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 commentThe reason will be displayed to describe this comment to others. Learn more. Work around for now works for me. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import ( | |
"github.com/cosmos/cosmos-sdk/x/auth/ante" | ||
"github.com/cosmos/cosmos-sdk/x/group" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
icahosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" | ||
|
||
"github.com/regen-network/regen-ledger/x/data" | ||
"github.com/regen-network/regen-ledger/x/ecocredit" | ||
|
@@ -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 commentThe 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 commentThe 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 commentThe 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 commentThe 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 commentThe 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 👍🏻 |
||
}, | ||
} | ||
|
||
|
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:
https://github.com/cosmos/ibc-go/blob/main/modules/apps/27-interchain-accounts/controller/types/params.go#L9-L12
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:
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 newIBCFee
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.
issue: #1453
commented in code: bf6f818