Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op-program: Prune L1 blocks after advancing origin #11530

Merged
merged 6 commits into from
Aug 31, 2024

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Aug 20, 2024

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 in l1Blocks 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

@ajsutton ajsutton marked this pull request as ready for review August 20, 2024 07:39
@ajsutton ajsutton requested review from protolambda and a team as code owners August 20, 2024 07:39
@ajsutton ajsutton changed the title op-program: Retry pruning L1 blocks when advancing origin to include the parent L1 origin op-program: Prune L1 blocks after advancing origin Aug 27, 2024
Copy link
Contributor

@protolambda protolambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one question about a test assertion that seems off though

op-e2e/actions/batch_queue_test.go Show resolved Hide resolved
@protolambda protolambda added this pull request to the merge queue Aug 31, 2024
Merged via the queue into develop with commit 18f6453 Aug 31, 2024
60 checks passed
@protolambda protolambda deleted the aj/reprune-l1blocks branch August 31, 2024 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants