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

Implement incremental hasher for computing txroot/etc without constructing database #724

Open
arnetheduck opened this issue Aug 30, 2024 · 0 comments

Comments

@arnetheduck
Copy link
Member

arnetheduck commented Aug 30, 2024

When computing MPT roots, the current version of the code works by constructing a database of the full value and then hashing up to the root - this is extremely inefficient due to the many allocations involved as well as the cost of maintaining the full data in memory - instead, it's possible to build an incremental hasher that:

  • only stores hashes, not values
  • every time a branch is full (ie has 16 children) collapses those into a single hash

Examples of this can be found:

Also related is #698

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

No branches or pull requests

1 participant