Skip to content
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

Merged
merged 20 commits into from
Aug 21, 2024

Conversation

sangier
Copy link
Contributor

@sangier sangier commented Aug 19, 2024

Closes #1135

@sangier
Copy link
Contributor Author

sangier commented Aug 19, 2024

Wondering If we should add an upper bound check on the initialise function for delayTimePeriod and delayBlockPeriod. Non negativeness is guaranteed for being uint type.

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just have a question on how we should communicate both versions here

@@ -388,9 +390,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)
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm, what If we do something like:
// assert(currentTimestamp() >= processedTime + delayPeriodTime) // DEPRECATED - USED in TAO V1 assert(currentTimestamp() >= processedTime + clientState.delayTimePeriod) // TAO V2 SUPPORT`

Copy link
Contributor

Choose a reason for hiding this comment

The 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 release/v1 and that branch will keep the classic specs as they are today. And in main we just change them according to eureka. In the README of the repo we give a link to the release branch, so that anyone can take a look at the specs in their "classic" state.

What do you guys think?

Copy link
Contributor Author

@sangier sangier Aug 20, 2024

Choose a reason for hiding this comment

The 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.
At the moment, I would be even fine to have a v2 folder under all ICS that needs changes, where we place all the new eureka related specs. Then once we release eureka on ibc-go we could change the folder structure as we have done in ICS20, so creating the v1 folder with classic spec and have the main readme of the folder describing the v2 spec.

Any of the approaches works fine for me, let's just decide what we wanna do!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be even fine to have a v2 folder instead where we place all the new eureka related specs

This also sounds good! So we can switch when the v2 specs are mature enough.

@sangier
Copy link
Contributor Author

sangier commented Aug 20, 2024

Note that the approach I took here has been:

git mv spec/client/ics-007-tendermint-client/README.md spec/client/ics-007-tendermint-client/v2/

git checkout HEAD -- spec/client/ics-007-tendermint-client/README.md

git add .

git commit -m "Copied README.md to v2/ while preserving history"

However, to then see the full commit history for the v2/README.md we would need to run
git log --follow and the v2 files appears in the PR as a new files, so it is not easy to track the change to review. Mmm.

How do you see it?

@sangier sangier changed the base branch from main to feat/v2-spec August 21, 2024 12:11
@sangier
Copy link
Contributor Author

sangier commented Aug 21, 2024

@AdityaSripal Note that the failing CI check are relative to new v2 core folder, e.g. ../ics-023-vector-commitments should now be ../../ics-023-vector-commitments. I can fix this in another PR if we want to.


```typescript
interface ClientState {
chainID: string
trustLevel: Rational
trustingPeriod: uint64
unbondingPeriod: uint64
delayTimePeriod: uint64
Copy link
Contributor Author

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?

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@sangier sangier force-pushed the stefano/tao-v2-support-in-07-client branch from fb0dd55 to a7f80c1 Compare August 21, 2024 14:15
Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@AdityaSripal AdityaSripal merged commit f8e7134 into feat/v2-spec Aug 21, 2024
2 checks passed
@AdityaSripal AdityaSripal deleted the stefano/tao-v2-support-in-07-client branch August 21, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify 07-tendermint client specifications in order to also support TAO v2 spec.
3 participants