-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
IBC SDK specification #5426
IBC SDK specification #5426
Changes from 3 commits
2f5141a
07739be
98c3918
d186577
dffd713
3a4c822
a296964
c4f3df7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- | ||
order: 1 | ||
--> | ||
|
||
# Concepts | ||
|
||
> NOTE: if you are not familiar with the IBC terminology and concepts, please read | ||
this [document](https://github.com/cosmos/ics/blob/master/ibc/1_IBC_TERMINOLOGY.md) as prerequisite reading. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- | ||
order: 2 | ||
--> | ||
|
||
# State | ||
|
||
The paths for the values stored in state can be found [here](https://github.com/cosmos/ics/blob/master/spec/ics-024-host-requirements/README.md#path-space). Additionally, the SDK adds | ||
a prefix to the path to be able to aggregate the values for querying purposes. | ||
|
||
| Prefix | Path | Value type | | ||
|--------|------------------------------------------------------------------------|----------------| | ||
| "0/" | "clients/{identifier}" | ClientState | | ||
| "0/" | "clients/{identifier}/consensusState" | ConsensusState | | ||
| "0/" | "clients/{identifier}/type" | ClientType | | ||
| "0/" | "connections/{identifier}" | ConnectionEnd | | ||
| "0/" | "ports/{identifier}" | CapabilityKey | | ||
| "0/" | "ports/{identifier}/channels/{identifier}" | ChannelEnd | | ||
| "0/" | "ports/{identifier}/channels/{identifier}/key" | CapabilityKey | | ||
| "0/" | "ports/{identifier}/channels/{identifier}/nextSequenceRecv" | uint64 | | ||
| "0/" | "ports/{identifier}/channels/{identifier}/packets/{sequence}" | bytes | | ||
| "0/" | "ports/{identifier}/channels/{identifier}/acknowledgements/{sequence}" | bytes | |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!-- | ||
order: 4 | ||
--> | ||
|
||
# Messages | ||
|
||
In this section we describe the processing of the IBC messages and the corresponding updates to the state. | ||
|
||
## ICS 02 - Client | ||
|
||
### MsgCreateClient | ||
|
||
A light client is created using the `MsgCreateClient`. | ||
|
||
```go | ||
type MsgCreateClient struct { | ||
ClientID string | ||
ClientType string | ||
ConsensusState ConsensusState | ||
Signer AccAddress | ||
} | ||
``` | ||
|
||
This message is expected to fail if: | ||
|
||
- `ClientID` is invalid (not alphanumeric or not within 10-20 characters) | ||
- `ClientType` is not registered | ||
- `ConsensusState` is empty | ||
- `Signer` is empty | ||
- A light client with the provided id and type already exist | ||
|
||
The message creates and stores a light client with the given ID and consensus type, | ||
stores the validator set as the `Commiter` of the given consensus state and stores | ||
both the consensus state and its commitment root (i.e app hash). | ||
|
||
### MsgUpdateClient | ||
|
||
A light client is updated with a new header using the `MsgUpdateClient`. | ||
|
||
```go | ||
type MsgUpdateClient struct { | ||
ClientID string | ||
Header Header | ||
Signer AccAddress | ||
} | ||
``` | ||
|
||
This message is expected to fail if: | ||
|
||
- `ClientID` is invalid (not alphanumeric or not within 10-20 characters) | ||
- `Header` is empty | ||
- `Signer` is empty | ||
- A Client hasn't been created for the given ID | ||
- the header's client type is different from the registered one | ||
- the client is frozen due to misbehaviour and cannot be updated | ||
|
||
The message validates the header and updates the consensus state with the new | ||
height, commitment root and validator sets, which are then stored. | ||
|
||
## ICS 03 - Connection | ||
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. Documentation to be added? |
||
|
||
## ICS 04 - Channels | ||
|
||
### MsgChannelOpenInit | ||
|
||
A channel handshake is initiated by a chain A using the `MsgChannelOpenInit` | ||
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. Why specifically a "chain A"? |
||
message. | ||
|
||
```go | ||
type MsgChannelOpenInit struct { | ||
PortID string | ||
ChannelID string | ||
Channel Channel | ||
Signer sdk.AccAddress | ||
} | ||
``` | ||
|
||
This message is expected to fail if: | ||
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. When will it fail? |
||
|
||
## ICS 20 - Fungible Token Transfer |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!-- | ||
order: 5 | ||
--> | ||
|
||
# Callbacks |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
<!-- | ||
order: 6 | ||
--> | ||
|
||
# Events | ||
|
||
The IBC module emits the following events: | ||
|
||
## ICS 02 - Client | ||
|
||
### MsgCreateClient | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|---------------|---------------|-----------------| | ||
| create_client | client_id | {clientID} | | ||
| message | module | ibc_client | | ||
| message | action | create_client | | ||
| message | sender | {signer} | | ||
|
||
### MsgUpdateClient | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|---------------|---------------|-----------------| | ||
| update_client | client_id | {clientID} | | ||
| message | module | ibc_client | | ||
| message | action | update_client | | ||
| message | sender | {signer} | | ||
|
||
### MsgSubmitMisbehaviour | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|---------------------|---------------|---------------------| | ||
| client_misbehaviour | client_id | {clientID} | | ||
| message | module | evidence | | ||
| message | action | client_misbehaviour | | ||
| message | sender | {signer} | | ||
|
||
## ICS 03 - Connection | ||
|
||
### MsgConnectionOpenInit | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|----------------------|------------------------|-------------------------| | ||
| connection_open_init | connection_id | {connectionID} | | ||
| connection_open_init | client_id | {clientID} | | ||
| connection_open_init | counterparty_client_id | {counterparty.clientID} | | ||
| message | module | ibc_connection | | ||
| message | action | connection_open_init | | ||
| message | sender | {signer} | | ||
|
||
### MsgConnectionOpenTry | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|---------------------|---------------|---------------------| | ||
| connection_open_try | connection_id | {connectionID} | | ||
| connection_open_try | client_id | {clientID} | | ||
| message | module | ibc_connection | | ||
| message | action | connection_open_try | | ||
| message | sender | {signer} | | ||
|
||
### MsgConnectionOpenAck | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|----------------------|------------------------|-------------------------| | ||
| connection_open_ack | connection_id | {connectionID} | | ||
| connection_open_ack | client_id | {clientID} | | ||
| connection_open_init | counterparty_client_id | {counterparty.clientID} | | ||
| message | module | ibc_connection | | ||
| message | action | connection_open_ack | | ||
| message | sender | {signer} | | ||
|
||
### MsgConnectionOpenConfirm | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|-------------------------|---------------|-------------------------| | ||
| connection_open_confirm | connection_id | {connectionID} | | ||
| message | module | ibc_connection | | ||
| message | action | connection_open_confirm | | ||
| message | sender | {signer} | | ||
|
||
## ICS 04 - Channel | ||
|
||
### MsgChannelOpenInit | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|-------------------|-------------------------|----------------------------------| | ||
| channel_open_init | port_id | {portID} | | ||
| channel_open_init | channel_id | {channelID} | | ||
| channel_open_init | counterparty_port_id | {channel.counterparty.portID} | | ||
| channel_open_init | counterparty_channel_id | {channel.counterparty.channelID} | | ||
| channel_open_init | connection_id | {channel.connectionHops} | | ||
| message | module | ibc_channel | | ||
| message | action | channel_open_init | | ||
| message | sender | {signer} | | ||
|
||
### MsgChannelOpenTry | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|------------------|-------------------------|----------------------------------| | ||
| channel_open_try | port_id | {portID} | | ||
| channel_open_try | channel_id | {channelID} | | ||
| channel_open_try | counterparty_port_id | {channel.counterparty.portID} | | ||
| channel_open_try | counterparty_channel_id | {channel.counterparty.channelID} | | ||
| channel_open_try | connection_id | {channel.connectionHops} | | ||
| message | module | ibc_channel | | ||
| message | action | channel_open_try | | ||
| message | sender | {signer} | | ||
|
||
### MsgChannelOpenAck | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|------------------|---------------|------------------| | ||
| channel_open_ack | port_id | {portID} | | ||
| channel_open_ack | channel_id | {channelID} | | ||
| message | module | ibc_channel | | ||
| message | action | channel_open_ack | | ||
| message | sender | {signer} | | ||
|
||
### MsgChannelOpenConfirm | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|----------------------|---------------|----------------------| | ||
| channel_open_confirm | port_id | {portID} | | ||
| channel_open_confirm | channel_id | {channelID} | | ||
| message | module | ibc_channel | | ||
| message | action | channel_open_confirm | | ||
| message | sender | {signer} | | ||
|
||
### MsgChannelCloseInit | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|--------------------|---------------|--------------------| | ||
| channel_close_init | port_id | {portID} | | ||
| channel_close_init | channel_id | {channelID} | | ||
| message | module | ibc_channel | | ||
| message | action | channel_close_init | | ||
| message | sender | {signer} | | ||
|
||
### MsgChannelCloseConfirm | ||
|
||
| Type | Attribute Key | Attribute Value | | ||
|-----------------------|---------------|-----------------------| | ||
| channel_close_confirm | port_id | {portID} | | ||
| channel_close_confirm | channel_id | {channelID} | | ||
| message | module | ibc_channel | | ||
| message | action | channel_close_confirm | | ||
| message | sender | {signer} | |
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.
This will no longer be true once the new store layout is implemented, correct?