-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(trie): update prefix set on the call to RevealedSparseTrie::update_rlp_node_level
#14108
Conversation
17bc2bc
to
2278214
Compare
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.
don't have enough context to review this in detail
but changes lgtm, would prefer to swap the tuple for a newtype though
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.
some nit qs, seems good otherwise
f93c257
to
95dc36b
Compare
Previously, we were doing the
std::mem::take
for the whole prefix set on each call toRevealedSparseTrie::root
, but not onRevealedSparseTrie::update_rlp_node_level
.Effectively, this made
update_rlp_node_level
have no effect on the subsequentroot
call, because it was still re-calculating the whole trie.This PR makes the
RevealedSparseTrie::update_rlp_node_level
update the prefix set, so that it includes only those paths that are above the specified level. Just doing thetake
is not correct there, because the nodes above the specified level still need re-calculation.On the screenshot, before 14:40 is
main
, after is this branch.