Skip to content

fix(op-reth): wait for proofs ExEx store before validator eth_getProof#20487

Open
nonsense wants to merge 1 commit intodevelopfrom
nonsense/fix-storage-proof-test-flake
Open

fix(op-reth): wait for proofs ExEx store before validator eth_getProof#20487
nonsense wants to merge 1 commit intodevelopfrom
nonsense/fix-storage-proof-test-flake

Conversation

@nonsense
Copy link
Copy Markdown
Contributor

@nonsense nonsense commented May 1, 2026

Summary

Root cause

The op-reth validator's eth_getProof reads historical state through OpStateProviderFactory, which is backed by the proofs ExEx store. The ExEx ingests ChainCommitted notifications asynchronously, so the EL head can advance to block N before the store has indexed it. WaitForBlockNumber only syncs the EL head, so the first proof query right after a deploy (e.g. block 2 in TestStorageProofUsingSimpleStorageContract) intermittently fails with no state found for block number N.

Failing run

The other proof tests (TestStorageProofUsingMultiStorageContract, TestTokenVaultStorageProofs) follow the same WaitForBlockNumber → FetchAndVerifyProofs pattern and are equally exposed to the race; they happened to pass on this run. Centralizing the wait in FetchAndVerifyProofs covers all of them.

Test plan

  • CI: rust/op-reth/tests/proofs/... Go tests pass
  • Local: re-run TestStorageProofUsingSimpleStorageContract (and the multistorage / tokenvault tests) against the mixed op-geth sequencer + op-reth validator preset

🤖 Generated with Claude Code

FetchAndVerifyProofs queries the validator (op-reth) via eth_getProof,
which reads through OpStateProviderFactory backed by the proofs ExEx
store. The ExEx ingests ChainCommitted notifications asynchronously,
so the EL head can advance to the target block before the store has
indexed it, causing "no state found for block number N".

WaitForBlockNumber syncs only the EL head, so the first proof query
right after a deploy (e.g. block 2 in TestStorageProofUsingSimpleStorageContract)
flakes. Mirror the fix from #19986 by polling debug_proofsSyncStatus
on the validator before calling GetProof.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nonsense nonsense requested a review from a team as a code owner May 1, 2026 12:42
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.4%. Comparing base (f0f3c93) to head (f0357e4).
⚠️ Report is 1 commits behind head on develop.

❗ There is a different number of reports uploaded between BASE (f0f3c93) and HEAD (f0357e4). Click for more details.

HEAD has 11 uploads less than BASE
Flag BASE (f0f3c93) HEAD (f0357e4)
cannon-go-tests-64 1 0
unit 2 1
contracts-bedrock-tests 9 0
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20487      +/-   ##
===========================================
- Coverage     11.0%     0.4%   -10.6%     
===========================================
  Files          692      506     -186     
  Lines        76858    66167   -10691     
===========================================
- Hits          8498      323    -8175     
+ Misses       68216    65844    -2372     
+ Partials       144        0     -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests ?
unit 0.4% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 186 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant