-
Notifications
You must be signed in to change notification settings - Fork 586
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
Add a gRPC endpoint for fetching consensus state heights #798
Comments
In terms of priority, this is not urgent, something like priority 7 on a scale from 1 to 10 (10 highest). Rationale: The lack of this gRPC endpoint does impact the quality and stability of relayer operations, because relayers must rely on an expensive query ( |
Thanks for the rationale, @adizere. :) |
Would a gRPC with the following request/response messages satisfy the requirements?
The heights in the response should be in decreasing order. |
Yes, thank you!
This would be great. We usually sort the heights in descending order after we fetch them, so descending order is the semantic we'd like to achieve. Note that the protobuf type
For the first case we use |
Thanks for the feedback, @adizere. So if I understand you correctly, the heights should be in descending order if |
Yes. The new request should probably adhere to the same semantics as the others requests. The default ordering semantics are "ascending order". On the client side (i.e., relayer side), we will probably set
|
Anca pointed out that the default ordering in gRPC responses works on lexicographic value of Height, not on their numerical value.
Shall I open a separate issue for this? Or will this PR have the correct ordering implemented (i.e., adhering to numerical, not lexicographical order)? |
@catShaark, can you please check this in #1336 and fix it and add a test if needed? |
I can't find any ways to do numerical ordering efficiently as the On second thought, I think we should index Height by converting Height.RevisionNumber along with Height.RevisionHeight directly to 16 bytes ( 2 uint64 -> 16 bytes, big-endian ) in instead of turning them into a string ( uint64 -> string + "-" + uint64 -> string ) and then to bytes. Tho this change is state breaking and requires store migration so It might not be okay ?? |
@crodriguezvega , I've opened an issue to propose my solution. |
I think we should close #1336 without the numerical ordering and then do separate PR for numerical ordering on both |
Summary
The ibc-rs codebase would benefit from a gRPC endpoint that only fetches consensus state heights for a given client.
Problem Definition
At the moment, height information is extracted after querying for all consensus states via the
QueryConsensusStatesRequest
query, which is suboptimal. It would be nice to be able to query just for consensus state heights so that the extra step of extracting all of the heights can be eliminated.Proposal
Add a gRPC endpoint (perhaps something like
QueryConsensusHeightsRequest
) that returns all consensus state heights for a given client.For Admin Use
The text was updated successfully, but these errors were encountered: