Skip to content

Commit

Permalink
refactor: replace queue with facade over CircuitProver
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr committed Apr 25, 2024
1 parent 7eb164f commit 29759db
Show file tree
Hide file tree
Showing 19 changed files with 435 additions and 367 deletions.
6 changes: 3 additions & 3 deletions yarn-project/aztec/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{
"path": "../aztec.js"
},
{
"path": "../builder"
},
{
"path": "../circuit-types"
},
Expand All @@ -39,9 +42,6 @@
{
"path": "../l1-artifacts"
},
{
"path": "../builder"
},
{
"path": "../noir-contracts.js"
},
Expand Down
1 change: 1 addition & 0 deletions yarn-project/circuit-types/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export * from './configs.js';
export * from './nullifier_tree.js';
export * from './public_data_tree.js';
export * from './prover-client.js';
export * from './proving-job.js';
export * from './block-prover.js';
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { type PublicKernelNonTailRequest, type PublicKernelTailRequest } from '@aztec/circuit-types';
import {
type BaseOrMergeRollupPublicInputs,
type BaseParityInputs,
Expand All @@ -13,6 +12,13 @@ import {
type RootRollupPublicInputs,
} from '@aztec/circuits.js';

import type { PublicKernelNonTailRequest, PublicKernelTailRequest } from '../tx/processed_tx.js';

export type ProvingJob<T extends ProvingRequest> = {
id: string;
request: T;
};

export enum ProvingRequestType {
PUBLIC_VM,

Expand Down Expand Up @@ -79,3 +85,11 @@ export type ProvingRequestPublicInputs = {
};

export type ProvingRequestResult<T extends ProvingRequestType> = [ProvingRequestPublicInputs[T], Proof];

export interface ProvingJobSource {
getProvingJob(): Promise<ProvingJob<ProvingRequest> | null>;

resolveProvingJob<T extends ProvingRequestType>(jobId: string, result: ProvingRequestResult<T>): Promise<void>;

rejectProvingJob(jobId: string, reason: Error): Promise<void>;
}
9 changes: 8 additions & 1 deletion yarn-project/end-to-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@
"@swc/jest"
]
},
"reporters": [["default", {"summaryThreshold": 9999}]],
"reporters": [
[
"default",
{
"summaryThreshold": 9999
}
]
],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
},
Expand Down
6 changes: 3 additions & 3 deletions yarn-project/noir-protocol-circuits-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
},
"references": [
{
"path": "../circuits.js"
"path": "../builder"
},
{
"path": "../foundation"
"path": "../circuits.js"
},
{
"path": "../builder"
"path": "../foundation"
},
{
"path": "../types"
Expand Down
10 changes: 6 additions & 4 deletions yarn-project/prover-client/src/mocks/test_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import * as fs from 'fs/promises';
import { type MockProxy, mock } from 'jest-mock-extended';

import { ProvingOrchestrator } from '../orchestrator/orchestrator.js';
import { CircuitProverAgent } from '../prover-pool/circuit-prover-agent.js';
import { MemoryProvingQueue } from '../prover-pool/memory-proving-queue.js';
import { ProverAgent } from '../prover-pool/prover-agent.js';
import { ProverPool } from '../prover-pool/prover-pool.js';
import { type BBProverConfig } from '../prover/bb_prover.js';
import { type CircuitProver } from '../prover/interface.js';
Expand Down Expand Up @@ -87,10 +88,11 @@ export class TestContext {
localProver = await createProver(bbConfig);
}

const proverPool = new ProverPool(proverCount, i => new CircuitProverAgent(localProver, 10, `${i}`));
const orchestrator = new ProvingOrchestrator(actualDb, proverPool.queue);
const queue = new MemoryProvingQueue();
const proverPool = new ProverPool(proverCount, i => new ProverAgent(localProver, 10, `${i}`));
const orchestrator = new ProvingOrchestrator(actualDb, queue);

await proverPool.start();
await proverPool.start(queue);

return new this(
publicExecutor,
Expand Down
Loading

0 comments on commit 29759db

Please sign in to comment.