-
Notifications
You must be signed in to change notification settings - Fork 75
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
soroban-rpc: getLedgerEntries: query multiple ledger entries at once #896
soroban-rpc: getLedgerEntries: query multiple ledger entries at once #896
Conversation
7891fd6
to
a4818b6
Compare
BTW, we should probably limit the number of entries requested at once. @tsachiherman did you get to add a limit to the size of JSON requests? We should also do that. |
Uhmm .. this PR actually reduces the performance of preflighting. I should look into it before merging. Before:
After:
|
I added a small optimization leading to better times but we are still doing worse than before.
|
fa9e62a
to
7ea058e
Compare
This improves performance of the getLedgerEntries and also paves the way to querying multiple entries from libpreflight.
7ea058e
to
2e9b9de
Compare
After #897 the numbers are much closer! Before this PR:
After this PR:
|
I think I am happy with this. |
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.
looks great, please take a note of @tamirms 's comment.
I'm not sure where that would be. But we should definitely add a limit to the number of keys that can be queried in a single getLedgerEntries call. Adding a limit to the json size request is a bit harder to implement; we might be able to limit the http request size by adding a middleware. |
@tsachiherman did you note this comments? |
I agree that we should limit the number of entries requested. As for the other one, I think that it's doable via a middleware - but it's more work .. with less obvious gain. ( unless it's easy to configure ) |
Limiting the size of http requests is a pretty common practice. Should we limit the number of entries queried to, say, 200? |
This improves the performance of the
getLedgerEntries
method and also paves the way to querying multiple entries from libpreflight (ahead of the upcoming ledger expiration changes)