zkevm-circuits icon indicating copy to clipboard operation
zkevm-circuits copied to clipboard

Extension into branch

Open miha-stopar opened this issue 1 year ago • 0 comments

Description

Light client mainnet test with block 18363441 revealed some issues:

  • getDriftedPosition in branch.go issue
  • Calling getProof/getStorageProof in modified_extension_node.go when 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.

miha-stopar avatar Feb 05 '24 10:02 miha-stopar