fix(indexer): bounded in-place retry for the raced reth head refresh (#210)#211
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C9RTnbCyhqEUSPc7xCK76p
|
Adversarial review gate (two lenses on e794d6e) — fable: CLEAN, zero findings at any severity; Gemini: three precise no-defects, two open items both resolved by fable with repo/upstream evidence. Verified highlights: the retry type is private and constructed at exactly one site — byte-for-byte the old failure site — so nothing else can trigger the retry, and no previously-succeeding shape changes behavior; exhaustion returns the raw error whose Display is the identical string the old code produced (the outer wrap reproduces the exact live Merging on CI green + connector verdict. Deploy note: rides the next image rebuild alongside #208 to protect the Base phase-1 pass from the observed ~2–3-hourly race crashes. |
Closes #210. The live recovery deploy hit this twice in ~3 hours: the reth-db source's head refresh races reth's own tip advancement — best number resolves but the canonical-hash lookup at that height returns
None— and the whole indexer process died each time, paying the full startup-scan tax and aborting all in-flight work (post-#208 this would also restart an in-flight phase-1 stateless pass from scratch).Change
chain_info()resolving a best number with zero best hash whileblock_hash(best_number)returnsNone— retries, with a fresh best-number+hash re-read each attempt.fetch_chain_heads_sync); driver/classifier logic isolated inreth_db/head.rs.Verification
Focused reth tests 4 passed (fresh-height recovery, persistent exhaustion, unrelated-error bypass, typed-only classification — via the narrow driver seam, no new datadir stub machinery); feature-enabled provider filter 93 passed. fmt/clippy/file-size clean. Codex
$verify-loop: clean.Deploy note: intended to ride the next image rebuild alongside #208 so the Base phase-1 pass is protected from the ~2-3-hourly race crashes observed live.
🤖 Generated with Claude Code
https://claude.ai/code/session_01C9RTnbCyhqEUSPc7xCK76p