gRPC calls should support returning proofs for the query.
Currently gRPC just uses the module's keeper to return the desired information. No proofs are generated for the query. In IBC, we need to generate proofs for almost every interaction so the current workaround is to essentially create wrapper functions around our gRPC calls that do ABCI queries and inject the proof into the response. It is quite redundant to do the same query twice via different mechanisms and for IBC, gRPC is unnecessary without proofs.
I imagine users might want to do a gRPC via an untrusted node and verify the returned proof via their light client.
One probably shorter term solution is to expose a function that can generate proofs based on a key and value. That way if I do a gRPC to query object V with key K, then I'd like to be able to call GenerateProof(K, V) and get back a proof and height for the proof.
I think there has been possible discussion of adding some sort of proto headers to handle proofs, but I have no idea how this would look. I just wanted to open this issue to begin discussion around this topic since I couldn't find an existing issue.
Great thanks @colin-axner. Yeah, I previously mentioned the idea of doing proofs via headers. It's probably a fair amount of work, but I think it can be done for at least simple key/value queries. Proofs that for index scans would be more involved but are also I think doable. The one big challenge is making sure the protobuf encoding of the response doesn't change at some intermediate serialization step because the proof depends on the serialized store bytes.
Most helpful comment
Great thanks @colin-axner. Yeah, I previously mentioned the idea of doing proofs via headers. It's probably a fair amount of work, but I think it can be done for at least simple key/value queries. Proofs that for index scans would be more involved but are also I think doable. The one big challenge is making sure the protobuf encoding of the response doesn't change at some intermediate serialization step because the proof depends on the serialized store bytes.