Skip to content
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

Sei ibc v3.2.0 #34

Merged
merged 51 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ef86156
call packet.GetSequence() rather than passing the func as argument (b…
mergify[bot] Mar 21, 2022
901d0a7
add versions for new releases (#1175) (#1183)
mergify[bot] Mar 28, 2022
55579fc
fix typos in the controller params (#1172) (#1182)
mergify[bot] Mar 28, 2022
c8c1b9f
requirements document for ICA (#1173) (#1209)
mergify[bot] Apr 4, 2022
c6cfde1
imp: improve Logger performance (#1160) (#1218)
mergify[bot] Apr 6, 2022
9da9558
docs: replace links in apps with correct ones (#1255) (#1261)
mergify[bot] Apr 14, 2022
3b16b66
update godoc of `RegisterInterchainAccount` (#1256) (#1262)
mergify[bot] Apr 14, 2022
e98dfd4
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.1 to 0.45.3 …
mergify[bot] Apr 21, 2022
906ada0
add missing changelog entry for bump of sdk 0.45.3 (#1272) (#1277)
mergify[bot] Apr 25, 2022
495d976
fixing dead links from sdk default branch update (#1301) (#1303)
mergify[bot] Apr 27, 2022
a63b8bc
override default docsBranch (#1355) (#1390)
mergify[bot] May 17, 2022
0188718
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.3 to 0.45.4 …
mergify[bot] May 18, 2022
8c44da9
add empty keepers checking in ibc NewKeeper (backport #1284) (#1382)
mergify[bot] May 18, 2022
d479429
fix: prefix ResponseResultType enum for proto linting (#1143) (#1393)
mergify[bot] May 18, 2022
f5474c5
chore : add selected channel version to MsgChanOpenInitResponse and M…
mergify[bot] May 19, 2022
351a258
feat: Add sender to fungible_token_packet events (backport #1414) (#1…
mergify[bot] May 24, 2022
bcdb2d5
add swagger for interchain accounts (#1402) (#1411)
mergify[bot] May 24, 2022
f2083b3
add actual parameter example to denom-trace and denom-hash CLI querie…
mergify[bot] May 30, 2022
7c802b6
Emit channel close event on ordered channel close (backport #1464) (#…
mergify[bot] Jun 2, 2022
266e416
backport #1416 (#1496)
crodriguezvega Jun 8, 2022
bb95eb2
chore: improve DenomTrace grpc (backport #1342) (#1504)
mergify[bot] Jun 9, 2022
833bbb2
Emit an event to indicate a successful acknowledgement in the ICA mod…
mergify[bot] Jun 9, 2022
8a15abd
chore: Add consensus state heights query (backport #1336) (#1507)
mergify[bot] Jun 11, 2022
0085458
fix: deprecate AllowUpdateAfter...check (backport #1511) (#1521)
mergify[bot] Jun 12, 2022
4614a62
fix to correctly parse denoms with slashes in the base denom (backpor…
mergify[bot] Jun 14, 2022
c0f29de
Update CHANGELOG.md
crodriguezvega Jun 14, 2022
cece2cb
Update CHANGELOG.md
crodriguezvega Jun 14, 2022
60f8130
Update CHANGELOG.md
crodriguezvega Jun 14, 2022
4d457f1
feat: added check for wildcard * to allow all message types (#1512) (…
mergify[bot] Jun 14, 2022
3b2de10
Update versions
crodriguezvega Jun 16, 2022
8ccad34
Update config.js
crodriguezvega Jun 17, 2022
d799a6a
Delete v3-to-v4.md
crodriguezvega Jun 20, 2022
cd82a40
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.4 to 0.45.5 …
mergify[bot] Jun 20, 2022
666eecf
add migration for base denoms with slashes to docs site (#1544) (#1557)
mergify[bot] Jun 23, 2022
9e5ed3b
docs: add upgrade client proposal event (#1596) (#1635)
mergify[bot] Jul 1, 2022
945d089
feat: emitting an event when handling a client upgrade proposal (back…
mergify[bot] Jul 5, 2022
020903a
deps: bumping go version 1.18 (backport #1627) (#1656)
mergify[bot] Jul 6, 2022
910eb95
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.5 to 0.45.6 …
mergify[bot] Jul 7, 2022
39ae1aa
Update CHANGELOG.md
crodriguezvega Jul 14, 2022
27dcfa0
fix typo
crodriguezvega Jul 18, 2022
79f823e
chore: denom traces migration handler (backport #1680) (#1754)
mergify[bot] Jul 22, 2022
8714223
feat: allow governance to update the TrustingPeriod of the 07-tenderm…
mergify[bot] Jul 22, 2022
39ab1b5
fix broken link (#1776) (#1808)
mergify[bot] Jul 28, 2022
c00de0f
fix: add cosmos_proto.implements_interface (backport #1740) (#1817)
mergify[bot] Jul 29, 2022
9cecdff
fix: ics27 check packet data length explicitly over nil check (#1882)…
mergify[bot] Aug 7, 2022
5266f04
fix: prevent blocked addresses from sending ICS 20 transfers (backpor…
mergify[bot] Aug 9, 2022
c416bdc
chore: backport #1905 (#1978)
crodriguezvega Aug 11, 2022
307c549
fix: "acknowledgement written" logs unsupported type (backport #1919)…
mergify[bot] Aug 12, 2022
b3f4050
Update CHANGELOG.md
crodriguezvega Aug 12, 2022
a5b3ce1
remove workflow
Sep 12, 2023
629fca3
Bump version
Sep 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.17
- uses: technote-space/get-diff-action@v6.0.1
go-version: 1.18
- uses: technote-space/get-diff-action@v6.1.0
id: git_diff
with:
PATTERNS: |
Expand Down Expand Up @@ -69,8 +69,8 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: 1.17
- uses: technote-space/get-diff-action@v6.0.1
go-version: 1.18
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.go
Expand Down
190 changes: 189 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.18 as builder

ENV GOPATH=""
ENV GOMODULE="on"

COPY go.mod .
COPY go.sum .

RUN go mod download

ADD testing testing
ADD modules modules
ADD LICENSE LICENSE

COPY Makefile .

RUN make build

FROM ubuntu:20.04

COPY --from=builder /go/build/simd /bin/simd

ENTRYPOINT ["simd"]
40 changes: 39 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
themeConfig: {
repo: "cosmos/ibc-go",
docsRepo: "cosmos/ibc-go",
docsBranch: "main",
docsDir: "docs",
editLinks: true,
label: "ibc",
Expand All @@ -42,10 +43,42 @@ module.exports = {
"label": "v1.2.0",
"key": "v1.2.0"
},
{
"label": "v1.3.0",
"key": "v1.3.0"
},
{
"label": "v1.4.0",
"key": "v1.4.0"
},
{
"label": "v1.5.0",
"key": "v1.5.0"
},
{
"label": "v2.0.0",
"key": "v2.0.0"
}
} ,
{
"label": "v2.1.0",
"key": "v2.1.0"
},
{
"label": "v2.2.0",
"key": "v2.2.0"
},
{
"label": "v2.3.0",
"key": "v2.3.0"
},
{
"label": "v3.0.0",
"key": "v3.0.0"
},
{
"label": "v3.1.0",
"key": "v3.1.0"
}
],
topbar: {
banner: true
Expand Down Expand Up @@ -148,6 +181,11 @@ module.exports = {
{
title: "Migrations",
children: [
{
title: "Support transfer of coins whose base denom contains slashes",
directory: false,
path: "/migrations/support-denoms-with-slashes.html"
},
{
title: "SDK v0.43 to IBC-Go v1",
directory: false,
Expand Down
8 changes: 8 additions & 0 deletions docs/apps/interchain-accounts/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ For example, a Cosmos SDK based chain that elects to provide hosted Interchain A
"host_enabled": true,
"allow_messages": ["/cosmos.staking.v1beta1.MsgDelegate", "/cosmos.gov.v1beta1.MsgVote"]
}
```
There is also a special wildcard `"*"` message type which allows any type of message to be executed by the interchain account. This must be the only message in the `allow_messages` array.

```
"params": {
"host_enabled": true,
"allow_messages": ["*"]
}
```
119 changes: 119 additions & 0 deletions docs/apps/interchain-accounts/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Business requirements

> **TL;DR**: Rather than creating an IBC application to expose cross-chain access to every module's features, the Interchain Accounts feature would allow to leverage the capabilities of an account to access a blockchain's application-specific features.

## Problem

Without Interchain Accounts, cross-chain access to chain-specific features (such as staking, sending, voting, etc) has to be built as separate applications on top of the IBC TAO (Transport, Authentication, Ordering) layer. Creating new IBC application standards and implementations for each application-specific feature requires considerable time and resources. Interchain Accounts will allow new chain-specific features to be immediately available over IBC.

## Objectives

Provide a way to programmatically create accounts on a destination blockchain (called the host) and control them via transactions over IBC. An IBC packet will take a message from the controller blockchain to the host blockchain where it will be executed. This will allow new features on a blockchain to be immediately supported as IBC transactions, since the (destination blockchain) native messages are encapsulated in an IBC packet in an agnostic way. This will allow all of the modules on a chain to take advantage of the network effects created by the IBC ecosystem.

## Scope

| Features | Release |
| --------- | ------- |
| Deterministically create a new interchain account over IBC on the host chain. | v1 |
| Send over IBC a packet that contains the message to be executed by the interchain account on the host. | v1 |

# User requirements

## Use cases

### Injective <> Band Chain

Currently, Injective sends an IBC transaction to Band Chain via their custom IBC oracle module, which is a data request. When this IBC packet is executed on Band Chain, validators on Band Chain fetch prices for 10 different markets. A random selection of validators will post this selection on-chain. Once a minimum quorum has been reached, an IBC packet is sent to Injective with the prices of markets. The roundtrip latency of this flow is around 30 seconds when things go well (no packet timeouts or delays in validation).

However, Injective wants to minimise as much as possible the latency between real world price updates and price updates on Injective. They can simplify this two-transaction flow to a single transaction using Interchain Accounts: Injective opens an interchain account on Band Chain, which would be able to pay for a continuous set of update transactions and maintain a standing request for the prices of marke. This would simplify the transaction flow to a single transaction, and introduce a simple flow to update the standing request if necessary.

### Umee <> Cosmos Hub

Users on the Hub would send their ATOM to Umee. In return, the user gets equivalent amount of meTokens (this token would be a form of a liquid staking token), which could then be staked on the Hub, in some other liquidity pool, etc, in addition to other business logic which Umee could perform on behalf of the users in return for the ATOM.

Umee then stakes these ATOM tokens on the Hub on behalf of Umee (ATOMs get inflation rewards, etc). Without Interchain Accounts, Umee would have to use validator controlled multisig, because for this flow Umee needs an account on the Hub which can be controlled externally in a decentralised way. With Interchain Accounts, Umee can register an interchain account on the Hub and then receive the staking rewards for the ATOM, figure out distribution back to Umee chain, and send back to the corresponding existing account on Umee.

### Hub custodial services

The problem the Cosmos ecosystem faces is fragmentation of services. When a new chain goes live, they need to talk to custodial solutions and exchanges to integrate. Many exchanges and custodial solutions don't want to integrate tens of chains unless paid in advance.

An alternative is offering the custodial service through the Hub. When a new chain goes live, the tokens of the chain are transferred through IBC to the Hub. This means that the custodial service would just have to integrate with one chain (the Hub), rather with an arbitrary number of them.

Using Interchain Accounts, a service could be built in which a user sends tokens to an interchain account address on chain `X`, which corresponds to the registered interchain account of chain `X` on the Hub. This account would handle the token transfer to the Hub and then further on to the custodial wallet.

# Functional requirements

## Assumptions

1. Interchain account packets will rarely timeout with application-set values.
2. Cosmos-SDK modules deployed on a chain are not malicious.
3. Authentication modules may implement their own permissioning scheme.

## Features

### 1 - Configuration

| ID | Description | Verification | Status |
| --- | ----------- | ------------ | ------ |
| 1.01 | A chain shall have the ability to enable or disable Interchain Accounts controller functionality in the genesis state. | The controller parameters have a [flag](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/types/host.pb.go#L30) to enable/disable the controller submodule, and this flag [is stored during genesis initialization](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/params.go#L24). | `Implemented` |
| 1.02 | A chain shall have the ability to export the Interchain Accounts controller genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go#L47) | `Implemented` |
| 1.03 | A chain shall have the ability to initialize the Interchain Accounts controller genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go#L10) | `Implemented` |
| 1.04 | A chain shall have the ability to set the Interchain Accounts controller parameters when upgrading or via proposal. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/module_test.go#L33) | `Implemented` |
| 1.05 | A chain shall have the ability to enable or disable Interchain Accounts host functionality in the genesis state. | The host parameters have a [flag](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/types/host.pb.go#L30) to enable/disable the host submodule, and this flag [is stored during genesis initialization](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/params.go#L31) | `Implemented` |
| 1.06 | A chain shall have the ability to export the Interchain Accounts host genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go#L46) | `Implemented` |
| 1.07 | A chain shall have the ability to initialize the Interchain Accounts host genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go#L10) | `Implemented` |
| 1.08 | A chain shall have the ability to set the Interchain Accounts host parameters when upgrading or via proposal. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/module_test.go#L33) | `Implemented` |
| 1.09 | The host chain shall have the ability to whitelist what types of messages or transactions that it chooses to facilitate (e.g. it can decide that registered interchain accounts cannot execute staking messages). | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/params_test.go#L5) | `Implemented` |

### 2 - Registration

| ID | Description | Verification | Status |
| --- | ----------- | ------------ | ------ |
| 2.01 | The controller chain can programmatically create interchain accounts on the host chain that shall be controlled only by the owner account on the controller chain. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/account_test.go#L10) | `Implemented` |
| 2.02 | An interchain account shall be created by any actor without the approval of a third party (e.g. chain governance). | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/account_test.go#L10) | `Implemented` |

### 3 - Control

| ID | Description | Verification | Status |
| --- | ----------- | ------------ | ------ |
| 3.01 | The controller chain can programmatically control the interchain account by submitting transactions to be executed on the host chain on the behalf of the interchain account. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/relay_test.go#L29) | `Implemented` |
| 3.02 | Under no circumstances shall the owner account on the controller chain irretrievably lose control over the registered interchain account on the host chain. | If the channel between controller and host closes, then [a relayer can open a new channel on the existing controller port](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account.go#L16-L17). | `Implemented` |

### 4 - Host execution

| ID | Description | Verification | Status |
| --- | ----------- | ------------ | ------ |
| 4.01 | Transactions shall be executed by an interchain account on the host chain in exactly the same order in which they are submitted by the controller chain. | IBC packets with SDK messages will be sent from the controller to the host over an [ordered channel](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account.go#L60). | `Implemented` |
| 4.02 | The host shall execute only messages in the allow list. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay_test.go#L340) | `Implemented` |
| 4.03 | The controller chain shall know how the host chain will handle the transaction bytes in advance. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go#L109-L133) | `Implemented` |
| 4.04 | Each transaction submitted by the controller chain shall be executed only once by the interchain account on the host chain. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay_test.go#L248) | `Implemented` |

# Non-functional requirements

## 5 - Security

| ID | Description | Verification | Status |
| -- | ----------- | ------------ | ------ |
| 5.01 | There shall be no means for the interchain account to execute transactions that have not been submitted first by the respective owner account on the controller chain. |[Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay_test.go#L361) | `Implemented` |
| 5.02 | Every interchain account on the host chain shall have one and only one respective owner account on the controller chain. | The interchain account on the host [is generated using the host connection ID and the address of the owner on the controller](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/handshake.go#L73-L76). | `Implemented` |
| 5.03 | The owner account on a controller chain shall not be able to control interchain accounts registered by other owner accounts on the same controller chain. | Before the host logic executes the received messages, it [retrieves the interchain account associated with the port ID](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay.go#L94) over which it received the message. For owner address B to be able to execute a message with the interchain account registered with owner address A, it would need to send the messages over a channel that binds to a port ID that contains the owner address A, and since we have assumption number 3, this should not be allowed by applications. | `Implemented` |
| 5.04 | A controller chain shall not be able to control interchain accounts registered by owner accounts on different controller chains. | Same as 5.03. | `Implemented` | |
| 5.05 | Each interchain account on the host chain is owned by a single owner account on the controller chain. It shall not be possible to register a second interchain account with the same owner account on the controller chain. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account_test.go#L42) | `Implemented` |

# External interface requirements

## 6 - CLI

| ID | Description | Verification | Status |
| -- | ----------- | ------------ | ------ |
| 6.01 | There shall be a CLI command available to query the host parameters. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/client/cli/query.go#L22) | `Implemented` |
| 6.02 | There shall be a CLI command available to query the receive packet events on the host chain to check the result of the execution of the message on the host. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/client/cli/query.go#L51) | `Implemented` |
| 6.03 | There shall be a CLI command available to query the controller parameters. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/client/cli/query.go#L15) | `Implemented` |


## 7 - Application developers

| ID | Description | Verification | Status |
| -- | ----------- | ------------ | ------ |
| 7.01 | An IBC application developer shall be able to develop an Interchain Accounts authentication module that can register interchain accounts. | The [`RegisterInterchainAccount` function](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account.go#L18) is the entry point to registering an interchain account. | `Implemented` |
| 7.02 | An IBC application developer shall be able to develop an Interchain Accounts authentication module that can send messages from the controller to the host. | The [`SendTx` function](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/relay.go#L18) takes pre-built packet data containing messages to be executed on the host chain from an authentication module and attempts to send the packet. | `Implemented` |
2 changes: 1 addition & 1 deletion docs/apps/interchain-accounts/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Transactions are executed via the ICS27 [`SendTx` API](./auth-modules.md#trysend

## 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/master/core/store.html#cachemultistore) architecture provided by the [`Context`](https://docs.cosmos.network/master/core/context.html) type.
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.
Loading