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

context: remove verifier & trust node #6805

Merged
merged 10 commits into from
Jul 23, 2020
Merged

context: remove verifier & trust node #6805

merged 10 commits into from
Jul 23, 2020

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Jul 21, 2020

Description

This Pr removes trust node and verifier. This is preparation for tendermint 0.34. These methods and flow of logic is not present any longer. This is up for discussion on how to be handled. I have a issue for incorporating the light client into the sdk here: #6563

closes: #XXXX


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

@lgtm-com
Copy link

lgtm-com bot commented Jul 21, 2020

This pull request introduces 1 alert when merging 5fa4e4b into 6e7ce48 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@codecov
Copy link

codecov bot commented Jul 21, 2020

Codecov Report

Merging #6805 into master will increase coverage by 0.14%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #6805      +/-   ##
==========================================
+ Coverage   61.27%   61.42%   +0.14%     
==========================================
  Files         510      509       -1     
  Lines       31555    31457      -98     
==========================================
- Hits        19334    19321      -13     
+ Misses      10720    10637      -83     
+ Partials     1501     1499       -2     

@tac0turtle tac0turtle marked this pull request as ready for review July 21, 2020 13:57
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Thanks @marbar3778! Left a few minor comments. Should we also create an issue for how we plan to tackle the light client?

client/flags/flags.go Outdated Show resolved Hide resolved
client/flags/flags.go Outdated Show resolved Hide resolved
x/auth/client/query.go Show resolved Hide resolved
x/auth/client/query.go Show resolved Hide resolved
@alexanderbez alexanderbez added the A:automerge Automatically merge PR once all prerequisites pass. label Jul 21, 2020
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.

We need to be able to query and verify proofs for IBC cc: @cwgoes

@@ -103,18 +99,12 @@ func (ctx Context) queryABCI(req abci.RequestQuery) (abci.ResponseQuery, error)
return result.Response, nil
}

if err = ctx.verifyProof(req.Path, result.Response); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

so proofs are not verified anymore? I don't think this is desirable

Copy link
Member Author

@tac0turtle tac0turtle Jul 21, 2020

Choose a reason for hiding this comment

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

the lite.verifier is no longer present in tendermint. These methods are no longer useable. the light client can verify, isnt that what is needed by IBC?

Copy link
Contributor

Choose a reason for hiding this comment

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

The context is still using tendermint/lite/proxy - I don't know if that's up to date or not

Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm understanding this correctly, this removes verification of the proof of the internal query returned from a sdk application process to the querying client. This is technically fine because these queried results shouldn't be used to execute any state. If one is updating state they should be using the light client not this verifier.

Maybe we should update documentation to explain this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the verification just being pushed downstream to the light client? Can one query through the light client?

Copy link
Member Author

Choose a reason for hiding this comment

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

From my understanding, this is used if the query is being executed against a distrusted node.

I will go through the docs and update the removal of this feature. In the future, I believe operators that do not wish to run a full node will be able to run a light client if they would like verification. This can be done in 0.40.x as it should not introduce any breaking changes

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the verification just being pushed downstream to the light client? Can one query through the light client?

there is no notion of running a light client in the Cosmos-SDK from my limited knowledge.

Copy link
Contributor

Choose a reason for hiding this comment

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

gotcha, so basically

  • trust no one -> full node
  • trust someone -> light client
  • trust many folk -> use a service

Copy link
Collaborator

Choose a reason for hiding this comment

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

gotcha, so basically
trust no one -> full node
trust someone -> light client
trust many folk -> use a service

ok this makes sense then

Copy link
Contributor

@alexanderbez alexanderbez Jul 21, 2020

Choose a reason for hiding this comment

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

note that the binary (full-node) will connect and serve queries through itself by default and not need to prove anything. If you override this behavior by specifying --node=... when you do a query, then you'll need to potentially verify the proof. To do this, you'll need a light client.

Honestly, I'm not sure about the UX. We can leave the --node flag, but then maybe we provide a warning log that you cannot trust nodes in this case and that you should start a light client.

client/query.go Show resolved Hide resolved
@tac0turtle tac0turtle removed the A:automerge Automatically merge PR once all prerequisites pass. label Jul 21, 2020
@tac0turtle
Copy link
Member Author

removed automerge, there is still work to be done in docs

@tac0turtle tac0turtle added the A:automerge Automatically merge PR once all prerequisites pass. label Jul 23, 2020
@mergify mergify bot merged commit e6a5622 into master Jul 23, 2020
@mergify mergify bot deleted the marko/remove_verifier branch July 23, 2020 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:CLI T: Client UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants