Skip to content
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

Merged
merged 2 commits into from
May 4, 2022
Merged

Initial ICA integration #837

merged 2 commits into from
May 4, 2022

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented May 4, 2022

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

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?
Copy link
Member Author

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.

Copy link
Contributor

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

@ethanfrey ethanfrey added this to the v0.27.0 milestone May 4, 2022
@ethanfrey ethanfrey mentioned this pull request May 4, 2022
@ethanfrey ethanfrey changed the title Initial ICA integration, missing auth setup Initial ICA integration May 4, 2022
@codecov
Copy link

codecov bot commented May 4, 2022

Codecov Report

Merging #837 (38932b7) into main (7b78b7e) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
app/app.go 88.30% <100.00%> (+0.59%) ⬆️

@ethanfrey ethanfrey marked this pull request as ready for review May 4, 2022 11:28
@ethanfrey ethanfrey requested a review from alpe as a code owner May 4, 2022 11:28
@ethanfrey
Copy link
Member Author

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.

Copy link
Contributor

@alpe alpe left a 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

app/app.go Outdated Show resolved Hide resolved
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,
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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)
Copy link
Contributor

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).
Copy link
Contributor

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
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ethanfrey
Copy link
Member Author

Removed all controller code in 38932b7 as we only use host mode here

Added it back in #839 as 9b8fb98 which can be used as a good start for any real controller+auth integration

@ethanfrey ethanfrey merged commit bef8a31 into main May 4, 2022
youngjoon-lee added a commit to medibloc/panacea-core that referenced this pull request Feb 4, 2023
@alpe alpe deleted the interchain-accounts branch May 10, 2023 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to ibc-go v3
2 participants