From e5c78ad0360eecd6876261b803cc062235e91c97 Mon Sep 17 00:00:00 2001 From: vraspar Date: Sun, 5 Apr 2026 19:24:17 -0700 Subject: [PATCH] add pollingInterval and FORK_URL warning to fork setup - Add pollingInterval: 100 to fork public client (Anvil mines instantly, default 4s polling wastes time per waitForTransactionReceipt) - Warn when FORK_URL not set and falling back to public RPC Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/setup/anvil.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/setup/anvil.ts b/tests/setup/anvil.ts index ba1c371..ed03bbd 100644 --- a/tests/setup/anvil.ts +++ b/tests/setup/anvil.ts @@ -73,6 +73,7 @@ function defineAnvil(options: { chain, transport, cacheTime: 0, + pollingInterval: 100, }) }, @@ -98,8 +99,13 @@ function defineAnvil(options: { // Pre-configured instance for Base Sepolia fork // --------------------------------------------------------------------------- +const forkUrl = process.env.FORK_URL ?? 'https://sepolia.base.org' +if (!process.env.FORK_URL) { + console.warn('FORK_URL not set, using public RPC (rate-limited)') +} + export const anvilBaseSepolia = defineAnvil({ chain: baseSepolia, - forkUrl: process.env.FORK_URL ?? 'https://sepolia.base.org', + forkUrl, port: 8745, })