-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extend 03-connection with a proof object for chains that can't intros…
…pect their own consensus state. (#839) * extend 03-connection with HostConsensusStateProof * make hostConsensusStateProof optional
- Loading branch information
1 parent
01dbba9
commit 17d62c0
Showing
2 changed files
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ requires: 23 | |
required-by: 2, 3, 4, 5, 18 | ||
author: Christopher Goes <[email protected]> | ||
created: 2019-04-16 | ||
modified: 2022-07-05 | ||
modified: 2022-09-14 | ||
--- | ||
|
||
## Synopsis | ||
|
@@ -170,11 +170,15 @@ Host state machines MUST define a unique `ConsensusState` type fulfilling the re | |
Host state machines MUST provide the ability to introspect their own consensus state, with `getConsensusState`: | ||
```typescript | ||
type getConsensusState = (height: Height) => ConsensusState | ||
type getConsensusState = (height: Height, proof?: bytes) => ConsensusState | ||
``` | ||
`getConsensusState` MUST return the consensus state for at least some number `n` of contiguous recent heights, where `n` is constant for the host state machine. Heights older than `n` MAY be safely pruned (causing future calls to fail for those heights). | ||
We provide an optional proof data which comes from the `MsgConnectionOpenAck` or `MsgConnectionOpenTry` for host state machines which are unable to introspect their own `ConsensusState` and must rely on off-chain data. | ||
<br /> | ||
In this case host state machines MUST maintain a map of `n` block numbers to header hashes where the proof would contain full header which can be hashed and compared with the on-chain record. | ||
Host state machines MUST provide the ability to introspect this stored recent consensus state count `n`, with `getStoredRecentConsensusStateCount`: | ||
```typescript | ||
|