Skip to content

Commit

Permalink
Merge branch 'carlos/#1359-bump-package-to-v4' of https://github.com/…
Browse files Browse the repository at this point in the history
…cosmos/ibc-go into carlos/#1359-bump-package-to-v4

# Conflicts:
#	modules/apps/29-fee/keeper/escrow_test.go
  • Loading branch information
crodriguezvega committed Jun 29, 2022
2 parents 161666e + 18536b5 commit 2738f86
Show file tree
Hide file tree
Showing 40 changed files with 743 additions and 217 deletions.
9 changes: 7 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
/modules/core/ @colin-axner @fedekunze @AdityaSripal
/proto/ibc/core/ @colin-axner @fedekunze @AdityaSripal

## CODEOWNERS for core/02-client

/modules/core/02-client @seantking @damiannolan
/proto/ibc/core/client @seantking @damiannolan

# CODEOWNERS for the light-clients

/modules/light-clients/ @colin-axner @fedekunze @AdityaSripal
/proto/ibc/lightclients/ @colin-axner @fedekunze @AdityaSripal
/modules/light-clients/ @colin-axner @fedekunze @AdityaSripal @seantking @damiannolan
/proto/ibc/lightclients/ @colin-axner @fedekunze @AdityaSripal @seantking @damiannolan

