-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(trie): retain branch nodes in sparse trie #12291
base: main
Are you sure you want to change the base?
Conversation
47ede04
to
8c04ef0
Compare
let mut tree_mask_values = Vec::new(); | ||
let mut hash_mask_values = Vec::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these vecs and not bitmasks (TrieMask
s) from the start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it requires checking the children set in state_mask
to correctly set the bits in tree_mask
and hash_mask
, so I would suggest we do it in a follow-up PR because it requires changes to alloy-trie
crates/trie/sparse/src/trie.rs
Outdated
path, | ||
RlpNode::word_rlp(&hash), | ||
false, | ||
SparseNodeType::Branch { store_in_db_trie: true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the flag set to true in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, fixed by memoizing in the same way as we do with hash
Doesn't collect removed branch nodes yet, only updated ones.