Skip to content

Commit 9d79e86

Browse files
colin-axnerseantkingdependabot[bot]damiannolancrodriguezvega
authored
Backport commits from main to v3 release branch (#682)
* reorganize channel handshake handler (#647) * reorganize channel handshake handler split out channel state changes into its own function. * readjust 27-interchain-accounts to not rely on state being set before the application callback * add changelog and migration doc entry * Update modules/core/04-channel/keeper/handshake.go * docs: ICA Overview (#626) * docs: ica overview * fix: ordering * add spacing * fix: spacing * fix: remove bulletpoints * fix: wording * update go mod for security vulnerabilities (#655) * update go mod for security vulnerabilities * update package-lock.json * update vue dependency (#662) * bump glob-parent version in json package (#663) * build(deps): bump actions/setup-go from 2.1.4 to 2.1.5 (#656) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.4 to 2.1.5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v2.1.4...v2.1.5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: colin axnér <[email protected]> * docs: begin removal of internal "spec" directories (#634) * begin removal of spec docs within core ibc * remove broken link * Apply suggestions from code review Co-authored-by: Damian Nolan <[email protected]> * remove broken link * remove broken links * Apply suggestions from code review Co-authored-by: Carlos Rodriguez <[email protected]> Co-authored-by: Damian Nolan <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> * Modify `OnChanOpenTry` application callback to perform app version negotitation (#646) * remove NegotiateAppVersion and AppVersion gRPC (#643) The NegotiateAppVersion callback has been removed from the IBC Application interface. The gRPC AppVersion has been removed. The app version negoitation will be handled by applications by returning the version in OnChanOpenTry. * Modify `OnChanOpenTry` to return application version (#650) * modify OnChanOpenTry to return negotiated version modify IBCModule interface function OnChanOpenTry to return the negotiated app version. Tests have not been updated * fix ibc_module_test.go tests * fix tests * Apply suggestions from code review * add handshake test case * add CHANGELOG and migration docs * update documentation * fix broken link * fix broken link (#664) * chore: update make build-docs, add docs build checker (#667) * update Makefile, add docs build checker * Update .github/workflows/check-docs.yml Co-authored-by: Marko <[email protected]> Co-authored-by: Marko <[email protected]> * register ICA query server, fix panics in params query cli (#666) Register the controller and host query servers to a chain. Returns an error upon cli params query failure instead of panicing. * update of roadmap with latest release (#653) * update of roadmap with latest release and changed the way release versions are encoded * fixed typo Co-authored-by: Carlos Rodriguez <[email protected]> * build(deps): bump actions/checkout from 2.3.1 to 2.4.0 (#672) Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.1 to 2.4.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v2.3.1...v2.4.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * allow ics20 to connect to middleware (#675) * allow ics20 to connect to middleware Creates ics4Wrapper which allows middleware applications to only implement SendPacket to connect ics20 as an application in its middleware stack * add changelog and migration doc * fix migration doc spelling * fix: register InterchainAccount as x/auth GenesisAccount (#676) * adding GenesisAccount interface registration for InterchainAccount impl * updating RegisterInterfaces ica godoc * enable mergify for backports (#678) Co-authored-by: Carlos Rodriguez <[email protected]> Co-authored-by: Sean King <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Damian Nolan <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]> Co-authored-by: Marko <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]>
1 parent e3036e3 commit 9d79e86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3278
-3641
lines changed

.github/mergify.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
queue_rules:
2+
- name: default
3+
conditions:
4+
- "#approved-reviews-by>=1"
5+
- base=main
6+
- label=automerge
7+
8+
pull_request_rules:
9+
- name: automerge to main with label automerge and branch protection passing
10+
conditions:
11+
- "#approved-reviews-by>=1"
12+
- base=main
13+
- label=automerge
14+
actions:
15+
queue:
16+
name: default
17+
method: squash
18+
commit_message_template: |
19+
{{ title }} (#{{ number }})
20+
{{ body }}
21+
- name: backport patches to v1.1.x branch
22+
conditions:
23+
- base=main
24+
- label=backport-to-v1.1.x
25+
actions:
26+
backport:
27+
branches:
28+
- release/v1.1.x
29+
- name: backport patches to v1.2x branch
30+
conditions:
31+
- base=main
32+
- label=backport-to-v1.2.x
33+
actions:
34+
backport:
35+
branches:
36+
- release/v1.2.x
37+
- name: backport patches to v2.0.x branch
38+
conditions:
39+
- base=main
40+
- label=backport-to-v2.0.x
41+
actions:
42+
backport:
43+
branches:
44+
- release/v2.0.x
45+
- name: backport patches to v3.0.x branch
46+
conditions:
47+
- base=main
48+
- label=backport-to-v3.0.x
49+
actions:
50+
backport:
51+
branches:
52+
- release/v3.0.x

.github/workflows/check-docs.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check docs build
2+
# This workflow runs when a PR is labeled with `docs`
3+
# This will check if the docs build successfully by running `npm run build`
4+
on:
5+
pull_request:
6+
paths:
7+
- './docs'
8+
9+
jobs:
10+
check-docs-build:
11+
if: ${{ github.event.label.name == 'docs' }}
12+
13+
name: Check docs build
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout 🛎️
17+
uses: actions/[email protected]
18+
with:
19+
persist-credentials: false
20+
fetch-depth: 0
21+
22+
- name: Install dependencies and build docs 🧱
23+
run: |
24+
cd docs
25+
npm install
26+
npm run build

.github/workflows/link-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
markdown-link-check:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v2.4.0
88
- uses: gaurav-nelson/github-action-markdown-link-check@v1
99
with:
1010
config-file: '.github/workflows/link-check-config.json'

.github/workflows/test.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
install-tparse:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/[email protected].4
21+
- uses: actions/[email protected].5
2222
with:
2323
go-version: 1.17
2424
- name: Display go version
@@ -37,8 +37,8 @@ jobs:
3737
matrix:
3838
go-arch: ["amd64", "arm", "arm64"]
3939
steps:
40-
- uses: actions/checkout@v2.3.4
41-
- uses: actions/[email protected].4
40+
- uses: actions/checkout@v2.4.0
41+
- uses: actions/[email protected].5
4242
with:
4343
go-version: 1.17
4444
- uses: technote-space/get-diff-action@v5
@@ -54,7 +54,7 @@ jobs:
5454
split-test-files:
5555
runs-on: ubuntu-latest
5656
steps:
57-
- uses: actions/checkout@v2.3.4
57+
- uses: actions/checkout@v2.4.0
5858
- name: Create a file with all the pkgs
5959
run: go list ./... > pkgs.txt
6060
- name: Split pkgs into 4 files
@@ -85,8 +85,8 @@ jobs:
8585
matrix:
8686
part: ["00", "01", "02", "03"]
8787
steps:
88-
- uses: actions/checkout@v2.3.4
89-
- uses: actions/[email protected].4
88+
- uses: actions/checkout@v2.4.0
89+
- uses: actions/[email protected].5
9090
with:
9191
go-version: 1.17
9292
- uses: technote-space/get-diff-action@v5
@@ -112,7 +112,7 @@ jobs:
112112
runs-on: ubuntu-latest
113113
needs: tests
114114
steps:
115-
- uses: actions/checkout@v2.3.4
115+
- uses: actions/checkout@v2.4.0
116116
- uses: technote-space/get-diff-action@v5
117117
with:
118118
PATTERNS: |

.mergify.yml

-10
This file was deleted.

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
4242

4343
### API Breaking
4444

45+
* (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.
46+
* (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.
4547
* (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.
4648
* (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.
4749
* (modules/core/02-client) [\#536](https://github.com/cosmos/ibc-go/pull/536) `GetSelfConsensusState` return type changed from bool to error.
@@ -54,6 +56,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
5456
* [\#383](https://github.com/cosmos/ibc-go/pull/383) Adds helper functions for merging and splitting middleware versions from the underlying app version.
5557
* (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.
5658
* (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.
59+
* (channel) [\647](https://github.com/cosmos/ibc-go/pull/647) Reorganizes channel handshake handling to set channel state after IBC application callbacks.
5760

5861
### Features
5962

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,13 @@ godocs:
196196
build-docs:
197197
@cd docs && \
198198
while read -r branch path_prefix; do \
199-
(git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \
199+
echo "building branch $${branch}" ; \
200+
(git clean -fdx && git reset --hard && git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \
200201
mkdir -p ~/output/$${path_prefix} ; \
201202
cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \
202203
cp ~/output/$${path_prefix}/index.html ~/output ; \
203204
done < versions ;
205+
204206
.PHONY: build-docs
205207

206208
###############################################################################

docs/app_modules/interchain-accounts/overview.md

+27
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,31 @@
22
order: 1
33
-->
44

5+
# Overview
6+
7+
Learn about what the Interchain Accounts module is, and how to build custom modules that utilize Interchain Accounts functionality {synopsis}
8+
9+
10+
# What is the Interchain Accounts module?
11+
12+
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.
13+
14+
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.
15+
16+
Developers looking to build upon Interchain Accounts must write custom logic in their own IBC application module, called authentication modules.
17+
18+
- How is an interchain account different than a regular account?
19+
20+
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.
21+
22+
# Concepts
23+
24+
*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.
25+
26+
*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.
27+
28+
*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.
29+
30+
*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.
31+
532

docs/ibc/apps.md

+16-34
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ OnChanOpenTry(
7171
channelID string,
7272
channelCap *capabilitytypes.Capability,
7373
counterparty channeltypes.Counterparty,
74-
version,
7574
counterpartyVersion string,
76-
) error {
75+
) (string, error) {
7776
// Module may have already claimed capability in OnChanOpenInit in the case of crossing hellos
7877
// (ie chainA and chainB both call ChanOpenInit before one of them calls ChanOpenTry)
7978
// If the module can already authenticate the capability then the module already owns it so we don't need to claim
@@ -88,8 +87,18 @@ OnChanOpenTry(
8887
// ... do custom initialization logic
8988

9089
// Use above arguments to determine if we want to abort handshake
91-
err := checkArguments(args)
92-
return err
90+
if err := checkArguments(args); err != nil {
91+
return err
92+
}
93+
94+
// Construct application version
95+
// IBC applications must return the appropriate application version
96+
// This can be a simple string or it can be a complex version constructed
97+
// from the counterpartyVersion and other arguments.
98+
// The version returned will be the channel version used for both channel ends.
99+
appVersion := negotiateAppVersion(counterpartyVersion, args)
100+
101+
return appVersion, nil
93102
}
94103

95104
// Called by IBC Handler on MsgOpenAck
@@ -157,38 +166,11 @@ OnChanCloseConfirm(
157166
Application modules are expected to verify versioning used during the channel handshake procedure.
158167

159168
* `ChanOpenInit` callback should verify that the `MsgChanOpenInit.Version` is valid
160-
* `ChanOpenTry` callback should verify that the `MsgChanOpenTry.Version` is valid and that `MsgChanOpenTry.CounterpartyVersion` is valid.
169+
* `ChanOpenTry` callback should construct the application version used for both channel ends. If no application version can be constructed, it must return an error.
161170
* `ChanOpenAck` callback should verify that the `MsgChanOpenAck.CounterpartyVersion` is valid and supported.
162171

163-
IBC expects application modules to implement the `NegotiateAppVersion` method from the `IBCModule`
164-
interface. This method performs application version negotiation and returns the negotiated version.
165-
If the version cannot be negotiated, an error should be returned.
166-
167-
```go
168-
// NegotiateAppVersion performs application version negotiation given the provided channel ordering, connectionID, portID, counterparty and proposed version.
169-
// An error is returned if version negotiation cannot be performed. For example, an application module implementing this interface
170-
// may decide to return an error in the event of the proposed version being incompatible with it's own
171-
NegotiateAppVersion(
172-
ctx sdk.Context,
173-
order channeltypes.Order,
174-
connectionID string,
175-
portID string,
176-
counterparty channeltypes.Counterparty,
177-
proposedVersion string,
178-
) (version string, err error) {
179-
// do custom application version negotiation logic
180-
}
181-
```
182-
183-
This function `NegotiateAppVersion` returns the version to be used in the `ChanOpenTry` step
184-
(`MsgChanOpenTry.Version`). The relayer chooses the initial version in the `ChanOpenInit` step
185-
(this will likely be chosen by the user controlling the relayer or by the application that
186-
triggers the `ChanOpenInit` step).
187-
188-
The version submitted in the `ChanOpenInit` step (`MsgChanOpenInit.Version`) is passed as an
189-
argument (`proposedVersion`) to the function `NegotiateAppVersion`. This function looks at
190-
the `proposedVersion` and returns the matching version to be used in the `ChanOpenTry` step.
191-
Applications can choose to implement this in however fashion they choose.
172+
IBC expects application modules to perform application version negotiation in `OnChanOpenTry`. The negotiated version
173+
must be returned to core IBC. If the version cannot be negotiated, an error should be returned.
192174

193175
Versions must be strings but can implement any versioning structure. If your application plans to
194176
have linear releases then semantic versioning is recommended. If your application plans to release

modules/core/spec/06_events.md docs/ibc/events.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<!--
2-
order: 6
2+
order: 5
33
-->
44

55
# Events
66

7+
**NOTE**: This document is unmaintained and may be out of date!
8+
79
The IBC module emits the following events. It can be expected that the type `message`,
810
with an attirbute key of `action` will represent the first event for each message
911
being processed as emitted by the SDK's baseapp. Each IBC TAO message will

docs/ibc/middleware/develop.md

+34-31
Original file line numberDiff line numberDiff line change
@@ -103,29 +103,32 @@ func OnChanOpenTry(
103103
channelID string,
104104
channelCap *capabilitytypes.Capability,
105105
counterparty channeltypes.Counterparty,
106-
version,
107106
counterpartyVersion string,
108-
) error {
109-
// core/04-channel/types contains a helper function to split middleware and underlying app version
110-
cpMiddlewareVersion, cpAppVersion = channeltypes.SplitChannelVersion(counterpartyVersion)
111-
middlewareVersion, appVersion = channeltypes.SplitChannelVersion(version)
112-
if !isCompatible(cpMiddlewareVersion, middlewareVersion) {
113-
return error
114-
}
115-
doCustomLogic()
116-
117-
// call the underlying applications OnChanOpenTry callback
118-
app.OnChanOpenTry(
119-
ctx,
120-
order,
121-
connectionHops,
122-
portID,
123-
channelID,
124-
channelCap,
125-
counterparty,
126-
cpAppVersion, // note we only pass counterparty app version here
127-
appVersion, // only pass app version
128-
)
107+
) (string, error) {
108+
doCustomLogic()
109+
110+
// core/04-channel/types contains a helper function to split middleware and underlying app version
111+
cpMiddlewareVersion, cpAppVersion = channeltypes.SplitChannelVersion(counterpartyVersion)
112+
113+
// call the underlying applications OnChanOpenTry callback
114+
appVersion, err := app.OnChanOpenTry(
115+
ctx,
116+
order,
117+
connectionHops,
118+
portID,
119+
channelID,
120+
channelCap,
121+
counterparty,
122+
cpAppVersion, // note we only pass counterparty app version here
123+
)
124+
if err != nil {
125+
return err
126+
}
127+
128+
middlewareVersion := negotiateMiddlewareVersion(cpMiddlewareVersion)
129+
version := constructVersion(middlewareVersion, appVersion)
130+
131+
return version
129132
}
130133

131134
func OnChanOpenAck(
@@ -134,15 +137,15 @@ func OnChanOpenAck(
134137
channelID string,
135138
counterpartyVersion string,
136139
) error {
137-
// core/04-channel/types contains a helper function to split middleware and underlying app version
138-
middlewareVersion, appVersion = channeltypes.SplitChannelVersion(version)
139-
if !isCompatible(middlewareVersion) {
140-
return error
141-
}
142-
doCustomLogic()
140+
// core/04-channel/types contains a helper function to split middleware and underlying app version
141+
middlewareVersion, appVersion = channeltypes.SplitChannelVersion(version)
142+
if !isCompatible(middlewareVersion) {
143+
return error
144+
}
145+
doCustomLogic()
143146

144-
// call the underlying applications OnChanOpenTry callback
145-
app.OnChanOpenAck(ctx, portID, channelID, appVersion)
147+
// call the underlying applications OnChanOpenTry callback
148+
app.OnChanOpenAck(ctx, portID, channelID, appVersion)
146149
}
147150

148151
func OnChanOpenConfirm(
@@ -236,4 +239,4 @@ func SendPacket(appPacket channeltypes.Packet) {
236239

237240
return ics4Keeper.SendPacket(packet)
238241
}
239-
```
242+
```

0 commit comments

Comments
 (0)