@aztec/prover-client 0.0.1-commit.e558bd1c → 0.0.1-commit.e5a3663dd
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 +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +12 -2
- package/dest/light/lightweight_checkpoint_builder.d.ts +10 -5
- package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -1
- package/dest/light/lightweight_checkpoint_builder.js +41 -18
- package/dest/mocks/test_context.d.ts +1 -1
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +17 -9
- package/dest/orchestrator/block-building-helpers.d.ts +4 -4
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +2 -2
- package/dest/orchestrator/block-proving-state.d.ts +4 -1
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +7 -0
- package/dest/orchestrator/checkpoint-proving-state.d.ts +3 -3
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +4 -4
- package/dest/orchestrator/epoch-proving-state.d.ts +3 -3
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +5 -3
- package/dest/orchestrator/orchestrator.d.ts +5 -3
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +64 -57
- package/dest/prover-client/prover-client.d.ts +2 -2
- package/dest/prover-client/prover-client.d.ts.map +1 -1
- package/dest/prover-client/prover-client.js +1 -1
- package/dest/proving_broker/broker_prover_facade.d.ts +1 -1
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +13 -19
- package/dest/proving_broker/config.d.ts +2 -2
- package/dest/proving_broker/config.d.ts.map +1 -1
- package/dest/proving_broker/config.js +3 -3
- package/dest/proving_broker/proving_broker.d.ts +1 -1
- package/dest/proving_broker/proving_broker.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +35 -8
- package/dest/proving_broker/proving_broker_instrumentation.d.ts +3 -1
- package/dest/proving_broker/proving_broker_instrumentation.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker_instrumentation.js +7 -0
- package/dest/proving_broker/rpc.d.ts +3 -1
- package/dest/proving_broker/rpc.d.ts.map +1 -1
- package/dest/proving_broker/rpc.js +16 -15
- package/dest/test/mock_prover.d.ts +4 -4
- package/package.json +17 -18
- package/src/config.ts +13 -2
- package/src/light/lightweight_checkpoint_builder.ts +42 -19
- package/src/mocks/test_context.ts +12 -10
- package/src/orchestrator/block-building-helpers.ts +2 -2
- package/src/orchestrator/block-proving-state.ts +9 -0
- package/src/orchestrator/checkpoint-proving-state.ts +5 -5
- package/src/orchestrator/epoch-proving-state.ts +6 -4
- package/src/orchestrator/orchestrator.ts +72 -63
- package/src/prover-client/prover-client.ts +2 -1
- package/src/proving_broker/broker_prover_facade.ts +17 -20
- package/src/proving_broker/config.ts +3 -2
- package/src/proving_broker/proving_broker.ts +30 -5
- package/src/proving_broker/proving_broker_instrumentation.ts +9 -0
- package/src/proving_broker/rpc.ts +12 -3
|
@@ -18,6 +18,7 @@ export class ProvingBrokerInstrumentation {
|
|
|
18
18
|
private activeJobs: ObservableGauge;
|
|
19
19
|
private resolvedJobs: UpDownCounter;
|
|
20
20
|
private rejectedJobs: UpDownCounter;
|
|
21
|
+
private abortedJobs: UpDownCounter;
|
|
21
22
|
private timedOutJobs: UpDownCounter;
|
|
22
23
|
private cachedJobs: UpDownCounter;
|
|
23
24
|
private totalJobs: UpDownCounter;
|
|
@@ -39,6 +40,8 @@ export class ProvingBrokerInstrumentation {
|
|
|
39
40
|
|
|
40
41
|
this.rejectedJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_REJECTED_JOBS, provingJobAttrs);
|
|
41
42
|
|
|
43
|
+
this.abortedJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_ABORTED_JOBS, provingJobAttrs);
|
|
44
|
+
|
|
42
45
|
this.retriedJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_RETRIED_JOBS, provingJobAttrs);
|
|
43
46
|
|
|
44
47
|
this.timedOutJobs = createUpDownCounterWithDefault(meter, Metrics.PROVING_QUEUE_TIMED_OUT_JOBS, provingJobAttrs);
|
|
@@ -72,6 +75,12 @@ export class ProvingBrokerInstrumentation {
|
|
|
72
75
|
});
|
|
73
76
|
}
|
|
74
77
|
|
|
78
|
+
incAbortedJobs(proofType: ProvingRequestType) {
|
|
79
|
+
this.abortedJobs.add(1, {
|
|
80
|
+
[Attributes.PROVING_JOB_TYPE]: ProvingRequestType[proofType],
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
75
84
|
incRetriedJobs(proofType: ProvingRequestType) {
|
|
76
85
|
this.retriedJobs.add(1, {
|
|
77
86
|
[Attributes.PROVING_JOB_TYPE]: ProvingRequestType[proofType],
|
|
@@ -18,6 +18,15 @@ import { makeTracedFetch } from '@aztec/telemetry-client';
|
|
|
18
18
|
|
|
19
19
|
import { z } from 'zod';
|
|
20
20
|
|
|
21
|
+
/** Indefinite backoff for broker communication: 1, 1, 1, 2, 4, 4, 4, ... seconds. */
|
|
22
|
+
export function* proverBrokerBackoff() {
|
|
23
|
+
const v = [1, 1, 1, 2, 4];
|
|
24
|
+
let i = 0;
|
|
25
|
+
while (true) {
|
|
26
|
+
yield v[Math.min(i++, v.length - 1)];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
const ProvingJobFilterSchema = z.object({
|
|
22
31
|
allowList: z.array(z.nativeEnum(ProvingRequestType)),
|
|
23
32
|
});
|
|
@@ -70,7 +79,7 @@ export const ProvingJobBrokerSchemaWithDebug: ApiSchemaFor<ProvingJobBroker & Pr
|
|
|
70
79
|
export function createProvingJobBrokerClient(
|
|
71
80
|
url: string,
|
|
72
81
|
versions: Partial<ComponentsVersions>,
|
|
73
|
-
fetch = makeTracedFetch(
|
|
82
|
+
fetch = makeTracedFetch(proverBrokerBackoff, false),
|
|
74
83
|
): ProvingJobBroker {
|
|
75
84
|
return createSafeJsonRpcClient(url, ProvingJobBrokerSchema, {
|
|
76
85
|
namespaceMethods: 'proverBroker',
|
|
@@ -82,7 +91,7 @@ export function createProvingJobBrokerClient(
|
|
|
82
91
|
export function createProvingJobProducerClient(
|
|
83
92
|
url: string,
|
|
84
93
|
versions: Partial<ComponentsVersions>,
|
|
85
|
-
fetch = makeTracedFetch(
|
|
94
|
+
fetch = makeTracedFetch(proverBrokerBackoff, false),
|
|
86
95
|
): ProvingJobProducer {
|
|
87
96
|
return createSafeJsonRpcClient(url, ProvingJobProducerSchema, {
|
|
88
97
|
namespaceMethods: 'provingJobProducer',
|
|
@@ -94,7 +103,7 @@ export function createProvingJobProducerClient(
|
|
|
94
103
|
export function createProvingJobConsumerClient(
|
|
95
104
|
url: string,
|
|
96
105
|
versions: Partial<ComponentsVersions>,
|
|
97
|
-
fetch = makeTracedFetch(
|
|
106
|
+
fetch = makeTracedFetch(proverBrokerBackoff, false),
|
|
98
107
|
): ProvingJobConsumer {
|
|
99
108
|
return createSafeJsonRpcClient(url, ProvingJobConsumerSchema, {
|
|
100
109
|
namespaceMethods: 'provingJobConsumer',
|