Skip to content

Commit

Permalink
Merge PR cosmos#120: ICS 26: Relayer Module
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgoes authored Jun 9, 2019
1 parent 27055e0 commit a7eaffa
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 160 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ All standards in the "draft" stage are listed here in order of their ICS numbers
| [18](spec/ics-018-relayer-algorithms) | Relayer Algorithms | Draft |
| [23](spec/ics-023-vector-commitments) | Vector Commitments | Draft |
| [24](spec/ics-024-host-requirements) | Host Requirements | Draft |
| [26](spec/ics-026-relayer-module) | Relayer Module | Draft |

## Standard Dependency Visualization

Expand Down
4 changes: 2 additions & 2 deletions deps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ibc/5_IBC_DESIGN_PATTERNS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ It also has one notable disadvantage:
can be submitted.

However, for common relay patterns, an "IBC relayer" module can optionally be implemented, outside of IBC
core, which maintains a module dispatch table and simplifies the job of relayers. This relayer module will be defined in ICS 26.
core, which maintains a module dispatch table and simplifies the job of relayers. This relayer module will be defined in [ICS 26](../spec/ics-026-relayer-module).
81 changes: 1 addition & 80 deletions spec/ics-003-connection-semantics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ interface Connection {

### Subprotocols

This ICS defines two subprotocols: opening handshake and closing handshake. Header tracking and closing-by-equivocation are defined in [ICS 2](../ics-002-consensus-verification). Datagrams defined herein are handled as external messages by the IBC relayer module defined in ICS 26.
This ICS defines two subprotocols: opening handshake and closing handshake. Header tracking and closing-by-equivocation are defined in [ICS 2](../ics-002-consensus-verification). Datagrams defined herein are handled as external messages by the IBC relayer module defined in [ICS 26](../ics-026-relayer-module).

![State Machine Diagram](state.png)

Expand All @@ -115,16 +115,6 @@ This subprotocol need not be permissioned, modulo anti-spam measures.

*ConnOpenInit* initializes a connection attempt on chain A.

```typescript
interface ConnOpenInit {
identifier: Identifier
desiredCounterpartyIdentifier: Identifier
clientIdentifier: Identifier
counterpartyClientIdentifier: Identifier
nextTimeoutHeight: uint64
}
```

```typescript
function connOpenInit(
identifier: Identifier, desiredCounterpartyIdentifier: Identifier,
Expand All @@ -139,18 +129,6 @@ function connOpenInit(

*ConnOpenTry* relays notice of a connection attempt on chain A to chain B.

```typescript
interface ConnOpenTry {
desiredIdentifier: Identifier
counterpartyIdentifier: Identifier
counterpartyClientIdentifier: Identifier
clientIdentifier: Identifier
proofInit: CommitmentProof
timeoutHeight: uint64
nextTimeoutHeight: uint64
}
```

```typescript
function connOpenTry(
desiredIdentifier: Identifier, counterpartyIdentifier: Identifier,
Expand All @@ -174,15 +152,6 @@ function connOpenTry(

*ConnOpenAck* relays acceptance of a connection open attempt from chain B back to chain A.

```typescript
interface ConnOpenAck {
identifier: Identifier
proofTry: CommitmentProof
timeoutHeight: uint64
nextTimeoutHeight: uint64
}
```

```typescript
function connOpenAck(
identifier: Identifier, proofTry: CommitmentProof,
Expand All @@ -205,14 +174,6 @@ function connOpenAck(

*ConnOpenConfirm* confirms opening of a connection on chain A to chain B, after which the connection is open on both chains.

```typescript
interface ConnOpenConfirm {
identifier: Identifier
proofAck: CommitmentProof
timeoutHeight: uint64
}
```

```typescript
function connOpenConfirm(identifier: Identifier, proofAck: CommitmentProof, timeoutHeight: uint64)
assert(getConsensusState().getHeight() <= timeoutHeight)
Expand All @@ -229,14 +190,6 @@ function connOpenConfirm(identifier: Identifier, proofAck: CommitmentProof, time
*ConnOpenTimeout* aborts a connection opening attempt due to a timeout on the other side.
```typescript
interface ConnOpenTimeout {
identifier: Identifier
proofTimeout: CommitmentProof
timeoutHeight: uint64
}
```
```typescript
function connOpenTimeout(identifier: Identifier, proofTimeout: CommitmentProof, timeoutHeight: uint64) {
connection = get("connections/{identifier}")
Expand Down Expand Up @@ -295,13 +248,6 @@ A correct protocol execution flows as follows (note that all calls are made thro
*ConnCloseInit* initializes a close attempt on chain A.
```typescript
interface ConnCloseInit {
identifier: Identifier
nextTimeoutHeight: uint64
}
```
```typescript
function connCloseInit(identifier: Identifier, nextTimeoutHeight: uint64) {
connection = get("connections/{identifier}")
Expand All @@ -314,15 +260,6 @@ function connCloseInit(identifier: Identifier, nextTimeoutHeight: uint64) {
*ConnCloseTry* relays the intent to close a connection from chain A to chain B.
```typescript
interface ConnCloseTry {
identifier: Identifier
proofInit: CommitmentProof
timeoutHeight: uint64
nextTimeoutHeight: uint64
}
```
```typescript
function connCloseTry(
identifier: Identifier, proofInit: CommitmentProof,
Expand All @@ -342,14 +279,6 @@ function connCloseTry(
*ConnCloseAck* acknowledges a connection closure on chain B.
```typescript
interface ConnCloseAck {
identifier: Identifier
proofTry: CommitmentProof
timeoutHeight: uint64
}
```
```typescript
function connCloseAck(identifier: Identifier, proofTry: CommitmentProof, timeoutHeight: uint64) {
assert(getConsensusState().getHeight() <= timeoutHeight)
Expand All @@ -367,14 +296,6 @@ function connCloseAck(identifier: Identifier, proofTry: CommitmentProof, timeout
*ConnCloseTimeout* aborts a connection closing attempt due to a timeout on the other side and reopens the connection.
```typescript
interface ConnCloseTimeout {
identifier: Identifier
proofTimeout: CommitmentProof
timeoutHeight: uint64
}
```
```typescript
function connCloseTimeout(identifier: Identifier, proofTimeout: CommitmentProof, timeoutHeight: uint64) {
connection = get("connections/{identifier}")
Expand Down
77 changes: 0 additions & 77 deletions spec/ics-004-channel-and-packet-semantics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,6 @@ When the opening handshake is complete, the module which initiates the handshake
it specifies will own the other end of the created channel on the counterparty chain. Once a channel is created, ownership cannot be changed (although higher-level abstractions
could be implemented to provide this).

```typescript
interface ChanOpenInit {
connectionIdentifier: Identifier
channelIdentifier: Identifier
counterpartyChannelIdentifier: Identifier
counterpartyModuleIdentifier: Identifier
nextTimeoutHeight: uint64
}
```

```typescript
function chanOpenInit(
connectionIdentifier: Identifier, channelIdentifier: Identifier,
Expand All @@ -226,19 +216,6 @@ function chanOpenInit(

The `chanOpenTry` function is called by a module to accept the first step of a chanel opening handshake initiated by a module on another chain.

```typescript
interface ChanOpenTry {
connectionIdentifier: Identifier
channelIdentifier: Identifier
counterpartyChannelIdentifier: Identifier
moduleIdentifier: Identifier
counterpartyModuleIdentifier: Identifier
timeoutHeight: uint64
nextTimeoutHeight: uint64
proofInit: CommitmentProof
}
```

```typescript
function chanOpenTry(
connectionIdentifier: Identifier, channelIdentifier: Identifier, counterpartyChannelIdentifier: Identifier,
Expand Down Expand Up @@ -267,16 +244,6 @@ function chanOpenTry(
The `chanOpenAck` is called by the handshake-originating module to acknowledge the acceptance of the initial request by the
counterparty module on the other chain.

```typescript
interface ChanOpenAck {
connectionIdentifier: Identifier
channelIdentifier: Identifier
timeoutHeight: uint64
nextTimeoutHeight: uint64
proofTry: CommitmentProof
}
```

```typescript
function chanOpenAck(
connectionIdentifier: Identifier, channelIdentifier: Identifier,
Expand Down Expand Up @@ -304,15 +271,6 @@ function chanOpenAck(
The `chanOpenConfirm` function is called by the handshake-accepting module to acknowledge the acknowledgement
of the handshake-originating module on the other chain and finish the channel opening handshake.

```typescript
interface ChanOpenConfirm {
connectionIdentifier: Identifier
channelIdentifier: Identifier
timeoutHeight: uint64
proofAck: CommitmentProof
}
```

```typescript
function chanOpenConfirm(
connectionIdentifier: Identifier, channelIdentifier: Identifier,
Expand Down Expand Up @@ -340,15 +298,6 @@ function chanOpenConfirm(
The `chanOpenTimeout` function is called by either the handshake-originating
module or the handshake-confirming module to prove that a timeout has occurred and reset the state.

```typescript
interface ChanOpenTimeout {
connectionIdentifier: Identifier
channelIdentifier: Identifier
timeoutHeight: uint64
proofTimeout: CommitmentProof
}
```

```typescript
function chanOpenTimeout(
connectionIdentifier: Identifier, channelIdentifier: Identifier,
Expand Down Expand Up @@ -396,14 +345,6 @@ function chanOpenTimeout(
The `chanCloseInit` function is called by either module to initiate
the channel-closing handshake.

```typescript
interface ChanCloseInit {
connectionIdentifier: Identifier
channelIdentifier: Identifier
nextTimeoutHeight: uint64
}
```

```typescript
function chanCloseInit(
connectionIdentifier: Identifier, channelIdentifier: Identifier, nextTimeoutHeight: uint64) {
Expand Down Expand Up @@ -457,15 +398,6 @@ function chanCloseTry(
The `chanCloseAck` function is called by the handshake-originating module
to acknowledge the closing acknowledgement and finalize channel closure.

```typescript
interface ChanCloseAck {
connectionIdentifier: Identifier
channelIdentifier: Identifier
timeoutHeight: uint64
proofTry: CommitmentProof
}
```

```typescript
function chanCloseAck(
connectionIdentifier: Identifier, channelIdentifier: Identifier,
Expand Down Expand Up @@ -493,15 +425,6 @@ function chanCloseAck(
The `chanCloseTimeout` function is called by either the handshake-originating
or handshake-accepting module to prove a timeout and reset state.

```typescript
interface ChanCloseTimeout {
connectionIdentifier: Identifier
channelIdentifier: Identifier
timeoutHeight: uint64
proofTimeout: CommitmentProof
}
```

```typescript
function chanCloseTimeout(
connectionIdentifier: Identifier, channelIdentifier: Identifier,
Expand Down
Loading

0 comments on commit a7eaffa

Please sign in to comment.