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
Christmas trie #236
Christmas trie #236
Conversation
trie
package
* core/state: minor optimization in state onleaf allocation * trie: implement dedicated committer and hasher * trie: use dedicated committer/hasher * trie: linter nitpicks * core/state, trie: avoid unnecessary storage trie load+commit * trie: review feedback, mainly docs + minor changes * trie: start deprecating old hasher * trie: fix misspell+lint * trie: deprecate hasher.go, make proof framework use new hasher * trie: rename pure_committer/hasher to committer/hasher * trie, core/state: fix review concerns * trie: more review concerns * trie: make commit collapse into hashnode, don't touch dirtyness * trie: goimports fixes * trie: remove panics
We should separate the |
I will do that in next PRs. Thanks
The changes of Iterator in |
Dedicated hasher/committer
The previous
hasher.go
, was a generic implementation which was used by bothCommit
andHash
. It does acouple of things:
shadow
-trie containing the new hashes,cached
, which will replace the oldroot
,collapsed
-trie containing the hashing-preimages, which is incrementally used to create higher order hash values.store
, if commit is being performed, to send nodes to the database, and also to theonleaf
handler (for Commit)This means that for every
Hash
orCommit
, every processed node was duplicated twice, usingcopy
. When I split this in two, it was possible to remove a lot of redundant allocs.Commit
The
Commit
operation is basically read-only, with the exception of setting thedirty
-flag tofalse
.onleaf
anddb
has been split off into a separate thread, and instead this PR send those tasks via a channel.This commit update the
trie
package to commit5a9c96454e04673124eedf681ae3aa0a58ffc843
ofgo-thereum
.