@aztec/prover-client 3.0.0-nightly.20250918 → 3.0.0-nightly.20250920
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/orchestrator/block-proving-state.d.ts +7 -7
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +14 -23
- package/dest/orchestrator/checkpoint-proving-state.d.ts +2 -2
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +3 -3
- package/dest/orchestrator/epoch-proving-state.d.ts +2 -3
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +6 -13
- package/dest/orchestrator/orchestrator.d.ts +2 -2
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +21 -21
- package/dest/orchestrator/tx-proving-state.d.ts +3 -3
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/tx-proving-state.js +5 -5
- package/dest/prover-client/server-epoch-prover.d.ts +2 -2
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +4 -4
- package/dest/proving_broker/broker_prover_facade.d.ts +7 -7
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +8 -8
- package/dest/proving_broker/fixtures.js +1 -1
- package/dest/proving_broker/proof_store/index.d.ts +1 -0
- 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/proving_broker.js +10 -10
- package/dest/proving_broker/proving_job_controller.js +8 -8
- package/dest/test/mock_prover.d.ts +7 -7
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +7 -7
- package/package.json +16 -17
- package/src/orchestrator/block-proving-state.ts +18 -43
- package/src/orchestrator/checkpoint-proving-state.ts +3 -3
- package/src/orchestrator/epoch-proving-state.ts +5 -13
- package/src/orchestrator/orchestrator.ts +21 -19
- package/src/orchestrator/tx-proving-state.ts +6 -6
- package/src/prover-client/server-epoch-prover.ts +3 -7
- package/src/proving_broker/broker_prover_facade.ts +26 -32
- package/src/proving_broker/fixtures.ts +1 -1
- package/src/proving_broker/proof_store/index.ts +1 -0
- package/src/proving_broker/proving_broker.ts +10 -10
- package/src/proving_broker/proving_job_controller.ts +8 -8
- package/src/test/mock_prover.ts +20 -26
- 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
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
BlockRootSingleTxRollupPrivateInputs,
|
|
35
35
|
CheckpointConstantData,
|
|
36
36
|
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
37
|
-
|
|
37
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
38
38
|
PublicTubePrivateInputs,
|
|
39
39
|
RootRollupPublicInputs,
|
|
40
40
|
} from '@aztec/stdlib/rollup';
|
|
@@ -119,7 +119,6 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
119
119
|
|
|
120
120
|
public startNewEpoch(
|
|
121
121
|
epochNumber: number,
|
|
122
|
-
firstCheckpointNumber: Fr,
|
|
123
122
|
totalNumCheckpoints: number,
|
|
124
123
|
finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
|
|
125
124
|
) {
|
|
@@ -134,7 +133,6 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
134
133
|
logger.info(`Starting epoch ${epochNumber} with ${totalNumCheckpoints} checkpoints.`);
|
|
135
134
|
this.provingState = new EpochProvingState(
|
|
136
135
|
epochNumber,
|
|
137
|
-
firstCheckpointNumber,
|
|
138
136
|
totalNumCheckpoints,
|
|
139
137
|
finalBlobBatchingChallenges,
|
|
140
138
|
provingState => this.checkAndEnqueueCheckpointRootRollup(provingState),
|
|
@@ -145,6 +143,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
145
143
|
}
|
|
146
144
|
|
|
147
145
|
public async startNewCheckpoint(
|
|
146
|
+
checkpointIndex: number,
|
|
148
147
|
constants: CheckpointConstantData,
|
|
149
148
|
l1ToL2Messages: Fr[],
|
|
150
149
|
totalNumBlocks: number,
|
|
@@ -178,6 +177,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
178
177
|
} = await this.updateL1ToL2MessageTree(l1ToL2Messages, db);
|
|
179
178
|
|
|
180
179
|
this.provingState.startNewCheckpoint(
|
|
180
|
+
checkpointIndex,
|
|
181
181
|
constants,
|
|
182
182
|
totalNumBlocks,
|
|
183
183
|
totalNumBlobFields,
|
|
@@ -694,23 +694,25 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
694
694
|
wrapCallbackInSpan(
|
|
695
695
|
this.tracer,
|
|
696
696
|
`ProvingOrchestrator.prover.${
|
|
697
|
-
inputs instanceof
|
|
697
|
+
inputs instanceof PrivateTxBaseRollupPrivateInputs
|
|
698
|
+
? 'getPrivateTxBaseRollupProof'
|
|
699
|
+
: 'getPublicTxBaseRollupProof'
|
|
698
700
|
}`,
|
|
699
701
|
{
|
|
700
702
|
[Attributes.TX_HASH]: processedTx.hash.toString(),
|
|
701
703
|
[Attributes.PROTOCOL_CIRCUIT_NAME]: rollupType,
|
|
702
704
|
},
|
|
703
705
|
signal => {
|
|
704
|
-
if (inputs instanceof
|
|
705
|
-
return this.prover.
|
|
706
|
+
if (inputs instanceof PrivateTxBaseRollupPrivateInputs) {
|
|
707
|
+
return this.prover.getPrivateTxBaseRollupProof(inputs, signal, provingState.epochNumber);
|
|
706
708
|
} else {
|
|
707
|
-
return this.prover.
|
|
709
|
+
return this.prover.getPublicTxBaseRollupProof(inputs, signal, provingState.epochNumber);
|
|
708
710
|
}
|
|
709
711
|
},
|
|
710
712
|
),
|
|
711
713
|
result => {
|
|
712
714
|
logger.debug(`Completed proof for ${rollupType} for tx ${processedTx.hash.toString()}`);
|
|
713
|
-
validatePartialState(result.inputs.
|
|
715
|
+
validatePartialState(result.inputs.endPartialState, txProvingState.treeSnapshots);
|
|
714
716
|
const leafLocation = provingState.setBaseRollupProof(txIndex, result);
|
|
715
717
|
if (provingState.totalNumTxs === 1) {
|
|
716
718
|
this.checkAndEnqueueBlockRootRollup(provingState);
|
|
@@ -777,7 +779,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
777
779
|
'ProvingOrchestrator.prover.getPublicTubeProof',
|
|
778
780
|
{
|
|
779
781
|
[Attributes.TX_HASH]: txHash,
|
|
780
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'public
|
|
782
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'tube-public' satisfies CircuitName,
|
|
781
783
|
},
|
|
782
784
|
signal => this.prover.getPublicTubeProof(inputs, signal, provingState.epochNumber),
|
|
783
785
|
),
|
|
@@ -804,11 +806,11 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
804
806
|
provingState,
|
|
805
807
|
wrapCallbackInSpan(
|
|
806
808
|
this.tracer,
|
|
807
|
-
'ProvingOrchestrator.prover.
|
|
809
|
+
'ProvingOrchestrator.prover.getTxMergeRollupProof',
|
|
808
810
|
{
|
|
809
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'merge
|
|
811
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'rollup-tx-merge' satisfies CircuitName,
|
|
810
812
|
},
|
|
811
|
-
signal => this.prover.
|
|
813
|
+
signal => this.prover.getTxMergeRollupProof(inputs, signal, provingState.epochNumber),
|
|
812
814
|
),
|
|
813
815
|
result => {
|
|
814
816
|
provingState.setMergeRollupProof(location, result);
|
|
@@ -898,7 +900,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
898
900
|
this.tracer,
|
|
899
901
|
'ProvingOrchestrator.prover.getBaseParityProof',
|
|
900
902
|
{
|
|
901
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'base
|
|
903
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-base' satisfies CircuitName,
|
|
902
904
|
},
|
|
903
905
|
signal => this.prover.getBaseParityProof(inputs, signal, provingState.epochNumber),
|
|
904
906
|
),
|
|
@@ -930,7 +932,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
930
932
|
return;
|
|
931
933
|
}
|
|
932
934
|
|
|
933
|
-
const inputs = provingState.
|
|
935
|
+
const inputs = provingState.getParityRootInputs();
|
|
934
936
|
|
|
935
937
|
this.deferredProving(
|
|
936
938
|
provingState,
|
|
@@ -938,7 +940,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
938
940
|
this.tracer,
|
|
939
941
|
'ProvingOrchestrator.prover.getRootParityProof',
|
|
940
942
|
{
|
|
941
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'root
|
|
943
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-root' satisfies CircuitName,
|
|
942
944
|
},
|
|
943
945
|
signal => this.prover.getRootParityProof(inputs, signal, provingState.epochNumber),
|
|
944
946
|
),
|
|
@@ -969,7 +971,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
969
971
|
this.tracer,
|
|
970
972
|
'ProvingOrchestrator.prover.getBlockMergeRollupProof',
|
|
971
973
|
{
|
|
972
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'block-merge
|
|
974
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'rollup-block-merge' satisfies CircuitName,
|
|
973
975
|
},
|
|
974
976
|
signal => this.prover.getBlockMergeRollupProof(inputs, signal, provingState.epochNumber),
|
|
975
977
|
),
|
|
@@ -1060,7 +1062,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1060
1062
|
this.tracer,
|
|
1061
1063
|
'ProvingOrchestrator.prover.getCheckpointMergeRollupProof',
|
|
1062
1064
|
{
|
|
1063
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'checkpoint-merge
|
|
1065
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'rollup-checkpoint-merge' satisfies CircuitName,
|
|
1064
1066
|
},
|
|
1065
1067
|
signal => this.prover.getCheckpointMergeRollupProof(inputs, signal, provingState.epochNumber),
|
|
1066
1068
|
),
|
|
@@ -1093,7 +1095,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1093
1095
|
this.tracer,
|
|
1094
1096
|
'ProvingOrchestrator.prover.getCheckpointPaddingRollupProof',
|
|
1095
1097
|
{
|
|
1096
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'checkpoint-padding
|
|
1098
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'rollup-checkpoint-padding' satisfies CircuitName,
|
|
1097
1099
|
},
|
|
1098
1100
|
signal => this.prover.getCheckpointPaddingRollupProof(inputs, signal, provingState.epochNumber),
|
|
1099
1101
|
),
|
|
@@ -1122,7 +1124,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
1122
1124
|
this.tracer,
|
|
1123
1125
|
'ProvingOrchestrator.prover.getRootRollupProof',
|
|
1124
1126
|
{
|
|
1125
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'root
|
|
1127
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'rollup-root' satisfies CircuitName,
|
|
1126
1128
|
},
|
|
1127
1129
|
signal => this.prover.getRootRollupProof(inputs, signal, provingState.epochNumber),
|
|
1128
1130
|
),
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
AvmProofData,
|
|
14
14
|
type BaseRollupHints,
|
|
15
15
|
PrivateBaseRollupHints,
|
|
16
|
-
|
|
16
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
17
17
|
PublicBaseRollupHints,
|
|
18
|
-
|
|
18
|
+
PublicTxBaseRollupPrivateInputs,
|
|
19
19
|
} from '@aztec/stdlib/rollup';
|
|
20
20
|
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
21
21
|
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
@@ -61,12 +61,12 @@ export class TxProvingState {
|
|
|
61
61
|
public getBaseRollupTypeAndInputs() {
|
|
62
62
|
if (this.requireAvmProof) {
|
|
63
63
|
return {
|
|
64
|
-
rollupType: '
|
|
64
|
+
rollupType: 'rollup-tx-base-public' satisfies CircuitName,
|
|
65
65
|
inputs: this.#getPublicBaseInputs(),
|
|
66
66
|
};
|
|
67
67
|
} else {
|
|
68
68
|
return {
|
|
69
|
-
rollupType: '
|
|
69
|
+
rollupType: 'rollup-tx-base-private' satisfies CircuitName,
|
|
70
70
|
inputs: this.#getPrivateBaseInputs(),
|
|
71
71
|
};
|
|
72
72
|
}
|
|
@@ -96,7 +96,7 @@ export class TxProvingState {
|
|
|
96
96
|
getVkData('HidingKernelToRollup'),
|
|
97
97
|
);
|
|
98
98
|
|
|
99
|
-
return new
|
|
99
|
+
return new PrivateTxBaseRollupPrivateInputs(privateTailProofData, this.baseRollupHints);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
#getPublicBaseInputs() {
|
|
@@ -121,7 +121,7 @@ export class TxProvingState {
|
|
|
121
121
|
this.#getVkData(this.avm!.verificationKey, AVM_VK_INDEX),
|
|
122
122
|
);
|
|
123
123
|
|
|
124
|
-
return new
|
|
124
|
+
return new PublicTxBaseRollupPrivateInputs(publicTubeProofData, avmProofData, this.baseRollupHints);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
#getVkData(verificationKey: VerificationKeyData, vkIndex: number) {
|
|
@@ -19,19 +19,14 @@ export class ServerEpochProver implements EpochProver {
|
|
|
19
19
|
|
|
20
20
|
startNewEpoch(
|
|
21
21
|
epochNumber: number,
|
|
22
|
-
firstCheckpointNumber: Fr,
|
|
23
22
|
totalNumCheckpoints: number,
|
|
24
23
|
finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
|
|
25
24
|
): void {
|
|
26
|
-
this.orchestrator.startNewEpoch(
|
|
27
|
-
epochNumber,
|
|
28
|
-
firstCheckpointNumber,
|
|
29
|
-
totalNumCheckpoints,
|
|
30
|
-
finalBlobBatchingChallenges,
|
|
31
|
-
);
|
|
25
|
+
this.orchestrator.startNewEpoch(epochNumber, totalNumCheckpoints, finalBlobBatchingChallenges);
|
|
32
26
|
this.facade.start();
|
|
33
27
|
}
|
|
34
28
|
startNewCheckpoint(
|
|
29
|
+
checkpointIndex: number,
|
|
35
30
|
constants: CheckpointConstantData,
|
|
36
31
|
l1ToL2Messages: Fr[],
|
|
37
32
|
totalNumBlocks: number,
|
|
@@ -39,6 +34,7 @@ export class ServerEpochProver implements EpochProver {
|
|
|
39
34
|
headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
40
35
|
): Promise<void> {
|
|
41
36
|
return this.orchestrator.startNewCheckpoint(
|
|
37
|
+
checkpointIndex,
|
|
42
38
|
constants,
|
|
43
39
|
l1ToL2Messages,
|
|
44
40
|
totalNumBlocks,
|
|
@@ -23,10 +23,9 @@ import {
|
|
|
23
23
|
makeProvingJobId,
|
|
24
24
|
} from '@aztec/stdlib/interfaces/server';
|
|
25
25
|
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
26
|
-
import type {
|
|
26
|
+
import type { ParityBasePrivateInputs, ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
27
27
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
28
28
|
import type {
|
|
29
|
-
BaseOrMergeRollupPublicInputs,
|
|
30
29
|
BlockMergeRollupPrivateInputs,
|
|
31
30
|
BlockRollupPublicInputs,
|
|
32
31
|
BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
@@ -39,12 +38,13 @@ import type {
|
|
|
39
38
|
CheckpointRollupPublicInputs,
|
|
40
39
|
CheckpointRootRollupPrivateInputs,
|
|
41
40
|
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
42
|
-
|
|
43
|
-
PrivateBaseRollupInputs,
|
|
44
|
-
PublicBaseRollupInputs,
|
|
41
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
45
42
|
PublicTubePrivateInputs,
|
|
43
|
+
PublicTxBaseRollupPrivateInputs,
|
|
46
44
|
RootRollupPrivateInputs,
|
|
47
45
|
RootRollupPublicInputs,
|
|
46
|
+
TxMergeRollupPrivateInputs,
|
|
47
|
+
TxRollupPublicInputs,
|
|
48
48
|
} from '@aztec/stdlib/rollup';
|
|
49
49
|
|
|
50
50
|
import { InlineProofStore, type ProofStore } from './proof_store/index.js';
|
|
@@ -418,29 +418,27 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
getBaseParityProof(
|
|
421
|
-
inputs:
|
|
421
|
+
inputs: ParityBasePrivateInputs,
|
|
422
422
|
signal?: AbortSignal,
|
|
423
423
|
epochNumber?: number,
|
|
424
424
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>> {
|
|
425
425
|
return this.enqueueJob(
|
|
426
|
-
this.generateId(ProvingRequestType.
|
|
427
|
-
ProvingRequestType.
|
|
426
|
+
this.generateId(ProvingRequestType.PARITY_BASE, inputs, epochNumber),
|
|
427
|
+
ProvingRequestType.PARITY_BASE,
|
|
428
428
|
inputs,
|
|
429
429
|
epochNumber,
|
|
430
430
|
signal,
|
|
431
431
|
);
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
|
|
435
|
-
input:
|
|
434
|
+
getTxMergeRollupProof(
|
|
435
|
+
input: TxMergeRollupPrivateInputs,
|
|
436
436
|
signal?: AbortSignal,
|
|
437
437
|
epochNumber?: number,
|
|
438
|
-
): Promise<
|
|
439
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
440
|
-
> {
|
|
438
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
441
439
|
return this.enqueueJob(
|
|
442
|
-
this.generateId(ProvingRequestType.
|
|
443
|
-
ProvingRequestType.
|
|
440
|
+
this.generateId(ProvingRequestType.TX_MERGE_ROLLUP, input, epochNumber),
|
|
441
|
+
ProvingRequestType.TX_MERGE_ROLLUP,
|
|
444
442
|
input,
|
|
445
443
|
epochNumber,
|
|
446
444
|
signal,
|
|
@@ -466,32 +464,28 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
466
464
|
);
|
|
467
465
|
}
|
|
468
466
|
|
|
469
|
-
|
|
470
|
-
baseRollupInput:
|
|
467
|
+
getPrivateTxBaseRollupProof(
|
|
468
|
+
baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
471
469
|
signal?: AbortSignal,
|
|
472
470
|
epochNumber?: number,
|
|
473
|
-
): Promise<
|
|
474
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
475
|
-
> {
|
|
471
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
476
472
|
return this.enqueueJob(
|
|
477
|
-
this.generateId(ProvingRequestType.
|
|
478
|
-
ProvingRequestType.
|
|
473
|
+
this.generateId(ProvingRequestType.PRIVATE_TX_BASE_ROLLUP, baseRollupInput, epochNumber),
|
|
474
|
+
ProvingRequestType.PRIVATE_TX_BASE_ROLLUP,
|
|
479
475
|
baseRollupInput,
|
|
480
476
|
epochNumber,
|
|
481
477
|
signal,
|
|
482
478
|
);
|
|
483
479
|
}
|
|
484
480
|
|
|
485
|
-
|
|
486
|
-
inputs:
|
|
481
|
+
getPublicTxBaseRollupProof(
|
|
482
|
+
inputs: PublicTxBaseRollupPrivateInputs,
|
|
487
483
|
signal?: AbortSignal,
|
|
488
484
|
epochNumber?: number,
|
|
489
|
-
): Promise<
|
|
490
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
491
|
-
> {
|
|
485
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
492
486
|
return this.enqueueJob(
|
|
493
|
-
this.generateId(ProvingRequestType.
|
|
494
|
-
ProvingRequestType.
|
|
487
|
+
this.generateId(ProvingRequestType.PUBLIC_TX_BASE_ROLLUP, inputs, epochNumber),
|
|
488
|
+
ProvingRequestType.PUBLIC_TX_BASE_ROLLUP,
|
|
495
489
|
inputs,
|
|
496
490
|
epochNumber,
|
|
497
491
|
signal,
|
|
@@ -499,13 +493,13 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
499
493
|
}
|
|
500
494
|
|
|
501
495
|
getRootParityProof(
|
|
502
|
-
inputs:
|
|
496
|
+
inputs: ParityRootPrivateInputs,
|
|
503
497
|
signal?: AbortSignal,
|
|
504
498
|
epochNumber?: number,
|
|
505
499
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>> {
|
|
506
500
|
return this.enqueueJob(
|
|
507
|
-
this.generateId(ProvingRequestType.
|
|
508
|
-
ProvingRequestType.
|
|
501
|
+
this.generateId(ProvingRequestType.PARITY_ROOT, inputs, epochNumber),
|
|
502
|
+
ProvingRequestType.PARITY_ROOT,
|
|
509
503
|
inputs,
|
|
510
504
|
epochNumber,
|
|
511
505
|
signal,
|
|
@@ -3,7 +3,7 @@ import { type ProofUri, type ProvingJobId, makeProvingJobId } from '@aztec/stdli
|
|
|
3
3
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
4
4
|
|
|
5
5
|
export function makeRandomProvingJobId(epochNumber?: number): ProvingJobId {
|
|
6
|
-
return makeProvingJobId(epochNumber ?? 1, ProvingRequestType.
|
|
6
|
+
return makeProvingJobId(epochNumber ?? 1, ProvingRequestType.PARITY_BASE, randomBytes(8).toString('hex'));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function makeInputsUri(): ProofUri {
|
|
@@ -46,9 +46,9 @@ export class ProvingBroker implements ProvingJobProducer, ProvingJobConsumer, Tr
|
|
|
46
46
|
[ProvingRequestType.PUBLIC_VM]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
47
47
|
[ProvingRequestType.PUBLIC_TUBE]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
48
48
|
|
|
49
|
-
[ProvingRequestType.
|
|
50
|
-
[ProvingRequestType.
|
|
51
|
-
[ProvingRequestType.
|
|
49
|
+
[ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
50
|
+
[ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
51
|
+
[ProvingRequestType.TX_MERGE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
52
52
|
[ProvingRequestType.ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
53
53
|
|
|
54
54
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
@@ -69,8 +69,8 @@ export class ProvingBroker implements ProvingJobProducer, ProvingJobConsumer, Tr
|
|
|
69
69
|
[ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
70
70
|
[ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
71
71
|
|
|
72
|
-
[ProvingRequestType.
|
|
73
|
-
[ProvingRequestType.
|
|
72
|
+
[ProvingRequestType.PARITY_BASE]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
73
|
+
[ProvingRequestType.PARITY_ROOT]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
// holds a copy of the database in memory in order to quickly fulfill requests
|
|
@@ -696,11 +696,11 @@ export const PROOF_TYPES_IN_PRIORITY_ORDER: ProvingRequestType[] = [
|
|
|
696
696
|
ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP,
|
|
697
697
|
ProvingRequestType.CHECKPOINT_MERGE_ROLLUP,
|
|
698
698
|
ProvingRequestType.CHECKPOINT_PADDING_ROLLUP,
|
|
699
|
-
ProvingRequestType.
|
|
700
|
-
ProvingRequestType.
|
|
701
|
-
ProvingRequestType.
|
|
699
|
+
ProvingRequestType.TX_MERGE_ROLLUP,
|
|
700
|
+
ProvingRequestType.PUBLIC_TX_BASE_ROLLUP,
|
|
701
|
+
ProvingRequestType.PRIVATE_TX_BASE_ROLLUP,
|
|
702
702
|
ProvingRequestType.PUBLIC_VM,
|
|
703
703
|
ProvingRequestType.PUBLIC_TUBE,
|
|
704
|
-
ProvingRequestType.
|
|
705
|
-
ProvingRequestType.
|
|
704
|
+
ProvingRequestType.PARITY_ROOT,
|
|
705
|
+
ProvingRequestType.PARITY_BASE,
|
|
706
706
|
];
|
|
@@ -132,16 +132,16 @@ export class ProvingJobController {
|
|
|
132
132
|
return await this.circuitProver.getPublicTubeProof(inputs, signal, this.epochNumber);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
case ProvingRequestType.
|
|
136
|
-
return await this.circuitProver.
|
|
135
|
+
case ProvingRequestType.PRIVATE_TX_BASE_ROLLUP: {
|
|
136
|
+
return await this.circuitProver.getPrivateTxBaseRollupProof(inputs, signal, this.epochNumber);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
case ProvingRequestType.
|
|
140
|
-
return await this.circuitProver.
|
|
139
|
+
case ProvingRequestType.PUBLIC_TX_BASE_ROLLUP: {
|
|
140
|
+
return await this.circuitProver.getPublicTxBaseRollupProof(inputs, signal, this.epochNumber);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
case ProvingRequestType.
|
|
144
|
-
return await this.circuitProver.
|
|
143
|
+
case ProvingRequestType.TX_MERGE_ROLLUP: {
|
|
144
|
+
return await this.circuitProver.getTxMergeRollupProof(inputs, signal, this.epochNumber);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
case ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP: {
|
|
@@ -188,11 +188,11 @@ export class ProvingJobController {
|
|
|
188
188
|
return await this.circuitProver.getRootRollupProof(inputs, signal, this.epochNumber);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
case ProvingRequestType.
|
|
191
|
+
case ProvingRequestType.PARITY_BASE: {
|
|
192
192
|
return await this.circuitProver.getBaseParityProof(inputs, signal, this.epochNumber);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
case ProvingRequestType.
|
|
195
|
+
case ProvingRequestType.PARITY_ROOT: {
|
|
196
196
|
return await this.circuitProver.getRootParityProof(inputs, signal, this.epochNumber);
|
|
197
197
|
}
|
|
198
198
|
|
package/src/test/mock_prover.ts
CHANGED
|
@@ -18,10 +18,9 @@ import {
|
|
|
18
18
|
makePublicInputsAndRecursiveProof,
|
|
19
19
|
} from '@aztec/stdlib/interfaces/server';
|
|
20
20
|
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
21
|
-
import type {
|
|
21
|
+
import type { ParityBasePrivateInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
22
22
|
import { makeEmptyRecursiveProof, makeRecursiveProof } from '@aztec/stdlib/proofs';
|
|
23
23
|
import type {
|
|
24
|
-
BaseOrMergeRollupPublicInputs,
|
|
25
24
|
BlockMergeRollupPrivateInputs,
|
|
26
25
|
BlockRollupPublicInputs,
|
|
27
26
|
BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
@@ -34,20 +33,21 @@ import type {
|
|
|
34
33
|
CheckpointRollupPublicInputs,
|
|
35
34
|
CheckpointRootRollupPrivateInputs,
|
|
36
35
|
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
37
|
-
|
|
38
|
-
PrivateBaseRollupInputs,
|
|
39
|
-
PublicBaseRollupInputs,
|
|
36
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
40
37
|
PublicTubePrivateInputs,
|
|
38
|
+
PublicTxBaseRollupPrivateInputs,
|
|
41
39
|
RootRollupPrivateInputs,
|
|
42
40
|
RootRollupPublicInputs,
|
|
41
|
+
TxMergeRollupPrivateInputs,
|
|
42
|
+
TxRollupPublicInputs,
|
|
43
43
|
} from '@aztec/stdlib/rollup';
|
|
44
44
|
import {
|
|
45
|
-
makeBaseOrMergeRollupPublicInputs,
|
|
46
45
|
makeBlockRollupPublicInputs,
|
|
47
46
|
makeCheckpointRollupPublicInputs,
|
|
48
47
|
makeParityPublicInputs,
|
|
49
48
|
makePrivateToPublicKernelCircuitPublicInputs,
|
|
50
49
|
makeRootRollupPublicInputs,
|
|
50
|
+
makeTxRollupPublicInputs,
|
|
51
51
|
} from '@aztec/stdlib/testing';
|
|
52
52
|
import { VerificationKeyData } from '@aztec/stdlib/vks';
|
|
53
53
|
|
|
@@ -119,7 +119,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
getBaseParityProof(_inputs:
|
|
122
|
+
getBaseParityProof(_inputs: ParityBasePrivateInputs, _signal?: AbortSignal, _epochNumber?: number) {
|
|
123
123
|
return Promise.resolve(
|
|
124
124
|
makePublicInputsAndRecursiveProof(
|
|
125
125
|
makeParityPublicInputs(),
|
|
@@ -129,7 +129,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
getRootParityProof(_inputs:
|
|
132
|
+
getRootParityProof(_inputs: ParityRootPrivateInputs, _signal?: AbortSignal, _epochNumber?: number) {
|
|
133
133
|
return Promise.resolve(
|
|
134
134
|
makePublicInputsAndRecursiveProof(
|
|
135
135
|
makeParityPublicInputs(),
|
|
@@ -158,48 +158,42 @@ export class MockProver implements ServerCircuitProver {
|
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
_baseRollupInput:
|
|
161
|
+
getPrivateTxBaseRollupProof(
|
|
162
|
+
_baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
163
163
|
_signal?: AbortSignal,
|
|
164
164
|
_epochNumber?: number,
|
|
165
|
-
): Promise<
|
|
166
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
167
|
-
> {
|
|
165
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
168
166
|
return Promise.resolve(
|
|
169
167
|
makePublicInputsAndRecursiveProof(
|
|
170
|
-
|
|
168
|
+
makeTxRollupPublicInputs(),
|
|
171
169
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
172
170
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
173
171
|
),
|
|
174
172
|
);
|
|
175
173
|
}
|
|
176
174
|
|
|
177
|
-
|
|
178
|
-
_inputs:
|
|
175
|
+
getPublicTxBaseRollupProof(
|
|
176
|
+
_inputs: PublicTxBaseRollupPrivateInputs,
|
|
179
177
|
_signal?: AbortSignal,
|
|
180
178
|
_epochNumber?: number,
|
|
181
|
-
): Promise<
|
|
182
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
183
|
-
> {
|
|
179
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
184
180
|
return Promise.resolve(
|
|
185
181
|
makePublicInputsAndRecursiveProof(
|
|
186
|
-
|
|
182
|
+
makeTxRollupPublicInputs(),
|
|
187
183
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
188
184
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
189
185
|
),
|
|
190
186
|
);
|
|
191
187
|
}
|
|
192
188
|
|
|
193
|
-
|
|
194
|
-
_input:
|
|
189
|
+
getTxMergeRollupProof(
|
|
190
|
+
_input: TxMergeRollupPrivateInputs,
|
|
195
191
|
_signal?: AbortSignal,
|
|
196
192
|
_epochNumber?: number,
|
|
197
|
-
): Promise<
|
|
198
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
199
|
-
> {
|
|
193
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
200
194
|
return Promise.resolve(
|
|
201
195
|
makePublicInputsAndRecursiveProof(
|
|
202
|
-
|
|
196
|
+
makeTxRollupPublicInputs(),
|
|
203
197
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
204
198
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
205
199
|
),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-proof-inputs.d.ts","sourceRoot":"","sources":["../../src/bin/get-proof-inputs.ts"],"names":[],"mappings":""}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */ import { AVM_INPUTS_FILENAME } from '@aztec/bb-prover';
|
|
2
|
-
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
-
import { ProvingJobInputs } from '@aztec/stdlib/interfaces/server';
|
|
5
|
-
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
6
|
-
import { mkdirSync, writeFileSync } from 'fs';
|
|
7
|
-
import { createProofStoreForUri } from '../proving_broker/index.js';
|
|
8
|
-
const logger = createLogger('prover-client:get-proof-inputs');
|
|
9
|
-
function printUsage() {
|
|
10
|
-
console.error('Usage: get-proof-inputs <proof-uri> [out-dir=.]');
|
|
11
|
-
}
|
|
12
|
-
async function main() {
|
|
13
|
-
if (process.argv[2] === '--help') {
|
|
14
|
-
printUsage();
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const uri = process.argv[2];
|
|
18
|
-
const outDir = process.argv[3] || '.';
|
|
19
|
-
if (!uri) {
|
|
20
|
-
printUsage();
|
|
21
|
-
throw new Error('Missing proof URI');
|
|
22
|
-
}
|
|
23
|
-
mkdirSync(outDir, {
|
|
24
|
-
recursive: true
|
|
25
|
-
});
|
|
26
|
-
const proofStore = createProofStoreForUri(uri);
|
|
27
|
-
logger.info(`Processing uri ${uri}`);
|
|
28
|
-
const input = await proofStore.getProofInput(uri);
|
|
29
|
-
logger.info(`Found inputs for ${ProvingRequestType[input.type]}`);
|
|
30
|
-
writeProofInputs(input, outDir);
|
|
31
|
-
console.log(jsonParseWithSchema(jsonStringify(input), ProvingJobInputs).inputs);
|
|
32
|
-
}
|
|
33
|
-
// This mimics the behavior of bb-prover/src/bb/execute.ts
|
|
34
|
-
function writeProofInputs(input, outDir) {
|
|
35
|
-
switch(input.type){
|
|
36
|
-
case ProvingRequestType.PUBLIC_VM:
|
|
37
|
-
{
|
|
38
|
-
writeFileSync(`${outDir}/${AVM_INPUTS_FILENAME}`, input.inputs.serializeWithMessagePack());
|
|
39
|
-
logger.info(`Wrote AVM inputs to ${AVM_INPUTS_FILENAME}`);
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
default:
|
|
43
|
-
{
|
|
44
|
-
throw new Error(`Unimplemented proving request type: ${ProvingRequestType[input.type]}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
main().catch((err)=>{
|
|
49
|
-
console.error(err);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
});
|