This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
forked from matter-labs/zksync-era
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(en): Fix reorg detection in presence of tree data fetcher (matter…
…-labs#2197) ## What ❔ Fixes reorg detection logic so that it accounts for the tree data fetcher: - **In tree data fetcher:** Tries to detect reorgs, so that root hashes are not written for diverging L1 batches. - **In reorg detector:** Checks last L2 block correspondence during binary searching a diverging L1 batch. ## Why ❔ Reorg detection may be broken if tree data fetcher is enabled: - The tree data fetcher doesn't check that fetched L1 batch root hashes correspond to local L1 batches, i.e. it can fetch a root hash after a revert. - Hence, the logic in reorg detector which binary-searches the diverged L1 batch is broken because the latest L1 batch isn't guaranteed to diverge if there's a divergence. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. - [x] Spellcheck has been run via `zk spellcheck`.
- Loading branch information
Showing
7 changed files
with
434 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.