-
Notifications
You must be signed in to change notification settings - Fork 628
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
docs: ics27 v6 documentation updates #2561
Changes from 9 commits
2edcdb0
821f40d
41322fc
489736b
57df559
0002d6b
52cbf32
dd686b8
965905f
a41be5d
4b88cd7
76d978d
eb0e396
fa514e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!-- | ||
order: 3 | ||
order: 2 | ||
--> | ||
|
||
# Integration | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!-- | ||
order: 3 | ||
--> | ||
|
||
# Messages | ||
|
||
## `MsgRegisterInterchainAccount` | ||
|
||
An Interchain Accounts channel handshake can be initated using `MsgRegisterInterchainAccount`: | ||
|
||
```go | ||
type MsgRegisterInterchainAccount struct { | ||
Owner string | ||
ConnectionID string | ||
Version string | ||
} | ||
``` | ||
|
||
This message is expected to fail if: | ||
|
||
- `Owner` is an empty string. | ||
- `ConnectionID` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). | ||
|
||
This message will construct a new `MsgChannelOpenInit` on chain and route it to the core IBC message server to initiate the opening step of the channel handshake. | ||
|
||
The controller module will generate a new port identifier and claim the associated port capability. The caller is expected to provide an appropriate application version string. For example, this may be an ICS27 JSON encoded `Metadata` type or an ICS29 JSON encoded `Metadata` type with a nested application version. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add some links to the each of the |
||
If the `Version` string omitted the application will construct a default version string in the `OnChanOpenInit` handshake callback. | ||
damiannolan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```go | ||
type MsgRegisterInterchainAccountResponse struct { | ||
ChannelID string | ||
} | ||
``` | ||
|
||
The `ChannelID` is return in the message response. | ||
|
||
|
||
## `MsgSendTx` | ||
|
||
An Interchain Accounts transaction can be executed on a remote host chain by sending a `MsgSendTx` from the corresponding controller chain: | ||
|
||
```go | ||
type MsgSendTx struct { | ||
Owner string | ||
ConnectionID string | ||
PacketData InterchainAccountPacketData | ||
RelativeTimeout uint64 | ||
} | ||
``` | ||
|
||
This message is expected to fail if: | ||
|
||
- `Owner` is an empty string. | ||
- `ConnectionID` is invalid (see [24-host naming requirements](https://github.com/cosmos/ibc/blob/master/spec/core/ics-024-host-requirements/README.md#paths-identifiers-separators)). | ||
- `PacketData` contains an `UNSPECIFIED` type enum, the length of `Data` bytes is zero or the `Memo` field exceeds `256` characters in length. | ||
damiannolan marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we talk somewhere (maybe in a CLI section) about the cli to construct the packet data? Otherwise it might be difficult for users to know that it is available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And maybe it's also worth explaining how to use the query for packet events to see what happened with the message(s) executed on the host? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
- `RelativeTimeout` is zero. | ||
|
||
This message will create a new IBC packet with the provided `PacketData` and send it via the channel associated with the `Owner` and `ConnectionID`. | ||
The `PacketData` is expected to contain a list of serialized `[]sdk.Msg` in the form of `CosmosTx`. Please note the signer field of each `sdk.Msg` must be the interchain account address. | ||
When the packet is relayed to the host chain, the `PacketData` is unmarshalled and the messages are authenticated and executed. | ||
|
||
```go | ||
type MsgSendTxResponse struct { | ||
Sequence uint64 | ||
} | ||
``` | ||
|
||
The packet `Sequence` is returned in the message response. | ||
|
||
### Atomicity | ||
|
||
As the Interchain Accounts module supports the execution of multiple transactions using the Cosmos SDK `Msg` interface, it provides the same atomicity guarantees as Cosmos SDK-based applications, leveraging the [`CacheMultiStore`](https://docs.cosmos.network/main/core/store.html#cachemultistore) architecture provided by the [`Context`](https://docs.cosmos.network/main/core/context.html) type. | ||
|
||
This provides atomic execution of transactions when using Interchain Accounts, where state changes are only committed if all `Msg`s succeed. | ||
Comment on lines
+120
to
+124
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved this section from the transactions.md file and removed it since the other points were regarding auth modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,35 +4,28 @@ order: 1 | |
|
||
# Overview | ||
|
||
Learn about what the Interchain Accounts module is, and how to build custom modules that utilize Interchain Accounts functionality {synopsis} | ||
|
||
Learn about what the Interchain Accounts module is {synopsis} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've trimmed down the |
||
|
||
## What is the Interchain Accounts module? | ||
|
||
Interchain Accounts is the Cosmos SDK implementation of the ICS-27 protocol, which enables cross-chain account management built upon IBC. Chains using the Interchain Accounts module can programmatically create accounts on other chains and control these accounts via IBC transactions. | ||
|
||
Interchain Accounts exposes a simple-to-use API which means IBC application developers do not require an in-depth knowledge of the underlying low-level details of IBC or the ICS-27 protocol. | ||
Interchain Accounts is the Cosmos SDK implementation of the ICS-27 protocol, which enables cross-chain account management built upon IBC. | ||
|
||
Developers looking to build upon Interchain Accounts must write custom logic in their own IBC application module, called authentication modules. | ||
- How does an interchain account differ from a regular account? | ||
|
||
- How is an interchain account different than a regular account? | ||
|
||
Regular accounts use a private key to sign transactions on-chain. Interchain Accounts are instead controlled programmatically by separate chains via IBC transactions. Interchain Accounts are implemented as sub-accounts of the interchain accounts module account. | ||
Regular accounts use a private key to sign transactions. Interchain Accounts are instead controlled programmatically by counterparty chains via IBC packets. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was incorrect, transactions are not signed on chain. |
||
|
||
## Concepts | ||
|
||
`Host Chain`: The chain where the interchain account is registered. The host chain listens for IBC packets from a controller chain which should contain instructions (e.g. cosmos SDK messages) for which the interchain account will execute. | ||
|
||
`Controller Chain`: The chain registering and controlling an account on a host chain. The controller chain sends IBC packets to the host chain to control the account. A controller chain must have at least one interchain accounts authentication module in order to act as a controller chain. | ||
`Host Chain`: The chain where the interchain account is registered. The host chain listens for IBC packets from a controller chain which should contain instructions (e.g. Cosmos SDK messages) for which the interchain account will execute. | ||
|
||
`Authentication Module`: A custom IBC application module on the controller chain that uses the Interchain Accounts module API to build custom logic for the creation & management of interchain accounts. For a controller chain to utilize the interchain accounts module functionality, an authentication module is required. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we still keep this but say that authentication modules are deprecated? |
||
`Controller Chain`: The chain registering and controlling an account on a host chain. The controller chain sends IBC packets to the host chain to control the account. | ||
|
||
`Interchain Account`: An account on a host chain. An interchain account has all the capabilities of a normal account. However, rather than signing transactions with a private key, a controller chain's authentication module will send IBC packets to the host chain which signals what transactions the interchain account should execute. | ||
`Interchain Account`: An account on a host chain created using the ICS-27 protocol. An interchain account has all the capabilities of a normal account. However, rather than signing transactions with a private key, a controller chain will send IBC packets to the host chain which signals what transactions the interchain account should execute. | ||
|
||
## SDK Security Model | ||
|
||
SDK modules on a chain are assumed to be trustworthy. For example, there are no checks to prevent an untrustworthy module from accessing the bank keeper. | ||
|
||
The implementation of ICS27 on ibc-go uses this assumption in its security considerations. The implementation assumes the authentication module will not try to open channels on owner addresses it does not control. | ||
The implementation of ICS-27 in ibc-go uses this assumption in its security considerations. | ||
|
||
The implementation assumes other IBC application modules will not bind to ports within the ICS27 namespace. | ||
The implementation assumes other IBC application modules will not bind to ports within the ICS-27 namespace. |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the note at the end here still valid, "Future versions of 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." The link forOrdered Channels
suggests there's a possible flag to allow that channel to remain openordered_allow_timeout channels
. I apologize if I misunderstood the reference document. I'm new to IBC and ICAThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @anthonyra, thanks for raising this. To answer your question:
Yes, the note here is still valid. The current implementation in
ibc-go/v6
still remains to useORDERED
channels. IBC core has yet to be updated to accommodate theORDERED_ALLOW_TIMEOUT
channel type, but when this work is implemented we will be sure to leverage it in ICA.Please see:
This will also likely require Channel Upgrades - #1599 to make this all happen!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I'll take a peek at all of those to get a better understanding. I wonder if the document linked should have references to those as well to indicate a work in progress? Thank you for the guidance!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think @anthonyra 's suggestion could make sense, to add a link to the WIP tracking issues for order timeouts and channel upgrades. but this can also be added later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thanks for the feedback @anthonyra and @charleenfei :)