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

[chainstate] defer trie root hash calculation until no more writes will occur on the trie #3041

Closed
jcnelson opened this issue Feb 10, 2022 · 0 comments
Assignees

Comments

@jcnelson
Copy link
Member

Right now, writing nodes to a trie in the MARF consumes in aggregate a lot of time, because each time a leaf is inserted, the trie root hash is recalculated. This is unnecessary; the root hash only needs to be calculated once we're done writing leaf nodes. To implement this, the MARF needs a seal() operation that (a) calculates the trie root hash and the MARF root hash in the uncommitted state and stores it there, and (b) prevents subsequent writes from happening on the uncommitted state. Reads and transaction abort/commit will continue to be permitted.

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