@aztec/prover-client 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
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/block-factory/index.d.ts +1 -1
- package/dest/block-factory/light.d.ts +5 -3
- package/dest/block-factory/light.d.ts.map +1 -1
- package/dest/block-factory/light.js +32 -11
- package/dest/config.d.ts +2 -2
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +2 -2
- package/dest/index.d.ts +1 -1
- package/dest/light/index.d.ts +2 -0
- package/dest/light/index.d.ts.map +1 -0
- package/dest/light/index.js +1 -0
- package/dest/light/lightweight_checkpoint_builder.d.ts +36 -0
- package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -0
- package/dest/light/lightweight_checkpoint_builder.js +147 -0
- package/dest/mocks/fixtures.d.ts +5 -5
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +33 -15
- package/dest/mocks/test_context.d.ts +38 -33
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +133 -82
- package/dest/orchestrator/block-building-helpers.d.ts +35 -35
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +151 -187
- package/dest/orchestrator/block-proving-state.d.ts +68 -55
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +273 -185
- package/dest/orchestrator/checkpoint-proving-state.d.ts +63 -0
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/checkpoint-proving-state.js +210 -0
- package/dest/orchestrator/epoch-proving-state.d.ts +38 -31
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +128 -84
- package/dest/orchestrator/index.d.ts +1 -1
- package/dest/orchestrator/orchestrator.d.ts +35 -34
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +777 -292
- package/dest/orchestrator/orchestrator_metrics.d.ts +1 -3
- package/dest/orchestrator/orchestrator_metrics.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator_metrics.js +0 -9
- package/dest/orchestrator/tx-proving-state.d.ts +12 -10
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/tx-proving-state.js +23 -29
- package/dest/prover-client/factory.d.ts +3 -3
- package/dest/prover-client/factory.d.ts.map +1 -1
- package/dest/prover-client/index.d.ts +1 -1
- package/dest/prover-client/prover-client.d.ts +3 -3
- package/dest/prover-client/prover-client.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.d.ts +13 -11
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +9 -9
- package/dest/proving_broker/broker_prover_facade.d.ts +23 -18
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +42 -33
- package/dest/proving_broker/config.d.ts +18 -14
- package/dest/proving_broker/config.d.ts.map +1 -1
- package/dest/proving_broker/config.js +12 -6
- package/dest/proving_broker/factory.d.ts +1 -1
- package/dest/proving_broker/factory.js +1 -1
- package/dest/proving_broker/fixtures.d.ts +3 -2
- package/dest/proving_broker/fixtures.d.ts.map +1 -1
- package/dest/proving_broker/fixtures.js +3 -2
- package/dest/proving_broker/index.d.ts +1 -1
- package/dest/proving_broker/proof_store/factory.d.ts +2 -2
- package/dest/proving_broker/proof_store/gcs_proof_store.d.ts +1 -1
- package/dest/proving_broker/proof_store/gcs_proof_store.d.ts.map +1 -1
- package/dest/proving_broker/proof_store/index.d.ts +2 -1
- package/dest/proving_broker/proof_store/index.d.ts.map +1 -1
- package/dest/proving_broker/proof_store/index.js +1 -0
- package/dest/proving_broker/proof_store/inline_proof_store.d.ts +1 -1
- package/dest/proving_broker/proof_store/inline_proof_store.d.ts.map +1 -1
- package/dest/proving_broker/proof_store/proof_store.d.ts +1 -1
- package/dest/proving_broker/proving_agent.d.ts +1 -1
- package/dest/proving_broker/proving_agent.d.ts.map +1 -1
- package/dest/proving_broker/proving_agent.js +383 -8
- package/dest/proving_broker/proving_agent_instrumentation.d.ts +1 -1
- package/dest/proving_broker/proving_agent_instrumentation.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.d.ts +2 -2
- package/dest/proving_broker/proving_broker.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +418 -29
- package/dest/proving_broker/proving_broker_database/memory.d.ts +3 -2
- package/dest/proving_broker/proving_broker_database/memory.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker_database/persisted.d.ts +3 -2
- package/dest/proving_broker/proving_broker_database/persisted.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker_database/persisted.js +8 -7
- package/dest/proving_broker/proving_broker_database.d.ts +3 -2
- package/dest/proving_broker/proving_broker_database.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker_instrumentation.d.ts +1 -1
- package/dest/proving_broker/proving_broker_instrumentation.d.ts.map +1 -1
- package/dest/proving_broker/proving_job_controller.d.ts +3 -2
- package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
- package/dest/proving_broker/proving_job_controller.js +40 -21
- package/dest/proving_broker/rpc.d.ts +4 -4
- package/dest/test/mock_proof_store.d.ts +3 -3
- package/dest/test/mock_proof_store.d.ts.map +1 -1
- package/dest/test/mock_prover.d.ts +23 -19
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +36 -21
- package/package.json +21 -19
- package/src/block-factory/light.ts +40 -17
- package/src/config.ts +2 -2
- package/src/light/index.ts +1 -0
- package/src/light/lightweight_checkpoint_builder.ts +198 -0
- package/src/mocks/fixtures.ts +41 -36
- package/src/mocks/test_context.ts +196 -114
- package/src/orchestrator/block-building-helpers.ts +233 -313
- package/src/orchestrator/block-proving-state.ts +315 -247
- package/src/orchestrator/checkpoint-proving-state.ts +303 -0
- package/src/orchestrator/epoch-proving-state.ts +176 -129
- package/src/orchestrator/orchestrator.ts +558 -348
- package/src/orchestrator/orchestrator_metrics.ts +1 -20
- package/src/orchestrator/tx-proving-state.ts +47 -55
- package/src/prover-client/factory.ts +6 -2
- package/src/prover-client/prover-client.ts +3 -2
- package/src/prover-client/server-epoch-prover.ts +30 -21
- package/src/proving_broker/broker_prover_facade.ts +175 -112
- package/src/proving_broker/config.ts +14 -7
- package/src/proving_broker/factory.ts +1 -1
- package/src/proving_broker/fixtures.ts +8 -3
- package/src/proving_broker/proof_store/index.ts +1 -0
- package/src/proving_broker/proving_broker.ts +41 -19
- package/src/proving_broker/proving_broker_database/memory.ts +2 -1
- package/src/proving_broker/proving_broker_database/persisted.ts +10 -9
- package/src/proving_broker/proving_broker_database.ts +2 -1
- package/src/proving_broker/proving_job_controller.ts +42 -22
- package/src/test/mock_prover.ts +143 -66
- package/dest/bin/get-proof-inputs.d.ts +0 -2
- package/dest/bin/get-proof-inputs.d.ts.map +0 -1
- package/dest/bin/get-proof-inputs.js +0 -51
- package/src/bin/get-proof-inputs.ts +0 -59
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Histogram,
|
|
3
|
-
Metrics,
|
|
4
|
-
type TelemetryClient,
|
|
5
|
-
type Tracer,
|
|
6
|
-
type UpDownCounter,
|
|
7
|
-
ValueType,
|
|
8
|
-
} from '@aztec/telemetry-client';
|
|
1
|
+
import { type Histogram, Metrics, type TelemetryClient, type Tracer, ValueType } from '@aztec/telemetry-client';
|
|
9
2
|
|
|
10
3
|
export class ProvingOrchestratorMetrics {
|
|
11
4
|
public readonly tracer: Tracer;
|
|
12
5
|
|
|
13
6
|
private baseRollupInputsDuration: Histogram;
|
|
14
|
-
private avmFallbackCount: UpDownCounter;
|
|
15
7
|
|
|
16
8
|
constructor(client: TelemetryClient, name = 'ProvingOrchestrator') {
|
|
17
9
|
this.tracer = client.getTracer(name);
|
|
@@ -22,20 +14,9 @@ export class ProvingOrchestratorMetrics {
|
|
|
22
14
|
description: 'Duration to build base rollup inputs',
|
|
23
15
|
valueType: ValueType.INT,
|
|
24
16
|
});
|
|
25
|
-
|
|
26
|
-
this.avmFallbackCount = meter.createUpDownCounter(Metrics.PROVING_ORCHESTRATOR_AVM_FALLBACK_COUNT, {
|
|
27
|
-
description: 'How many times the AVM fallback was used',
|
|
28
|
-
valueType: ValueType.INT,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
this.avmFallbackCount.add(0);
|
|
32
17
|
}
|
|
33
18
|
|
|
34
19
|
recordBaseRollupInputs(durationMs: number) {
|
|
35
20
|
this.baseRollupInputsDuration.record(Math.ceil(durationMs));
|
|
36
21
|
}
|
|
37
|
-
|
|
38
|
-
incAvmFallback() {
|
|
39
|
-
this.avmFallbackCount.add(1);
|
|
40
|
-
}
|
|
41
22
|
}
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
PRIVATE_TUBE_VK_INDEX,
|
|
5
|
-
PUBLIC_TUBE_VK_INDEX,
|
|
6
|
-
type TUBE_PROOF_LENGTH,
|
|
7
|
-
} from '@aztec/constants';
|
|
8
|
-
import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
1
|
+
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
9
4
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
10
|
-
import type { ProofAndVerificationKey } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
6
|
+
import { ProofData, ProofDataForFixedVk } from '@aztec/stdlib/proofs';
|
|
11
7
|
import {
|
|
12
|
-
AvmProofData,
|
|
13
8
|
type BaseRollupHints,
|
|
14
9
|
PrivateBaseRollupHints,
|
|
15
|
-
|
|
16
|
-
PrivateTubeData,
|
|
10
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
17
11
|
PublicBaseRollupHints,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
TubeInputs,
|
|
12
|
+
PublicChonkVerifierPublicInputs,
|
|
13
|
+
PublicTxBaseRollupPrivateInputs,
|
|
21
14
|
} from '@aztec/stdlib/rollup';
|
|
22
15
|
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
23
16
|
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
24
17
|
import type { ProcessedTx } from '@aztec/stdlib/tx';
|
|
25
|
-
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
getChonkProofFromTx,
|
|
21
|
+
getPublicChonkVerifierPrivateInputsFromTx,
|
|
22
|
+
toProofData,
|
|
23
|
+
} from './block-building-helpers.js';
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
26
|
* Helper class to manage the proving cycle of a transaction
|
|
@@ -30,13 +28,17 @@ import { VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
|
30
28
|
* Also stores the inputs to the base rollup for this transaction and the tree snapshots
|
|
31
29
|
*/
|
|
32
30
|
export class TxProvingState {
|
|
33
|
-
private
|
|
31
|
+
private publicChonkVerifier?: PublicInputsAndRecursiveProof<
|
|
32
|
+
PublicChonkVerifierPublicInputs,
|
|
33
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
34
|
+
>;
|
|
34
35
|
private avm?: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>;
|
|
35
36
|
|
|
36
37
|
constructor(
|
|
37
38
|
public readonly processedTx: ProcessedTx,
|
|
38
39
|
private readonly baseRollupHints: BaseRollupHints,
|
|
39
40
|
public readonly treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot>,
|
|
41
|
+
private readonly proverId: Fr,
|
|
40
42
|
) {}
|
|
41
43
|
|
|
42
44
|
get requireAvmProof() {
|
|
@@ -44,33 +46,38 @@ export class TxProvingState {
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
public ready() {
|
|
47
|
-
return
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public getTubeInputs() {
|
|
51
|
-
return new TubeInputs(!!this.processedTx.data.forPublic, this.processedTx.clientIvcProof);
|
|
49
|
+
return !this.requireAvmProof || (!!this.avm && !!this.publicChonkVerifier);
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
public getAvmInputs(): AvmCircuitInputs {
|
|
55
53
|
return this.processedTx.avmProvingRequest!.inputs;
|
|
56
54
|
}
|
|
57
55
|
|
|
56
|
+
public getPublicChonkVerifierPrivateInputs() {
|
|
57
|
+
return getPublicChonkVerifierPrivateInputsFromTx(this.processedTx, this.proverId);
|
|
58
|
+
}
|
|
59
|
+
|
|
58
60
|
public getBaseRollupTypeAndInputs() {
|
|
59
61
|
if (this.requireAvmProof) {
|
|
60
62
|
return {
|
|
61
|
-
rollupType: '
|
|
63
|
+
rollupType: 'rollup-tx-base-public' satisfies CircuitName,
|
|
62
64
|
inputs: this.#getPublicBaseInputs(),
|
|
63
65
|
};
|
|
64
66
|
} else {
|
|
65
67
|
return {
|
|
66
|
-
rollupType: '
|
|
68
|
+
rollupType: 'rollup-tx-base-private' satisfies CircuitName,
|
|
67
69
|
inputs: this.#getPrivateBaseInputs(),
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
public
|
|
73
|
-
|
|
74
|
+
public setPublicChonkVerifierProof(
|
|
75
|
+
publicChonkVerifierProofAndVk: PublicInputsAndRecursiveProof<
|
|
76
|
+
PublicChonkVerifierPublicInputs,
|
|
77
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
78
|
+
>,
|
|
79
|
+
) {
|
|
80
|
+
this.publicChonkVerifier = publicChonkVerifierProofAndVk;
|
|
74
81
|
}
|
|
75
82
|
|
|
76
83
|
public setAvmProof(avmProofAndVk: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>) {
|
|
@@ -78,55 +85,40 @@ export class TxProvingState {
|
|
|
78
85
|
}
|
|
79
86
|
|
|
80
87
|
#getPrivateBaseInputs() {
|
|
81
|
-
if (!this.
|
|
82
|
-
throw new Error('
|
|
88
|
+
if (!(this.baseRollupHints instanceof PrivateBaseRollupHints)) {
|
|
89
|
+
throw new Error('Mismatched base rollup hints, expected private base rollup hints');
|
|
83
90
|
}
|
|
84
91
|
|
|
85
|
-
const
|
|
86
|
-
const tubeData = new PrivateTubeData(
|
|
92
|
+
const privateTailProofData = new ProofData(
|
|
87
93
|
this.processedTx.data.toPrivateToRollupKernelCircuitPublicInputs(),
|
|
88
|
-
this.
|
|
89
|
-
|
|
94
|
+
getChonkProofFromTx(this.processedTx),
|
|
95
|
+
getVkData('HidingKernelToRollup'),
|
|
90
96
|
);
|
|
91
97
|
|
|
92
|
-
|
|
93
|
-
throw new Error('Mismatched base rollup hints, expected private base rollup hints');
|
|
94
|
-
}
|
|
95
|
-
return new PrivateBaseRollupInputs(tubeData, this.baseRollupHints);
|
|
98
|
+
return new PrivateTxBaseRollupPrivateInputs(privateTailProofData, this.baseRollupHints);
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
#getPublicBaseInputs() {
|
|
99
102
|
if (!this.processedTx.avmProvingRequest) {
|
|
100
103
|
throw new Error('Should create private base rollup for a tx not requiring avm proof.');
|
|
101
104
|
}
|
|
102
|
-
if (!this.
|
|
103
|
-
throw new Error('Tx not ready for proving base rollup:
|
|
105
|
+
if (!this.publicChonkVerifier) {
|
|
106
|
+
throw new Error('Tx not ready for proving base rollup: public chonk verifier proof undefined');
|
|
104
107
|
}
|
|
105
108
|
if (!this.avm) {
|
|
106
109
|
throw new Error('Tx not ready for proving base rollup: avm proof undefined');
|
|
107
110
|
}
|
|
111
|
+
if (!(this.baseRollupHints instanceof PublicBaseRollupHints)) {
|
|
112
|
+
throw new Error('Mismatched base rollup hints, expected public base rollup hints');
|
|
113
|
+
}
|
|
108
114
|
|
|
109
|
-
const
|
|
110
|
-
this.processedTx.data.toPrivateToPublicKernelCircuitPublicInputs(),
|
|
111
|
-
this.tube.proof,
|
|
112
|
-
this.#getVkData(this.tube!.verificationKey, PUBLIC_TUBE_VK_INDEX),
|
|
113
|
-
);
|
|
115
|
+
const publicChonkVerifierProofData = toProofData(this.publicChonkVerifier);
|
|
114
116
|
|
|
115
|
-
const avmProofData = new
|
|
117
|
+
const avmProofData = new ProofDataForFixedVk(
|
|
116
118
|
this.processedTx.avmProvingRequest.inputs.publicInputs,
|
|
117
119
|
this.avm.proof,
|
|
118
|
-
this.#getVkData(this.avm!.verificationKey, AVM_VK_INDEX),
|
|
119
120
|
);
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
throw new Error('Mismatched base rollup hints, expected public base rollup hints');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return new PublicBaseRollupInputs(tubeData, avmProofData, this.baseRollupHints);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
#getVkData(verificationKey: VerificationKeyData, vkIndex: number) {
|
|
129
|
-
const vkPath = getVKSiblingPath(vkIndex);
|
|
130
|
-
return new VkData(verificationKey, vkIndex, vkPath);
|
|
122
|
+
return new PublicTxBaseRollupPrivateInputs(publicChonkVerifierProofData, avmProofData, this.baseRollupHints);
|
|
131
123
|
}
|
|
132
124
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ForkMerkleTreeOperations,
|
|
3
|
+
ProvingJobBroker,
|
|
4
|
+
ReadonlyWorldStateAccess,
|
|
5
|
+
} from '@aztec/stdlib/interfaces/server';
|
|
2
6
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
3
7
|
|
|
4
8
|
import type { ProverClientConfig } from '../config.js';
|
|
@@ -6,7 +10,7 @@ import { ProverClient } from './prover-client.js';
|
|
|
6
10
|
|
|
7
11
|
export function createProverClient(
|
|
8
12
|
config: ProverClientConfig,
|
|
9
|
-
worldState: ForkMerkleTreeOperations,
|
|
13
|
+
worldState: ForkMerkleTreeOperations & ReadonlyWorldStateAccess,
|
|
10
14
|
broker: ProvingJobBroker,
|
|
11
15
|
telemetry: TelemetryClient = getTelemetryClient(),
|
|
12
16
|
) {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type ProvingJobBroker,
|
|
12
12
|
type ProvingJobConsumer,
|
|
13
13
|
type ProvingJobProducer,
|
|
14
|
+
type ReadonlyWorldStateAccess,
|
|
14
15
|
type ServerCircuitProver,
|
|
15
16
|
tryStop,
|
|
16
17
|
} from '@aztec/stdlib/interfaces/server';
|
|
@@ -33,7 +34,7 @@ export class ProverClient implements EpochProverManager {
|
|
|
33
34
|
|
|
34
35
|
private constructor(
|
|
35
36
|
private config: ProverClientConfig,
|
|
36
|
-
private worldState: ForkMerkleTreeOperations,
|
|
37
|
+
private worldState: ForkMerkleTreeOperations & ReadonlyWorldStateAccess,
|
|
37
38
|
private orchestratorClient: ProvingJobProducer,
|
|
38
39
|
private agentClient?: ProvingJobConsumer,
|
|
39
40
|
private telemetry: TelemetryClient = getTelemetryClient(),
|
|
@@ -99,7 +100,7 @@ export class ProverClient implements EpochProverManager {
|
|
|
99
100
|
*/
|
|
100
101
|
public static async new(
|
|
101
102
|
config: ProverClientConfig,
|
|
102
|
-
worldState: ForkMerkleTreeOperations,
|
|
103
|
+
worldState: ForkMerkleTreeOperations & ReadonlyWorldStateAccess,
|
|
103
104
|
broker: ProvingJobBroker,
|
|
104
105
|
telemetry: TelemetryClient = getTelemetryClient(),
|
|
105
106
|
) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { BatchedBlob, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
1
|
+
import type { BatchedBlob, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
|
|
2
|
+
import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import type { EthAddress } from '@aztec/stdlib/block';
|
|
4
5
|
import type { EpochProver } from '@aztec/stdlib/interfaces/server';
|
|
5
6
|
import type { Proof } from '@aztec/stdlib/proofs';
|
|
6
|
-
import type { RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
7
|
-
import type { BlockHeader,
|
|
7
|
+
import type { CheckpointConstantData, RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
8
|
+
import type { BlockHeader, ProcessedTx, Tx } from '@aztec/stdlib/tx';
|
|
9
|
+
import type { UInt64 } from '@aztec/stdlib/types';
|
|
8
10
|
|
|
9
11
|
import type { ProvingOrchestrator } from '../orchestrator/orchestrator.js';
|
|
10
12
|
import type { BrokerCircuitProverFacade } from '../proving_broker/broker_prover_facade.js';
|
|
@@ -17,18 +19,32 @@ export class ServerEpochProver implements EpochProver {
|
|
|
17
19
|
) {}
|
|
18
20
|
|
|
19
21
|
startNewEpoch(
|
|
20
|
-
epochNumber:
|
|
21
|
-
|
|
22
|
-
totalNumBlocks: number,
|
|
22
|
+
epochNumber: EpochNumber,
|
|
23
|
+
totalNumCheckpoints: number,
|
|
23
24
|
finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
|
|
24
25
|
): void {
|
|
25
|
-
this.orchestrator.startNewEpoch(epochNumber,
|
|
26
|
+
this.orchestrator.startNewEpoch(epochNumber, totalNumCheckpoints, finalBlobBatchingChallenges);
|
|
26
27
|
this.facade.start();
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
startNewCheckpoint(
|
|
30
|
+
checkpointIndex: number,
|
|
31
|
+
constants: CheckpointConstantData,
|
|
32
|
+
l1ToL2Messages: Fr[],
|
|
33
|
+
totalNumBlocks: number,
|
|
34
|
+
headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
35
|
+
): Promise<void> {
|
|
36
|
+
return this.orchestrator.startNewCheckpoint(
|
|
37
|
+
checkpointIndex,
|
|
38
|
+
constants,
|
|
39
|
+
l1ToL2Messages,
|
|
40
|
+
totalNumBlocks,
|
|
41
|
+
headerOfLastBlockInPreviousCheckpoint,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
startChonkVerifierCircuits(txs: Tx[]): Promise<void> {
|
|
45
|
+
return this.orchestrator.startChonkVerifierCircuits(txs);
|
|
30
46
|
}
|
|
31
|
-
setBlockCompleted(blockNumber:
|
|
47
|
+
setBlockCompleted(blockNumber: BlockNumber, expectedBlockHeader?: BlockHeader): Promise<BlockHeader> {
|
|
32
48
|
return this.orchestrator.setBlockCompleted(blockNumber, expectedBlockHeader);
|
|
33
49
|
}
|
|
34
50
|
finalizeEpoch(): Promise<{ publicInputs: RootRollupPublicInputs; proof: Proof; batchedBlobInputs: BatchedBlob }> {
|
|
@@ -40,19 +56,12 @@ export class ServerEpochProver implements EpochProver {
|
|
|
40
56
|
getProverId(): EthAddress {
|
|
41
57
|
return this.orchestrator.getProverId();
|
|
42
58
|
}
|
|
43
|
-
getBlock(index: number): L2Block {
|
|
44
|
-
return this.orchestrator.getBlock(index);
|
|
45
|
-
}
|
|
46
59
|
async stop(): Promise<void> {
|
|
47
60
|
await this.facade.stop();
|
|
48
61
|
await this.orchestrator.stop();
|
|
49
62
|
}
|
|
50
|
-
startNewBlock(
|
|
51
|
-
|
|
52
|
-
l1ToL2Messages: Fr[],
|
|
53
|
-
previousBlockHeader: BlockHeader,
|
|
54
|
-
): Promise<void> {
|
|
55
|
-
return this.orchestrator.startNewBlock(globalVariables, l1ToL2Messages, previousBlockHeader);
|
|
63
|
+
startNewBlock(blockNumber: BlockNumber, timestamp: UInt64, totalNumTxs: number): Promise<void> {
|
|
64
|
+
return this.orchestrator.startNewBlock(blockNumber, timestamp, totalNumTxs);
|
|
56
65
|
}
|
|
57
66
|
addTxs(txs: ProcessedTx[]): Promise<void> {
|
|
58
67
|
return this.orchestrator.addTxs(txs);
|