@aztec/prover-client 3.0.0-nightly.20250925 → 3.0.0-nightly.20250927
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-building-helpers.d.ts +1 -3
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +31 -54
- package/dest/orchestrator/block-proving-state.d.ts +3 -3
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +6 -6
- package/dest/orchestrator/checkpoint-proving-state.d.ts +4 -4
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +8 -8
- package/dest/orchestrator/epoch-proving-state.d.ts +4 -5
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +2 -2
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +10 -10
- package/dest/orchestrator/tx-proving-state.d.ts +5 -4
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/tx-proving-state.js +8 -4
- package/dest/proving_broker/broker_prover_facade.d.ts +2 -3
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/test/mock_prover.d.ts +2 -3
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +2 -2
- package/package.json +15 -15
- package/src/orchestrator/block-building-helpers.ts +52 -93
- package/src/orchestrator/block-proving-state.ts +8 -5
- package/src/orchestrator/checkpoint-proving-state.ts +12 -6
- package/src/orchestrator/epoch-proving-state.ts +7 -12
- package/src/orchestrator/orchestrator.ts +18 -27
- package/src/orchestrator/tx-proving-state.ts +9 -6
- package/src/proving_broker/broker_prover_facade.ts +2 -7
- package/src/test/mock_prover.ts +4 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BatchedBlob, BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges, SpongeBlob } from '@aztec/blob-lib';
|
|
2
2
|
import {
|
|
3
3
|
L1_TO_L2_MSG_SUBTREE_HEIGHT,
|
|
4
|
-
|
|
4
|
+
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
5
5
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
6
6
|
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
7
7
|
NUM_BASE_PARITY_PER_ROOT_PARITY,
|
|
@@ -24,7 +24,6 @@ import type {
|
|
|
24
24
|
PublicInputsAndRecursiveProof,
|
|
25
25
|
ServerCircuitProver,
|
|
26
26
|
} from '@aztec/stdlib/interfaces/server';
|
|
27
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
28
27
|
import type { Proof } from '@aztec/stdlib/proofs';
|
|
29
28
|
import {
|
|
30
29
|
type BaseRollupHints,
|
|
@@ -36,6 +35,7 @@ import {
|
|
|
36
35
|
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
37
36
|
PrivateTxBaseRollupPrivateInputs,
|
|
38
37
|
PublicTubePrivateInputs,
|
|
38
|
+
PublicTubePublicInputs,
|
|
39
39
|
RootRollupPublicInputs,
|
|
40
40
|
} from '@aztec/stdlib/rollup';
|
|
41
41
|
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
@@ -171,9 +171,9 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
171
171
|
// Insert all the l1 to l2 messages into the db. And get the states before and after the insertion.
|
|
172
172
|
const {
|
|
173
173
|
lastL1ToL2MessageTreeSnapshot,
|
|
174
|
-
|
|
174
|
+
lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
175
175
|
newL1ToL2MessageTreeSnapshot,
|
|
176
|
-
|
|
176
|
+
newL1ToL2MessageSubtreeRootSiblingPath,
|
|
177
177
|
} = await this.updateL1ToL2MessageTree(l1ToL2Messages, db);
|
|
178
178
|
|
|
179
179
|
this.provingState.startNewCheckpoint(
|
|
@@ -185,9 +185,9 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
185
185
|
lastArchiveSiblingPath,
|
|
186
186
|
l1ToL2Messages,
|
|
187
187
|
lastL1ToL2MessageTreeSnapshot,
|
|
188
|
-
|
|
188
|
+
lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
189
189
|
newL1ToL2MessageTreeSnapshot,
|
|
190
|
-
|
|
190
|
+
newL1ToL2MessageSubtreeRootSiblingPath,
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -324,7 +324,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
324
324
|
|
|
325
325
|
await spongeBlobState.absorb(tx.txEffect.toBlobFields());
|
|
326
326
|
|
|
327
|
-
const txProvingState = new TxProvingState(tx, hints, treeSnapshots);
|
|
327
|
+
const txProvingState = new TxProvingState(tx, hints, treeSnapshots, this.proverId.toField());
|
|
328
328
|
const txIndex = provingState.addNewTx(txProvingState);
|
|
329
329
|
if (txProvingState.requireAvmProof) {
|
|
330
330
|
this.getOrEnqueueTube(provingState, txIndex);
|
|
@@ -361,13 +361,10 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
361
361
|
const publicTxs = txs.filter(tx => tx.data.forPublic);
|
|
362
362
|
for (const tx of publicTxs) {
|
|
363
363
|
const txHash = tx.getTxHash().toString();
|
|
364
|
-
const privateInputs = getPublicTubePrivateInputsFromTx(tx);
|
|
364
|
+
const privateInputs = getPublicTubePrivateInputsFromTx(tx, this.proverId.toField());
|
|
365
365
|
const tubeProof =
|
|
366
366
|
promiseWithResolvers<
|
|
367
|
-
PublicInputsAndRecursiveProof<
|
|
368
|
-
PrivateToPublicKernelCircuitPublicInputs,
|
|
369
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
370
|
-
>
|
|
367
|
+
PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
371
368
|
>();
|
|
372
369
|
logger.debug(`Starting tube circuit for tx ${txHash}`);
|
|
373
370
|
this.doEnqueueTube(txHash, privateInputs, proof => {
|
|
@@ -612,25 +609,25 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
612
609
|
);
|
|
613
610
|
|
|
614
611
|
const lastL1ToL2MessageTreeSnapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
|
|
615
|
-
const
|
|
612
|
+
const lastL1ToL2MessageSubtreeRootSiblingPath = assertLength(
|
|
616
613
|
await getSubtreeSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, L1_TO_L2_MSG_SUBTREE_HEIGHT, db),
|
|
617
|
-
|
|
614
|
+
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
618
615
|
);
|
|
619
616
|
|
|
620
617
|
// Update the local trees to include the new l1 to l2 messages
|
|
621
618
|
await db.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, l1ToL2MessagesPadded);
|
|
622
619
|
|
|
623
620
|
const newL1ToL2MessageTreeSnapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
|
|
624
|
-
const
|
|
621
|
+
const newL1ToL2MessageSubtreeRootSiblingPath = assertLength(
|
|
625
622
|
await getSubtreeSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, L1_TO_L2_MSG_SUBTREE_HEIGHT, db),
|
|
626
|
-
|
|
623
|
+
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
627
624
|
);
|
|
628
625
|
|
|
629
626
|
return {
|
|
630
627
|
lastL1ToL2MessageTreeSnapshot,
|
|
631
|
-
|
|
628
|
+
lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
632
629
|
newL1ToL2MessageTreeSnapshot,
|
|
633
|
-
|
|
630
|
+
newL1ToL2MessageSubtreeRootSiblingPath,
|
|
634
631
|
};
|
|
635
632
|
}
|
|
636
633
|
|
|
@@ -712,7 +709,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
712
709
|
),
|
|
713
710
|
result => {
|
|
714
711
|
logger.debug(`Completed proof for ${rollupType} for tx ${processedTx.hash.toString()}`);
|
|
715
|
-
validatePartialState(result.inputs.
|
|
712
|
+
validatePartialState(result.inputs.endTreeSnapshots, txProvingState.treeSnapshots);
|
|
716
713
|
const leafLocation = provingState.setBaseRollupProof(txIndex, result);
|
|
717
714
|
if (provingState.totalNumTxs === 1) {
|
|
718
715
|
this.checkAndEnqueueBlockRootRollup(provingState);
|
|
@@ -735,10 +732,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
735
732
|
const txHash = txProvingState.processedTx.hash.toString();
|
|
736
733
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH;
|
|
737
734
|
const handleResult = (
|
|
738
|
-
result: PublicInputsAndRecursiveProof<
|
|
739
|
-
PrivateToPublicKernelCircuitPublicInputs,
|
|
740
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
741
|
-
>,
|
|
735
|
+
result: PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>,
|
|
742
736
|
) => {
|
|
743
737
|
logger.debug(`Got tube proof for tx index: ${txIndex}`, { txHash });
|
|
744
738
|
txProvingState.setPublicTubeProof(result);
|
|
@@ -760,10 +754,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
760
754
|
txHash: string,
|
|
761
755
|
inputs: PublicTubePrivateInputs,
|
|
762
756
|
handler: (
|
|
763
|
-
result: PublicInputsAndRecursiveProof<
|
|
764
|
-
PrivateToPublicKernelCircuitPublicInputs,
|
|
765
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
766
|
-
>,
|
|
757
|
+
result: PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>,
|
|
767
758
|
) => void,
|
|
768
759
|
provingState: EpochProvingState | BlockProvingState = this.provingState!,
|
|
769
760
|
) {
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
AVM_VK_INDEX,
|
|
4
4
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
5
5
|
} from '@aztec/constants';
|
|
6
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
6
7
|
import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
7
8
|
import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
8
9
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
9
10
|
import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
10
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
11
11
|
import { ProofData } from '@aztec/stdlib/proofs';
|
|
12
12
|
import {
|
|
13
|
-
AvmProofData,
|
|
14
13
|
type BaseRollupHints,
|
|
15
14
|
PrivateBaseRollupHints,
|
|
16
15
|
PrivateTxBaseRollupPrivateInputs,
|
|
17
16
|
PublicBaseRollupHints,
|
|
17
|
+
PublicTubePublicInputs,
|
|
18
18
|
PublicTxBaseRollupPrivateInputs,
|
|
19
19
|
} from '@aztec/stdlib/rollup';
|
|
20
20
|
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
@@ -31,7 +31,7 @@ import { getCivcProofFromTx, getPublicTubePrivateInputsFromTx, toProofData } fro
|
|
|
31
31
|
*/
|
|
32
32
|
export class TxProvingState {
|
|
33
33
|
private publicTube?: PublicInputsAndRecursiveProof<
|
|
34
|
-
|
|
34
|
+
PublicTubePublicInputs,
|
|
35
35
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
36
36
|
>;
|
|
37
37
|
private avm?: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>;
|
|
@@ -40,6 +40,7 @@ export class TxProvingState {
|
|
|
40
40
|
public readonly processedTx: ProcessedTx,
|
|
41
41
|
private readonly baseRollupHints: BaseRollupHints,
|
|
42
42
|
public readonly treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot>,
|
|
43
|
+
private readonly proverId: Fr,
|
|
43
44
|
) {}
|
|
44
45
|
|
|
45
46
|
get requireAvmProof() {
|
|
@@ -55,7 +56,7 @@ export class TxProvingState {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
public getPublicTubePrivateInputs() {
|
|
58
|
-
return getPublicTubePrivateInputsFromTx(this.processedTx);
|
|
59
|
+
return getPublicTubePrivateInputsFromTx(this.processedTx, this.proverId);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
public getBaseRollupTypeAndInputs() {
|
|
@@ -74,7 +75,7 @@ export class TxProvingState {
|
|
|
74
75
|
|
|
75
76
|
public setPublicTubeProof(
|
|
76
77
|
publicTubeProofAndVk: PublicInputsAndRecursiveProof<
|
|
77
|
-
|
|
78
|
+
PublicTubePublicInputs,
|
|
78
79
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
79
80
|
>,
|
|
80
81
|
) {
|
|
@@ -115,7 +116,7 @@ export class TxProvingState {
|
|
|
115
116
|
|
|
116
117
|
const publicTubeProofData = toProofData(this.publicTube);
|
|
117
118
|
|
|
118
|
-
const avmProofData = new
|
|
119
|
+
const avmProofData = new ProofData(
|
|
119
120
|
this.processedTx.avmProvingRequest.inputs.publicInputs,
|
|
120
121
|
this.avm.proof,
|
|
121
122
|
this.#getVkData(this.avm!.verificationKey, AVM_VK_INDEX),
|
|
@@ -125,6 +126,8 @@ export class TxProvingState {
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
#getVkData(verificationKey: VerificationKeyData, vkIndex: number) {
|
|
129
|
+
// TODO(#17162): Add avm vk hash to the tree and call `getVkData('AVM')` instead.
|
|
130
|
+
// Below will return a path to an empty leaf.
|
|
128
131
|
const vkPath = getVKSiblingPath(vkIndex);
|
|
129
132
|
return new VkData(verificationKey, vkIndex, vkPath);
|
|
130
133
|
}
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
type ServerCircuitProver,
|
|
23
23
|
makeProvingJobId,
|
|
24
24
|
} from '@aztec/stdlib/interfaces/server';
|
|
25
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
26
25
|
import type { ParityBasePrivateInputs, ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
27
26
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
28
27
|
import type {
|
|
@@ -40,6 +39,7 @@ import type {
|
|
|
40
39
|
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
41
40
|
PrivateTxBaseRollupPrivateInputs,
|
|
42
41
|
PublicTubePrivateInputs,
|
|
42
|
+
PublicTubePublicInputs,
|
|
43
43
|
PublicTxBaseRollupPrivateInputs,
|
|
44
44
|
RootRollupPrivateInputs,
|
|
45
45
|
RootRollupPublicInputs,
|
|
@@ -449,12 +449,7 @@ export class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
449
449
|
inputs: PublicTubePrivateInputs,
|
|
450
450
|
signal?: AbortSignal,
|
|
451
451
|
epochNumber?: number,
|
|
452
|
-
): Promise<
|
|
453
|
-
PublicInputsAndRecursiveProof<
|
|
454
|
-
PrivateToPublicKernelCircuitPublicInputs,
|
|
455
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
456
|
-
>
|
|
457
|
-
> {
|
|
452
|
+
): Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
458
453
|
return this.enqueueJob(
|
|
459
454
|
this.generateId(ProvingRequestType.PUBLIC_TUBE, inputs, epochNumber),
|
|
460
455
|
ProvingRequestType.PUBLIC_TUBE,
|
package/src/test/mock_prover.ts
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
makeProofAndVerificationKey,
|
|
18
18
|
makePublicInputsAndRecursiveProof,
|
|
19
19
|
} from '@aztec/stdlib/interfaces/server';
|
|
20
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
21
20
|
import type { ParityBasePrivateInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
22
21
|
import { makeEmptyRecursiveProof, makeRecursiveProof } from '@aztec/stdlib/proofs';
|
|
23
22
|
import type {
|
|
@@ -35,6 +34,7 @@ import type {
|
|
|
35
34
|
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
36
35
|
PrivateTxBaseRollupPrivateInputs,
|
|
37
36
|
PublicTubePrivateInputs,
|
|
37
|
+
PublicTubePublicInputs,
|
|
38
38
|
PublicTxBaseRollupPrivateInputs,
|
|
39
39
|
RootRollupPrivateInputs,
|
|
40
40
|
RootRollupPublicInputs,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
makeBlockRollupPublicInputs,
|
|
46
46
|
makeCheckpointRollupPublicInputs,
|
|
47
47
|
makeParityPublicInputs,
|
|
48
|
-
|
|
48
|
+
makePublicTubePublicInputs,
|
|
49
49
|
makeRootRollupPublicInputs,
|
|
50
50
|
makeTxRollupPublicInputs,
|
|
51
51
|
} from '@aztec/stdlib/testing';
|
|
@@ -143,15 +143,10 @@ export class MockProver implements ServerCircuitProver {
|
|
|
143
143
|
_inputs: PublicTubePrivateInputs,
|
|
144
144
|
_signal?: AbortSignal,
|
|
145
145
|
_epochNumber?: number,
|
|
146
|
-
): Promise<
|
|
147
|
-
PublicInputsAndRecursiveProof<
|
|
148
|
-
PrivateToPublicKernelCircuitPublicInputs,
|
|
149
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
150
|
-
>
|
|
151
|
-
> {
|
|
146
|
+
): Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
152
147
|
return Promise.resolve(
|
|
153
148
|
makePublicInputsAndRecursiveProof(
|
|
154
|
-
|
|
149
|
+
makePublicTubePublicInputs(),
|
|
155
150
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
156
151
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
157
152
|
),
|