algorand / algorand/go-algorand

Optimization: Leaf-hash-caching for SHA-512 Hashes

Open
#6,352 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.4k
Forks
537
Avg merge
1d 7h
Merged PRs (30d)
18

Description

Thinking about it more and talking with @algorandskiy, the easiest thing that doesn't require refactoring the merklearray package is to pre-compute all the leaf hashes as the block is built, and that saves you half the work at GenerateBlock time. Going deeper than that is trickier because of the way the leaves are indexed differently in the two implementations.. but the leaf-hash-caching would be lowest hanging fruit for a future optimization PR

_Originally posted by @cce in https://github.com/algorand/go-algorand/pull/6339#discussion_r2112495855_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.