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: implement and consume merkleizeBlockArray #420

Merged
merged 8 commits into from
Nov 6, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Nov 6, 2024

Motivation

  • When we have a list of bytes or list of composite, if new value is over the cached chunk/block bytes, right now we reallocate the whole Uint8Array which is not good due to gc

Description

  • Instead of that, implement merkleizeBlockArray(blocks: Uint8Array[], ...). In the above case we only need to allocate some more Uint8Array instances, each 64 bytes

  • refactor merkleizeInto() to merkleizeBlocksBytes() to avoid naming conflict

  • model block bytes which is 64 bytes instead of chunk bytes which is 32 bytes

  • this branch run on feat 16, 1, novc for 5 days without issue

Screenshot 2024-11-06 at 15 21 25
  • persisting gc statistic on 1d interval of md16:
Screenshot 2024-11-06 at 15 22 39
  • vs stable md16
Screenshot 2024-11-06 at 15 24 09

@twoeths twoeths marked this pull request as ready for review November 6, 2024 07:31
@twoeths twoeths requested a review from a team as a code owner November 6, 2024 07:31
@twoeths twoeths merged commit fbbf918 into te/batch_hash_tree_root Nov 6, 2024
7 checks passed
@twoeths twoeths deleted the te/merkleize_block_array branch November 6, 2024 07:31
@twoeths twoeths changed the title feat: merkleize block array feat: implement and consume merkleizeBlockArray Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant