fix(op-devstack): split ReorgTriggered into exact and relaxed variants#19549
Merged
fix(op-devstack): split ReorgTriggered into exact and relaxed variants#19549
Conversation
ReorgTriggered previously checked both that a reorg occurred on an exact block. When a reorg happens earlier than the target block and the target block is not the first in the epoch (e.g. due to an L1 reorg), the parent hash check fails because the reorged block's parent was itself reorged. Introduce ReorgExactFn which preserves the strict parent hash check, and relax ReorgTriggeredFn to only verify the block hash changed. Tests that assert a reorg at a specific divergence point now use ReorgExact; ReorgTriggered is available for cases where the reorg depth may vary. Extract shared reorg-detection logic into a reorgTriggered helper. Fixes TestUnsafeGapFillAfterSafeReorg CI failure where the reorg propagated deeper than the target block, causing a spurious parent hash mismatch. CircleCI: https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/119359/workflows/34010516-d6b0-4a0d-a424-f688235c28c5/jobs/4573838/tests
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #19549 +/- ##
===========================================
+ Coverage 75.3% 76.1% +0.7%
===========================================
Files 194 620 +426
Lines 11285 67407 +56122
===========================================
+ Hits 8502 51316 +42814
- Misses 2639 16091 +13452
+ Partials 144 0 -144
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
ajsutton
approved these changes
Mar 15, 2026
ClaytonNorthey92
pushed a commit
to hemilabs/optimism
that referenced
this pull request
Mar 19, 2026
ethereum-optimism#19549) ReorgTriggered previously checked both that a reorg occurred on an exact block. When a reorg happens earlier than the target block and the target block is not the first in the epoch (e.g. due to an L1 reorg), the parent hash check fails because the reorged block's parent was itself reorged. Introduce ReorgExactFn which preserves the strict parent hash check, and relax ReorgTriggeredFn to only verify the block hash changed. Tests that assert a reorg at a specific divergence point now use ReorgExact; ReorgTriggered is available for cases where the reorg depth may vary. Extract shared reorg-detection logic into a reorgTriggered helper. Fixes TestUnsafeGapFillAfterSafeReorg CI failure where the reorg propagated deeper than the target block, causing a spurious parent hash mismatch. CircleCI: https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/119359/workflows/34010516-d6b0-4a0d-a424-f688235c28c5/jobs/4573838/tests
ClaytonNorthey92
pushed a commit
to hemilabs/optimism
that referenced
this pull request
Mar 23, 2026
ethereum-optimism#19549) ReorgTriggered previously checked both that a reorg occurred on an exact block. When a reorg happens earlier than the target block and the target block is not the first in the epoch (e.g. due to an L1 reorg), the parent hash check fails because the reorged block's parent was itself reorged. Introduce ReorgExactFn which preserves the strict parent hash check, and relax ReorgTriggeredFn to only verify the block hash changed. Tests that assert a reorg at a specific divergence point now use ReorgExact; ReorgTriggered is available for cases where the reorg depth may vary. Extract shared reorg-detection logic into a reorgTriggered helper. Fixes TestUnsafeGapFillAfterSafeReorg CI failure where the reorg propagated deeper than the target block, causing a spurious parent hash mismatch. CircleCI: https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/119359/workflows/34010516-d6b0-4a0d-a424-f688235c28c5/jobs/4573838/tests
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.
Commit message drafted with the help of AI
ReorgTriggered previously checked both that a reorg occurred on an exact block. When a reorg happens earlier than the target block and the target block is not the first in the epoch (e.g. due to an L1 reorg), the parent hash check fails because the reorged block's parent was itself reorged.
Introduce ReorgExactFn which preserves the strict parent hash check, and relax ReorgTriggeredFn to only verify the block hash changed. Tests that assert a reorg at a specific divergence point now use ReorgExact; ReorgTriggered is available for cases where the reorg depth may vary.
Extract shared reorg-detection logic into a reorgTriggered helper.
Fixes TestUnsafeGapFillAfterSafeReorg CI failure where the reorg propagated deeper than the target block, causing a spurious parent hash mismatch.
CircleCI: https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/119359/workflows/34010516-d6b0-4a0d-a424-f688235c28c5/jobs/4573838/tests