@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
|
@@ -2,7 +2,7 @@ import { AVM_VK_INDEX } from '@aztec/constants';
|
|
|
2
2
|
import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
3
3
|
import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
4
4
|
import { ProofData } from '@aztec/stdlib/proofs';
|
|
5
|
-
import {
|
|
5
|
+
import { PrivateBaseRollupHints, PrivateTxBaseRollupPrivateInputs, PublicBaseRollupHints, PublicTxBaseRollupPrivateInputs } from '@aztec/stdlib/rollup';
|
|
6
6
|
import { VkData } from '@aztec/stdlib/vks';
|
|
7
7
|
import { getCivcProofFromTx, getPublicTubePrivateInputsFromTx, toProofData } from './block-building-helpers.js';
|
|
8
8
|
/**
|
|
@@ -13,12 +13,14 @@ import { getCivcProofFromTx, getPublicTubePrivateInputsFromTx, toProofData } fro
|
|
|
13
13
|
processedTx;
|
|
14
14
|
baseRollupHints;
|
|
15
15
|
treeSnapshots;
|
|
16
|
+
proverId;
|
|
16
17
|
publicTube;
|
|
17
18
|
avm;
|
|
18
|
-
constructor(processedTx, baseRollupHints, treeSnapshots){
|
|
19
|
+
constructor(processedTx, baseRollupHints, treeSnapshots, proverId){
|
|
19
20
|
this.processedTx = processedTx;
|
|
20
21
|
this.baseRollupHints = baseRollupHints;
|
|
21
22
|
this.treeSnapshots = treeSnapshots;
|
|
23
|
+
this.proverId = proverId;
|
|
22
24
|
}
|
|
23
25
|
get requireAvmProof() {
|
|
24
26
|
return !!this.processedTx.avmProvingRequest;
|
|
@@ -30,7 +32,7 @@ import { getCivcProofFromTx, getPublicTubePrivateInputsFromTx, toProofData } fro
|
|
|
30
32
|
return this.processedTx.avmProvingRequest.inputs;
|
|
31
33
|
}
|
|
32
34
|
getPublicTubePrivateInputs() {
|
|
33
|
-
return getPublicTubePrivateInputsFromTx(this.processedTx);
|
|
35
|
+
return getPublicTubePrivateInputsFromTx(this.processedTx, this.proverId);
|
|
34
36
|
}
|
|
35
37
|
getBaseRollupTypeAndInputs() {
|
|
36
38
|
if (this.requireAvmProof) {
|
|
@@ -72,10 +74,12 @@ import { getCivcProofFromTx, getPublicTubePrivateInputsFromTx, toProofData } fro
|
|
|
72
74
|
throw new Error('Mismatched base rollup hints, expected public base rollup hints');
|
|
73
75
|
}
|
|
74
76
|
const publicTubeProofData = toProofData(this.publicTube);
|
|
75
|
-
const avmProofData = new
|
|
77
|
+
const avmProofData = new ProofData(this.processedTx.avmProvingRequest.inputs.publicInputs, this.avm.proof, this.#getVkData(this.avm.verificationKey, AVM_VK_INDEX));
|
|
76
78
|
return new PublicTxBaseRollupPrivateInputs(publicTubeProofData, avmProofData, this.baseRollupHints);
|
|
77
79
|
}
|
|
78
80
|
#getVkData(verificationKey, vkIndex) {
|
|
81
|
+
// TODO(#17162): Add avm vk hash to the tree and call `getVkData('AVM')` instead.
|
|
82
|
+
// Below will return a path to an empty leaf.
|
|
79
83
|
const vkPath = getVKSiblingPath(vkIndex);
|
|
80
84
|
return new VkData(verificationKey, vkIndex, vkPath);
|
|
81
85
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '@aztec/constants';
|
|
2
2
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
3
3
|
import { type ProofAndVerificationKey, type ProvingJobProducer, type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
|
|
4
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
5
4
|
import type { ParityBasePrivateInputs, ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
6
|
-
import type { BlockMergeRollupPrivateInputs, BlockRollupPublicInputs, BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxFirstRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, CheckpointRootRollupPrivateInputs, CheckpointRootSingleBlockRollupPrivateInputs, PrivateTxBaseRollupPrivateInputs, PublicTubePrivateInputs, PublicTxBaseRollupPrivateInputs, RootRollupPrivateInputs, RootRollupPublicInputs, TxMergeRollupPrivateInputs, TxRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
5
|
+
import type { BlockMergeRollupPrivateInputs, BlockRollupPublicInputs, BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxFirstRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, CheckpointRootRollupPrivateInputs, CheckpointRootSingleBlockRollupPrivateInputs, PrivateTxBaseRollupPrivateInputs, PublicTubePrivateInputs, PublicTubePublicInputs, PublicTxBaseRollupPrivateInputs, RootRollupPrivateInputs, RootRollupPublicInputs, TxMergeRollupPrivateInputs, TxRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
7
6
|
import { type ProofStore } from './proof_store/index.js';
|
|
8
7
|
export declare class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
9
8
|
private broker;
|
|
@@ -34,7 +33,7 @@ export declare class BrokerCircuitProverFacade implements ServerCircuitProver {
|
|
|
34
33
|
signal?: AbortSignal, epochNumber?: number): Promise<ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>>;
|
|
35
34
|
getBaseParityProof(inputs: ParityBasePrivateInputs, signal?: AbortSignal, epochNumber?: number): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>>;
|
|
36
35
|
getTxMergeRollupProof(input: TxMergeRollupPrivateInputs, signal?: AbortSignal, epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
37
|
-
getPublicTubeProof(inputs: PublicTubePrivateInputs, signal?: AbortSignal, epochNumber?: number): Promise<PublicInputsAndRecursiveProof<
|
|
36
|
+
getPublicTubeProof(inputs: PublicTubePrivateInputs, signal?: AbortSignal, epochNumber?: number): Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
38
37
|
getPrivateTxBaseRollupProof(baseRollupInput: PrivateTxBaseRollupPrivateInputs, signal?: AbortSignal, epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
39
38
|
getPublicTxBaseRollupProof(inputs: PublicTxBaseRollupPrivateInputs, signal?: AbortSignal, epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
40
39
|
getRootParityProof(inputs: ParityRootPrivateInputs, signal?: AbortSignal, epochNumber?: number): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broker_prover_facade.d.ts","sourceRoot":"","sources":["../../src/proving_broker/broker_prover_facade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oCAAoC,EACpC,6BAA6B,EAC7B,yCAAyC,EACzC,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,KAAK,uBAAuB,EAI5B,KAAK,kBAAkB,EAGvB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"broker_prover_facade.d.ts","sourceRoot":"","sources":["../../src/proving_broker/broker_prover_facade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oCAAoC,EACpC,6BAA6B,EAC7B,yCAAyC,EACzC,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,KAAK,uBAAuB,EAI5B,KAAK,kBAAkB,EAGvB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEjH,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,wCAAwC,EACxC,iCAAiC,EACjC,4BAA4B,EAC5B,yCAAyC,EACzC,oCAAoC,EACpC,kCAAkC,EAClC,oCAAoC,EACpC,4BAA4B,EAC5B,iCAAiC,EACjC,4CAA4C,EAC5C,gCAAgC,EAChC,uBAAuB,EACvB,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAiB3E,qBAAa,yBAA0B,YAAW,mBAAmB;IAOjE,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,gBAAgB,CAAC;IACzB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,GAAG;IAVb,OAAO,CAAC,IAAI,CAA4C;IACxD,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,sBAAsB,CAAc;IAC5C,OAAO,CAAC,cAAc,CAAgC;gBAG5C,MAAM,EAAE,kBAAkB,EAC1B,UAAU,GAAE,UAAmC,EAC/C,gBA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W,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,6BAA6B,CAAC,uBAAuB,EAAE,OAAO,yCAAyC,CAAC,CAAC;IAUpH,4BAA4B,CAC1B,KAAK,EAAE,iCAAiC,EACxC,MAAM,CAAC,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,uCAAuC,CACrC,KAAK,EAAE,4CAA4C,EACnD,MAAM,CAAC,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,+BAA+B,CAC7B,KAAK,EAAE,oCAAoC,EAC3C,MAAM,CAAC,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,6BAA6B,CAC3B,KAAK,EAAE,kCAAkC,EACzC,MAAM,CAAC,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,kBAAkB,CAChB,KAAK,EAAE,uBAAuB,EAC9B,MAAM,CAAC,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,6BAA6B,CAAC,sBAAsB,EAAE,OAAO,sBAAsB,CAAC,CAAC;IAUhG,OAAO,CAAC,UAAU;CAInB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
2
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
3
3
|
import { type ProvingJob, type ProvingJobId, type ProvingJobProducer, type ProvingJobStatus, type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
|
|
4
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
5
4
|
import type { ParityBasePrivateInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
6
|
-
import type { BlockMergeRollupPrivateInputs, BlockRollupPublicInputs, BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxFirstRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, CheckpointRootRollupPrivateInputs, CheckpointRootSingleBlockRollupPrivateInputs, PrivateTxBaseRollupPrivateInputs, PublicTubePrivateInputs, PublicTxBaseRollupPrivateInputs, RootRollupPrivateInputs, RootRollupPublicInputs, TxMergeRollupPrivateInputs, TxRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
5
|
+
import type { BlockMergeRollupPrivateInputs, BlockRollupPublicInputs, BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxFirstRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, CheckpointRootRollupPrivateInputs, CheckpointRootSingleBlockRollupPrivateInputs, PrivateTxBaseRollupPrivateInputs, PublicTubePrivateInputs, PublicTubePublicInputs, PublicTxBaseRollupPrivateInputs, RootRollupPrivateInputs, RootRollupPublicInputs, TxMergeRollupPrivateInputs, TxRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
7
6
|
import { type ProofStore } from '../proving_broker/proof_store/index.js';
|
|
8
7
|
export declare class TestBroker implements ProvingJobProducer {
|
|
9
8
|
private proofStore;
|
|
@@ -24,7 +23,7 @@ export declare class MockProver implements ServerCircuitProver {
|
|
|
24
23
|
_signal?: AbortSignal, _epochNumber?: number): Promise<import("@aztec/stdlib/interfaces/server").ProofAndVerificationKey<20000>>;
|
|
25
24
|
getBaseParityProof(_inputs: ParityBasePrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs, 457>>;
|
|
26
25
|
getRootParityProof(_inputs: ParityRootPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs, 457>>;
|
|
27
|
-
getPublicTubeProof(_inputs: PublicTubePrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<
|
|
26
|
+
getPublicTubeProof(_inputs: PublicTubePrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
28
27
|
getPrivateTxBaseRollupProof(_baseRollupInput: PrivateTxBaseRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
29
28
|
getPublicTxBaseRollupProof(_inputs: PublicTxBaseRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
30
29
|
getTxMergeRollupProof(_input: TxMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock_prover.d.ts","sourceRoot":"","sources":["../../src/test/mock_prover.ts"],"names":[],"mappings":"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M,EAAE,6BAA6B,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,MAAM;IAU5G,4BAA4B,CAC1B,MAAM,EAAE,iCAAiC,EACzC,OAAO,CAAC,EAAE,WAAW,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,uCAAuC,CACrC,MAAM,EAAE,4CAA4C,EACpD,OAAO,CAAC,EAAE,WAAW,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,6BAA6B,CAC3B,MAAM,EAAE,kCAAkC,EAC1C,OAAO,CAAC,EAAE,WAAW,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,+BAA+B,CAC7B,MAAM,EAAE,oCAAoC,EAC5C,OAAO,CAAC,EAAE,WAAW,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CACR,6BAA6B,CAAC,4BAA4B,EAAE,OAAO,yCAAyC,CAAC,CAC9G;IAUD,kBAAkB,CAChB,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,WAAW,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,6BAA6B,CAAC,sBAAsB,CAAC,CAAC;CASlE"}
|
package/dest/test/mock_prover.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN
|
|
|
2
2
|
import { times } from '@aztec/foundation/collection';
|
|
3
3
|
import { makeProofAndVerificationKey, makePublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
4
4
|
import { makeEmptyRecursiveProof, makeRecursiveProof } from '@aztec/stdlib/proofs';
|
|
5
|
-
import { makeBlockRollupPublicInputs, makeCheckpointRollupPublicInputs, makeParityPublicInputs,
|
|
5
|
+
import { makeBlockRollupPublicInputs, makeCheckpointRollupPublicInputs, makeParityPublicInputs, makePublicTubePublicInputs, makeRootRollupPublicInputs, makeTxRollupPublicInputs } from '@aztec/stdlib/testing';
|
|
6
6
|
import { VerificationKeyData } from '@aztec/stdlib/vks';
|
|
7
7
|
import { InlineProofStore } from '../proving_broker/proof_store/index.js';
|
|
8
8
|
import { ProvingAgent } from '../proving_broker/proving_agent.js';
|
|
@@ -53,7 +53,7 @@ export class MockProver {
|
|
|
53
53
|
return Promise.resolve(makePublicInputsAndRecursiveProof(makeParityPublicInputs(), makeRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH), VerificationKeyData.makeFakeHonk()));
|
|
54
54
|
}
|
|
55
55
|
getPublicTubeProof(_inputs, _signal, _epochNumber) {
|
|
56
|
-
return Promise.resolve(makePublicInputsAndRecursiveProof(
|
|
56
|
+
return Promise.resolve(makePublicInputsAndRecursiveProof(makePublicTubePublicInputs(), makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()));
|
|
57
57
|
}
|
|
58
58
|
getPrivateTxBaseRollupProof(_baseRollupInput, _signal, _epochNumber) {
|
|
59
59
|
return Promise.resolve(makePublicInputsAndRecursiveProof(makeTxRollupPublicInputs(), makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-client",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250927",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -67,19 +67,19 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
71
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
72
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
73
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
74
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
75
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
77
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
78
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
79
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
80
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
81
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
82
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
70
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250927",
|
|
71
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250927",
|
|
72
|
+
"@aztec/constants": "3.0.0-nightly.20250927",
|
|
73
|
+
"@aztec/ethereum": "3.0.0-nightly.20250927",
|
|
74
|
+
"@aztec/foundation": "3.0.0-nightly.20250927",
|
|
75
|
+
"@aztec/kv-store": "3.0.0-nightly.20250927",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250927",
|
|
77
|
+
"@aztec/noir-types": "3.0.0-nightly.20250927",
|
|
78
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250927",
|
|
79
|
+
"@aztec/simulator": "3.0.0-nightly.20250927",
|
|
80
|
+
"@aztec/stdlib": "3.0.0-nightly.20250927",
|
|
81
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250927",
|
|
82
|
+
"@aztec/world-state": "3.0.0-nightly.20250927",
|
|
83
83
|
"@google-cloud/storage": "^7.15.0",
|
|
84
84
|
"@iarna/toml": "^2.2.5",
|
|
85
85
|
"commander": "^12.1.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"zod": "^3.23.8"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
92
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250927",
|
|
93
93
|
"@jest/globals": "^30.0.0",
|
|
94
94
|
"@types/jest": "^30.0.0",
|
|
95
95
|
"@types/node": "^22.15.17",
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
MAX_NOTE_HASHES_PER_TX,
|
|
7
7
|
MAX_NULLIFIERS_PER_TX,
|
|
8
8
|
NOTE_HASH_SUBTREE_HEIGHT,
|
|
9
|
-
|
|
9
|
+
NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
10
10
|
NULLIFIER_SUBTREE_HEIGHT,
|
|
11
|
-
|
|
11
|
+
NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
12
12
|
NULLIFIER_TREE_HEIGHT,
|
|
13
13
|
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
14
14
|
PUBLIC_DATA_TREE_HEIGHT,
|
|
@@ -22,7 +22,6 @@ import { MembershipWitness, MerkleTreeCalculator, computeUnbalancedMerkleTreeRoo
|
|
|
22
22
|
import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
23
23
|
import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
24
24
|
import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
25
|
-
import { PublicDataHint } from '@aztec/stdlib/avm';
|
|
26
25
|
import { Body, L2BlockHeader, getBlockBlobFields } from '@aztec/stdlib/block';
|
|
27
26
|
import type { MerkleTreeWriteOperations, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
28
27
|
import { ContractClassLogFields } from '@aztec/stdlib/logs';
|
|
@@ -31,9 +30,9 @@ import {
|
|
|
31
30
|
BlockConstantData,
|
|
32
31
|
BlockRollupPublicInputs,
|
|
33
32
|
PrivateBaseRollupHints,
|
|
34
|
-
PrivateBaseStateDiffHints,
|
|
35
33
|
PublicBaseRollupHints,
|
|
36
34
|
PublicTubePrivateInputs,
|
|
35
|
+
TreeSnapshotDiffHints,
|
|
37
36
|
} from '@aztec/stdlib/rollup';
|
|
38
37
|
import {
|
|
39
38
|
AppendOnlyTreeSnapshot,
|
|
@@ -85,15 +84,11 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
85
84
|
await getTreeSnapshot(MerkleTreeId.NULLIFIER_TREE, db),
|
|
86
85
|
await getTreeSnapshot(MerkleTreeId.PUBLIC_DATA_TREE, db),
|
|
87
86
|
);
|
|
88
|
-
// Get the subtree sibling paths for the circuit
|
|
89
|
-
const noteHashSubtreeSiblingPathArray = await getSubtreeSiblingPath(
|
|
90
|
-
MerkleTreeId.NOTE_HASH_TREE,
|
|
91
|
-
NOTE_HASH_SUBTREE_HEIGHT,
|
|
92
|
-
db,
|
|
93
|
-
);
|
|
94
87
|
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
// Get the note hash subtree root sibling path for insertion.
|
|
89
|
+
const noteHashSubtreeRootSiblingPath = assertLength(
|
|
90
|
+
await getSubtreeSiblingPath(MerkleTreeId.NOTE_HASH_TREE, NOTE_HASH_SUBTREE_HEIGHT, db),
|
|
91
|
+
NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
97
92
|
);
|
|
98
93
|
|
|
99
94
|
// Update the note hash trees with the new items being inserted to get the new roots
|
|
@@ -101,10 +96,6 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
101
96
|
const noteHashes = padArrayEnd(tx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX);
|
|
102
97
|
await db.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, noteHashes);
|
|
103
98
|
|
|
104
|
-
// Create data hint for reading fee payer initial balance in Fee Juice
|
|
105
|
-
const leafSlot = await computeFeePayerBalanceLeafSlot(tx.data.feePayer);
|
|
106
|
-
const feePayerFeeJuiceBalanceReadHint = await getPublicDataHint(db, leafSlot.toBigInt());
|
|
107
|
-
|
|
108
99
|
// The read witnesses for a given TX should be generated before the writes of the same TX are applied.
|
|
109
100
|
// All reads that refer to writes in the same tx are transient and can be simplified out.
|
|
110
101
|
const txPublicDataUpdateRequestInfo = await processPublicDataUpdateRequests(tx, db);
|
|
@@ -112,8 +103,8 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
112
103
|
// Update the nullifier tree, capturing the low nullifier info for each individual operation
|
|
113
104
|
const {
|
|
114
105
|
lowLeavesWitnessData: nullifierWitnessLeaves,
|
|
115
|
-
newSubtreeSiblingPath:
|
|
116
|
-
sortedNewLeaves:
|
|
106
|
+
newSubtreeSiblingPath: nullifiersSubtreeRootSiblingPath,
|
|
107
|
+
sortedNewLeaves: sortedNullifiers,
|
|
117
108
|
sortedNewLeavesIndexes,
|
|
118
109
|
} = await db.batchInsert(
|
|
119
110
|
MerkleTreeId.NULLIFIER_TREE,
|
|
@@ -125,17 +116,10 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
125
116
|
throw new Error(`Could not craft nullifier batch insertion proofs`);
|
|
126
117
|
}
|
|
127
118
|
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
const nullifierSubtreeSiblingPathArray = nullifiersSubtreeSiblingPath.toFields();
|
|
135
|
-
|
|
136
|
-
const nullifierSubtreeSiblingPath = makeTuple(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, i =>
|
|
137
|
-
i < nullifierSubtreeSiblingPathArray.length ? nullifierSubtreeSiblingPathArray[i] : Fr.ZERO,
|
|
138
|
-
);
|
|
119
|
+
const blockHash = await tx.data.constants.anchorBlockHeader.hash();
|
|
120
|
+
const anchorBlockArchiveSiblingPath = (
|
|
121
|
+
await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db)
|
|
122
|
+
).siblingPath;
|
|
139
123
|
|
|
140
124
|
const contractClassLogsFields = makeTuple(
|
|
141
125
|
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
@@ -143,20 +127,11 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
143
127
|
);
|
|
144
128
|
|
|
145
129
|
if (tx.avmProvingRequest) {
|
|
146
|
-
const blockHash = await tx.data.constants.anchorBlockHeader.hash();
|
|
147
|
-
const archiveRootMembershipWitness = await getMembershipWitnessFor(
|
|
148
|
-
blockHash,
|
|
149
|
-
MerkleTreeId.ARCHIVE,
|
|
150
|
-
ARCHIVE_HEIGHT,
|
|
151
|
-
db,
|
|
152
|
-
);
|
|
153
|
-
|
|
154
130
|
return PublicBaseRollupHints.from({
|
|
155
131
|
startSpongeBlob,
|
|
156
132
|
lastArchive,
|
|
157
|
-
|
|
133
|
+
anchorBlockArchiveSiblingPath,
|
|
158
134
|
contractClassLogsFields,
|
|
159
|
-
proverId,
|
|
160
135
|
});
|
|
161
136
|
} else {
|
|
162
137
|
if (
|
|
@@ -167,43 +142,47 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
167
142
|
throw new Error(`More than one public data write in a private only tx`);
|
|
168
143
|
}
|
|
169
144
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
145
|
+
// Get hints for reading fee payer's balance in the public data tree.
|
|
146
|
+
const feePayerBalanceMembershipWitness = txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses[0];
|
|
147
|
+
const feePayerBalanceLeafPreimage = txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages[0];
|
|
148
|
+
const leafSlot = await computeFeePayerBalanceLeafSlot(tx.data.feePayer);
|
|
149
|
+
if (!feePayerBalanceMembershipWitness || !leafSlot.equals(feePayerBalanceLeafPreimage?.leaf.slot)) {
|
|
150
|
+
throw new Error(`Cannot find the public data tree leaf for the fee payer's balance`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Extract witness objects from returned data
|
|
154
|
+
const nullifierPredecessorMembershipWitnessesWithoutPadding: MembershipWitness<typeof NULLIFIER_TREE_HEIGHT>[] =
|
|
155
|
+
nullifierWitnessLeaves.map(l =>
|
|
156
|
+
MembershipWitness.fromBufferArray(
|
|
157
|
+
l.index,
|
|
158
|
+
assertLength(l.siblingPath.toBufferArray(), NULLIFIER_TREE_HEIGHT),
|
|
159
|
+
),
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const treeSnapshotDiffHints = TreeSnapshotDiffHints.from({
|
|
163
|
+
noteHashSubtreeRootSiblingPath,
|
|
164
|
+
nullifierPredecessorPreimages: padArrayEnd(
|
|
165
|
+
nullifierWitnessLeaves.map(l => l.leafPreimage as NullifierLeafPreimage),
|
|
166
|
+
NullifierLeafPreimage.empty(),
|
|
167
|
+
MAX_NULLIFIERS_PER_TX,
|
|
184
168
|
),
|
|
185
169
|
nullifierPredecessorMembershipWitnesses: makeTuple(MAX_NULLIFIERS_PER_TX, i =>
|
|
186
170
|
i < nullifierPredecessorMembershipWitnessesWithoutPadding.length
|
|
187
171
|
? nullifierPredecessorMembershipWitnessesWithoutPadding[i]
|
|
188
172
|
: makeEmptyMembershipWitness(NULLIFIER_TREE_HEIGHT),
|
|
189
173
|
),
|
|
190
|
-
sortedNullifiers:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
174
|
+
sortedNullifiers: assertLength(
|
|
175
|
+
sortedNullifiers.map(n => Fr.fromBuffer(n)),
|
|
176
|
+
MAX_NULLIFIERS_PER_TX,
|
|
177
|
+
),
|
|
178
|
+
sortedNullifierIndexes: assertLength(sortedNewLeavesIndexes, MAX_NULLIFIERS_PER_TX),
|
|
179
|
+
nullifierSubtreeRootSiblingPath: assertLength(
|
|
180
|
+
nullifiersSubtreeRootSiblingPath.toFields(),
|
|
181
|
+
NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
182
|
+
),
|
|
183
|
+
feePayerBalanceMembershipWitness,
|
|
197
184
|
});
|
|
198
185
|
|
|
199
|
-
const blockHash = await tx.data.constants.anchorBlockHeader.hash();
|
|
200
|
-
const archiveRootMembershipWitness = await getMembershipWitnessFor(
|
|
201
|
-
blockHash,
|
|
202
|
-
MerkleTreeId.ARCHIVE,
|
|
203
|
-
ARCHIVE_HEIGHT,
|
|
204
|
-
db,
|
|
205
|
-
);
|
|
206
|
-
|
|
207
186
|
const constants = BlockConstantData.from({
|
|
208
187
|
lastArchive,
|
|
209
188
|
l1ToL2TreeSnapshot: newL1ToL2MessageTreeSnapshot,
|
|
@@ -216,9 +195,9 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
216
195
|
return PrivateBaseRollupHints.from({
|
|
217
196
|
start,
|
|
218
197
|
startSpongeBlob,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
198
|
+
treeSnapshotDiffHints,
|
|
199
|
+
feePayerBalanceLeafPreimage,
|
|
200
|
+
anchorBlockArchiveSiblingPath,
|
|
222
201
|
contractClassLogsFields,
|
|
223
202
|
constants,
|
|
224
203
|
});
|
|
@@ -226,26 +205,6 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan(
|
|
|
226
205
|
},
|
|
227
206
|
);
|
|
228
207
|
|
|
229
|
-
export async function getPublicDataHint(db: MerkleTreeWriteOperations, leafSlot: bigint) {
|
|
230
|
-
const { index } = (await db.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot)) ?? {};
|
|
231
|
-
if (index === undefined) {
|
|
232
|
-
throw new Error(`Cannot find the previous value index for public data ${leafSlot}.`);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const siblingPath = await db.getSiblingPath(MerkleTreeId.PUBLIC_DATA_TREE, index);
|
|
236
|
-
const membershipWitness = new MembershipWitness(PUBLIC_DATA_TREE_HEIGHT, index, siblingPath.toTuple());
|
|
237
|
-
|
|
238
|
-
const leafPreimage = (await db.getLeafPreimage(MerkleTreeId.PUBLIC_DATA_TREE, index)) as PublicDataTreeLeafPreimage;
|
|
239
|
-
if (!leafPreimage) {
|
|
240
|
-
throw new Error(`Cannot find the leaf preimage for public data tree at index ${index}.`);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const exists = leafPreimage.leaf.slot.toBigInt() === leafSlot;
|
|
244
|
-
const value = exists ? leafPreimage.leaf.value : Fr.ZERO;
|
|
245
|
-
|
|
246
|
-
return new PublicDataHint(new Fr(leafSlot), value, membershipWitness, leafPreimage);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
208
|
export function getCivcProofFromTx(tx: Tx | ProcessedTx) {
|
|
250
209
|
const proofFields = tx.clientIvcProof.proof;
|
|
251
210
|
const numPublicInputs = proofFields.length - CIVC_PROOF_LENGTH;
|
|
@@ -254,13 +213,13 @@ export function getCivcProofFromTx(tx: Tx | ProcessedTx) {
|
|
|
254
213
|
return new RecursiveProof(proofFieldsWithoutPublicInputs, binaryProof, true, CIVC_PROOF_LENGTH);
|
|
255
214
|
}
|
|
256
215
|
|
|
257
|
-
export function getPublicTubePrivateInputsFromTx(tx: Tx | ProcessedTx) {
|
|
216
|
+
export function getPublicTubePrivateInputsFromTx(tx: Tx | ProcessedTx, proverId: Fr) {
|
|
258
217
|
const proofData = new ProofData(
|
|
259
218
|
tx.data.toPrivateToPublicKernelCircuitPublicInputs(),
|
|
260
219
|
getCivcProofFromTx(tx),
|
|
261
220
|
getVkData('HidingKernelToPublic'),
|
|
262
221
|
);
|
|
263
|
-
return new PublicTubePrivateInputs(proofData);
|
|
222
|
+
return new PublicTubePrivateInputs(proofData, proverId);
|
|
264
223
|
}
|
|
265
224
|
|
|
266
225
|
// Build "hints" as the private inputs for the checkpoint root rollup circuit.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SpongeBlob } from '@aztec/blob-lib';
|
|
2
2
|
import {
|
|
3
3
|
type ARCHIVE_HEIGHT,
|
|
4
|
-
type
|
|
4
|
+
type L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
5
5
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
6
6
|
type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
7
7
|
NUM_BASE_PARITY_PER_ROOT_PARITY,
|
|
@@ -69,7 +69,10 @@ export class BlockProvingState {
|
|
|
69
69
|
public readonly lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
70
70
|
private readonly lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
71
71
|
private readonly lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
72
|
-
private readonly
|
|
72
|
+
private readonly lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<
|
|
73
|
+
Fr,
|
|
74
|
+
typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH
|
|
75
|
+
>,
|
|
73
76
|
public readonly newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
74
77
|
private readonly headerOfLastBlockInPreviousCheckpoint: BlockHeader,
|
|
75
78
|
private readonly startSpongeBlob: SpongeBlob,
|
|
@@ -295,7 +298,7 @@ export class BlockProvingState {
|
|
|
295
298
|
this.constants,
|
|
296
299
|
this.startSpongeBlob,
|
|
297
300
|
this.timestamp,
|
|
298
|
-
this.
|
|
301
|
+
this.lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
299
302
|
this.lastArchiveSiblingPath,
|
|
300
303
|
),
|
|
301
304
|
};
|
|
@@ -306,7 +309,7 @@ export class BlockProvingState {
|
|
|
306
309
|
l1ToL2Roots,
|
|
307
310
|
leftRollup,
|
|
308
311
|
this.lastL1ToL2MessageTreeSnapshot,
|
|
309
|
-
this.
|
|
312
|
+
this.lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
310
313
|
this.lastArchiveSiblingPath,
|
|
311
314
|
),
|
|
312
315
|
};
|
|
@@ -317,7 +320,7 @@ export class BlockProvingState {
|
|
|
317
320
|
l1ToL2Roots,
|
|
318
321
|
[leftRollup, rightRollup],
|
|
319
322
|
this.lastL1ToL2MessageTreeSnapshot,
|
|
320
|
-
this.
|
|
323
|
+
this.lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
321
324
|
this.lastArchiveSiblingPath,
|
|
322
325
|
),
|
|
323
326
|
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type ARCHIVE_HEIGHT,
|
|
9
9
|
BLOBS_PER_BLOCK,
|
|
10
10
|
FIELDS_PER_BLOB,
|
|
11
|
-
type
|
|
11
|
+
type L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
12
12
|
type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
13
13
|
NUM_MSGS_PER_BASE_PARITY,
|
|
14
14
|
} from '@aztec/constants';
|
|
@@ -60,10 +60,16 @@ export class CheckpointProvingState {
|
|
|
60
60
|
private readonly l1ToL2Messages: Fr[],
|
|
61
61
|
// The snapshot and sibling path before the new l1 to l2 message subtree is inserted.
|
|
62
62
|
private readonly lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
63
|
-
private readonly
|
|
63
|
+
private readonly lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<
|
|
64
|
+
Fr,
|
|
65
|
+
typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH
|
|
66
|
+
>,
|
|
64
67
|
// The snapshot and sibling path after the new l1 to l2 message subtree is inserted.
|
|
65
68
|
private readonly newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
66
|
-
private readonly
|
|
69
|
+
private readonly newL1ToL2MessageSubtreeRootSiblingPath: Tuple<
|
|
70
|
+
Fr,
|
|
71
|
+
typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH
|
|
72
|
+
>,
|
|
67
73
|
public parentEpoch: EpochProvingState,
|
|
68
74
|
private onBlobAccumulatorSet: (checkpoint: CheckpointProvingState) => void,
|
|
69
75
|
) {
|
|
@@ -92,8 +98,8 @@ export class CheckpointProvingState {
|
|
|
92
98
|
// happen in the first block.
|
|
93
99
|
const lastL1ToL2MessageTreeSnapshot =
|
|
94
100
|
index === 0 ? this.lastL1ToL2MessageTreeSnapshot : this.newL1ToL2MessageTreeSnapshot;
|
|
95
|
-
const
|
|
96
|
-
index === 0 ? this.
|
|
101
|
+
const lastL1ToL2MessageSubtreeRootSiblingPath =
|
|
102
|
+
index === 0 ? this.lastL1ToL2MessageSubtreeRootSiblingPath : this.newL1ToL2MessageSubtreeRootSiblingPath;
|
|
97
103
|
|
|
98
104
|
const startSpongeBlob =
|
|
99
105
|
index === 0 ? SpongeBlob.init(this.totalNumBlobFields) : this.blocks[index - 1]?.getEndSpongeBlob();
|
|
@@ -112,7 +118,7 @@ export class CheckpointProvingState {
|
|
|
112
118
|
lastArchiveTreeSnapshot,
|
|
113
119
|
lastArchiveSiblingPath,
|
|
114
120
|
lastL1ToL2MessageTreeSnapshot,
|
|
115
|
-
|
|
121
|
+
lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
116
122
|
this.newL1ToL2MessageTreeSnapshot,
|
|
117
123
|
this.headerOfLastBlockInPreviousCheckpoint,
|
|
118
124
|
startSpongeBlob,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BatchedBlob, BatchedBlobAccumulator, type FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
2
2
|
import type {
|
|
3
3
|
ARCHIVE_HEIGHT,
|
|
4
|
-
|
|
4
|
+
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
5
5
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
6
6
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
7
7
|
} from '@aztec/constants';
|
|
@@ -9,13 +9,13 @@ import type { Fr } from '@aztec/foundation/fields';
|
|
|
9
9
|
import type { Tuple } from '@aztec/foundation/serialize';
|
|
10
10
|
import { type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees';
|
|
11
11
|
import type { PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
12
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
13
12
|
import type { Proof } from '@aztec/stdlib/proofs';
|
|
14
13
|
import {
|
|
15
14
|
CheckpointConstantData,
|
|
16
15
|
CheckpointMergeRollupPrivateInputs,
|
|
17
16
|
CheckpointPaddingRollupPrivateInputs,
|
|
18
17
|
CheckpointRollupPublicInputs,
|
|
18
|
+
PublicTubePublicInputs,
|
|
19
19
|
RootRollupPrivateInputs,
|
|
20
20
|
type RootRollupPublicInputs,
|
|
21
21
|
} from '@aztec/stdlib/rollup';
|
|
@@ -60,12 +60,7 @@ export class EpochProvingState {
|
|
|
60
60
|
// Map from tx hash to tube proof promise. Used when kickstarting tube proofs before tx processing.
|
|
61
61
|
public readonly cachedTubeProofs = new Map<
|
|
62
62
|
string,
|
|
63
|
-
Promise<
|
|
64
|
-
PublicInputsAndRecursiveProof<
|
|
65
|
-
PrivateToPublicKernelCircuitPublicInputs,
|
|
66
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
67
|
-
>
|
|
68
|
-
>
|
|
63
|
+
Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>
|
|
69
64
|
>();
|
|
70
65
|
|
|
71
66
|
constructor(
|
|
@@ -91,9 +86,9 @@ export class EpochProvingState {
|
|
|
91
86
|
lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
92
87
|
l1ToL2Messages: Fr[],
|
|
93
88
|
lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
94
|
-
|
|
89
|
+
lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
95
90
|
newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
96
|
-
|
|
91
|
+
newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
97
92
|
): CheckpointProvingState {
|
|
98
93
|
if (checkpointIndex >= this.totalNumCheckpoints) {
|
|
99
94
|
throw new Error(
|
|
@@ -111,9 +106,9 @@ export class EpochProvingState {
|
|
|
111
106
|
lastArchiveSiblingPath,
|
|
112
107
|
l1ToL2Messages,
|
|
113
108
|
lastL1ToL2MessageTreeSnapshot,
|
|
114
|
-
|
|
109
|
+
lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
115
110
|
newL1ToL2MessageTreeSnapshot,
|
|
116
|
-
|
|
111
|
+
newL1ToL2MessageSubtreeRootSiblingPath,
|
|
117
112
|
this,
|
|
118
113
|
this.onCheckpointBlobAccumulatorSet,
|
|
119
114
|
);
|