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

refactor: replace usage of verification funcs in 03-connection #1647

Merged

Conversation

damiannolan
Copy link
Member

Description

Replacing usage of:

  • VerifyClientState
  • VerifyConsensusState
  • VerifyConnection
  • VerifyChannel
  • VerifyPacketCommitment
  • VerifyAcknowledgement
  • VerifyPacketReceipt
  • VerifyPacketReceiptAbsence

with the generic VerifyMembership and VerifyNonMembership functions.

closes: #1293


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@damiannolan damiannolan marked this pull request as ready for review July 4, 2022 12:22
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 @damiannolan !

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Great work!

See comments regarding time/block delay. Since we are hard coding 0, 0, I think it might be worth adding some more code docs/test cases to ensure it doesn't get accidentally changed in the future


if err := targetClient.VerifyMembership(
ctx, clientStore, k.cdc, height,
0, 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

might be nice to add an inline comment for future readers:

    0, 0, // skip delay period checks for non-packet processing verification

or something along those lines

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we should add test cases for each of the verify functions with the time/block delay periods set to 0. That is, add test cases which will normally fail on the delay period not being passed (if 0, 0, isn't passed in). Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great idea, I'll add the inline comment.

add test cases which will normally fail on the delay period not being passed (if 0, 0, isn't passed in)

So if 0, 0, isn't passed in here it won't fail? there's nothing at the lightclient level which would return an error, and it needs to be generic to support both zero values and non zero values for delay periods, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's address this with a follow up if needs be.

* removing legacy verify funcs from clientstate interface

* chore: remove legacy verify funcs tm client (#1651)

* removing legacy verification methods from tendermint client

* removing commented out tests
@damiannolan damiannolan merged commit 3987a5b into 02-client-refactor Jul 7, 2022
@damiannolan damiannolan deleted the damian/1293-verify-03-connection-funcs branch July 7, 2022 14:55
oshorefueled pushed a commit to ComposableFi/ibc-go that referenced this pull request Aug 9, 2022
…s#1647)

* replacing 03-connection verifications with generic membership methods

* adding inline comments for skipping delay period checks

* chore: removing legacy verify funcs from `ClientState` interface (cosmos#1649)

* removing legacy verify funcs from clientstate interface

* chore: remove legacy verify funcs tm client (cosmos#1651)

* removing legacy verification methods from tendermint client

* removing commented out tests

* fixing interface definition
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.

3 participants