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

How ibc-go generate the existence proof of a packet? #2449

Closed
3 tasks
ImJeremyHe opened this issue Sep 30, 2022 · 3 comments
Closed
3 tasks

How ibc-go generate the existence proof of a packet? #2449

ImJeremyHe opened this issue Sep 30, 2022 · 3 comments

Comments

@ImJeremyHe
Copy link

Summary of Bug

I have investigated for a while that how an existence proof is generated in ibc-go.
But I found that it is always nil in the response.

return types.NewQueryPacketCommitmentResponse(commitmentBz, nil, selfHeight), nil

I'm not sure whether this is the relevant code I am looking for.

Expected Behaviour

Version

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@crodriguezvega
Copy link
Contributor

Hi @ImJeremyHe. The reason why the proof is nil in that response (and in the response of other gRPC queries of ibc-go) is the lack of support at SDK/Tendermint level for gRPC calls to return proofs for the query. There is this issue open in the SDK repo to add support for it.

The way to get the proof would be to make an ABCI query using either Tendermint's RPC endpoint or the SDK's gRPC endpoint that has been added recently (and released in v0.46).

I hope this helps!

@ImJeremyHe
Copy link
Author

@crodriguezvega Thank you for your reply! Do you know where I can read the exact implementation of getting proof? There are so many relevant repo and I have no clue.

@crodriguezvega
Copy link
Contributor

crodriguezvega commented Nov 12, 2022

@ImJeremyHe Sorry for the late reply, but I didn't have the knowledge to be able to answer your question, until @AdityaSripal actually explained this week how it works.

When a relayer makes an ABCI query on Tendermint't RPC endpoint, Tendermint routes via ABCI the query to the SDK. From here, the steps to follow where a proof for data stored in IAVL is obtained are these: 1, 2, 3, 4, 5, 6, 7, 8 and finally inside this function the IAVL treeGetMembershipProof or GetNonMembershipProof functions are used to retrieved a proof depending on whether a existence or non-existence proof is needed.

I hope this helps!

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

No branches or pull requests

3 participants