Skip to content
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

Include total items in blocks per slot endpoint (Nova) [none] #1355

Closed
begonaalvarezd opened this issue Feb 27, 2024 · 3 comments
Closed

Include total items in blocks per slot endpoint (Nova) [none] #1355

begonaalvarezd opened this issue Feb 27, 2024 · 3 comments

Comments

@begonaalvarezd
Copy link
Member

Description

Priority: none

Add the total number of items in the response to avoid clients exhausting the cursor to be able to know the total size.
We should study if this impacts the performance of chronicle, and if it does, we can close this issue and we can continue using it as we currently do

Motivation

Improve usage

Requirements

Open questions (optional)

Are you planning to do it yourself in a pull request?

No.

@DaughterOfMars
Copy link
Collaborator

Implemented. The route will get the count before getting the stream, so this comes with some caveats:

  1. The count may not match the actual total if you were to exhaust the stream.
  2. The count may change each time you get the next page of results.

Still, I think this is as good as it is possible to be.

@begonaalvarezd
Copy link
Member Author

We will only request the blocks for past slots, so we dont expect the sum to change over time since the blocks are already issued and the slot is in the past, can this still be an edge case we might experience?

@DaughterOfMars
Copy link
Collaborator

Good point. I don't think it can be wrong in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants