-
Notifications
You must be signed in to change notification settings - Fork 409
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
TAO V2 support in 07 client #1137
Changes from all commits
c2ca116
dd898bc
9ef0ab9
86c6123
e038fb1
a55be22
a601770
16f0f63
643548d
6742a50
7a689b3
6c8d492
f3d06a9
5da76b8
a7f80c1
445db7e
b298a65
9e3ebfe
35414c3
6b60c74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ implements: 2 | |
version compatibility: ibc-go v7.0.0 | ||
author: Christopher Goes <[email protected]> | ||
created: 2019-12-10 | ||
modified: 2019-12-19 | ||
modified: 2024-08-19 | ||
--- | ||
|
||
## Synopsis | ||
|
@@ -59,14 +59,16 @@ This specification depends on correct instantiation of the [Tendermint consensus | |
|
||
### Client state | ||
|
||
The Tendermint client state tracks the current revision, current validator set, trusting period, unbonding period, latest height, latest timestamp (block time), and a possible frozen height. | ||
The Tendermint client state tracks the current revision, current validator set, trusting period, unbonding period, delayTimePeriod, delayBlockPeriod, latest height, latest timestamp (block time), and a possible frozen height. | ||
|
||
```typescript | ||
interface ClientState { | ||
chainID: string | ||
trustLevel: Rational | ||
trustingPeriod: uint64 | ||
unbondingPeriod: uint64 | ||
delayTimePeriod: uint64 | ||
delayBlockPeriod: uint64 | ||
latestHeight: Height | ||
frozenHeight: Maybe<uint64> | ||
upgradePath: []string | ||
|
@@ -377,8 +379,6 @@ These functions utilise the `proofSpecs` with which the client was initialised. | |
function verifyMembership( | ||
clientState: ClientState, | ||
height: Height, | ||
delayTimePeriod: uint64, | ||
delayBlockPeriod: uint64, | ||
proof: CommitmentProof, | ||
path: CommitmentPath, | ||
value: []byte | ||
|
@@ -388,9 +388,9 @@ function verifyMembership( | |
// check that the client is unfrozen or frozen at a higher height | ||
assert(clientState.frozenHeight === null || clientState.frozenHeight > height) | ||
// assert that enough time has elapsed | ||
assert(currentTimestamp() >= processedTime + delayPeriodTime) | ||
assert(currentTimestamp() >= processedTime + clientState.delayTimePeriod) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm I'm wondering how we should handle this since they will use DEPRECATED field for v1 implementations There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mmm, what If we do something like: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you guys discussed in one of the issues, but maybe it's easier to just have two exact copies of the specs as they are today, one of them we will put into the v1 folder and the other copy in v2 and we modify that one with all the eureka changes without having to deal with this problem of how we communicate in the same spec what's for v1 and what's for v2. We could even maybe not even make a copy, but just a release branch: for example, we branch off from main and create What do you guys think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that to deal with this problem of how we communicate in the same spec what's for v1 and what's for v2 it's not the best thing. I like the idea to have two separate release branch for V1 and keep on main the V2 specs, however I guess that the alternative approach to have the v1 folder, as we have done for ICS20, can be more straightforward for readers to navigate and checkout the changes we will be doing. Any of the approaches works fine for me, let's just decide what we wanna do! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This also sounds good! So we can switch when the v2 specs are mature enough. |
||
// assert that enough blocks have elapsed | ||
assert(currentHeight() >= processedHeight + delayPeriodBlocks) | ||
assert(currentHeight() >= processedHeight + clientState.delayBlockPeriod) | ||
// fetch the previously verified commitment root & verify membership | ||
// Implementations may choose how to pass in the identifier | ||
// ibc-go provides the identifier-prefixed store to this method | ||
|
@@ -406,8 +406,6 @@ function verifyMembership( | |
function verifyNonMembership( | ||
clientState: ClientState, | ||
height: Height, | ||
delayTimePeriod: uint64, | ||
delayBlockPeriod: uint64, | ||
proof: CommitmentProof, | ||
path: CommitmentPath | ||
): Error { | ||
|
@@ -416,9 +414,9 @@ function verifyNonMembership( | |
// check that the client is unfrozen or frozen at a higher height | ||
assert(clientState.frozenHeight === null || clientState.frozenHeight > height) | ||
// assert that enough time has elapsed | ||
assert(currentTimestamp() >= processedTime + delayPeriodTime) | ||
assert(currentTimestamp() >= processedTime + clientState.delayTimePeriod) | ||
// assert that enough blocks have elapsed | ||
assert(currentHeight() >= processedHeight + delayPeriodBlocks) | ||
assert(currentHeight() >= processedHeight + clientState.delayBlockPeriod) | ||
// fetch the previously verified commitment root & verify membership | ||
// Implementations may choose how to pass in the identifier | ||
// ibc-go provides the identifier-prefixed store to this method | ||
|
@@ -452,8 +450,11 @@ Not applicable. Alterations to the client verification algorithm will require a | |
## History | ||
|
||
December 10th, 2019 - Initial version | ||
|
||
December 19th, 2019 - Final first draft | ||
|
||
August 19th, 2024 - [Support for IBC/TAO V2](https://github.com/cosmos/ibc/pull/1137) | ||
|
||
## Copyright | ||
|
||
All content herein is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we put an upper bound check for delayPeriods in the client initialisation to avoid misconfigurations?