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

Why is this code checking the "Path" instead of the request for proof? #173

Closed
greg-szabo opened this issue Jul 28, 2020 · 2 comments · Fixed by #174
Closed

Why is this code checking the "Path" instead of the request for proof? #173

greg-szabo opened this issue Jul 28, 2020 · 2 comments · Fixed by #174
Assignees

Comments

@greg-szabo
Copy link
Member

https://github.com/informalsystems/ibc-rs/blob/9545ccddfad78582532f1eb13f7ac201ccdac72f/relayer/relay/src/query.rs#L68-L72

This code survived a few refactors and we should implement it - or at least make it easier to understand.

As far as I understand, if the request came in with prove=true, it would be nice, if we checked that proof. But this code seems to suggest, that based on the Path there's an indication if the response should be checked.

I guess this must relate to the provableStore idea in the ICS. But as far as I'm aware, all request Paths are going to come from store/ibc/key. Or maybe I'm missing something.

Is it possible that the code is just slightly wrong and it should check the data field to see if the request contains something that's in the provableStore? (In that case I know how to deal with that.)

@greg-szabo
Copy link
Member Author

Here's my assumption for now:

  • we're going to assume we query the IBC store
  • a path is provable if it's in the provableStore, as indicated in ICS-024.

@ebuchman
Copy link
Member

ebuchman commented Aug 1, 2020

Just a note.

// Data that is not from trusted node or subspace query needs verification.

So obviously if we trust the node/ we set prove=false we don't verify.

The other type, subspace query, is when we query a whole subspace, which I mentioned here: #128 (comment)

ie. if we use a path like store/ibc/subspace we get all the keys prefixed with whatever we pass in data

I believe the idea re proofs here is that if you get a full subspace (ie. a complete merkle sub-tree), you don't need to worry about proofs, because you have all the data to construct them yourself. But you'd still need some proof to verify that the root of your subtree is in the larger tree ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants