@aztec/prover-client 0.42.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +12 -8
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +8 -5
- package/dest/orchestrator/block-building-helpers.d.ts +5 -5
- package/dest/orchestrator/orchestrator.d.ts +3 -1
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +599 -518
- package/dest/prover-agent/memory-proving-queue.d.ts +14 -1
- package/dest/prover-agent/memory-proving-queue.d.ts.map +1 -1
- package/dest/prover-agent/memory-proving-queue.js +77 -11
- package/dest/prover-agent/prover-agent.d.ts.map +1 -1
- package/dest/prover-agent/prover-agent.js +32 -13
- package/dest/tx-prover/tx-prover.d.ts +3 -1
- package/dest/tx-prover/tx-prover.d.ts.map +1 -1
- package/dest/tx-prover/tx-prover.js +14 -11
- package/package.json +19 -10
- package/src/config.ts +13 -6
- package/src/mocks/test_context.ts +7 -3
- package/src/orchestrator/orchestrator.ts +159 -45
- package/src/prover-agent/memory-proving-queue.ts +98 -12
- package/src/prover-agent/prover-agent.ts +40 -15
- package/src/tx-prover/tx-prover.ts +22 -8
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from '@aztec/circuit-types/interfaces';
|
|
10
10
|
import { type Fr, type GlobalVariables, type Header, type VerificationKeys } from '@aztec/circuits.js';
|
|
11
11
|
import { NativeACVMSimulator } from '@aztec/simulator';
|
|
12
|
+
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
12
13
|
import { type WorldStateSynchronizer } from '@aztec/world-state';
|
|
13
14
|
|
|
14
15
|
import { type ProverClientConfig } from '../config.js';
|
|
@@ -21,17 +22,24 @@ import { ProverAgent } from '../prover-agent/prover-agent.js';
|
|
|
21
22
|
*/
|
|
22
23
|
export class TxProver implements ProverClient {
|
|
23
24
|
private orchestrator: ProvingOrchestrator;
|
|
24
|
-
private queue
|
|
25
|
+
private queue: MemoryProvingQueue;
|
|
25
26
|
private running = false;
|
|
26
27
|
|
|
27
28
|
private constructor(
|
|
28
29
|
private config: ProverClientConfig,
|
|
29
30
|
private worldStateSynchronizer: WorldStateSynchronizer,
|
|
30
31
|
private vks: VerificationKeys,
|
|
32
|
+
private telemetry: TelemetryClient,
|
|
31
33
|
private agent?: ProverAgent,
|
|
32
34
|
initialHeader?: Header,
|
|
33
35
|
) {
|
|
34
|
-
this.
|
|
36
|
+
this.queue = new MemoryProvingQueue(config.proverJobTimeoutMs, config.proverJobPollIntervalMs);
|
|
37
|
+
this.orchestrator = new ProvingOrchestrator(
|
|
38
|
+
worldStateSynchronizer.getLatest(),
|
|
39
|
+
this.queue,
|
|
40
|
+
telemetry,
|
|
41
|
+
initialHeader,
|
|
42
|
+
);
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
async updateProverConfig(config: Partial<ProverClientConfig & { vks: VerificationKeys }>): Promise<void> {
|
|
@@ -42,7 +50,7 @@ export class TxProver implements ProverClient {
|
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
if (newConfig.realProofs !== this.config.realProofs && this.agent) {
|
|
45
|
-
const circuitProver = await TxProver.buildCircuitProver(newConfig);
|
|
53
|
+
const circuitProver = await TxProver.buildCircuitProver(newConfig, this.telemetry);
|
|
46
54
|
this.agent.setCircuitProver(circuitProver);
|
|
47
55
|
}
|
|
48
56
|
|
|
@@ -66,6 +74,7 @@ export class TxProver implements ProverClient {
|
|
|
66
74
|
}
|
|
67
75
|
|
|
68
76
|
this.running = true;
|
|
77
|
+
this.queue.start();
|
|
69
78
|
this.agent?.start(this.queue);
|
|
70
79
|
return Promise.resolve();
|
|
71
80
|
}
|
|
@@ -79,6 +88,7 @@ export class TxProver implements ProverClient {
|
|
|
79
88
|
}
|
|
80
89
|
this.running = false;
|
|
81
90
|
await this.agent?.stop();
|
|
91
|
+
await this.queue.stop();
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
/**
|
|
@@ -92,31 +102,35 @@ export class TxProver implements ProverClient {
|
|
|
92
102
|
config: ProverClientConfig,
|
|
93
103
|
vks: VerificationKeys,
|
|
94
104
|
worldStateSynchronizer: WorldStateSynchronizer,
|
|
105
|
+
telemetry: TelemetryClient,
|
|
95
106
|
initialHeader?: Header,
|
|
96
107
|
) {
|
|
97
108
|
const agent = config.proverAgentEnabled
|
|
98
109
|
? new ProverAgent(
|
|
99
|
-
await TxProver.buildCircuitProver(config),
|
|
110
|
+
await TxProver.buildCircuitProver(config, telemetry),
|
|
100
111
|
config.proverAgentConcurrency,
|
|
101
112
|
config.proverAgentPollInterval,
|
|
102
113
|
)
|
|
103
114
|
: undefined;
|
|
104
115
|
|
|
105
|
-
const prover = new TxProver(config, worldStateSynchronizer, vks, agent, initialHeader);
|
|
116
|
+
const prover = new TxProver(config, worldStateSynchronizer, vks, telemetry, agent, initialHeader);
|
|
106
117
|
await prover.start();
|
|
107
118
|
return prover;
|
|
108
119
|
}
|
|
109
120
|
|
|
110
|
-
private static async buildCircuitProver(
|
|
121
|
+
private static async buildCircuitProver(
|
|
122
|
+
config: ProverClientConfig,
|
|
123
|
+
telemetry: TelemetryClient,
|
|
124
|
+
): Promise<ServerCircuitProver> {
|
|
111
125
|
if (config.realProofs) {
|
|
112
|
-
return await BBNativeRollupProver.new(config);
|
|
126
|
+
return await BBNativeRollupProver.new(config, telemetry);
|
|
113
127
|
}
|
|
114
128
|
|
|
115
129
|
const simulationProvider = config.acvmBinaryPath
|
|
116
130
|
? new NativeACVMSimulator(config.acvmWorkingDirectory, config.acvmBinaryPath)
|
|
117
131
|
: undefined;
|
|
118
132
|
|
|
119
|
-
return new TestCircuitProver(simulationProvider);
|
|
133
|
+
return new TestCircuitProver(telemetry, simulationProvider);
|
|
120
134
|
}
|
|
121
135
|
|
|
122
136
|
/**
|