@aztec/prover-client 3.0.0-nightly.20250917 → 3.0.0-nightly.20250919
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/light.d.ts +5 -3
- package/dest/block-factory/light.d.ts.map +1 -1
- package/dest/block-factory/light.js +16 -9
- package/dest/mocks/fixtures.d.ts +3 -1
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +19 -2
- package/dest/mocks/test_context.d.ts +30 -9
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +68 -15
- package/dest/orchestrator/block-building-helpers.d.ts +16 -14
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +69 -66
- package/dest/orchestrator/block-proving-state.d.ts +59 -52
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +215 -187
- package/dest/orchestrator/checkpoint-proving-state.d.ts +62 -0
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/checkpoint-proving-state.js +208 -0
- package/dest/orchestrator/epoch-proving-state.d.ts +32 -25
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +132 -81
- package/dest/orchestrator/orchestrator.d.ts +25 -24
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +331 -203
- 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 +8 -7
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +7 -7
- package/dest/proving_broker/broker_prover_facade.d.ts +18 -13
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +36 -21
- 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.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +27 -16
- package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
- package/dest/proving_broker/proving_job_controller.js +34 -14
- package/dest/test/mock_prover.d.ts +18 -13
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +31 -16
- package/package.json +16 -17
- package/src/block-factory/light.ts +33 -9
- package/src/mocks/fixtures.ts +25 -7
- package/src/mocks/test_context.ts +113 -21
- package/src/orchestrator/block-building-helpers.ts +107 -93
- package/src/orchestrator/block-proving-state.ts +232 -244
- package/src/orchestrator/checkpoint-proving-state.ts +294 -0
- package/src/orchestrator/epoch-proving-state.ts +169 -121
- package/src/orchestrator/orchestrator.ts +483 -262
- package/src/orchestrator/tx-proving-state.ts +6 -6
- package/src/prover-client/server-epoch-prover.ts +30 -16
- package/src/proving_broker/broker_prover_facade.ts +151 -83
- 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 +34 -16
- package/src/proving_broker/proving_job_controller.ts +34 -14
- package/src/test/mock_prover.ts +125 -54
- 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
|
@@ -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) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { BatchedBlob, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
2
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import type { EthAddress
|
|
3
|
+
import type { EthAddress } from '@aztec/stdlib/block';
|
|
4
4
|
import type { EpochProver } from '@aztec/stdlib/interfaces/server';
|
|
5
5
|
import type { Proof } from '@aztec/stdlib/proofs';
|
|
6
|
-
import type { RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
7
|
-
import type { BlockHeader,
|
|
6
|
+
import type { CheckpointConstantData, RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
7
|
+
import type { BlockHeader, ProcessedTx, Tx } from '@aztec/stdlib/tx';
|
|
8
|
+
import type { UInt64 } from '@aztec/stdlib/types';
|
|
8
9
|
|
|
9
10
|
import type { ProvingOrchestrator } from '../orchestrator/orchestrator.js';
|
|
10
11
|
import type { BrokerCircuitProverFacade } from '../proving_broker/broker_prover_facade.js';
|
|
@@ -18,17 +19,37 @@ export class ServerEpochProver implements EpochProver {
|
|
|
18
19
|
|
|
19
20
|
startNewEpoch(
|
|
20
21
|
epochNumber: number,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
firstCheckpointNumber: Fr,
|
|
23
|
+
totalNumCheckpoints: number,
|
|
23
24
|
finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
|
|
24
25
|
): void {
|
|
25
|
-
this.orchestrator.startNewEpoch(
|
|
26
|
+
this.orchestrator.startNewEpoch(
|
|
27
|
+
epochNumber,
|
|
28
|
+
firstCheckpointNumber,
|
|
29
|
+
totalNumCheckpoints,
|
|
30
|
+
finalBlobBatchingChallenges,
|
|
31
|
+
);
|
|
26
32
|
this.facade.start();
|
|
27
33
|
}
|
|
34
|
+
startNewCheckpoint(
|
|
35
|
+
constants: CheckpointConstantData,
|
|
36
|
+
l1ToL2Messages: Fr[],
|
|
37
|
+
totalNumBlocks: number,
|
|
38
|
+
totalNumBlobFields: number,
|
|
39
|
+
headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
40
|
+
): Promise<void> {
|
|
41
|
+
return this.orchestrator.startNewCheckpoint(
|
|
42
|
+
constants,
|
|
43
|
+
l1ToL2Messages,
|
|
44
|
+
totalNumBlocks,
|
|
45
|
+
totalNumBlobFields,
|
|
46
|
+
headerOfLastBlockInPreviousCheckpoint,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
28
49
|
startTubeCircuits(txs: Tx[]): Promise<void> {
|
|
29
50
|
return this.orchestrator.startTubeCircuits(txs);
|
|
30
51
|
}
|
|
31
|
-
setBlockCompleted(blockNumber: number, expectedBlockHeader?: BlockHeader): Promise<
|
|
52
|
+
setBlockCompleted(blockNumber: number, expectedBlockHeader?: BlockHeader): Promise<BlockHeader> {
|
|
32
53
|
return this.orchestrator.setBlockCompleted(blockNumber, expectedBlockHeader);
|
|
33
54
|
}
|
|
34
55
|
finalizeEpoch(): Promise<{ publicInputs: RootRollupPublicInputs; proof: Proof; batchedBlobInputs: BatchedBlob }> {
|
|
@@ -40,19 +61,12 @@ export class ServerEpochProver implements EpochProver {
|
|
|
40
61
|
getProverId(): EthAddress {
|
|
41
62
|
return this.orchestrator.getProverId();
|
|
42
63
|
}
|
|
43
|
-
getBlock(index: number): L2Block {
|
|
44
|
-
return this.orchestrator.getBlock(index);
|
|
45
|
-
}
|
|
46
64
|
async stop(): Promise<void> {
|
|
47
65
|
await this.facade.stop();
|
|
48
66
|
await this.orchestrator.stop();
|
|
49
67
|
}
|
|
50
|
-
startNewBlock(
|
|
51
|
-
|
|
52
|
-
l1ToL2Messages: Fr[],
|
|
53
|
-
previousBlockHeader: BlockHeader,
|
|
54
|
-
): Promise<void> {
|
|
55
|
-
return this.orchestrator.startNewBlock(globalVariables, l1ToL2Messages, previousBlockHeader);
|
|
68
|
+
startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number): Promise<void> {
|
|
69
|
+
return this.orchestrator.startNewBlock(blockNumber, timestamp, totalNumTxs);
|
|
56
70
|
}
|
|
57
71
|
addTxs(txs: ProcessedTx[]): Promise<void> {
|
|
58
72
|
return this.orchestrator.addTxs(txs);
|
|
@@ -23,22 +23,28 @@ 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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
BlockMergeRollupPrivateInputs,
|
|
30
|
+
BlockRollupPublicInputs,
|
|
31
|
+
BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
32
|
+
BlockRootFirstRollupPrivateInputs,
|
|
33
|
+
BlockRootRollupPrivateInputs,
|
|
34
|
+
BlockRootSingleTxFirstRollupPrivateInputs,
|
|
35
|
+
BlockRootSingleTxRollupPrivateInputs,
|
|
36
|
+
CheckpointMergeRollupPrivateInputs,
|
|
37
|
+
CheckpointPaddingRollupPrivateInputs,
|
|
38
|
+
CheckpointRollupPublicInputs,
|
|
39
|
+
CheckpointRootRollupPrivateInputs,
|
|
40
|
+
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
41
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
38
42
|
PublicTubePrivateInputs,
|
|
39
|
-
|
|
43
|
+
PublicTxBaseRollupPrivateInputs,
|
|
44
|
+
RootRollupPrivateInputs,
|
|
40
45
|
RootRollupPublicInputs,
|
|
41
|
-
|
|
46
|
+
TxMergeRollupPrivateInputs,
|
|
47
|
+
TxRollupPublicInputs,
|
|
42
48
|
} from '@aztec/stdlib/rollup';
|
|
43
49
|
|
|
44
50
|
import { InlineProofStore, type ProofStore } from './proof_store/index.js';
|
|
@@ -412,182 +418,244 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
412
418
|
}
|
|
413
419
|
|
|
414
420
|
getBaseParityProof(
|
|
415
|
-
inputs:
|
|
421
|
+
inputs: ParityBasePrivateInputs,
|
|
416
422
|
signal?: AbortSignal,
|
|
417
423
|
epochNumber?: number,
|
|
418
424
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>> {
|
|
419
425
|
return this.enqueueJob(
|
|
420
|
-
this.generateId(ProvingRequestType.
|
|
421
|
-
ProvingRequestType.
|
|
426
|
+
this.generateId(ProvingRequestType.PARITY_BASE, inputs, epochNumber),
|
|
427
|
+
ProvingRequestType.PARITY_BASE,
|
|
422
428
|
inputs,
|
|
423
429
|
epochNumber,
|
|
424
430
|
signal,
|
|
425
431
|
);
|
|
426
432
|
}
|
|
427
433
|
|
|
428
|
-
|
|
429
|
-
input:
|
|
434
|
+
getTxMergeRollupProof(
|
|
435
|
+
input: TxMergeRollupPrivateInputs,
|
|
430
436
|
signal?: AbortSignal,
|
|
431
437
|
epochNumber?: number,
|
|
432
|
-
): Promise<
|
|
433
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
434
|
-
> {
|
|
438
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
435
439
|
return this.enqueueJob(
|
|
436
|
-
this.generateId(ProvingRequestType.
|
|
437
|
-
ProvingRequestType.
|
|
440
|
+
this.generateId(ProvingRequestType.TX_MERGE_ROLLUP, input, epochNumber),
|
|
441
|
+
ProvingRequestType.TX_MERGE_ROLLUP,
|
|
438
442
|
input,
|
|
439
443
|
epochNumber,
|
|
440
444
|
signal,
|
|
441
445
|
);
|
|
442
446
|
}
|
|
443
447
|
|
|
444
|
-
|
|
445
|
-
|
|
448
|
+
getPublicTubeProof(
|
|
449
|
+
inputs: PublicTubePrivateInputs,
|
|
446
450
|
signal?: AbortSignal,
|
|
447
451
|
epochNumber?: number,
|
|
448
452
|
): Promise<
|
|
449
|
-
PublicInputsAndRecursiveProof<
|
|
453
|
+
PublicInputsAndRecursiveProof<
|
|
454
|
+
PrivateToPublicKernelCircuitPublicInputs,
|
|
455
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
456
|
+
>
|
|
450
457
|
> {
|
|
451
458
|
return this.enqueueJob(
|
|
452
|
-
this.generateId(ProvingRequestType.
|
|
453
|
-
ProvingRequestType.
|
|
459
|
+
this.generateId(ProvingRequestType.PUBLIC_TUBE, inputs, epochNumber),
|
|
460
|
+
ProvingRequestType.PUBLIC_TUBE,
|
|
461
|
+
inputs,
|
|
462
|
+
epochNumber,
|
|
463
|
+
signal,
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
getPrivateTxBaseRollupProof(
|
|
468
|
+
baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
469
|
+
signal?: AbortSignal,
|
|
470
|
+
epochNumber?: number,
|
|
471
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
472
|
+
return this.enqueueJob(
|
|
473
|
+
this.generateId(ProvingRequestType.PRIVATE_TX_BASE_ROLLUP, baseRollupInput, epochNumber),
|
|
474
|
+
ProvingRequestType.PRIVATE_TX_BASE_ROLLUP,
|
|
475
|
+
baseRollupInput,
|
|
476
|
+
epochNumber,
|
|
477
|
+
signal,
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
getPublicTxBaseRollupProof(
|
|
482
|
+
inputs: PublicTxBaseRollupPrivateInputs,
|
|
483
|
+
signal?: AbortSignal,
|
|
484
|
+
epochNumber?: number,
|
|
485
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
486
|
+
return this.enqueueJob(
|
|
487
|
+
this.generateId(ProvingRequestType.PUBLIC_TX_BASE_ROLLUP, inputs, epochNumber),
|
|
488
|
+
ProvingRequestType.PUBLIC_TX_BASE_ROLLUP,
|
|
489
|
+
inputs,
|
|
490
|
+
epochNumber,
|
|
491
|
+
signal,
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
getRootParityProof(
|
|
496
|
+
inputs: ParityRootPrivateInputs,
|
|
497
|
+
signal?: AbortSignal,
|
|
498
|
+
epochNumber?: number,
|
|
499
|
+
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>> {
|
|
500
|
+
return this.enqueueJob(
|
|
501
|
+
this.generateId(ProvingRequestType.PARITY_ROOT, inputs, epochNumber),
|
|
502
|
+
ProvingRequestType.PARITY_ROOT,
|
|
503
|
+
inputs,
|
|
504
|
+
epochNumber,
|
|
505
|
+
signal,
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
getBlockRootFirstRollupProof(
|
|
510
|
+
input: BlockRootFirstRollupPrivateInputs,
|
|
511
|
+
signal?: AbortSignal,
|
|
512
|
+
epochNumber?: number,
|
|
513
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
514
|
+
return this.enqueueJob(
|
|
515
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP, input, epochNumber),
|
|
516
|
+
ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP,
|
|
454
517
|
input,
|
|
455
518
|
epochNumber,
|
|
456
519
|
signal,
|
|
457
520
|
);
|
|
458
521
|
}
|
|
459
522
|
|
|
460
|
-
|
|
461
|
-
input:
|
|
523
|
+
getBlockRootSingleTxFirstRollupProof(
|
|
524
|
+
input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
462
525
|
signal?: AbortSignal,
|
|
463
526
|
epochNumber?: number,
|
|
464
|
-
): Promise<
|
|
465
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
466
|
-
> {
|
|
527
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
467
528
|
return this.enqueueJob(
|
|
468
|
-
this.generateId(ProvingRequestType.
|
|
469
|
-
ProvingRequestType.
|
|
529
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP, input, epochNumber),
|
|
530
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP,
|
|
470
531
|
input,
|
|
471
532
|
epochNumber,
|
|
472
533
|
signal,
|
|
473
534
|
);
|
|
474
535
|
}
|
|
475
536
|
|
|
476
|
-
|
|
477
|
-
input:
|
|
537
|
+
getBlockRootEmptyTxFirstRollupProof(
|
|
538
|
+
input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
478
539
|
signal?: AbortSignal,
|
|
479
540
|
epochNumber?: number,
|
|
480
|
-
): Promise<
|
|
481
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
482
|
-
> {
|
|
541
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
483
542
|
return this.enqueueJob(
|
|
484
|
-
this.generateId(ProvingRequestType.
|
|
485
|
-
ProvingRequestType.
|
|
543
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP, input, epochNumber),
|
|
544
|
+
ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP,
|
|
486
545
|
input,
|
|
487
546
|
epochNumber,
|
|
488
547
|
signal,
|
|
489
548
|
);
|
|
490
549
|
}
|
|
491
550
|
|
|
492
|
-
|
|
493
|
-
input:
|
|
551
|
+
getBlockRootRollupProof(
|
|
552
|
+
input: BlockRootRollupPrivateInputs,
|
|
494
553
|
signal?: AbortSignal,
|
|
495
554
|
epochNumber?: number,
|
|
496
|
-
): Promise<
|
|
497
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
498
|
-
> {
|
|
555
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
499
556
|
return this.enqueueJob(
|
|
500
|
-
this.generateId(ProvingRequestType.
|
|
501
|
-
ProvingRequestType.
|
|
557
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_ROLLUP, input, epochNumber),
|
|
558
|
+
ProvingRequestType.BLOCK_ROOT_ROLLUP,
|
|
502
559
|
input,
|
|
503
560
|
epochNumber,
|
|
504
561
|
signal,
|
|
505
562
|
);
|
|
506
563
|
}
|
|
507
564
|
|
|
508
|
-
|
|
509
|
-
input:
|
|
565
|
+
getBlockRootSingleTxRollupProof(
|
|
566
|
+
input: BlockRootSingleTxRollupPrivateInputs,
|
|
510
567
|
signal?: AbortSignal,
|
|
511
568
|
epochNumber?: number,
|
|
512
|
-
): Promise<
|
|
513
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
514
|
-
> {
|
|
569
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
515
570
|
return this.enqueueJob(
|
|
516
|
-
this.generateId(ProvingRequestType.
|
|
517
|
-
ProvingRequestType.
|
|
571
|
+
this.generateId(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP, input, epochNumber),
|
|
572
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP,
|
|
518
573
|
input,
|
|
519
574
|
epochNumber,
|
|
520
575
|
signal,
|
|
521
576
|
);
|
|
522
577
|
}
|
|
523
578
|
|
|
524
|
-
|
|
525
|
-
|
|
579
|
+
getBlockMergeRollupProof(
|
|
580
|
+
input: BlockMergeRollupPrivateInputs,
|
|
581
|
+
signal?: AbortSignal,
|
|
582
|
+
epochNumber?: number,
|
|
583
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
584
|
+
return this.enqueueJob(
|
|
585
|
+
this.generateId(ProvingRequestType.BLOCK_MERGE_ROLLUP, input, epochNumber),
|
|
586
|
+
ProvingRequestType.BLOCK_MERGE_ROLLUP,
|
|
587
|
+
input,
|
|
588
|
+
epochNumber,
|
|
589
|
+
signal,
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
getCheckpointRootRollupProof(
|
|
594
|
+
input: CheckpointRootRollupPrivateInputs,
|
|
526
595
|
signal?: AbortSignal,
|
|
527
596
|
epochNumber?: number,
|
|
528
597
|
): Promise<
|
|
529
|
-
PublicInputsAndRecursiveProof<
|
|
530
|
-
PrivateToPublicKernelCircuitPublicInputs,
|
|
531
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
532
|
-
>
|
|
598
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
533
599
|
> {
|
|
534
600
|
return this.enqueueJob(
|
|
535
|
-
this.generateId(ProvingRequestType.
|
|
536
|
-
ProvingRequestType.
|
|
537
|
-
|
|
601
|
+
this.generateId(ProvingRequestType.CHECKPOINT_ROOT_ROLLUP, input, epochNumber),
|
|
602
|
+
ProvingRequestType.CHECKPOINT_ROOT_ROLLUP,
|
|
603
|
+
input,
|
|
538
604
|
epochNumber,
|
|
539
605
|
signal,
|
|
540
606
|
);
|
|
541
607
|
}
|
|
542
608
|
|
|
543
|
-
|
|
544
|
-
|
|
609
|
+
getCheckpointRootSingleBlockRollupProof(
|
|
610
|
+
input: CheckpointRootSingleBlockRollupPrivateInputs,
|
|
545
611
|
signal?: AbortSignal,
|
|
546
612
|
epochNumber?: number,
|
|
547
613
|
): Promise<
|
|
548
|
-
PublicInputsAndRecursiveProof<
|
|
614
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
549
615
|
> {
|
|
550
616
|
return this.enqueueJob(
|
|
551
|
-
this.generateId(ProvingRequestType.
|
|
552
|
-
ProvingRequestType.
|
|
553
|
-
|
|
617
|
+
this.generateId(ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP, input, epochNumber),
|
|
618
|
+
ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP,
|
|
619
|
+
input,
|
|
554
620
|
epochNumber,
|
|
555
621
|
signal,
|
|
556
622
|
);
|
|
557
623
|
}
|
|
558
624
|
|
|
559
|
-
|
|
560
|
-
|
|
625
|
+
getCheckpointPaddingRollupProof(
|
|
626
|
+
input: CheckpointPaddingRollupPrivateInputs,
|
|
561
627
|
signal?: AbortSignal,
|
|
562
628
|
epochNumber?: number,
|
|
563
629
|
): Promise<
|
|
564
|
-
PublicInputsAndRecursiveProof<
|
|
630
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
565
631
|
> {
|
|
566
632
|
return this.enqueueJob(
|
|
567
|
-
this.generateId(ProvingRequestType.
|
|
568
|
-
ProvingRequestType.
|
|
569
|
-
|
|
633
|
+
this.generateId(ProvingRequestType.CHECKPOINT_PADDING_ROLLUP, input, epochNumber),
|
|
634
|
+
ProvingRequestType.CHECKPOINT_PADDING_ROLLUP,
|
|
635
|
+
input,
|
|
570
636
|
epochNumber,
|
|
571
637
|
signal,
|
|
572
638
|
);
|
|
573
639
|
}
|
|
574
640
|
|
|
575
|
-
|
|
576
|
-
|
|
641
|
+
getCheckpointMergeRollupProof(
|
|
642
|
+
input: CheckpointMergeRollupPrivateInputs,
|
|
577
643
|
signal?: AbortSignal,
|
|
578
644
|
epochNumber?: number,
|
|
579
|
-
): Promise<
|
|
645
|
+
): Promise<
|
|
646
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
647
|
+
> {
|
|
580
648
|
return this.enqueueJob(
|
|
581
|
-
this.generateId(ProvingRequestType.
|
|
582
|
-
ProvingRequestType.
|
|
583
|
-
|
|
649
|
+
this.generateId(ProvingRequestType.CHECKPOINT_MERGE_ROLLUP, input, epochNumber),
|
|
650
|
+
ProvingRequestType.CHECKPOINT_MERGE_ROLLUP,
|
|
651
|
+
input,
|
|
584
652
|
epochNumber,
|
|
585
653
|
signal,
|
|
586
654
|
);
|
|
587
655
|
}
|
|
588
656
|
|
|
589
657
|
getRootRollupProof(
|
|
590
|
-
input:
|
|
658
|
+
input: RootRollupPrivateInputs,
|
|
591
659
|
signal?: AbortSignal,
|
|
592
660
|
epochNumber?: number,
|
|
593
661
|
): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs, typeof RECURSIVE_PROOF_LENGTH>> {
|
|
@@ -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,19 +46,31 @@ 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),
|
|
55
|
+
[ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
56
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(
|
|
57
|
+
provingJobComparator,
|
|
58
|
+
),
|
|
59
|
+
[ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(
|
|
60
|
+
provingJobComparator,
|
|
61
|
+
),
|
|
55
62
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
56
|
-
[ProvingRequestType.
|
|
57
|
-
[ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
58
|
-
[ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
63
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
59
64
|
|
|
60
|
-
[ProvingRequestType.
|
|
61
|
-
[ProvingRequestType.
|
|
65
|
+
[ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
66
|
+
[ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(
|
|
67
|
+
provingJobComparator,
|
|
68
|
+
),
|
|
69
|
+
[ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
70
|
+
[ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
71
|
+
|
|
72
|
+
[ProvingRequestType.PARITY_BASE]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
73
|
+
[ProvingRequestType.PARITY_ROOT]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
62
74
|
};
|
|
63
75
|
|
|
64
76
|
// holds a copy of the database in memory in order to quickly fulfill requests
|
|
@@ -673,16 +685,22 @@ function proofTypeComparator(a: ProvingRequestType, b: ProvingRequestType): -1 |
|
|
|
673
685
|
* is to get picked up by agents
|
|
674
686
|
*/
|
|
675
687
|
export const PROOF_TYPES_IN_PRIORITY_ORDER: ProvingRequestType[] = [
|
|
688
|
+
ProvingRequestType.ROOT_ROLLUP,
|
|
689
|
+
ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP,
|
|
690
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP,
|
|
691
|
+
ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP,
|
|
676
692
|
ProvingRequestType.BLOCK_ROOT_ROLLUP,
|
|
677
|
-
ProvingRequestType.
|
|
693
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP,
|
|
678
694
|
ProvingRequestType.BLOCK_MERGE_ROLLUP,
|
|
679
|
-
ProvingRequestType.
|
|
680
|
-
ProvingRequestType.
|
|
681
|
-
ProvingRequestType.
|
|
682
|
-
ProvingRequestType.
|
|
695
|
+
ProvingRequestType.CHECKPOINT_ROOT_ROLLUP,
|
|
696
|
+
ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP,
|
|
697
|
+
ProvingRequestType.CHECKPOINT_MERGE_ROLLUP,
|
|
698
|
+
ProvingRequestType.CHECKPOINT_PADDING_ROLLUP,
|
|
699
|
+
ProvingRequestType.TX_MERGE_ROLLUP,
|
|
700
|
+
ProvingRequestType.PUBLIC_TX_BASE_ROLLUP,
|
|
701
|
+
ProvingRequestType.PRIVATE_TX_BASE_ROLLUP,
|
|
683
702
|
ProvingRequestType.PUBLIC_VM,
|
|
684
703
|
ProvingRequestType.PUBLIC_TUBE,
|
|
685
|
-
ProvingRequestType.
|
|
686
|
-
ProvingRequestType.
|
|
687
|
-
ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP,
|
|
704
|
+
ProvingRequestType.PARITY_ROOT,
|
|
705
|
+
ProvingRequestType.PARITY_BASE,
|
|
688
706
|
];
|
|
@@ -132,47 +132,67 @@ 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
|
-
case ProvingRequestType.
|
|
148
|
-
return await this.circuitProver.
|
|
147
|
+
case ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP: {
|
|
148
|
+
return await this.circuitProver.getBlockRootFirstRollupProof(inputs, signal, this.epochNumber);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
case ProvingRequestType.
|
|
152
|
-
return await this.circuitProver.
|
|
151
|
+
case ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP: {
|
|
152
|
+
return await this.circuitProver.getBlockRootSingleTxFirstRollupProof(inputs, signal, this.epochNumber);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
case ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP: {
|
|
156
|
+
return await this.circuitProver.getBlockRootEmptyTxFirstRollupProof(inputs, signal, this.epochNumber);
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
case ProvingRequestType.BLOCK_ROOT_ROLLUP: {
|
|
156
160
|
return await this.circuitProver.getBlockRootRollupProof(inputs, signal, this.epochNumber);
|
|
157
161
|
}
|
|
158
162
|
|
|
159
|
-
case ProvingRequestType.
|
|
160
|
-
return await this.circuitProver.
|
|
163
|
+
case ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP: {
|
|
164
|
+
return await this.circuitProver.getBlockRootSingleTxRollupProof(inputs, signal, this.epochNumber);
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
case ProvingRequestType.BLOCK_MERGE_ROLLUP: {
|
|
164
168
|
return await this.circuitProver.getBlockMergeRollupProof(inputs, signal, this.epochNumber);
|
|
165
169
|
}
|
|
166
170
|
|
|
171
|
+
case ProvingRequestType.CHECKPOINT_ROOT_ROLLUP: {
|
|
172
|
+
return await this.circuitProver.getCheckpointRootRollupProof(inputs, signal, this.epochNumber);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
case ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP: {
|
|
176
|
+
return await this.circuitProver.getCheckpointRootSingleBlockRollupProof(inputs, signal, this.epochNumber);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
case ProvingRequestType.CHECKPOINT_PADDING_ROLLUP: {
|
|
180
|
+
return await this.circuitProver.getCheckpointPaddingRollupProof(inputs, signal, this.epochNumber);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
case ProvingRequestType.CHECKPOINT_MERGE_ROLLUP: {
|
|
184
|
+
return await this.circuitProver.getCheckpointMergeRollupProof(inputs, signal, this.epochNumber);
|
|
185
|
+
}
|
|
186
|
+
|
|
167
187
|
case ProvingRequestType.ROOT_ROLLUP: {
|
|
168
188
|
return await this.circuitProver.getRootRollupProof(inputs, signal, this.epochNumber);
|
|
169
189
|
}
|
|
170
190
|
|
|
171
|
-
case ProvingRequestType.
|
|
191
|
+
case ProvingRequestType.PARITY_BASE: {
|
|
172
192
|
return await this.circuitProver.getBaseParityProof(inputs, signal, this.epochNumber);
|
|
173
193
|
}
|
|
174
194
|
|
|
175
|
-
case ProvingRequestType.
|
|
195
|
+
case ProvingRequestType.PARITY_ROOT: {
|
|
176
196
|
return await this.circuitProver.getRootParityProof(inputs, signal, this.epochNumber);
|
|
177
197
|
}
|
|
178
198
|
|