Consensys / shomei

Shomei Linea state manager extends the Hyperledger Besu functionality. This component communicates with Besu in order to maintain and update the ZK state. This component will communicate with Besu thanks to this plugin https://github.com/ConsenSys/besu-shomei-plugin
https://documenter.getpostman.com/view/27370530/2s93ebTr7h
Apache License 2.0
1 stars 5 forks source link

bug: linea_getProof / SparseMerkleProof.sol #97

Closed adraffy closed 1 month ago

adraffy commented 2 months ago

Description

linea_getProof returns wrong values for storage values that don't exist in the trie.

Steps to Reproduce (Bug)

Here is a simple demo, view-source to see what it's doing exactly, but it does account and storage proof verification for a single slot.

The default contract is USDC but you can change it with query paramater address.

For slot 0xcb0cbc8493baf4a7b1972914ba0be89040e56e4a3c98d60268fe37b8c8e546d8 (the default): https://raffy.antistupid.com/eth/linea-proof-bug.html

2024-09-21T22:58:30.386Z accountProof is valid: true
2024-09-21T22:58:30.555Z leftStorageProof is valid: false
2024-09-21T22:58:30.670Z rightStorageProof is valid: false

For slot 0, which is owner and exists: https://raffy.antistupid.com/eth/linea-proof-bug.html?slot=0

2024-09-21T22:59:18.777Z accountProof is valid: true
2024-09-21T22:59:18.976Z storageProof is valid: true

For slot 49, which is also and does not exist: https://raffy.antistupid.com/eth/linea-proof-bug.html?slot=49

2024-09-21T23:02:21.272Z accountProof is valid: true
2024-09-21T23:02:21.527Z leftStorageProof is valid: true
2024-09-21T23:02:21.625Z rightStorageProof is valid: false
matkt commented 2 months ago

we did a fix in the last release. could you try again ?

adraffy commented 2 months ago

Yes, I believe that fixed the issue AFAICT. I'll get back to you with further analysis. Thank you!

Edit I haven't encountered any invalid proofs yet, seems fixed.