-
Notifications
You must be signed in to change notification settings - Fork 410
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
Initial ICA integration #837
Conversation
app/app.go
Outdated
|
||
// icaControllerIBCModule := icacontroller.NewIBCModule(app.icaControllerKeeper, icaAuthModule) | ||
// icaHostIBCModule := icahost.NewIBCModule(app.icaHostKeeper) | ||
// TODO: clarify how to build icaAuthModule or remove icaController support? |
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 am a bit lost here.
Can anyone show me an example of non-mock authorization for an icaController?
Otherwise, I would just make this a host... I want to integrate tried-and-true ibc code, not experiment here.
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.
Just host makes sense for me, in this PR
Codecov Report
@@ Coverage Diff @@
## main #837 +/- ##
==========================================
+ Coverage 59.63% 59.77% +0.14%
==========================================
Files 52 52
Lines 5948 5969 +21
==========================================
+ Hits 3547 3568 +21
Misses 2139 2139
Partials 262 262
|
Happy for a review here. I could also merge as is (with icaController not working) for the demo of ica integration, and add #839 later, to allow icaController once the downstream dependencies get worked out. |
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.
Looks complete. I have added a lot of comments about the ICA controller setup.
If you want to be strict on the host role, you can remove some setup
// TODO: ICA | ||
// icatypes.ModuleName: nil, | ||
wasm.ModuleName: {authtypes.Burner}, | ||
icatypes.ModuleName: nil, |
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.
👍
app/app.go
Outdated
@@ -290,7 +300,7 @@ func NewWasmApp( | |||
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, | |||
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, | |||
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, | |||
feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, | |||
feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, icahosttypes.StoreKey, icacontrollertypes.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.
icacontrollertypes
not required for host role
app/app.go
Outdated
ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" | ||
icacontroller "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller" | ||
icacontrollerkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/keeper" | ||
icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" |
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.
icacontrollertypes
is not required for host role
app/app.go
Outdated
@@ -74,6 +74,14 @@ import ( | |||
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" | |||
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" | |||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | |||
ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" | |||
icacontroller "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller" |
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.
icacontroller
is not required for the host role
app/app.go
Outdated
// See https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/integration.md | ||
// "Note: No `icaauth` exists, this must be substituted with an actual Interchain Accounts authentication module" | ||
var icaAuthModule porttypes.IBCModule | ||
icaControllerIBCModule := icacontroller.NewIBCModule(app.icaControllerKeeper, icaAuthModule) |
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.
let's not have ica controller setup here
app/app.go
Outdated
@@ -508,11 +529,11 @@ func NewWasmApp( | |||
} | |||
ibcRouter. | |||
AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.ibcKeeper.ChannelKeeper)). | |||
AddRoute(ibctransfertypes.ModuleName, transferIBCModule) | |||
AddRoute(ibctransfertypes.ModuleName, transferIBCModule). | |||
AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). |
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.
remove this line for the just host role only
app/app.go
Outdated
@@ -718,6 +743,8 @@ func NewWasmApp( | |||
app.scopedIBCKeeper = scopedIBCKeeper | |||
app.scopedTransferKeeper = scopedTransferKeeper | |||
app.scopedWasmKeeper = scopedWasmKeeper | |||
app.scopedICAHostKeeper = scopedICAHostKeeper | |||
app.scopedICAControllerKeeper = scopedICAControllerKeeper |
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.
no controller needed
app/app.go
Outdated
@@ -865,6 +892,8 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino | |||
paramsKeeper.Subspace(crisistypes.ModuleName) | |||
paramsKeeper.Subspace(ibctransfertypes.ModuleName) | |||
paramsKeeper.Subspace(ibchost.ModuleName) | |||
paramsKeeper.Subspace(icahosttypes.SubModuleName) | |||
paramsKeeper.Subspace(icacontrollertypes.SubModuleName) |
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.
no controller needed
AddRoute(ibctransfertypes.ModuleName, transferIBCModule) | ||
AddRoute(ibctransfertypes.ModuleName, transferIBCModule). | ||
AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). | ||
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) |
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.
👍
Reference: CosmWasm/wasmd#837 https://ibc.cosmos.network/main/migrations/v2-to-v3.html#upgrade-proposal https://github.com/cosmos/gaia/blob/6742b7158a9b7abf28e3615143620e759cb8307d/app/upgrades/v7/upgrades.go#L15 https://github.com/cosmos/gaia/blob/a4e9d1171d6ab82c95e96bd65c7366d6dee87a49/app/upgrades/v8/upgrades.go#L119 fix
Reference: CosmWasm/wasmd#837 https://ibc.cosmos.network/main/migrations/v2-to-v3.html#upgrade-proposal https://github.com/cosmos/gaia/blob/6742b7158a9b7abf28e3615143620e759cb8307d/app/upgrades/v7/upgrades.go#L15 https://github.com/cosmos/gaia/blob/a4e9d1171d6ab82c95e96bd65c7366d6dee87a49/app/upgrades/v8/upgrades.go#L119
Based on
gaiad
integration (for host) and referencing #793 for the ice controller setup.Closes #806
Replaces #793
This enables ICA on the default wasmd application. However, it is very unclear how to add proper icaController support.
TODO:
Please see #839 for updates to use icaAuth