Skip to content

Commit 4871d65

Browse files
committed
Enhance nonce handling in bridgeL1FeeJuice function to account for eventual consistency in public RPC nodes
1 parent dcfb6e0 commit 4871d65

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/utils/bridge_fee_juice.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export async function bridgeL1FeeJuice(
5757

5858
// Create a fresh L1 client so viem picks up the current on-chain nonce.
5959
// The mint (or prior runs) may have incremented it beyond what the
60-
// original client has cached.
60+
// original client has cached. Public RPC nodes may have eventual consistency,
61+
// so wait briefly for the nonce to propagate.
62+
await new Promise(resolve => setTimeout(resolve, 3_000));
6163
const freshClient = createExtendedL1Client(chain.rpcUrls, key, chain.chainInfo);
6264
const freshPortal = await L1FeeJuicePortalManager.new(node, freshClient, logger);
6365
const claim = await freshPortal.bridgeTokensPublic(recipient, amount, false);

0 commit comments

Comments
 (0)