-
Notifications
You must be signed in to change notification settings - Fork 717
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: ADR for introducing ICA Controller module on the Hub (#2994)
* added ADR for ICA controller module on Hub Co-authored-by: Stana Miric <[email protected]> * CR changes * Update docs/docs/architecture/adr/adr-003-ica-controller.md Co-authored-by: Marius Poke <[email protected]> * Added entry for adr-003 to readme.md Co-authored-by: Stana Miric <[email protected]> --------- Co-authored-by: Stana Miric <[email protected]> Co-authored-by: MSalopek <[email protected]> Co-authored-by: Marius Poke <[email protected]>
- Loading branch information
1 parent
0192205
commit 0b1f3d8
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# ADR 003: Interchain Accounts Controller Module | ||
|
||
## Changelog | ||
|
||
- 2024-03-08: Initial Draft | ||
|
||
## Status | ||
|
||
Proposed | ||
|
||
## Abstract | ||
|
||
The Interchain Accounts Controller IBC module allows users of one chain to create and control accounts on other chains. The Hub currently doesn't have ICA Controller module enabled, so it is not possible to create accounts on other chains from the Hub chain. | ||
|
||
## Context | ||
|
||
Enabling the ICA Controller module on the Hub would support various use cases. One such case could be the provider-based governance that would allow the ATOM stakers to participate in a governance on consumer chains. | ||
|
||
## Decision | ||
|
||
The ICA Controller module will be included in the application, so the Hub will have both ICA Host and Controller modules. The implementation will use the Controller module's built-in authentication mechanism, since we don't have a need for custom authentication logic. According to this, users will directly use `MsgRegisterInterchainAccount` and `MsgSendTx` messages defined by the Controller module. The possibility provided by the Controller module to define underlaying application to have custom processing of IBC messages exchanged by the Controller module (e.g. `OnChanOpenInit`, `OnAcknowledgementPacket`, etc.) will not be used, since there is currently no need for this. | ||
|
||
```go | ||
// ICA Controller keeper | ||
appKeepers.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( | ||
appCodec, | ||
appKeepers.keys[icacontrollertypes.StoreKey], | ||
appKeepers.GetSubspace(icacontrollertypes.SubModuleName), | ||
appKeepers.IBCKeeper.ChannelKeeper, // ICS4Wrapper | ||
appKeepers.IBCKeeper.ChannelKeeper, | ||
&appKeepers.IBCKeeper.PortKeeper, | ||
appKeepers.ScopedICAControllerKeeper, | ||
bApp.MsgServiceRouter(), | ||
) | ||
|
||
// Create ICA module | ||
appKeepers.ICAModule = ica.NewAppModule(&appKeepers.ICAControllerKeeper, &appKeepers.ICAHostKeeper) | ||
|
||
// Create Interchain Accounts Controller Stack | ||
var icaControllerStack porttypes.IBCModule = icacontroller.NewIBCMiddleware(nil, appKeepers.ICAControllerKeeper) | ||
|
||
// Add Interchain Accounts Controller IBC route | ||
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerStack) | ||
``` | ||
|
||
## Consequences | ||
|
||
### Positive | ||
|
||
- Users of the Hub will have a possibility to create and utilize Interchain Accounts on other IBC connected chains. | ||
|
||
### Negative | ||
|
||
### Neutral | ||
|
||
- Since we don't need to implement a custom authentication mechanism, we can rely on the one defined by the Controller module itself, implemented through the `MsgRegisterInterchainAccount` and `MsgSendTx` messages. | ||
|
||
## References | ||
|
||
[https://github.com/cosmos/gaia/issues/2869](https://github.com/cosmos/gaia/issues/2869) |