From 5fdde14286851436c79447502934f79a83ae56b3 Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Sun, 18 Aug 2024 16:09:38 +0000 Subject: [PATCH 1/2] Minor refactor and set max pending jobs --- .../src/fixtures/snapshot_manager.ts | 104 +++++++++--------- 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts index ef5b7b56915..287effeb7c3 100644 --- a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts +++ b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts @@ -3,10 +3,12 @@ import { type Archiver, createArchiver } from '@aztec/archiver'; import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; import { type AztecAddress, + type AztecNode, BatchCall, type CompleteAddress, type DebugLogger, type DeployL1Contracts, + type EthAddress, EthCheatCodes, Fr, GrumpkinScalar, @@ -228,6 +230,42 @@ async function teardown(context: SubsystemsContext | undefined) { await context.anvil.stop(); } +export async function createAndSyncProverNode( + rollupAddress: EthAddress, + proverNodePrivateKey: Buffer, + aztecNodeConfig: AztecNodeConfig, + aztecNode: AztecNode, +) { + // Creating temp store and archiver for simulated prover node + + const store = await createStore({ dataDirectory: undefined }, rollupAddress); + + const archiver = await createArchiver( + { ...aztecNodeConfig, dataDirectory: undefined }, + store, + new NoopTelemetryClient(), + { blockUntilSync: true }, + ); + + // Prover node config is for simulated proofs + const proverConfig: ProverNodeConfig = { + ...aztecNodeConfig, + txProviderNodeUrl: undefined, + dataDirectory: undefined, + proverId: new Fr(42), + realProofs: false, + proverAgentConcurrency: 2, + publisherPrivateKey: `0x${proverNodePrivateKey.toString('hex')}`, + proverNodeMaxPendingJobs: 100, + }; + const proverNode = await createProverNode(proverConfig, { + aztecNodeTxProvider: aztecNode, + archiver: archiver as Archiver, + }); + proverNode.start(); + return proverNode; +} + /** * Initializes a fresh set of subsystems. * If given a statePath, the state will be written to the path. @@ -291,38 +329,14 @@ async function setupFromFresh( logger.verbose('Creating and synching an aztec node...'); const aztecNode = await AztecNodeService.createAndSync(aztecNodeConfig, telemetry); - // Creating temp store and archiver for simulated prover node - - const store = await createStore( - { dataDirectory: undefined }, + logger.verbose('Creating and syncing a simulated prover node...'); + const proverNode = await createAndSyncProverNode( deployL1ContractsValues.l1ContractAddresses.rollupAddress, + proverNodePrivateKey!, + aztecNodeConfig, + aztecNode, ); - const archiver = await createArchiver( - { ...aztecNodeConfig, dataDirectory: undefined }, - store, - new NoopTelemetryClient(), - { blockUntilSync: true }, - ); - - // Prover node config is for simulated proofs - const proverConfig: ProverNodeConfig = { - ...aztecNodeConfig, - txProviderNodeUrl: undefined, - dataDirectory: undefined, - proverId: new Fr(42), - realProofs: false, - proverAgentConcurrency: 2, - publisherPrivateKey: `0x${proverNodePrivateKey!.toString('hex')}`, - }; - const proverNode = await createProverNode(proverConfig, { - aztecNodeTxProvider: aztecNode, - archiver: archiver as Archiver, - }); - proverNode.start(); - - logger.verbose('Prover node started'); - logger.verbose('Creating pxe...'); const pxeConfig = getPXEServiceConfig(); pxeConfig.dataDirectory = statePath; @@ -397,34 +411,16 @@ async function setupFromState(statePath: string, logger: Logger): Promise Date: Sun, 18 Aug 2024 18:51:48 +0000 Subject: [PATCH 2/2] Another fix --- yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts b/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts index 209bbce574e..f3631a0eca7 100644 --- a/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts @@ -246,6 +246,7 @@ export class FullProverTest { realProofs: true, proverAgentConcurrency: 2, publisherPrivateKey: `0x${proverNodePrivateKey!.toString('hex')}`, + proverNodeMaxPendingJobs: 100, }; this.proverNode = await createProverNode(proverConfig, { aztecNodeTxProvider: this.aztecNode,