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

core/rawdb: support freezer batch read with no size limit #27687

Merged
merged 3 commits into from
Jul 12, 2023

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Jul 10, 2023

This PR lets freezer to perform batch read without size limitation.

Nowadays, it's a bit painful if users want to batch-read from multiple freezer tables
without knowing the accurate size requirement for each table. It might happen that
the items read from different tables are different. In this case, truncation is required
to align the items returned from different tables as a whole.

This feature can be useful if users are aware that out-of-memory will not happen
(e.g. read only 1k elements)

TODO

  • Add unit test

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman holiman added this to the 1.12.1 milestone Jul 12, 2023
@holiman holiman merged commit 0b1f97e into ethereum:master Jul 12, 2023
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
…7687)

This change adds the ability to perform reads from freezer without size limitation. This can be useful in cases where callers are certain that out-of-memory will not happen (e.g. reading only a few elements). 

The previous API was designed to behave both optimally and secure while servicing a request from a peer, whereas this change should _not_ be used when an untrusted peer can influence the query size.
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants