Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Set prover node max pending jobs in tests #8055

Merged
merged 2 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions yarn-project/end-to-end/src/e2e_prover/e2e_prover_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
104 changes: 50 additions & 54 deletions yarn-project/end-to-end/src/fixtures/snapshot_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -397,34 +411,16 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
const telemetry = createAndStartTelemetryClient(getTelemetryConfig());
const aztecNode = await AztecNodeService.createAndSync(aztecNodeConfig, telemetry);

// Creating temp store and archiver for simulated prover node

const store = await createStore({ dataDirectory: undefined }, aztecNodeConfig.l1Contracts.rollupAddress);
const proverNodePrivateKey = getPrivateKeyFromIndex(2);

const archiver = await createArchiver(
{ ...aztecNodeConfig, dataDirectory: undefined },
store,
new NoopTelemetryClient(),
{ blockUntilSync: true },
logger.verbose('Creating and syncing a simulated prover node...');
const proverNode = await createAndSyncProverNode(
aztecNodeConfig.l1Contracts.rollupAddress,
proverNodePrivateKey!,
aztecNodeConfig,
aztecNode,
);

// Prover node config is for simulated proofs
const proverConfig: ProverNodeConfig = {
...aztecNodeConfig,
txProviderNodeUrl: undefined,
dataDirectory: undefined,
proverId: new Fr(42),
realProofs: false,
proverAgentConcurrency: 2,
};
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;
Expand Down
Loading