feat: improve type.hashTreeRoot() using batch#409
Merged
nazarhussain merged 10 commits intomasterfrom Mar 11, 2025
Merged
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
Contributor
Author
|
tested this on |
Contributor
Author
|
sha256 works in blocks, each is 64 bytes so perhaps it's more meaningful to reflect that for also with holesky, there are 1.7M validators. For every 8 deposits we have to reallocate the whole 1.7M * 8 bytes = 13.6MB for Update:
|
9e32c5c to
7ed3ced
Compare
d3821ee to
cbb30a2
Compare
matthewkeil
reviewed
Feb 21, 2025
Member
matthewkeil
left a comment
There was a problem hiding this comment.
I left a few comments but I think this PR really needs to be reviewed by @wemeetagain
This reverts commit 15cf649.
wemeetagain
previously approved these changes
Mar 7, 2025
wemeetagain
approved these changes
Mar 11, 2025
nazarhussain
approved these changes
Mar 11, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Description
getRoots()and compute root from there, this PR implementgetChunkBytes()merkleizeInto()which use batch therechunkBytesBuffermemory in type, almost noUint8Arrayallocations in the middlehashTreeRootInto()api. This is needed in case consumers want to reuse memory allocation thereallocUnsafe()of as-sha256 where it makes sensecherry picked from #378