-
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): witness #9803
feat(trie): witness #9803
Conversation
e2696cc
to
cda7023
Compare
cda7023
to
7a9161a
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.
tbh I don't have sufficient context to review this in detail but, logic wise this looks okay to me
let account = state | ||
.accounts | ||
.get(&hashed_address) | ||
.ok_or(TrieWitnessError::MissingAccount(hashed_address))?; |
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.
or_else?
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.
just a copy here, is it needed?
let value = if account.is_some() || storage_multiproof.root != EMPTY_ROOT_HASH { | ||
account_rlp.clear(); | ||
TrieAccount::from((account.unwrap_or_default(), storage_multiproof.root)) | ||
.encode(&mut account_rlp as &mut dyn BufMut); |
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 this cast required?
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.
to make rust analyzer happy :/
Description
Ref #9249
Create a trie witness implementation that gathers all trie nodes needed to apply state transition.