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

feat: ensure offset size is at most 8 bytes #8000

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Conversation

onbjerg
Copy link
Collaborator

@onbjerg onbjerg commented Apr 30, 2024

The offset size in Nippy Jar is stored in a single byte with a maximum value of 255. For context, the offset size denotes how big an offset is in number of bytes in the offset file.

Since an offset is read into an u64, we only support offset sizes of up to (and including) 8 bytes. This PR enforces that by checking the size of an offset on DataReader::new.

Note that currently all offsets are 8 bytes large, but this may change in the future: #5750

@onbjerg onbjerg added C-enhancement New feature or request A-static-files Related to static files labels Apr 30, 2024
Copy link
Collaborator

@joshieDo joshieDo left a comment

Choose a reason for hiding this comment

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

lgtm

@onbjerg onbjerg enabled auto-merge April 30, 2024 15:22
@onbjerg onbjerg added this pull request to the merge queue Apr 30, 2024
Merged via the queue into main with commit e158542 Apr 30, 2024
29 checks passed
@onbjerg onbjerg deleted the onbjerg/offset-size-cap branch April 30, 2024 15:46
mw2000 pushed a commit to mw2000/reth that referenced this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-static-files Related to static files C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants