Request Hedging for JSON-RPC Reads
Your p99 is bad, you already have a fallback list, and the tail did not move. Request hedging for JSON-RPC reads is a tail-latency technique, not a reliability one: send the same read to more than one endpoint at once and take the first answer. It does not make a failing endpoint work. It makes a slow one stop mattering. Two conditions make it correct — the operation is a read, and the tail is caused by the endpoint rather than by your own client. Get either wrong and the second request buys you nothing, while handing you an answer you still have to check.
What request hedging does to tail latency, and what it is not
Tail latency is a scale problem before it is a hedging problem: the tail of a latency distribution gets harder to keep low as a system grows and as load rises [1].
Issue the same read to two or more endpoints, take the first successful response, cancel or ignore the rest. The duplicate does not leave at the same instant as the original. It fires after a delay, and that delay decides whether hedging helps or multiplies your traffic. Set it from your own per-request latency distribution. Fire too early and the hedge goes out on every request, including the fast ones. Fire near the tail you are trying to cut and it goes out only on requests that are already slow. We hold no measurement that justifies a number, and a number here would be invented. Derive it from your own logs.
Three techniques get confused at this point. Failover is sequential and triggers on failure, so it does nothing for a request that succeeds slowly — see ordered, weighted and quorum failover compared. Quorum waits for agreement across sources and is about correctness, not speed — see quorum semantics and silent disagreement. Retries re-send after an error, which is a third trigger again. Hedging races and takes the first, which is about speed and says nothing about correctness. Failover answers "what if it breaks", quorum answers "what if they disagree", hedging answers "what if it is slow".
The tail you are trying to fix
A p99 caused by your client is not fixed by a second request. It is doubled. The client-side causes are ordinary: a connection pool too small for your concurrency, DNS resolution on the request path, a cold TLS handshake on every call, a client-side queue, a retry loop that is already firing. Each of them makes every endpoint look slow at the same moment, so a hedge adds a second request to a queue that is already the problem.
An endpoint-caused tail looks different. The same request is fast against one endpoint and slow against another at the same moment, and the slow one is slow in the server's own timing rather than in yours. That is the measurement to take: per-endpoint latency for the same request, not aggregate latency across your client. Aggregate latency hides the distinction — a single p99 across a mixed pool tells you the pool is slow, not which member was slow or whether the request would have been fast anywhere. If both endpoints are slow together, the cause is not the endpoint and hedging will not help. The same discipline applies when you are choosing between providers at all — see comparing two RPC providers before you switch.
The trap: fastest is not freshest
A node that is behind the chain head answers quickly with old state. It has less work to do, so it replies sooner. "First response wins" is therefore not a safe rule on its own: it prefers the fastest node, and the fastest node is sometimes the one that has not caught up. Hedging without a freshness check converts a latency problem into a correctness problem, and the correctness problem is harder to notice because the response looks fine — well-formed, correctly typed, plausible.
The specification gives you the reason two endpoints can disagree at the same moment. Block tags are per-node observations. "Latest" is the most recent block in the canonical chain observed by the client, and the spec says that block "may be re-orged out of the canonical chain even under healthy/normal conditions" [2]. Two healthy endpoints can return different answers to the same eth_getBalance in the same second, and neither is wrong about what it saw.
That matters wherever the value decides something: a balance read before a transfer, a nonce read before a send, a log query that decides whether a backfill is complete. A stale answer that arrives fast is worse than a correct one that arrives late, because nothing downstream flags it.
A freshness check is cheap. Compare the block number in the response against a known head. Accept only responses at or above a threshold. Or take the first response that is both fast and current, which means holding the fast one until its block number clears the bar. The rule: hedge on latency, decide on freshness. The hedge picks a candidate; the freshness check decides whether to keep it.
What it costs
A hedge is a second request against the same limit. Rate limits are counted per API key in a sliding window, and every chain draws on the same one — the plan's limit is a total across all chains [3]. The duplicate spends from the same per-key budget whichever endpoint or chain you send it to. Hedging near a limit makes the limit arrive sooner, and the interaction with 429 is what bites — see 429, backoff and jitter. Over-limit requests are rejected on arrival rather than queued, and they are not billed [3], so the failure mode is a rejected hedge rather than a surprise invoice. The number depends on your plan and volume.
The second cost is a storm. A hedge multiplies requests exactly when the system is already slow, because that is when the delay fires. Cap the number of concurrent hedges per client, and when the cap is reached drop the hedge rather than the original request.
The duplicate is only safe because a read has no side effect. That is the whole reason hedging belongs on reads and nowhere else.
When not to hedge
Four situations where the second request makes things worse.
Writes and anything with a side effect: a hedge is a duplicate, and a duplicate write is a bug. Nothing in JSON-RPC 2.0 makes a repeated request safe — the specification does not use the words idempotent, safe or duplicate anywhere, and the id member exists to correlate a request with its response, not to collapse two identical ones [4]. Its one statement about concurrency is that a server may process a batch as concurrent tasks in any order [4], which is about batches, not about a client sending the same request twice.
A tail that is client-caused: you double the work and keep the tail.
Being near a rate limit: the hedge is what pushes you over.
Any answer that must be consistent across calls: two endpoints can disagree, and racing them picks a winner arbitrarily.
The spec's silence is a gap, not an endorsement. It does not forbid a duplicate read and it does not authorise one. The safety comes from the operation having no side effect, which is an argument about your code rather than a rule you can quote.
The decision rule
Hedge when all four of these hold. The operation is a read. The tail is endpoint-caused, measured per endpoint for the same request. You have headroom against your rate limit. You can check freshness on the response. If any one fails, do not hedge.
The third condition is the one that gets skipped. If you are already close to your limit, the hedge is the request that gets you rejected, and a rejected hedge leaves the original still in flight with one fewer slot to retry in.
Before any of that, try the cheaper fixes. Size the connection pool to your concurrency. Reuse connections instead of opening one per call. Move DNS resolution off the request path. Route reads to the endpoint that is measurably faster for that method. A routing decision costs nothing per request; a hedge costs a request every time. Hedging is the last of these to try, not the first.
Log per-endpoint latency for the same request for a week. Then look at whether the slow responses cluster on one endpoint or spread across all of them. That single chart decides whether hedging earns its cost: clustered means the endpoint is the cause and a hedge can help; spread means the cause is yours and a second request will only double it.
Sources
- The Tail at Scale — Google Research publication page — Google Research, 2013-01-01
- eth_getBalance — block parameter and block tags, including 'latest' (Ethereum Execution APIs, spec v1.0.0-beta.7) — ethereum.github.io (ethereum/execution-apis), 2026-01-01
- Rate Limits — SwiftNodes docs — SwiftNodes, 2026-01-01
- JSON-RPC 2.0 Specification — Request Object, id member — JSON-RPC Working Group (jsonrpc.org), 2010-01-01
This article was researched, written and edited by AI under human supervision, and checked against Rankwrite's public editorial rubric.
John Sullivan covers RPC infrastructure, node operations, and multi-chain development at SwiftNodes — what it actually takes to keep endpoints fast, fresh, and reliable across EVM and non-EVM networks.