11import { EpochCache } from '@aztec/epoch-cache' ;
22import { createEthereumChain } from '@aztec/ethereum/chain' ;
3+ import { makeL1HttpTransport } from '@aztec/ethereum/client' ;
34import { InboxContract , RollupContract } from '@aztec/ethereum/contracts' ;
45import type { ViemPublicDebugClient } from '@aztec/ethereum/types' ;
56import { BlockNumber } from '@aztec/foundation/branded-types' ;
@@ -18,7 +19,7 @@ import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
1819import { getTelemetryClient } from '@aztec/telemetry-client' ;
1920
2021import { EventEmitter } from 'events' ;
21- import { createPublicClient , fallback , http } from 'viem' ;
22+ import { createPublicClient } from 'viem' ;
2223
2324import { Archiver , type ArchiverDeps } from './archiver.js' ;
2425import { type ArchiverConfig , mapArchiverConfig } from './config.js' ;
@@ -59,17 +60,18 @@ export async function createArchiver(
5960
6061 // Create Ethereum clients
6162 const chain = createEthereumChain ( config . l1RpcUrls , config . l1ChainId ) ;
63+ const httpTimeout = config . l1HttpTimeoutMS ;
6264 const publicClient = createPublicClient ( {
6365 chain : chain . chainInfo ,
64- transport : fallback ( config . l1RpcUrls . map ( url => http ( url , { batch : false } ) ) ) ,
66+ transport : makeL1HttpTransport ( config . l1RpcUrls , { timeout : httpTimeout } ) ,
6567 pollingInterval : config . viemPollingIntervalMS ,
6668 } ) ;
6769
6870 // Create debug client using debug RPC URLs if available, otherwise fall back to regular RPC URLs
6971 const debugRpcUrls = config . l1DebugRpcUrls . length > 0 ? config . l1DebugRpcUrls : config . l1RpcUrls ;
7072 const debugClient = createPublicClient ( {
7173 chain : chain . chainInfo ,
72- transport : fallback ( debugRpcUrls . map ( url => http ( url , { batch : false } ) ) ) ,
74+ transport : makeL1HttpTransport ( debugRpcUrls , { timeout : httpTimeout } ) ,
7375 pollingInterval : config . viemPollingIntervalMS ,
7476 } ) as ViemPublicDebugClient ;
7577
0 commit comments