# CODEOWNERS for ICS 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.0.1
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.go
Expand Down
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@v3
with:
go-version: 1.17
- uses: technote-space/get-diff-action@v6.0.1
- uses: technote-space/get-diff-action@v6.1.0
id: git_diff
with:
PATTERNS: |
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: technote-space/get-diff-action@v6.0.1
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.go
Expand All @@ -120,7 +120,7 @@ jobs:
needs: tests
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.0.1
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.go
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (modules/core/04-channel) [\#1232](https://github.com/cosmos/ibc-go/pull/1232) Updating params on `NewPacketId` and moving to bottom of file.
* (app/29-fee) [\#1305](https://github.com/cosmos/ibc-go/pull/1305) Change version string for fee module to `ics29-1`
* (app/29-fee) [\#1341](https://github.com/cosmos/ibc-go/pull/1341) Check if the fee module is locked and if the fee module is enabled before refunding all fees
* (testing/simapp) [\#1397](https://github.com/cosmos/ibc-go/pull/1397) Adding mock module to maccperms and adding check to ensure mock module is not a blocked account address.
* (core/02-client) [\#1570](https://github.com/cosmos/ibc-go/pull/1570) Emitting an event when handling an upgrade client proposal.

### Features

Expand Down
89 changes: 78 additions & 11 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ module.exports = {
path: "/apps",
children: [
{
title: "Overview",
directory: false,
path: "/apps/interchain-accounts/overview.html"
title: "Overview",
directory: false,
path: "/apps/interchain-accounts/overview.html"
},
{
title: "Authentication Modules",
Expand All @@ -160,9 +160,9 @@ module.exports = {
path: "/apps/interchain-accounts/active-channels.html"
},
{
title: "Integration",
directory: false,
path: "/apps/interchain-accounts/integration.html"
title: "Integration",
directory: false,
path: "/apps/interchain-accounts/integration.html"
},
{
title: "Parameters",
Expand All @@ -176,22 +176,89 @@ module.exports = {
},
]
},
{
title: "Transfer",
directory: true,
path: "/apps",
children: [
{
title: "Overview",
directory: false,
path: "/apps/transfer/overview.html"
},
{
title: "State",
directory: false,
path: "/apps/transfer/state.html"
},
{
title: "State Transitions",
directory: false,
path: "/apps/transfer/state-transitions.html"
},
{
title: "Messages",
directory: false,
path: "/apps/transfer/messages.html"
},
{
title: "Events",
directory: false,
path: "/apps/transfer/events.html"
},
{
title: "Metrics",
directory: false,
path: "/apps/transfer/metrics.html"
},
{
title: "Params",
directory: false,
path: "/apps/transfer/params.html"
},
]
},
]
},
{
title: "IBC Middleware Modules",
children: [
{
title: "ICS29 Fee Middleware",
title: "Fee Middleware",
directory: true,
path: "/middleware",
children: [
{
title: "Overview",
directory: false,
path: "/middleware/ics29-fee/overview.html"
title: "Overview",
directory: false,
path: "/middleware/ics29-fee/overview.html"
},
]
{
title: "Integration",
directory: false,
path: "/middleware/ics29-fee/integration.html"
},
{
title: "End Users",
directory: false,
path: "/middleware/ics29-fee/end-users.html"
},
{
title: "Fee Messages",
directory: false,
path: "/middleware/ics29-fee/msgs.html"
},
{
title: "Fee Distribution",
directory: false,
path: "/middleware/ics29-fee/fee-distribution.html"
},
{
title: "Events",
directory: false,
path: "/middleware/ics29-fee/events.html"
},
]
},
]
},
Expand Down
6 changes: 3 additions & 3 deletions docs/apps/interchain-accounts/active-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ channel type that provides ordering of packets without the channel closing on ti
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:
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 `MsgChannelOpenInit` message like so:

```go
msg := channeltypes.NewMsgChannelOpenInit(portID, string(versionBytes), channeltypes.ORDERED, []string{connectionID}, icatypes.PortID, icatypes.ModuleName)
handler := k.msgRouter.Handler(msg)
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.
Expand Down
8 changes: 4 additions & 4 deletions docs/apps/interchain-accounts/auth-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ func (im IBCModule) OnChanOpenInit(
chanCap *capabilitytypes.Capability,
counterparty channeltypes.Counterparty,
version string,
) error {
) (string, error) {
// the authentication module *must* claim the channel capability on OnChanOpenInit
if err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil {
return err
return version, err
}

// perform custom logic

return nil
return version, nil
}

// OnChanOpenAck implements the IBCModule interface
Expand Down Expand Up @@ -157,7 +157,7 @@ if err := keeper.icaControllerKeeper.RegisterInterchainAccount(ctx, connectionID
return nil
```

The `version` argument is used to support ICS29 fee middleware for relayer incentivization of ICS27 packets. Consumers of the `RegisterInterchainAccount` are expected to build the appropriate JSON encoded version string themselves and pass it accordingly.
The `version` argument is used to support ICS29 fee middleware for relayer incentivization of ICS27 packets. Consumers of the `RegisterInterchainAccount` are expected to build the appropriate JSON encoded version string themselves and pass it accordingly. If an empty string is passed in the `version` argument, then the version will be initialized to a default value in the `OnChanOpenInit` callback of the controller's handler, so that channel handshake can proceed.

The following code snippet illustrates how to construct an appropriate interchain accounts `Metadata` and encode it as a JSON bytestring:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ order: 5

# Events

## MsgTransfer
## `MsgTransfer`

| Type | Attribute Key | Attribute Value |
|--------------|---------------|-----------------|
Expand All @@ -13,28 +13,31 @@ order: 5
| message | action | transfer |
| message | module | transfer |

## OnRecvPacket callback
## `OnRecvPacket` callback

| Type | Attribute Key | Attribute Value |
|-----------------------|---------------|-----------------|
| fungible_token_packet | module | transfer |
| fungible_token_packet | sender | {sender} |
| fungible_token_packet | receiver | {receiver} |
| fungible_token_packet | denom | {denom} |
| fungible_token_packet | amount | {amount} |
| fungible_token_packet | success | {ackSuccess} |
| denomination_trace | trace_hash | {hex_hash} |

## OnAcknowledgePacket callback
## `OnAcknowledgePacket` callback

| Type | Attribute Key | Attribute Value |
|-----------------------|-----------------|-------------------|
| fungible_token_packet | module | transfer |
| fungible_token_packet | sender | {sender} |
| fungible_token_packet | receiver | {receiver} |
| fungible_token_packet | denom | {denom} |
| fungible_token_packet | amount | {amount} |
| fungible_token_packet | acknowledgement | {ack.String()} |
| fungible_token_packet | success | error | {ack.Response} |

## OnTimeoutPacket callback
## `OnTimeoutPacket` callback

| Type | Attribute Key | Attribute Value |
|-----------------------|-----------------|-----------------|
Expand Down
36 changes: 36 additions & 0 deletions docs/apps/transfer/messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--
order: 4
-->

# Messages

## `MsgTransfer`

A fungible token cross chain transfer is achieved by using the `MsgTransfer`:

```go
type MsgTransfer struct {
SourcePort string
SourceChannel string
Token sdk.Coin
Sender string
Receiver string
TimeoutHeight ibcexported.Height
TimeoutTimestamp uint64
}
```

This message is expected to fail if:

- `SourcePort` 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).
- `SourceChannel` 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)).
- `Token` is invalid (denom is invalid or amount is negative)
- `Token.Amount` is not positive.
- `Token.Denom` is not a valid IBC denomination as per [ADR 001 - Coin Source Tracing](../../../docs/architecture/adr-001-coin-source-tracing.md).
- `Sender` is empty.
- `Receiver` is empty.
- `TimeoutHeight` and `TimeoutTimestamp` are both zero.

This message will send a fungible token to the counterparty chain represented by the counterparty Channel End connected to the Channel End with the identifiers `SourcePort` and `SourceChannel`.

The denomination provided for transfer should correspond to the same denomination represented on this chain. The prefixes will be added as necessary upon by the receiving chain.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ order: 6

# Metrics

The transfer IBC application module exposes the following set of [metrics](https://github.com/cosmos/cosmos-sdk/blob/master/docs/core/telemetry.md).
The IBC transfer application module exposes the following set of [metrics](https://github.com/cosmos/cosmos-sdk/blob/main/docs/core/telemetry.md).

| Metric | Description | Unit | Type |
|:--------------------------------|:------------------------------------------------------------------------------------------|:----------------|:--------|
Expand Down
Loading

0 comments on commit 2738f86

Please sign in to comment.