-
Notifications
You must be signed in to change notification settings - Fork 7
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
Migrate Account and Storage to merkle_patricia_proofs #316
Conversation
c55220b
to
3f1a3e1
Compare
3f1a3e1
to
b758bae
Compare
|
||
fn get_storage_value(rlp_encoded_value: [u8; MAX_STORAGE_VALUE_LEN]) -> [u8; MAX_STORAGE_VALUE_LEN] { | ||
let mut storage_value = rlp_encoded_value; | ||
let rlp_value_len = right_pad(rlp_encoded_value).len(); |
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.
left_padded_len
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.
I rewrote this function, now it uses Fragments and I think this name is outdated
ethereum/circuits/lib/src/receipt.nr
Outdated
@@ -109,7 +110,7 @@ unconstrained fn get_receipt_unconstrained_M( | |||
cumulative_gas_used: receipt.cumulative_gas_used, | |||
logs_bloom: receipt.logs_bloom | |||
}; | |||
let proof_input = ProofInput::deserialize(proof_input); | |||
let proof_input: ProofInput<MAX_PREFIXED_KEY_NIBBLE_LEN, MAX_VALUE_LEN_M, MAX_DEPTH_NO_LEAF, MAX_LEAF_LEN_M> = Serde::deserialize(proof_input); |
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.
Will it work without annotation?
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.
Oh, actually it works, I'll remove the annotations everywhere
wrong_proof.proof[0] += 1; | ||
let _ = verify_account(state_proof.key, account, wrong_proof, state_root); | ||
let mut wrong_proof = state_proof_input; | ||
wrong_proof.proof.nodes[0][0] -= 1; |
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.
alter_array?
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.
Doing +1 instead of -1 causes a compiler panic
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.
Add a comment about RLP lel len issue and compiler panic
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.
Added
wrong_address[0] += 1; | ||
let _ = verify_account(wrong_address, account, state_proof, state_root); | ||
let _ = verify_account(wrong_address, account, state_proof_input, state_root); | ||
} | ||
|
||
// TODO: Add correct assertion message when noir-trie-proofs is updated |
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.
Is this still a TODO? Seems like we don't even use noir-trie-proofs any more
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.
You're right, added correct assertion message
wrong_proof.proof[0] += 1; | ||
let _ = verify_account(state_proof.key, account, wrong_proof, state_root); | ||
let mut wrong_proof = state_proof_input; | ||
wrong_proof.proof.nodes[0][0] -= 1; |
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.
Add a comment about RLP lel len issue and compiler panic
f6d9081
to
fca07e1
Compare
4a4a730
to
221bc0a
Compare
This PR removes old proof fixtures as we don't use them anymore. It is a PR on top of #316
No description provided.