fix(op-reth): wait for proofs ExEx store before validator eth_getProof#20487
Open
fix(op-reth): wait for proofs ExEx store before validator eth_getProof#20487
Conversation
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>
Codecov Report✅ All modified and coverable lines are covered by tests.
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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
Summary
FetchAndVerifyProofsnow waits for the validator's proofs ExEx store to index the target block before callingeth_getProofon the op-reth validator.debug_executePayload.Root cause
The op-reth validator's
eth_getProofreads historical state throughOpStateProviderFactory, which is backed by the proofs ExEx store. The ExEx ingestsChainCommittednotifications asynchronously, so the EL head can advance to block N before the store has indexed it.WaitForBlockNumberonly syncs the EL head, so the first proof query right after a deploy (e.g. block 2 inTestStorageProofUsingSimpleStorageContract) intermittently fails withno state found for block number N.Failing run
TestStorageProofUsingSimpleStorageContractfailed to get proof from L2ELB at block 2: no state found for block number 2(rust/op-reth/tests/proofs/utils/proof.go:142)The other proof tests (
TestStorageProofUsingMultiStorageContract,TestTokenVaultStorageProofs) follow the sameWaitForBlockNumber → FetchAndVerifyProofspattern and are equally exposed to the race; they happened to pass on this run. Centralizing the wait inFetchAndVerifyProofscovers all of them.Test plan
rust/op-reth/tests/proofs/...Go tests passTestStorageProofUsingSimpleStorageContract(and the multistorage / tokenvault tests) against the mixed op-geth sequencer + op-reth validator preset🤖 Generated with Claude Code