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: add missing leaves cache #167

Merged
merged 3 commits into from
Oct 30, 2024
Merged

Conversation

keefel
Copy link
Contributor

@keefel keefel commented Oct 24, 2024

Description

This PR adds a cache for storage roots of missing leaves during prefetching. This cache can then be used directly when computing the state root.

Rationale

When computing the state root of the account tree, some account nodes may not have had their storage roots calculated during the parallel storage roots stage. Since these account nodes did not change their storage content in the current block, we can cache their storage roots during the prefetch stage. This cache can then be used to speed up the computation of the account tree state root.

This PR can reduce the elapsed time of the account trie tree by 15% and the total state root calculation time by 5%.

Example

NA

Changes

Notable changes:

  • add storage root cache for missing leaves

Potential Impacts

  • NA

@keefel keefel changed the title [WIP] feat: add cache for missing leaves [WIP] feat: add missing leaves cache Oct 25, 2024
@keefel keefel changed the title [WIP] feat: add missing leaves cache feat: add missing leaves cache Oct 29, 2024
@keefel keefel added this pull request to the merge queue Oct 30, 2024
Merged via the queue into bnb-chain:develop with commit 7452e10 Oct 30, 2024
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants