Skip to content

[SSZ] Optimization on merkleization of chunks by precomputed hashes. #597

Closed
@Godspower-Eze

Description

@Godspower-Eze

Description

Our current implementation of merkleization of chunks needs some optimization and one way of doing that is by using precomputed hashes of zeros.

During merkleization, chunks are padded by zeros to reach the next value that's a power of 2. And, merkleization of zeros are known so basically we hard code these hashes and use them rather than computing them everytime.

For example, the hash of:

  • two zeros of 32 bytes is f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b
  • four zeros of 32 bytes is db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71

references

Metadata

Metadata

Assignees

Labels

perfperformance-related PRs or issues

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions