feat: Support for L1 reorgs#13428
Merged
Merged
Conversation
45bf250 to
cb115b9
Compare
67e6b4f to
04e7f8d
Compare
5e002bf to
fb3b640
Compare
LHerskind
approved these changes
Apr 29, 2025
LHerskind
left a comment
Contributor
There was a problem hiding this comment.
I like the idea of being a bit too cautious hence the outcome should not be worse than potentially missed blocks due to filling the new chain in.
The diff scared me a little with 12K new lines, but was mostly log files. What is the reasoning about keeping the log files here?
793722d to
7a3c5ab
Compare
spalladino
added a commit
that referenced
this pull request
May 7, 2025
Merges 3 commits into alpha-testnet: - [`Test blob sources on archiver startup`](6d19a11) is a cherry-pick from a commit in #13542 in master. - [`Throw on gaps in blocks in archiver`](92cf557) causes the archiver to throw on `getBlocks` calls where there are gaps, instead of just returning the next available block. This was masking the world-state syncing errors: a missing block in the archiver would result on the _next_ block being returned, so world state syncing would skip a block and fail. This commit also changes the aztec-node to use `getBlock(number)` from the archiver, instead of `getBlocks(number, limit:1)`. - [`Recover from block gaps due to spurious L2 reorgs`](185c029) makes the archiver check if the previous block exists when adding new ones. If not, it rolls back the L1 syncpoint to the last known block. This should help recover from spurious L2 reorgs where the archiver prunes blocks when it shouldn't have (more info in #13604). Note that [this piece of code](https://github.com/AztecProtocol/aztec-packages/pull/13428/files#diff-ea8c8bb366fc42b03ebd6cf063c8e6aa21328b8887942089086fa958f96a3f85R631-R673) from #13428 should also help, but we have not yet moved L1 reorg code to alpha-testnet, and this change is less intrusive. Except for the first one, these commits are not yet in master. Fixes #13604
Merged
github-merge-queue Bot
pushed a commit
that referenced
this pull request
May 29, 2025
This PR attempts to fix the flakey `epochs_empty_blocks` test. There were a couple of problems with this test resulting from #13428: - the test assumes it will run for N consecutive epochs - but the test also waits for certain blocks to become proven/finalised/historical - in #13428 the meaning of 'finalised' was changed. This caused the test to _skip_ entire epochs (e.g. entire epochs would be proven in the background while it waited for historical blocks) - this PR replicates the 'finalised' logic from the archiver so that the epoch counter updates correctly
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial support and e2e tests for L1 reorgs. Adds a suite of tests (a few skipped until we can make them pass) that test how a node deals with proofs being added or removed from L1, or past L2 blocks being removed from L1.
Archiver now supports pruning proven blocks, and decreasing the proven block number. It also checks for new L2 blocks possibly added before the L1 syncpoint (not messages yet!) if it sees a discrepancy between local data and the rollup contract. Last, it sets the
finalizedtip to the last proven block minus two epochs; this is not exact and is overly cautious, but is the first step towards having a finalized tip different from the proven one.Fixes #11836