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

ConsensusState is retrieved by light clients in verifyXYZ as necessary #7005

Merged
merged 9 commits into from
Aug 12, 2020

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Aug 11, 2020

Description

Moves retrieval of consensus state to verifyXYZ functions. Refactored most of the tests in tm's client_state_test.go to use ibc testing package

closes: #6281


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

@colin-axner colin-axner changed the title move con state retrieval to verify funcs ConsensusState is retrieved by light clients in verifyXYZ as necessary Aug 11, 2020
@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #7005 into master will increase coverage by 0.20%.
The diff coverage is 75.47%.

@@            Coverage Diff             @@
##           master    #7005      +/-   ##
==========================================
+ Coverage   61.90%   62.10%   +0.20%     
==========================================
  Files         520      521       +1     
  Lines       32151    32123      -28     
==========================================
+ Hits        19902    19949      +47     
+ Misses      10632    10540      -92     
- Partials     1617     1634      +17     

@colin-axner colin-axner marked this pull request as ready for review August 11, 2020 16:02
Copy link
Collaborator

@fedekunze fedekunze 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! minor comments

x/ibc/07-tendermint/types/client_state_test.go Outdated Show resolved Hide resolved
x/ibc/07-tendermint/types/client_state_test.go Outdated Show resolved Hide resolved
x/ibc/07-tendermint/types/client_state_test.go Outdated Show resolved Hide resolved
x/ibc/07-tendermint/types/client_state_test.go Outdated Show resolved Hide resolved
x/ibc/07-tendermint/types/client_state_test.go Outdated Show resolved Hide resolved
x/ibc/07-tendermint/types/store.go Show resolved Hide resolved
x/ibc/07-tendermint/types/store.go Show resolved Hide resolved
@@ -144,6 +144,15 @@ func (cs ClientState) VerifyClientConsensusState(
return err
}

if consensusState == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't this checked on sanitizeVerificationArgs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took it out of sanitizeVerificationArgs since the consensusState is now being retrieved and decoded from the store

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.

LGTM, some minor requests

) error {
merkleProof, err := sanitizeVerificationArgs(cdc, cs, height, prefix, proof, consensusState)
merkleProof, consensusState, err := sanitizeVerificationArgs(store, cdc, cs, height, prefix, proof)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe sanitizeVerificationArgs is a misnomer given its returning the consensus state as well.

Maybe produceVerificationArgs

x/ibc/07-tendermint/types/client_state_test.go Outdated Show resolved Hide resolved
x/ibc/07-tendermint/types/client_state_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

utACK, agree with prior comments

colin-axner and others added 5 commits August 12, 2020 10:33
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
…m:cosmos/cosmos-sdk into colin/6281-remove-constate-from-verifyxyz
@fedekunze fedekunze merged commit d752a7b into master Aug 12, 2020
@fedekunze fedekunze deleted the colin/6281-remove-constate-from-verifyxyz branch August 12, 2020 09:20
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.

Remove consensus state from verifyXYZ funcs
5 participants