0xPolygonHermez / zkevm-node

Go implementation of a node that operates the Polygon zkEVM Network
Other
539 stars 699 forks source link

Add sanity-check on checkL1InfoTreeUpdate to check state L1 blockhash matches ethereum blockhash (L1 reorg check) #3480

Closed agnusmor closed 7 months ago

agnusmor commented 7 months ago

What does this PR do?

Adds sanity-check on checkL1InfoTreeUpdate to check that blockhash of the L1 block where l1InfoRootIndex was synced matches ethereum blockhash. If it doesn't match it means that probably a L1 reorg happened and the Synchornizer has not detected it. Therefore the data stored in the exit_root table for this l1InfoRootIndex is not valid and this index cannot be used in the new L2 blocks.

Reviewers

Main reviewers:

@ToniRamirezM @joanestebanr