-
Notifications
You must be signed in to change notification settings - Fork 21
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 cursor in GetEventResponse #287
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add a cursor, instead? It will be more precise relative to the end ledger.
I am more inclined towards but this is for the case when no events are found for given filter and we need to tell clients that we looked thru startLedger to endLedger range so that client could just copy paste the endLedger to startLedger in follow up request. We had a discussion in past around this here We got this suggestion to add |
I think I agree with @Shaptic in that it would be more useful to have a field in the response which indicates what cursor value should be used so we can continue the search. Assume the search window is
For case (1) you cannot use For case (2) you can use For case (3) you cannot use |
driving by, agree with the suggestions for encapsulating the notion of 'next' into a cursor on the response, as @tamirms highlights the complexity for a client to use endLedger correctly. GetEventResponse could provide the pre-computed 'next' cursor based on internal endLedger/scanLimit chunking, and the caller can just paste into its next GetEventRequest:
if 'next' is absent, implies there are no more events in rpc db to scan at that time. |
Thank you for all the inputs @tamirms @sreuland okay so we talked about this in planning and agreed on using cursor instead of endLedger. Also now with this task #118 (move pagination-token/cursor to root level) it actually kinda makes more sense to not introduce more fields for less confusion. Building up on aforementioned cases:
so all in all we are using cursor_id as normal pagination token and also as end of the search window based on the use cases. @janewang Do you have any feedback/suggestions on this? |
Hey @psheth9, thanks! Will this PR going in as part of Protocol 22? I think we may need to make update Lab UI for |
Got it, thank you @mollykarcher 👍 |
What
Add endLedger in GetEventResponse
Why
startLedger
(inclusive) -endLedger
(exclusive)getEvents
are capped by 10KLedgerScanLimit
which means you can query events for 10K ledger at maximum for a given request.Fixes: #289 and #118