zkevm-circuits
zkevm-circuits copied to clipboard
Extension into branch
Description
Light client mainnet test with block 18363441 revealed some issues:
getDriftedPositioninbranch.goissue- Calling
getProof/getStorageProofinmodified_extension_node.gowhen the short extension node is a branch and there is no trie node at this address/key - Wrongly prepared storage leaf
Furthermore, the test revealed a case which was not envisioned before - when proving that the leaf doesn't exist one might get a "wrong" extension node (so there are three scenarios for does-not-exist proofs: nil object in a branch, wrong leaf, wrong extension node), so WrongGadget needs to be extended to cover this case.
Issue Link
https://github.com/privacy-scaling-explorations/zkevm-circuits/issues/1738
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
Test
TestExtensionIntoBranch, TestAccountWrongExtensionNode in gen_witness_from_local_blockchain_test.go.
TestStorageWrongExtensionNode, TestStorageWrongExtensionNode1 in gen_witness_from_infura_blockchain_test.go.