Skip to content

feat: add ETHEREUM_HTTP_TIMEOUT_MS env var for viem HTTP transport#20919

Merged
PhilWindle merged 2 commits intomerge-train/spartanfrom
palla/ethereum-http-timeout
Mar 12, 2026
Merged

feat: add ETHEREUM_HTTP_TIMEOUT_MS env var for viem HTTP transport#20919
PhilWindle merged 2 commits intomerge-train/spartanfrom
palla/ethereum-http-timeout

Conversation

@spalladino
Copy link
Contributor

Summary

  • Adds ETHEREUM_HTTP_TIMEOUT_MS env var to configure the HTTP timeout on viem's http() transport (default is viem's 10s)
  • Introduces makeL1HttpTransport helper in ethereum/src/client.ts to centralize the repeated fallback(urls.map(url => http(url, { batch: false }))) pattern
  • Updates all non-test createPublicClient call sites (archiver, aztec-node, sequencer, prover-node, epoch-cache, blob-client) to use the helper with the configurable timeout

Motivation

Users hitting TimeoutError: The request took too long to respond on archiver eth_getLogs calls when querying slow or public L1 RPCs. Viem's default 10s timeout is too short for large log queries and there was no way to configure it.

Test plan

  • yarn build passes
  • yarn format and yarn lint pass
  • Set ETHEREUM_HTTP_TIMEOUT_MS=60000 and confirm the archiver no longer times out on large eth_getLogs ranges

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PhilWindle PhilWindle merged commit 6689d32 into merge-train/spartan Mar 12, 2026
10 checks passed
@PhilWindle PhilWindle deleted the palla/ethereum-http-timeout branch March 12, 2026 09:07
@AztecBot
Copy link
Collaborator

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

AztecBot pushed a commit that referenced this pull request Mar 12, 2026
… transport

Cherry-pick of fde4119 from PR #20919.
Contains conflict markers in yarn-project/blob-client/src/client/http.ts.
ludamad pushed a commit that referenced this pull request Mar 12, 2026
… transport

Cherry-pick of fde4119 from PR #20919.
Contains conflict markers in yarn-project/blob-client/src/client/http.ts.
spalladino added a commit that referenced this pull request Mar 12, 2026
…ackport #20919) (#21434)

## Summary
Backport of #20919 to v4-next.

Adds `ETHEREUM_HTTP_TIMEOUT_MS` env var to configure the timeout for
viem HTTP transports used in L1 RPC calls. Introduces
`makeL1HttpTransport` helper to centralize transport creation with
consistent timeout support.

## Conflict Resolution
Cherry-pick had a conflict in `blob-client/src/client/http.ts` because
`next` had refactored `getSlotNumber` to accept `parentBeaconBlockRoot`
as a parameter. Resolved by keeping the v4-next code structure and
applying only the transport change (`makeL1HttpTransport` with timeout
support).

## Commits
1. Cherry-pick with conflict markers (for reviewability)
2. Conflict resolution

ClaudeBox log: https://claudebox.work/s/02b67d20aae96377?run=2

---------

Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants