From f37d2ce8a8b8a15a94449058fa147c19df6f3f73 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Thu, 5 Dec 2024 10:24:33 +0000 Subject: [PATCH] fix: increase timeouts --- .../cli/src/cmds/devnet/bootstrap_network.ts | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts b/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts index de452290aad..12073936e11 100644 --- a/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts +++ b/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts @@ -1,5 +1,5 @@ import { getSchnorrAccount } from '@aztec/accounts/schnorr'; -import { BatchCall, type PXE, type Wallet, createCompatibleClient, retryUntil } from '@aztec/aztec.js'; +import { BatchCall, type PXE, type WaitOpts, type Wallet, createCompatibleClient, retryUntil } from '@aztec/aztec.js'; import { L1FeeJuicePortalManager } from '@aztec/aztec.js'; import { type AztecAddress, type EthAddress, FEE_FUNDING_FOR_TESTER_ACCOUNT, Fq, Fr } from '@aztec/circuits.js'; import { @@ -20,6 +20,12 @@ type ContractDeploymentInfo = { salt: Fr; }; +const waitOpts: WaitOpts = { + timeout: 120, + provenTimeout: 1200, + interval: 1, +}; + export async function bootstrapNetwork( pxeUrl: string, l1Url: string, @@ -90,9 +96,17 @@ export async function bootstrapNetwork( log(`DevCoin L1: ${erc20Address}`); log(`DevCoin L1 Portal: ${portalAddress}`); log(`DevCoin L2: ${token.address}`); + log(`DevCoin L2 init hash: ${token.initHash}`); + log(`DevCoin L2 salt: ${token.salt}`); log(`DevCoin L2 Bridge: ${bridge.address}`); + log(`DevCoin L2 Bridge init hash: ${bridge.initHash}`); + log(`DevCoin L2 Bridge salt: ${bridge.salt}`); log(`DevCoin FPC: ${fpc.address}`); + log(`DevCoin FPC init hash: ${fpc.initHash}`); + log(`DevCoin FPC salt: ${fpc.salt}`); log(`Counter: ${counter.address}`); + log(`Counter init hash: ${counter.initHash}`); + log(`Counter salt: ${counter.salt}`); } } @@ -142,17 +156,17 @@ async function deployToken( const { TokenContract, TokenBridgeContract } = await import('@aztec/noir-contracts.js'); const devCoin = await TokenContract.deploy(wallet, wallet.getAddress(), 'DevCoin', 'DEV', 18) .send({ universalDeploy: true }) - .deployed(); + .deployed(waitOpts); const bridge = await TokenBridgeContract.deploy(wallet, devCoin.address, l1Portal) .send({ universalDeploy: true }) - .deployed(); + .deployed(waitOpts); await new BatchCall(wallet, [ devCoin.methods.set_minter(bridge.address, true).request(), devCoin.methods.set_admin(bridge.address).request(), ]) .send() - .wait(); + .wait(waitOpts); return { token: { @@ -202,7 +216,9 @@ async function deployFPC( // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Importing noir-contracts.js even in devDeps results in a circular dependency error. Need to ignore because this line doesn't cause an error in a dev environment const { FPCContract } = await import('@aztec/noir-contracts.js'); - const fpc = await FPCContract.deploy(wallet, tokenAddress, feeRecipient).send({ universalDeploy: true }).deployed(); + const fpc = await FPCContract.deploy(wallet, tokenAddress, feeRecipient) + .send({ universalDeploy: true }) + .deployed(waitOpts); const info: ContractDeploymentInfo = { address: fpc.address, initHash: fpc.instance.initializationHash, @@ -217,7 +233,7 @@ async function deployCounter(wallet: Wallet): Promise { const { CounterContract } = await import('@aztec/noir-contracts.js'); const counter = await CounterContract.deploy(wallet, 1, wallet.getAddress(), wallet.getAddress()) .send({ universalDeploy: true }) - .deployed(); + .deployed(waitOpts); const info: ContractDeploymentInfo = { address: counter.address, initHash: counter.instance.initializationHash, @@ -263,11 +279,11 @@ async function fundFPC( // TODO (alexg) remove this once sequencer builds blocks continuously // advance the chain - await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(); - await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(); + await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(waitOpts); + await counter.methods.increment(wallet.getAddress(), wallet.getAddress()).send().wait(waitOpts); await feeJuiceContract.methods .claim(fpcAddress, claimAmount, claimSecret, messageLeafIndex) .send() - .wait({ proven: true }); + .wait({ ...waitOpts, proven: true }); }