-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix(l1): receipts invalid size libmdbx #2065
Open
MarcosNicolau
wants to merge
8
commits into
main
Choose a base branch
from
fix/receipts-invalid-size-libmdbx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4450593
feat: indexed chunks type for libdmbx
MarcosNicolau 1347db6
feat: implement indexed chunks for receipts
MarcosNicolau 7cc01fd
refactor: return key value pair in indexed chunk from impl
MarcosNicolau eaaf721
chore: address clippy warnings
MarcosNicolau b0b2f8f
test: libmdbx indexed chunks
MarcosNicolau 18b2941
feat: handle 256 chunks limitation explictly via code
MarcosNicolau 0bb8741
Merge branch 'main' into fix/receipts-invalid-size-libmdbx
MarcosNicolau 9149452
chore: address clippy warnings
MarcosNicolau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think there might be a risk of infinite looping here. If your block uses 256 chunks then after chunk with index
255
the addition overflows, and you'll ask for chunk with index0
of the same hash, and thus start the whole cycle again forever.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.
Maybe we should store the size somewhere.
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.
Yes, I considered that as well. The size is defined as a u8, meaning we can have up to 256 chunks. However, if each value is 2022 bytes, we'd need to store around 517,632 bytes (~0.5 MB) to reach this limit. Tbh, I am not sure about the log size in ethereum and whether a receipt can take that amount of space.
For now, as we discussed offline, we'll keep it as is and address any limitations if they arise. I'll also update the code to explicitly reflect this limit and leave a clear warning.
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.
Solved in 18b2941.