Skip to content

Commit 0b1f3d8

Browse files
dusan-maksimovicstana-miricMSalopekmpoke
authored
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]>
1 parent 0192205 commit 0b1f3d8

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

docs/docs/architecture/adr/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.o
5353

5454
### Proposed
5555

56-
- n/a
56+
- [ADR 003: Interchain Accounts Controller Module](./adr-003-ica-controller.md)
5757

5858
### Draft
5959

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ADR 003: Interchain Accounts Controller Module
2+
3+
## Changelog
4+
5+
- 2024-03-08: Initial Draft
6+
7+
## Status
8+
9+
Proposed
10+
11+
## Abstract
12+
13+
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.
14+
15+
## Context
16+
17+
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.
18+
19+
## Decision
20+
21+
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.
22+
23+
```go
24+
// ICA Controller keeper
25+
appKeepers.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
26+
appCodec,
27+
appKeepers.keys[icacontrollertypes.StoreKey],
28+
appKeepers.GetSubspace(icacontrollertypes.SubModuleName),
29+
appKeepers.IBCKeeper.ChannelKeeper, // ICS4Wrapper
30+
appKeepers.IBCKeeper.ChannelKeeper,
31+
&appKeepers.IBCKeeper.PortKeeper,
32+
appKeepers.ScopedICAControllerKeeper,
33+
bApp.MsgServiceRouter(),
34+
)
35+
36+
// Create ICA module
37+
appKeepers.ICAModule = ica.NewAppModule(&appKeepers.ICAControllerKeeper, &appKeepers.ICAHostKeeper)
38+
39+
// Create Interchain Accounts Controller Stack
40+
var icaControllerStack porttypes.IBCModule = icacontroller.NewIBCMiddleware(nil, appKeepers.ICAControllerKeeper)
41+
42+
// Add Interchain Accounts Controller IBC route
43+
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerStack)
44+
```
45+
46+
## Consequences
47+
48+
### Positive
49+
50+
- Users of the Hub will have a possibility to create and utilize Interchain Accounts on other IBC connected chains.
51+
52+
### Negative
53+
54+
### Neutral
55+
56+
- 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.
57+
58+
## References
59+
60+
[https://github.com/cosmos/gaia/issues/2869](https://github.com/cosmos/gaia/issues/2869)

0 commit comments

Comments
 (0)