Skip to content

Commit

Permalink
docs: active channel description (#787)
Browse files Browse the repository at this point in the history
* docs: adding active channels explanation

* change ordering

* updating config and adding more docs

* Update docs/app-modules/interchain-accounts/active-channels.md

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* Update docs/app-modules/interchain-accounts/active-channels.md

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* Update docs/app-modules/interchain-accounts/active-channels.md

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

* Update docs/app-modules/interchain-accounts/active-channels.md

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
  • Loading branch information
seantking and crodriguezvega authored Jan 28, 2022
1 parent 19b5b5f commit 3c2f2eb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ module.exports = {
directory: false,
path: "/app-modules/interchain-accounts/auth-modules.html"
},
{
title: "Active Channels",
directory: false,
path: "/app-modules/interchain-accounts/active-channels.html"
},
{
title: "Integration",
directory: false,
Expand Down
25 changes: 25 additions & 0 deletions docs/app-modules/interchain-accounts/active-channels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
order: 3
-->

# Understanding Active Channels

The Interchain Accounts module uses [ORDERED channels](https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#ordering) to maintain the order of transactions when sending packets from a controller to a host chain. A limitation when using ORDERED channels is that when a packet times out the channel will be closed.

In the case of a channel closing, a controller chain needs to be able to regain access to the interchain account registered on this channel. `Active Channels` enable this functionality. Future versions of the ICS-27 protocol and the Interchain Accounts module will likely use a new
channel type that provides ordering of packets without the channel closing on timing out, thus removing the need for `Active Channels` entirely.

When an Interchain Account is registered using the `RegisterInterchainAccount` API, a new channel is created on a particular port. During the `OnChanOpenAck` and `OnChanOpenConfirm` steps (controller & host chain) the `Active Channel` for this interchain account
is stored in state.

It is possible to create a new channel using the same controller chain portID if the previously set `Active Channel` is now in a `CLOSED` state. This channel creation can be initialized programatically by sending a new `OnChanOpenInit` message like so:

```go
msg := channeltypes.NewMsgChannelOpenInit(portID, string(versionBytes), channeltypes.ORDERED, []string{connectionID}, icatypes.PortID, icatypes.ModuleName)
handler := k.msgRouter.Handler(msg)
```

Alternatively, any relayer operator may initiate a new channel handshake for this interchain account once the previously set `Active Channel` is in a `CLOSED` state. This is done by initiating the channel handshake on the controller chain using the same portID associated with the interchain account in question.

It is important to note that once a channel has been opened for a given Interchain Account, new channels can not be opened for this account until the currently set `Active Channel` is set to `CLOSED`.

2 changes: 1 addition & 1 deletion docs/app-modules/interchain-accounts/transactions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
order: 5
order: 6
-->

# Transactions
Expand Down

0 comments on commit 3c2f2eb

Please sign in to comment.