-
Notifications
You must be signed in to change notification settings - Fork 825
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: proof verification #8220
feat: proof verification #8220
Conversation
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.
lgtm
/// Verify the proof against the provided storage root. | ||
pub fn verify(&self, root: B256) -> Result<(), ProofVerificationError> { | ||
let expected = | ||
if self.value.is_zero() { None } else { Some(encode_fixed_size(&self.value).to_vec()) }; |
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.
if self.value.is_zero() { None } else { Some(encode_fixed_size(&self.value).to_vec()) }; | |
// If the storage `value` is Zero then it's no longer part of the trie | |
if self.value.is_zero() { None } else { Some(encode_fixed_size(&self.value).to_vec()) }; |
this could also probably be self.value.encode()
given U256: RlpEncodable
seems like footgun
address, | ||
info: None, | ||
proof: Vec::new(), | ||
storage_root: EMPTY_ROOT_HASH, |
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.
This was a bug
c074975
to
2910d21
Compare
Description
Integrate proof verification introduced in alloy-rs/trie#13. Closes #8175