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

Faster online pruning with cached trie inserted/modified merkle values #2854

Closed
qdm12 opened this issue Sep 22, 2022 · 1 comment
Closed

Comments

@qdm12
Copy link
Contributor

qdm12 commented Sep 22, 2022

The online pruning finds inserted/modified nodes by going through the entire trie and checking each node for the dirty flag.

We can change that to have each trie cache merkle values (database keys) that were inserted/modified, so it should be much faster.

This should be done after #2835

@qdm12
Copy link
Contributor Author

qdm12 commented Nov 9, 2022

When inserting/updating a node in the trie, all the path of nodes from the root to that new or updated node is modified. In other words, for a node at depth N in the trie, N nodes are modified. That means for every Put operation, there are N node encoding and up to N blake2b hashing. As a consequence, performance is severely degraded, so tracking updates in the trie is not feasible. The current walk of the trie will be kept instead, especially since it would be needed to implement the 'write cache' for lazy loading (walk the trie and only write updated nodes since the last snapshot).

@qdm12 qdm12 closed this as completed Nov 9, 2022
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 a pull request may close this issue.

2 participants