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

chore: rebase v3 release branch onto main #815

Merged
merged 59 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
8c2c0a5
reorganize channel handshake handler (#647)
colin-axner Dec 21, 2021
c060673
docs: ICA Overview (#626)
seantking Dec 21, 2021
92f8bb3
update go mod for security vulnerabilities (#655)
colin-axner Dec 22, 2021
a5fadc5
update vue dependency (#662)
colin-axner Dec 22, 2021
25d4544
bump glob-parent version in json package (#663)
colin-axner Dec 22, 2021
ce4c81e
build(deps): bump actions/setup-go from 2.1.4 to 2.1.5 (#656)
dependabot[bot] Dec 22, 2021
b7fb4f1
docs: begin removal of internal "spec" directories (#634)
colin-axner Dec 22, 2021
411c440
Modify `OnChanOpenTry` application callback to perform app version ne…
colin-axner Dec 22, 2021
297df13
fix broken link (#664)
colin-axner Dec 22, 2021
ffc29d9
chore: update make build-docs, add docs build checker (#667)
colin-axner Dec 23, 2021
ce71056
register ICA query server, fix panics in params query cli (#666)
colin-axner Dec 23, 2021
f849588
update of roadmap with latest release (#653)
crodriguezvega Dec 23, 2021
4523ef5
build(deps): bump actions/checkout from 2.3.1 to 2.4.0 (#672)
dependabot[bot] Dec 23, 2021
e40cdec
allow ics20 to connect to middleware (#675)
colin-axner Jan 3, 2022
1bfa055
fix: register InterchainAccount as x/auth GenesisAccount (#676)
damiannolan Jan 3, 2022
4575650
enable mergify for backports (#678)
crodriguezvega Jan 4, 2022
c351015
build(deps): bump technote-space/get-diff-action from 5 to 6.0.1 (#684)
dependabot[bot] Jan 6, 2022
67cd1a2
update roadmap (#681)
crodriguezvega Jan 6, 2022
3ff0927
ADR 002: importing multiple ibc-go versions (#683)
colin-axner Jan 7, 2022
087bc5d
improve 04-channel logging (#692)
colin-axner Jan 7, 2022
cb9bf5d
add cli to get denom hash from trace path and base denom (#679)
nir1218 Jan 10, 2022
f5962c3
chore: separate import statements by type (#702)
crodriguezvega Jan 10, 2022
57679db
adding ICS 27 Interchain Accounts to README.md supported apps (#708)
damiannolan Jan 11, 2022
0a7ad9b
removing unused proto imports in interchain-accounts (#718)
damiannolan Jan 12, 2022
dd9c385
Merge pull request #721 from cosmos/colin/694-fix-err-msg
colin-axner Jan 13, 2022
d882b43
refactor: move ica connection identifiers from port to version metada…
damiannolan Jan 13, 2022
a4b9517
make IsValidAddr private and extend regex to account for 0 length str…
colin-axner Jan 13, 2022
5f4a90c
Update LICENSE (#728)
crodriguezvega Jan 13, 2022
5b7d362
refactor: allow ICA authentication module provided timeout timestamp …
colin-axner Jan 13, 2022
b0b52a3
Fix ambiguity in TimeoutTimestamp docs (#715)
assafmo Jan 13, 2022
e2693b0
bump docs json lock file to fix security vulnerability (#727)
colin-axner Jan 14, 2022
e28b6d1
fix: gogoproto yaml (#732)
seantking Jan 14, 2022
7415da7
refactor: no longer removing active channel mapping on close channel …
seantking Jan 14, 2022
8924ee6
refactor: reusable metadata validation (#729)
damiannolan Jan 14, 2022
e2ac503
remove amino, enforce serialize and deserialize functions to only acc…
colin-axner Jan 14, 2022
87bb391
fix: update IsRevisionFormat and IsClientIDFormat to account for newl…
colin-axner Jan 17, 2022
87b058d
add goreleaser github action to attach simd binary to releases and pr…
crodriguezvega Jan 18, 2022
bfcf9ab
docs: ica tx atomicity docs and code snippet updates (#719)
damiannolan Jan 18, 2022
89ffaaf
deps: bump vuepress-theme-cosmos (#754)
crodriguezvega Jan 18, 2022
4fb75e8
fix: remove error from ics27 channel ack (#751)
damiannolan Jan 20, 2022
60ed992
feat: adding helper fn to generate capability name for testing (#776)
seantking Jan 21, 2022
a6656a0
test: adding test for accessing interchain account after closing chan…
seantking Jan 21, 2022
f822756
Replace github.com/pkg/errors with stdlib errors (#775)
dkmccandless Jan 21, 2022
01c5848
update roadmap (#735)
crodriguezvega Jan 22, 2022
e19623f
fix: resolve proto lint failure - buf.yaml (#781)
damiannolan Jan 24, 2022
d7bf2a8
feat: query host chain msg events via cli (#782)
damiannolan Jan 24, 2022
1da4885
docs: add MakeFile command to view docs locally (#788)
seantking Jan 26, 2022
8dfbc9c
fix: support custom chain IDs for testing (#774)
ramacarlucho Jan 26, 2022
3e6464b
chore: renaming API fns (#786)
seantking Jan 27, 2022
640ba14
build(deps): bump google.golang.org/grpc from 1.43.0 to 1.44.0 (#796)
dependabot[bot] Jan 27, 2022
4f70554
chore: restructure code logically (#804)
colin-axner Jan 27, 2022
19b5b5f
refactor: construct ics27 error acknowledgement with determinstic ABC…
colin-axner Jan 28, 2022
3c2f2eb
docs: active channel description (#787)
seantking Jan 28, 2022
54dc848
add helper function in testing package: RecvPacketWithResult (#810)
colin-axner Jan 28, 2022
f393893
chore: use connection ID in interchain account store keys (#791)
damiannolan Jan 28, 2022
90a175e
chore: remove unnecessary arg from RelayPacket testing function (#813)
colin-axner Jan 28, 2022
1c0bee5
chore: use host chain connection id in ica address generation (#790)
damiannolan Jan 28, 2022
d8c74f4
docs: adding ica docs for exclusive submodule app wiring (#809)
damiannolan Jan 28, 2022
a536701
Merge branch 'release/v3.0.x' of github.com:cosmos/ibc-go into colin/…
colin-axner Jan 31, 2022
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
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-?[a-z0-9]*' # Push events to matching v*, i.e. v1.0.0, v20.15.10, v3.0.0-alpha1

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0

- uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Release
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/setup-go@v2.1.5
with:
go-version: 1.17
- uses: technote-space/get-diff-action@v5
- uses: technote-space/get-diff-action@v6.0.1
id: git_diff
with:
PATTERNS: |
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- uses: actions/setup-go@v2.1.5
with:
go-version: 1.17
- uses: technote-space/get-diff-action@v5
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
**/**.go
Expand All @@ -113,7 +113,7 @@ jobs:
needs: tests
steps:
- uses: actions/checkout@v2.4.0
- uses: technote-space/get-diff-action@v5
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
**/**.go
Expand Down
35 changes: 35 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
before:
hooks:
- go mod tidy

builds:
- main: ./testing/simapp/simd/main.go
binary: simd
flags:
- -tags=netgo ledger
- -mod=readonly
ldflags:
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
# for goarch use defaults: 386, amd64 and arm64.

checksum:
name_template: SHA256SUMS-{{.Version}}.txt
algorithm: sha256

release:
mode: keep-existing

archives:
- name_template: "{{ .ProjectName }}_simd_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
- README.md
- RELEASES.md
- SECURITY.md
- CHANGELOG.md
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,33 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Dependencies

* [\#404](https://github.com/cosmos/ibc-go/pull/404) Bump Go version to 1.17
* (core) [\#709](https://github.com/cosmos/ibc-go/pull/709) Replace github.com/pkg/errors with stdlib errors

### API Breaking

* (testing( [\#813](https://github.com/cosmos/ibc-go/pull/813) The `ack` argument to the testing function `RelayPacket` has been removed as it is no longer needed.
* (testing) [\#774](https://github.com/cosmos/ibc-go/pull/774) Added `ChainID` arg to `SetupWithGenesisValSet` on the testing app. `Coordinator` generated ChainIDs now starts at index 1
* (transfer) [\#675](https://github.com/cosmos/ibc-go/pull/675) Transfer `NewKeeper` now takes in an ICS4Wrapper. The ICS4Wrapper may be the IBC Channel Keeper when ICS20 is not used in a middleware stack. The ICS4Wrapper is required for applications wishing to connect middleware to ICS20.
* (core) [\#650](https://github.com/cosmos/ibc-go/pull/650) Modify `OnChanOpenTry` IBC application module callback to return the negotiated app version. The version passed into the `MsgChanOpenTry` has been deprecated and will be ignored by core IBC.
* (core) [\#629](https://github.com/cosmos/ibc-go/pull/629) Removes the `GetProofSpecs` from the ClientState interface. This function was previously unused by core IBC.
* (transfer) [\#517](https://github.com/cosmos/ibc-go/pull/517) Separates the ICS 26 callback functions from `AppModule` into a new type `IBCModule` for ICS 20 transfer.
* (modules/core/02-client) [\#536](https://github.com/cosmos/ibc-go/pull/536) `GetSelfConsensusState` return type changed from bool to error.
* (channel) [\#644](https://github.com/cosmos/ibc-go/pull/644) Removes `CounterpartyHops` function from the ChannelKeeper.
* (testing) [\#776](https://github.com/cosmos/ibc-go/pull/776) Adding helper fn to generate capability name for testing callbacks


### State Machine Breaking

### Improvements

* (testing) [\#810](https://github.com/cosmos/ibc-go/pull/810) Additional testing function added to `Endpoint` type called `RecvPacketWithResult`. Performs the same functionality as the existing `RecvPacket` function but also returns the message result. `path.RelayPacket` no longer uses the provided acknowledgement argument and instead obtains the acknowledgement via MsgRecvPacket events.
* (connection) [\#721](https://github.com/cosmos/ibc-go/pull/721) Simplify connection handshake error messages when unpacking client state.
* (channel) [\#692](https://github.com/cosmos/ibc-go/pull/692) Minimize channel logging by only emitting the packet sequence, source port/channel, destination port/channel upon packet receives, acknowledgements and timeouts.
* [\#383](https://github.com/cosmos/ibc-go/pull/383) Adds helper functions for merging and splitting middleware versions from the underlying app version.
* (modules/core/05-port) [\#288](https://github.com/cosmos/ibc-go/issues/288) Making the 05-port keeper function IsBound public. The IsBound function checks if the provided portID is already binded to a module.
* (channel) [\#644](https://github.com/cosmos/ibc-go/pull/644) Adds `GetChannelConnection` to the ChannelKeeper. This function returns the connectionID and connection state associated with a channel.
* (channel) [\647](https://github.com/cosmos/ibc-go/pull/647) Reorganizes channel handshake handling to set channel state after IBC application callbacks.
* (client) [\#724](https://github.com/cosmos/ibc-go/pull/724) `IsRevisionFormat` and `IsClientIDFormat` have been updated to disallow newlines before the dash used to separate the chainID and revision number, and the client type and client sequence.

### Features

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 COSMOS
Copyright (c) 2022 COSMOS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ build-docs:
cp ~/output/$${path_prefix}/index.html ~/output ; \
done < versions ;

view-docs:
@cd docs && \
npm install && npm run serve

.PHONY: build-docs

###############################################################################
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ The Inter-Blockchain Communication protocol (IBC) allows blockchains to talk to

2.1 [ICS 20 Fungible Token Transfers](https://github.com/cosmos/ibc-go/tree/main/modules/apps/transfer)

2.2 [ICS 27 Interchain Accounts](https://github.com/cosmos/ibc-go/tree/main/modules/apps/27-interchain-accounts)

3. **Light Clients**

3.1 [ICS 07 Tendermint](https://github.com/cosmos/ibc-go/tree/main/modules/light-clients/07-tendermint)
Expand Down
31 changes: 28 additions & 3 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,42 @@ module.exports = {
{
title: "Interchain Accounts",
directory: true,
path: "/app_modules",
path: "/app-modules",
children: [
{
title: "Overview",
directory: false,
path: "/app_modules/interchain-accounts/overview.html"
path: "/app-modules/interchain-accounts/overview.html"
},
{
title: "Authentication Modules",
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,
path: "/app_modules/interchain-accounts/integration.html"
path: "/app-modules/interchain-accounts/integration.html"
},
{
title: "Parameters",
directory: false,
path: "/app-modules/interchain-accounts/parameters.html"
},
{
title: "Transactions",
directory: false,
path: "/app-modules/interchain-accounts/transactions.html"
},
{
title: "Authentication module development",
directory: false,
path: "/app_modules/interchain-accounts/ica_auth.html"
},
]
},
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`.

Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<!--
order: 3
order: 2
-->

# Building an ICA authentication module
# Building an authentication module

The controller module is used for account registration and packet sending.
Authentication modules play the role of the `Base Application` as described in [ICS30 IBC Middleware](https://github.com/cosmos/ibc/tree/master/spec/app/ics-030-middleware), and enable application developers to perform custom logic when working with the Interchain Accounts controller API. {synopsis}

The controller submodule is used for account registration and packet sending.
It executes only logic required of all controllers of interchain accounts.
The type of authentication used to manage the interchain accounts remains unspecified.
There may exist many different types of authentication which are desirable for different use cases.
Expand Down Expand Up @@ -108,9 +110,8 @@ func (im IBCModule) OnChanOpenTry(
channelID string,
chanCap *capabilitytypes.Capability,
counterparty channeltypes.Counterparty,
version,
counterpartyVersion string,
) error {
) (string, error) {
panic("UNIMPLEMENTED")
}

Expand Down Expand Up @@ -142,53 +143,40 @@ func (im IBCModule) OnRecvPacket(
) ibcexported.Acknowledgement {
panic("UNIMPLEMENTED")
}

// NegotiateAppVersion implements the IBCModule interface
func (im IBCModule) NegotiateAppVersion(
ctx sdk.Context,
order channeltypes.Order,
connectionID string,
portID string,
counterparty channeltypes.Counterparty,
proposedVersion string,
) (string, error) {
panic("UNIMPLEMENTED")
}
```

## `InitInterchainAccount`
## `RegisterInterchainAccount`

The authentication module can begin registering interchain accounts by calling `InitInterchainAccount`:
The authentication module can begin registering interchain accounts by calling `RegisterInterchainAccount`:

```go
if err := keeper.icaControllerKeeper.InitInterchainAccount(ctx, connectionID, counterpartyConnectionID, owner.String()); err != nil {
if err := keeper.icaControllerKeeper.RegisterInterchainAccount(ctx, connectionID, owner.String()); err != nil {
return err
}

return nil
```

## `TrySendTx`
## `SendTx`

The authentication module can attempt to send a packet by calling `TrySendTx`:
The authentication module can attempt to send a packet by calling `SendTx`:
```go

// Authenticate owner
// perform custom logic

// Lookup portID based on interchain account owner address
portID, err := icatypes.GeneratePortID(owner.String(), connectionID, counterpartyConnectionID)
// Construct controller portID based on interchain account owner address
portID, err := icatypes.NewControllerPortID(owner.String())
if err != nil {
return err
}

channelID, found := keeper.icaControllerKeeper.GetActiveChannelID(ctx, portID)
if !found {
return sdkerrors.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel for port %s", portId)
return sdkerrors.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel for port %s", portID)
}

// Obtain the channel capability.
// The channel capability should have been claimed by the authentication module in OnChanOpenInit
// Obtain the channel capability, claimed in OnChanOpenInit
chanCap, found := keeper.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(portID, channelID))
if !found {
return sdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability")
Expand All @@ -210,7 +198,13 @@ packetData := icatypes.InterchainAccountPacketData{
Data: data,
}

_, err = keeper.icaControllerKeeper.TrySendTx(ctx, chanCap, p, packetData)
// Obtain timeout timestamp
// An appropriate timeout timestamp must be determined based on the usage of the interchain account.
// If the packet times out, the channel will be closed requiring a new channel to be created
timeoutTimestamp := obtainTimeoutTimestamp()

// Send the interchain accounts packet, returning the packet sequence
seq, err = keeper.icaControllerKeeper.SendTx(ctx, chanCap, portID, packetData, timeoutTimestamp)
```

The data within an `InterchainAccountPacketData` must be serialized using a format supported by the host chain.
Expand Down
Loading