From 59d28a735bc3f3ae10f510ed5ae85f92075b3552 Mon Sep 17 00:00:00 2001 From: dusan-maksimovic Date: Tue, 12 Mar 2024 14:47:55 +0100 Subject: [PATCH 1/4] added ADR for ICA controller module on Hub Co-authored-by: Stana Miric --- .../adr/adr-003-ica-controller.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/docs/architecture/adr/adr-003-ica-controller.md diff --git a/docs/docs/architecture/adr/adr-003-ica-controller.md b/docs/docs/architecture/adr/adr-003-ica-controller.md new file mode 100644 index 00000000000..7ebd10ed825 --- /dev/null +++ b/docs/docs/architecture/adr/adr-003-ica-controller.md @@ -0,0 +1,35 @@ +# ADR 003: Interchain Accounts Controller Module + +## Changelog + +- 2024-03-08: Initial Draft + +## Status + +DRAFT + +## 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. + +## Consequences + +### Positive + +Users of the Hub will have a possibility to create and utilize Interchain Accounts on other IBC connected chains. + +### Negative + +### Neutral + +## References + +[https://github.com/cosmos/gaia/issues/2869](https://github.com/cosmos/gaia/issues/2869) \ No newline at end of file From c5f88348a7b4266afec580c0c871a4b02e8de9df Mon Sep 17 00:00:00 2001 From: dusan-maksimovic Date: Tue, 12 Mar 2024 15:21:50 +0100 Subject: [PATCH 2/4] CR changes --- .../adr/adr-003-ica-controller.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/docs/architecture/adr/adr-003-ica-controller.md b/docs/docs/architecture/adr/adr-003-ica-controller.md index 7ebd10ed825..2a399ac0058 100644 --- a/docs/docs/architecture/adr/adr-003-ica-controller.md +++ b/docs/docs/architecture/adr/adr-003-ica-controller.md @@ -20,16 +20,41 @@ Enabling the ICA Controller module on the Hub would support various use cases. O 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. +- 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) \ No newline at end of file From f204a8a716f3bde1c3ba1b9bb09f7425a66db60d Mon Sep 17 00:00:00 2001 From: Dusan Maksimovic <94966669+dusan-maksimovic@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:54:13 +0100 Subject: [PATCH 3/4] Update docs/docs/architecture/adr/adr-003-ica-controller.md Co-authored-by: Marius Poke --- docs/docs/architecture/adr/adr-003-ica-controller.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/architecture/adr/adr-003-ica-controller.md b/docs/docs/architecture/adr/adr-003-ica-controller.md index 2a399ac0058..3a5dfd93314 100644 --- a/docs/docs/architecture/adr/adr-003-ica-controller.md +++ b/docs/docs/architecture/adr/adr-003-ica-controller.md @@ -6,7 +6,7 @@ ## Status -DRAFT +Proposed ## Abstract From 18450ad9c25d701b37fbe7f30443b735292b34d3 Mon Sep 17 00:00:00 2001 From: dusan-maksimovic Date: Tue, 19 Mar 2024 15:04:52 +0100 Subject: [PATCH 4/4] Added entry for adr-003 to readme.md Co-authored-by: Stana Miric --- docs/docs/architecture/adr/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/architecture/adr/README.md b/docs/docs/architecture/adr/README.md index bbf11bd7e2f..cafebc71202 100644 --- a/docs/docs/architecture/adr/README.md +++ b/docs/docs/architecture/adr/README.md @@ -53,7 +53,7 @@ They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.o ### Proposed -- n/a +- [ADR 003: Interchain Accounts Controller Module](./adr-003-ica-controller.md) ### Draft