-
-
Notifications
You must be signed in to change notification settings - Fork 19
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: improve type.hashTreeRoot() using batch #409
base: master
Are you sure you want to change the base?
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
tested this on |
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:
|
Motivation
Description
getRoots()
and compute root from there, this PR implementgetChunkBytes()
merkleizeInto()
which use batch therechunkBytesBuffer
memory in type, almost noUint8Array
allocations 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