ethereum-optimism / ethereum-optimism/optimism
flaky test: `TestELSyncSafeRetractedByOffset` — CrossSafe sync timeout during preset setup
- Dominant language
- Go
- Stars
- 6.5k
- Forks
- 4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 145
Description
**Claude:** Reporting a new flake.
## Flaky Test
`TestELSyncSafeRetractedByOffset` in `op-acceptance-tests/tests/sync/elsync/offset_el_safe/`
## CI Link
https://circleci.com/gh/ethereum-optimism/optimism/4907858
- Job: `memory-all-opn-op-geth` (CircleCI 4907858)
- Workflow: `main`
- Merge-queue pipeline for PR #20250, commit `c409fb370e462945e77526dd63afdaf87c4413c8`
- Test duration: 72.06s (of 940.43s total job)
## Error
```
--- FAIL: TestELSyncSafeRetractedByOffset (72.06s)
assertions.go:387:
Error Trace: /home/circleci/project/op-devstack/dsl/check.go:26
/home/circleci/project/op-devstack/presets/singlechain_from_runtime.go:51
/home/circleci/project/op-devstack/presets/singlechain_multinode.go:22
/home/circleci/project/op-acceptance-tests/tests/sync/elsync/offset_el_safe/init_test.go:15
/home/circleci/project/op-acceptance-tests/tests/sync/elsync/offset_el_safe/sync_test.go:28
Error: Received unexpected error:
operation failed permanently after 30 attempts: expected head to match: safe
```
## Context
The failure is during **preset setup**, before the test body runs — `singlechain_from_runtime.go:51` is the preset's initial CrossSafe/LocalUnsafe sync check, identical symptom to #19897. The preset waits up to 30×2s = 60s for the verifier CL to reach `types.CrossSafe` matching the sequencer.
The preset in `init_test.go` configures `VerifierSyncMode = nodeSync.ELSync` + `OffsetELSafe = 10s` for both L2CLs globally. In ELSync mode, `CrossSafe` requires derivation + supervisor confirmation of old batched data — slower than blocks arriving via EL p2p.
## Related
- #19897 — `TestTruncateDatabaseOnELResync`: same preset hook, same error message, also ELSync mode. Likely same root cause (CrossSafe promotion slower than 60s budget when under CI resource contention).
## Date
2026-04-24
Contributor guide
Research direction
Start with op-acceptance-tests/tests/sync/elsync/offset_el_safe/init_test.go and sync_test.go, then trace the preset setup through op-devstack/presets/singlechain_from_runtime.go:51 and singlechain_multinode.go:22. Compare the failure with #19897 and reproduce the CrossSafe timeout under CI-like contention. Done means the preset setup completes reliably and TestELSyncSafeRetractedByOffset passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100