-
Notifications
You must be signed in to change notification settings - Fork 101
imp(ibc-query): ProvableContext::get_proof
should return a domain type instead of bytes
#1136
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
Comments
We must not use @Farhad-Shabani do you think it's a good idea to use I suggest this, as it stays consistent with proof argument types in connection, channel, and packet methods in |
In real-world scenarios, this method will be called and consumed by RPC or gRPC methods. Therefore, the returned proof is included in the response sent to the caller, who, in our case, are the relayers. Of course, for the testing environment where everything occurs in place as mocks (meaning there is no RPC server), it does make sense to change to the |
Uh oh!
There was an error while loading. Please reload this page.
Improvement Summary
In
ibc-query
's traits,ProvableContext::get_proof
returns proofs in bytes format. We should use a domain type here.https://github.com/cosmos/ibc-rs/blob/d773a23aea09bae6cccb7c185db2c4101c090097/ibc-query/src/core/context.rs#L14-L18
Decoding this requires using
Protobuf::<T>::decode
, which needsprost::Message
trait and is not provided by theToProto
trait.Proposal
We can use
MerkleProof
here.https://github.com/cosmos/ibc-rs/blob/d773a23aea09bae6cccb7c185db2c4101c090097/ibc-core/ics23-commitment/types/src/merkle.rs#L31-L33
(In the query implementation, we will return the Protobuf encoded bytes for
MerkleProof
fromibc_proto
)Which is interchangeable with
CommitmentProofBytes
https://github.com/cosmos/ibc-rs/blob/d773a23aea09bae6cccb7c185db2c4101c090097/ibc-core/ics23-commitment/types/src/commitment.rs#L112-L128
Which is passed to
ClientStateCommon
for proof verification.https://github.com/cosmos/ibc-rs/blob/d773a23aea09bae6cccb7c185db2c4101c090097/ibc-core/ics02-client/context/src/client_state.rs#L58-L77
The text was updated successfully, but these errors were encountered: