Skip to content

fix(op-devstack): split ReorgTriggered into exact and relaxed variants#19549

Merged
joshklop merged 1 commit intodevelopfrom
joshklop/fix-flake
Mar 15, 2026
Merged

fix(op-devstack): split ReorgTriggered into exact and relaxed variants#19549
joshklop merged 1 commit intodevelopfrom
joshklop/fix-flake

Conversation

@joshklop
Copy link
Contributor

@joshklop joshklop commented Mar 14, 2026

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

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
@joshklop joshklop requested a review from a team as a code owner March 14, 2026 22:38
@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.1%. Comparing base (aadf0fc) to head (fff9228).
⚠️ Report is 5 commits behind head on develop.

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     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 80.2% <ø> (ø)
unit 75.6% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 536 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joshklop joshklop added this pull request to the merge queue Mar 15, 2026
Merged via the queue into develop with commit 5d9ae15 Mar 15, 2026
281 checks passed
@joshklop joshklop deleted the joshklop/fix-flake branch March 15, 2026 01:36
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
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.

2 participants