fix(taiko-client-rs): harden blob fetching and reconnect anchor resolution - #22006
Draft
davidtaikocha wants to merge 1 commit into
Draft
fix(taiko-client-rs): harden blob fetching and reconnect anchor resolution#22006davidtaikocha wants to merge 1 commit into
davidtaikocha wants to merge 1 commit into
Conversation
…ution
Three fixes for a follower-freeze incident where a transient L1 RPC blip
wedged the driver permanently:
- Blob-server fallback now understands blobscan-style responses: when
/blobs/{hash} omits the inline `data` field (returning
dataStorageReferences instead), fetch the payload from
/blobs/{hash}/data (JSON-string or bare hex), keeping the versioned-
hash verification. Previously any blobscan-backed fallback failed with
Parse("error decoding response body").
- Blob fetches get a dedicated, configurable timeout
(--blob.fetchTimeout, default 120s) instead of the global 12s
DEFAULT_HTTP_TIMEOUT. PeerDAS beacon nodes (lighthouse
--semi-supernode) reconstruct blobs from data columns per request,
measured at ~1.5-5s per blob in the slot — a near-head 21-blob slot
took 38-46s, so 12s cannot succeed on busy slots. Non-blob paths keep
the short timeout.
- The finalized reconnect anchor is now retried (up to 10 attempts with
the scanner reconnect backoff) before falling back to the startup
anchor. The lookup runs right after a scanner interruption, which is
usually caused by the same transient L1 RPC outage; the previous
one-shot fallback amplified a ~40s blip into a multi-day rewind. A
fresh-chain "no finality yet" answer still short-circuits without
retrying.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Incident this fixes
On alethia-hoodi (2026-08-12 ~13:04 UTC),
l2-node-reth-0's rust driver froze its L2 head permanently after a ~40s L1 RPC stall, while go-driver followers on the same L1 node rode it out. The chain of events:terminal event scanner error.blob_sidecarsexceeded the hardcoded 12sDEFAULT_HTTP_TIMEOUT;datafield (blobscan servesdataStorageReferences+ a separate/blobs/{hash}/dataroute), so decoding failed withParse("error decoding response body").preconfirmation ingress loop is not ready→ head frozen until manual pod restart.Measurements behind the timeout choice
Against lighthouse v8.2.1
--semi-supernode(hoodi),blob_sidecarslatency scales with blob count, not slot age (~1.5–5s per blob, no caching — repeat requests can be slower):PeerDAS nodes reconstruct blobs from data columns per request, so a 12s timeout cannot succeed on busy slots at all. (The go client survives with its 60s
DefaultRpcTimeout.) Meanwhile blobscan's/blobs/{hash}/dataserves the same blob in ~2s.Changes
Blob-server fallback understands blobscan responses (
rpc/src/blob.rs):datais now optional inBlobServerResponse; when absent (or empty), the payload is fetched from/blobs/{hash}/data, accepting both a JSON-encoded string ("0x…", what blobscan serves) and a bare hex body. The computed-commitment/versioned-hash verification is unchanged, so a wrong payload is still rejected. Servers that inlinedata(Taiko blob storage service) behave exactly as before.Dedicated, configurable blob fetch timeout (
--blob.fetchTimeout, envBLOB_FETCH_TIMEOUT, default 120s): applied to the beacon client used for blob fetches and to the blob-server HTTP client. The global 12sDEFAULT_HTTP_TIMEOUTis intentionally left untouched for everything else (event-scanner reconnect, the whitelist runner's slot/epoch metadata beacon client) — those paths want fast failure detection.Retry the finalized reconnect anchor before rewinding to the startup anchor (
driver/src/sync/event.rs): up to 10 attempts with the existing scanner reconnect backoff (≈75s at the default 12s cap), which rides out the transient RPC outages that cause scanner interruptions in the first place. A fresh-chain "no finality yet" (Ok(None)) answer still short-circuits immediately — only transport errors are retried. This extends the resilience direction of feat(taiko-client-rs): harden event scanner against transient L1 stalls #21969 to the anchor-resolution path.Tests
rpc::blob: blobscan-style metadata +/datafallback (JSON-string and raw-hex bodies), and rejection of a/datapayload that doesn't match the requested versioned hash. The fallback test reproduces the exact production failure (it fails withParse("error decoding response body")on the old code).driver::sync::event: transient-failure retry, give-up after max attempts, and Ok(None) short-circuit (proved by queue-consumption order).cargo test -p rpc -p driver --lib: 14 + 129 passed.just clippy(both passes,-D warnings -D missing_docs -D clippy::missing_docs_in_private_items) andcargo +nightly fmt --checkclean.Notes for reviewers
--supernode, or caching reconstructed blobs) needs attention regardless of any client timeout.🤖 Generated with Claude Code