op-program: Prune L1 blocks after advancing origin #11530
Merged
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.
Description
Prune the L1 blocks array in batch queue after advancing origin since the advancement may have added the parent L1 origin which is required to prune successfully. Previously if the initial L1 block used as origin was exactly 1 block prior to the L1 origin of the safe head, the batch queue broke its invariant for
l1Blocks
field and failed to pop off the initial L1 block because the safe head L1 origin wasn't inl1Blocks
when the trim happened but was then added as part of advancing the origin (indicating that all L2 blocks with the initial L1 block as their origin were already safe).Add e2e test to reproduce corner case when deploying a chain at L1 genesis.
Tests
Added unit test and action test.
Additional context
Fixes flaky test
TestPrecompiles/DisputePrecompile-ecrecover