-
Notifications
You must be signed in to change notification settings - Fork 332
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
query connection given connection_id #130
Comments
Proto definitions for connection queries and responses (see |
As per our discussion today, I'll create a proto folder and store the proto files in there following the same structure as the cosmos sdk proto folder. Also, per our discussion will be using prost crate to handle proto files/logic. |
BTW, something I forgot to mention but you've probably seen already is that if you want to generate the rust types during build time, you also need a dependency on
and a |
Next steps are trying to make it compile again using the new proto generated file. We might need to chat about this. Seems to me that a lot of logic in the proto files are somewhat duplicate with things already implemented in the Rust code. |
Just a note for now let's try to use the minimal amount of proto to get this working. Since this is just the ConnectionEnd we should probably copy over just the pieces we need to query just a ConnectionEnd - I don't think that should have any dependency on Tendermint. If we copy over the full dir we'll have lots of deps but let's try to simplify first to get it working. |
I’ve tried to use the minimal as far as I know. There might be more ways to trim possibly. The dependency on tendermint proto is from the cosmos proto, there’s an import for tendermint.crypto.Proof (which the cosmos proto had what it seems an old reference tendermint.crypto.merkle.Proof and I changed to match the new tendermint reorged protos). We should have some discussions on how we want to handle proto files on our side. Thought the idea of using proto in the end was that all implementations used the same interface to prevent mismatches and deserialization issues. But if we’re going to implement our own protos then we can structure for now in a more simplistic way. |
Regarding the dependency on the Go proto definitions & compiling them: It seems that the problem with using the Go-based .proto files is that there are some Go-specific declarations in there. The
Trying to trim out the |
While writing the above ^ comment I remembered that there are more "canonical" proto definitions here: These are slightly different, however, than the Go proto. Which makes me wonder why are they different... |
Out of curiosity do they err if build with |
If you want to run this
This is the output for the command above. Need someone (maybe @ancazamfir) to validate if it makes sense
and here's the output from the curl command to simd data
the key above Base64 decoded is:
the value above Base64 decoded is:
|
No, they don't error, surprisingly. But note we had to manually copy/paste the gogo.proto from github into our repo.. It seems that only the prefix needs fixing. And we need to also define |
Looks good! I made some comments in the PR wrt error handling. The command takes some other parameters, |
… connection. Doesn't throw exception anymore. Show error message. #130
Worked on the issue that an exception was thrown if height parameter was specified. Now it shows an error message (but not sure if the error makes sense, need @ancazamfir to validate message) For example specifying height 4:
Also noticed something strange, if you specify proof false (-p false) and a height (e.g. -h 4), the error message returned is about a non-existing connection
But if you omit the height the query works:
So not sure what's going on, maybe some logic error? |
* Initial implementation of proto files required for connection. Proto files generated but replacing connection mod breaks the build * Removed reference to MerklePrefix * Implemented logic to proto_unmarshall the connection using prost #130 * Trimmed the proto file, fixed commitments. Ready for review. (#130) * Fixed a couple of nits * Fix for unused_qualifications h/t @gregszabo @andynog. * Fixing unit testing since CommitPrefix was changed, failed to cargo build #136 * Replaced prost compilation with dependency on ibc-proto crate. * Better error propagation in connection query. * Fixed error handling when specifying height (-h) parameter in a query connection. Doesn't throw exception anymore. Show error message. #130 * Added validation for versions in ConnectionEnd unmarshalling * Implemented fmt::Debug trait for CommitPrefix to properly display its value (string instead of vector of bytes). Assumes value is valid utf-8. #136 Co-authored-by: Andy Nogueira <me@andynogueira.dev>
* Initial implementation of proto files required for connection. Proto files generated but replacing connection mod breaks the build * Removed reference to MerklePrefix * Implemented logic to proto_unmarshall the connection using prost informalsystems#130 * Trimmed the proto file, fixed commitments. Ready for review. (informalsystems#130) * Fixed a couple of nits * Fix for unused_qualifications h/t @gregszabo @andynog. * Fixing unit testing since CommitPrefix was changed, failed to cargo build informalsystems#136 * Replaced prost compilation with dependency on ibc-proto crate. * Better error propagation in connection query. * Fixed error handling when specifying height (-h) parameter in a query connection. Doesn't throw exception anymore. Show error message. informalsystems#130 * Added validation for versions in ConnectionEnd unmarshalling * Implemented fmt::Debug trait for CommitPrefix to properly display its value (string instead of vector of bytes). Assumes value is valid utf-8. informalsystems#136 Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Given a connection id, query the connection.
Should be able to run this from the relayer CLI.
The text was updated successfully, but these errors were encountered: