Skip to content

Commit

Permalink
fix: increase timeouts (#10412)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr authored Dec 5, 2024
1 parent f22cfb9 commit d3b8838
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions yarn-project/cli/src/cmds/devnet/bootstrap_network.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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,
Expand Down Expand Up @@ -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}`);
}
}

Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
Expand All @@ -217,7 +233,7 @@ async function deployCounter(wallet: Wallet): Promise<ContractDeploymentInfo> {
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,
Expand Down Expand Up @@ -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 });
}

0 comments on commit d3b8838

Please sign in to comment.