@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,6 @@ import { BatchedBlobAccumulator, Blob, SpongeBlob } from '@aztec/blob-lib';
|
|
|
2
2
|
import { BLS12Point, Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { type Bufferable, type Tuple } from '@aztec/foundation/serialize';
|
|
4
4
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
5
|
-
import { PublicDataHint } from '@aztec/stdlib/avm';
|
|
6
5
|
import { Body, L2BlockHeader } from '@aztec/stdlib/block';
|
|
7
6
|
import type { MerkleTreeWriteOperations, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
8
7
|
import { ProofData, RecursiveProof } from '@aztec/stdlib/proofs';
|
|
@@ -19,9 +18,8 @@ type BaseTreeNames = 'NoteHashTree' | 'ContractTree' | 'NullifierTree' | 'Public
|
|
|
19
18
|
*/
|
|
20
19
|
export type TreeNames = BaseTreeNames | 'L1ToL2MessageTree' | 'Archive';
|
|
21
20
|
export declare const insertSideEffectsAndBuildBaseRollupHints: (tx: ProcessedTx, lastArchive: AppendOnlyTreeSnapshot, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, startSpongeBlob: SpongeBlob, proverId: Fr, db: MerkleTreeWriteOperations) => Promise<PublicBaseRollupHints | PrivateBaseRollupHints>;
|
|
22
|
-
export declare function getPublicDataHint(db: MerkleTreeWriteOperations, leafSlot: bigint): Promise<PublicDataHint>;
|
|
23
21
|
export declare function getCivcProofFromTx(tx: Tx | ProcessedTx): RecursiveProof<2076>;
|
|
24
|
-
export declare function getPublicTubePrivateInputsFromTx(tx: Tx | ProcessedTx): PublicTubePrivateInputs;
|
|
22
|
+
export declare function getPublicTubePrivateInputsFromTx(tx: Tx | ProcessedTx, proverId: Fr): PublicTubePrivateInputs;
|
|
25
23
|
export declare const buildBlobHints: (blobFields: Fr[]) => Promise<{
|
|
26
24
|
blobCommitments: BLS12Point[];
|
|
27
25
|
blobs: Blob[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-building-helpers.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-building-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,sBAAsB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAkBxF,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAgC,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAyD,MAAM,yBAAyB,CAAC;AAInH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"block-building-helpers.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-building-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,sBAAsB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAkBxF,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAgC,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAyD,MAAM,yBAAyB,CAAC;AAInH,OAAO,EAAE,IAAI,EAAE,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhH,OAAO,EAAS,SAAS,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAEL,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EAExB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,sBAAsB,EACtB,YAAY,EAKb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EAEX,eAAe,EACf,qBAAqB,EACrB,KAAK,WAAW,EAEhB,EAAE,EACH,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AAC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, NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_HEIGHT, NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants';
|
|
3
3
|
import { makeTuple } from '@aztec/foundation/array';
|
|
4
4
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
5
5
|
import { sha256ToField, sha256Trunc } from '@aztec/foundation/crypto';
|
|
@@ -9,12 +9,11 @@ import { MembershipWitness, MerkleTreeCalculator, computeUnbalancedMerkleTreeRoo
|
|
|
9
9
|
import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
10
10
|
import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
11
11
|
import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
12
|
-
import { PublicDataHint } from '@aztec/stdlib/avm';
|
|
13
12
|
import { Body, L2BlockHeader, getBlockBlobFields } from '@aztec/stdlib/block';
|
|
14
13
|
import { ContractClassLogFields } from '@aztec/stdlib/logs';
|
|
15
14
|
import { Proof, ProofData, RecursiveProof } from '@aztec/stdlib/proofs';
|
|
16
|
-
import { BlockConstantData, PrivateBaseRollupHints,
|
|
17
|
-
import { AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafPreimage, PublicDataTreeLeaf,
|
|
15
|
+
import { BlockConstantData, PrivateBaseRollupHints, PublicBaseRollupHints, PublicTubePrivateInputs, TreeSnapshotDiffHints } from '@aztec/stdlib/rollup';
|
|
16
|
+
import { AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafPreimage, PublicDataTreeLeaf, getTreeHeight } from '@aztec/stdlib/trees';
|
|
18
17
|
import { BlockHeader, ContentCommitment, GlobalVariables, PartialStateReference, StateReference } from '@aztec/stdlib/tx';
|
|
19
18
|
import { VkData } from '@aztec/stdlib/vks';
|
|
20
19
|
import { Attributes, runInSpan } from '@aztec/telemetry-client';
|
|
@@ -23,59 +22,52 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan('BlockBuilderH
|
|
|
23
22
|
span.setAttribute(Attributes.TX_HASH, tx.hash.toString());
|
|
24
23
|
// Get trees info before any changes hit
|
|
25
24
|
const start = new PartialStateReference(await getTreeSnapshot(MerkleTreeId.NOTE_HASH_TREE, db), await getTreeSnapshot(MerkleTreeId.NULLIFIER_TREE, db), await getTreeSnapshot(MerkleTreeId.PUBLIC_DATA_TREE, db));
|
|
26
|
-
// Get the subtree sibling
|
|
27
|
-
const
|
|
28
|
-
const noteHashSubtreeSiblingPath = makeTuple(NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, (i)=>i < noteHashSubtreeSiblingPathArray.length ? noteHashSubtreeSiblingPathArray[i] : Fr.ZERO);
|
|
25
|
+
// Get the note hash subtree root sibling path for insertion.
|
|
26
|
+
const noteHashSubtreeRootSiblingPath = assertLength(await getSubtreeSiblingPath(MerkleTreeId.NOTE_HASH_TREE, NOTE_HASH_SUBTREE_HEIGHT, db), NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH);
|
|
29
27
|
// Update the note hash trees with the new items being inserted to get the new roots
|
|
30
28
|
// that will be used by the next iteration of the base rollup circuit, skipping the empty ones
|
|
31
29
|
const noteHashes = padArrayEnd(tx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX);
|
|
32
30
|
await db.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, noteHashes);
|
|
33
|
-
// Create data hint for reading fee payer initial balance in Fee Juice
|
|
34
|
-
const leafSlot = await computeFeePayerBalanceLeafSlot(tx.data.feePayer);
|
|
35
|
-
const feePayerFeeJuiceBalanceReadHint = await getPublicDataHint(db, leafSlot.toBigInt());
|
|
36
31
|
// The read witnesses for a given TX should be generated before the writes of the same TX are applied.
|
|
37
32
|
// All reads that refer to writes in the same tx are transient and can be simplified out.
|
|
38
33
|
const txPublicDataUpdateRequestInfo = await processPublicDataUpdateRequests(tx, db);
|
|
39
34
|
// Update the nullifier tree, capturing the low nullifier info for each individual operation
|
|
40
|
-
const { lowLeavesWitnessData: nullifierWitnessLeaves, newSubtreeSiblingPath:
|
|
35
|
+
const { lowLeavesWitnessData: nullifierWitnessLeaves, newSubtreeSiblingPath: nullifiersSubtreeRootSiblingPath, sortedNewLeaves: sortedNullifiers, sortedNewLeavesIndexes } = await db.batchInsert(MerkleTreeId.NULLIFIER_TREE, padArrayEnd(tx.txEffect.nullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX).map((n)=>n.toBuffer()), NULLIFIER_SUBTREE_HEIGHT);
|
|
41
36
|
if (nullifierWitnessLeaves === undefined) {
|
|
42
37
|
throw new Error(`Could not craft nullifier batch insertion proofs`);
|
|
43
38
|
}
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const nullifierSubtreeSiblingPathArray = nullifiersSubtreeSiblingPath.toFields();
|
|
47
|
-
const nullifierSubtreeSiblingPath = makeTuple(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, (i)=>i < nullifierSubtreeSiblingPathArray.length ? nullifierSubtreeSiblingPathArray[i] : Fr.ZERO);
|
|
39
|
+
const blockHash = await tx.data.constants.anchorBlockHeader.hash();
|
|
40
|
+
const anchorBlockArchiveSiblingPath = (await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db)).siblingPath;
|
|
48
41
|
const contractClassLogsFields = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, (i)=>tx.txEffect.contractClassLogs[i]?.fields || ContractClassLogFields.empty());
|
|
49
42
|
if (tx.avmProvingRequest) {
|
|
50
|
-
const blockHash = await tx.data.constants.anchorBlockHeader.hash();
|
|
51
|
-
const archiveRootMembershipWitness = await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db);
|
|
52
43
|
return PublicBaseRollupHints.from({
|
|
53
44
|
startSpongeBlob,
|
|
54
45
|
lastArchive,
|
|
55
|
-
|
|
56
|
-
contractClassLogsFields
|
|
57
|
-
proverId
|
|
46
|
+
anchorBlockArchiveSiblingPath,
|
|
47
|
+
contractClassLogsFields
|
|
58
48
|
});
|
|
59
49
|
} else {
|
|
60
50
|
if (txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses.length > 1 || txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages.length > 1 || txPublicDataUpdateRequestInfo.publicDataWritesSiblingPaths.length > 1) {
|
|
61
51
|
throw new Error(`More than one public data write in a private only tx`);
|
|
62
52
|
}
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
53
|
+
// Get hints for reading fee payer's balance in the public data tree.
|
|
54
|
+
const feePayerBalanceMembershipWitness = txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses[0];
|
|
55
|
+
const feePayerBalanceLeafPreimage = txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages[0];
|
|
56
|
+
const leafSlot = await computeFeePayerBalanceLeafSlot(tx.data.feePayer);
|
|
57
|
+
if (!feePayerBalanceMembershipWitness || !leafSlot.equals(feePayerBalanceLeafPreimage?.leaf.slot)) {
|
|
58
|
+
throw new Error(`Cannot find the public data tree leaf for the fee payer's balance`);
|
|
59
|
+
}
|
|
60
|
+
// Extract witness objects from returned data
|
|
61
|
+
const nullifierPredecessorMembershipWitnessesWithoutPadding = nullifierWitnessLeaves.map((l)=>MembershipWitness.fromBufferArray(l.index, assertLength(l.siblingPath.toBufferArray(), NULLIFIER_TREE_HEIGHT)));
|
|
62
|
+
const treeSnapshotDiffHints = TreeSnapshotDiffHints.from({
|
|
63
|
+
noteHashSubtreeRootSiblingPath,
|
|
64
|
+
nullifierPredecessorPreimages: padArrayEnd(nullifierWitnessLeaves.map((l)=>l.leafPreimage), NullifierLeafPreimage.empty(), MAX_NULLIFIERS_PER_TX),
|
|
68
65
|
nullifierPredecessorMembershipWitnesses: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>i < nullifierPredecessorMembershipWitnessesWithoutPadding.length ? nullifierPredecessorMembershipWitnessesWithoutPadding[i] : makeEmptyMembershipWitness(NULLIFIER_TREE_HEIGHT)),
|
|
69
|
-
sortedNullifiers:
|
|
70
|
-
sortedNullifierIndexes:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
feeWriteLowLeafPreimage,
|
|
74
|
-
feeWriteLowLeafMembershipWitness,
|
|
75
|
-
feeWriteSiblingPath
|
|
66
|
+
sortedNullifiers: assertLength(sortedNullifiers.map((n)=>Fr.fromBuffer(n)), MAX_NULLIFIERS_PER_TX),
|
|
67
|
+
sortedNullifierIndexes: assertLength(sortedNewLeavesIndexes, MAX_NULLIFIERS_PER_TX),
|
|
68
|
+
nullifierSubtreeRootSiblingPath: assertLength(nullifiersSubtreeRootSiblingPath.toFields(), NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH),
|
|
69
|
+
feePayerBalanceMembershipWitness
|
|
76
70
|
});
|
|
77
|
-
const blockHash = await tx.data.constants.anchorBlockHeader.hash();
|
|
78
|
-
const archiveRootMembershipWitness = await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db);
|
|
79
71
|
const constants = BlockConstantData.from({
|
|
80
72
|
lastArchive,
|
|
81
73
|
l1ToL2TreeSnapshot: newL1ToL2MessageTreeSnapshot,
|
|
@@ -87,29 +79,14 @@ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan('BlockBuilderH
|
|
|
87
79
|
return PrivateBaseRollupHints.from({
|
|
88
80
|
start,
|
|
89
81
|
startSpongeBlob,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
treeSnapshotDiffHints,
|
|
83
|
+
feePayerBalanceLeafPreimage,
|
|
84
|
+
anchorBlockArchiveSiblingPath,
|
|
93
85
|
contractClassLogsFields,
|
|
94
86
|
constants
|
|
95
87
|
});
|
|
96
88
|
}
|
|
97
89
|
});
|
|
98
|
-
export async function getPublicDataHint(db, leafSlot) {
|
|
99
|
-
const { index } = await db.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot) ?? {};
|
|
100
|
-
if (index === undefined) {
|
|
101
|
-
throw new Error(`Cannot find the previous value index for public data ${leafSlot}.`);
|
|
102
|
-
}
|
|
103
|
-
const siblingPath = await db.getSiblingPath(MerkleTreeId.PUBLIC_DATA_TREE, index);
|
|
104
|
-
const membershipWitness = new MembershipWitness(PUBLIC_DATA_TREE_HEIGHT, index, siblingPath.toTuple());
|
|
105
|
-
const leafPreimage = await db.getLeafPreimage(MerkleTreeId.PUBLIC_DATA_TREE, index);
|
|
106
|
-
if (!leafPreimage) {
|
|
107
|
-
throw new Error(`Cannot find the leaf preimage for public data tree at index ${index}.`);
|
|
108
|
-
}
|
|
109
|
-
const exists = leafPreimage.leaf.slot.toBigInt() === leafSlot;
|
|
110
|
-
const value = exists ? leafPreimage.leaf.value : Fr.ZERO;
|
|
111
|
-
return new PublicDataHint(new Fr(leafSlot), value, membershipWitness, leafPreimage);
|
|
112
|
-
}
|
|
113
90
|
export function getCivcProofFromTx(tx) {
|
|
114
91
|
const proofFields = tx.clientIvcProof.proof;
|
|
115
92
|
const numPublicInputs = proofFields.length - CIVC_PROOF_LENGTH;
|
|
@@ -117,9 +94,9 @@ export function getCivcProofFromTx(tx) {
|
|
|
117
94
|
const proofFieldsWithoutPublicInputs = proofFields.slice(numPublicInputs);
|
|
118
95
|
return new RecursiveProof(proofFieldsWithoutPublicInputs, binaryProof, true, CIVC_PROOF_LENGTH);
|
|
119
96
|
}
|
|
120
|
-
export function getPublicTubePrivateInputsFromTx(tx) {
|
|
97
|
+
export function getPublicTubePrivateInputsFromTx(tx, proverId) {
|
|
121
98
|
const proofData = new ProofData(tx.data.toPrivateToPublicKernelCircuitPublicInputs(), getCivcProofFromTx(tx), getVkData('HidingKernelToPublic'));
|
|
122
|
-
return new PublicTubePrivateInputs(proofData);
|
|
99
|
+
return new PublicTubePrivateInputs(proofData, proverId);
|
|
123
100
|
}
|
|
124
101
|
// Build "hints" as the private inputs for the checkpoint root rollup circuit.
|
|
125
102
|
// The `blobCommitments` will be accumulated and checked in the root rollup against the `finalBlobChallenges`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SpongeBlob } from '@aztec/blob-lib';
|
|
2
|
-
import { type ARCHIVE_HEIGHT, type
|
|
2
|
+
import { type ARCHIVE_HEIGHT, type L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { type Tuple } from '@aztec/foundation/serialize';
|
|
5
5
|
import { type TreeNodeLocation } from '@aztec/foundation/trees';
|
|
@@ -29,7 +29,7 @@ export declare class BlockProvingState {
|
|
|
29
29
|
readonly lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot;
|
|
30
30
|
private readonly lastArchiveSiblingPath;
|
|
31
31
|
private readonly lastL1ToL2MessageTreeSnapshot;
|
|
32
|
-
private readonly
|
|
32
|
+
private readonly lastL1ToL2MessageSubtreeRootSiblingPath;
|
|
33
33
|
readonly newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot;
|
|
34
34
|
private readonly headerOfLastBlockInPreviousCheckpoint;
|
|
35
35
|
private readonly startSpongeBlob;
|
|
@@ -43,7 +43,7 @@ export declare class BlockProvingState {
|
|
|
43
43
|
private txs;
|
|
44
44
|
private isFirstBlock;
|
|
45
45
|
private error;
|
|
46
|
-
constructor(index: number, blockNumber: number, totalNumTxs: number, constants: CheckpointConstantData, timestamp: UInt64, lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
46
|
+
constructor(index: number, blockNumber: number, totalNumTxs: number, constants: CheckpointConstantData, timestamp: UInt64, lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, headerOfLastBlockInPreviousCheckpoint: BlockHeader, startSpongeBlob: SpongeBlob, parentCheckpoint: CheckpointProvingState);
|
|
47
47
|
get epochNumber(): number;
|
|
48
48
|
addNewTx(tx: TxProvingState): number;
|
|
49
49
|
isAcceptingTxs(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,
|
|
1
|
+
{"version":3,"file":"block-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,6CAA6C,EAElD,KAAK,yCAAyC,EAE/C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AAErF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,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AAC,kBAAkB,CAAC;IAInF,wBAAwB;IASxB,uBAAuB,CAC5B,aAAa,EAAE,6BAA6B,CAC1C,uBAAuB,EACvB,OAAO,yCAAyC,CACjD,GACA,gBAAgB;IAKZ,wBAAwB;IAIxB,mBAAmB,CAAC,WAAW,EAAE,WAAW;IAI5C,mBAAmB;IAInB,kBAAkB;IAkBlB,kBAAkB;IAIlB,gBAAgB,CAAC,aAAa,EAAE,UAAU;IAI1C,gBAAgB;IAIhB,kBAAkB;IAIlB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB;IAI5C,oBAAoB,CAAC,aAAa,EAAE,gBAAgB;IASpD,+BAA+B;;;;;;;;;;IAuE/B,mBAAmB;IAWnB,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAI3B,6BAA6B;IAQnC,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB;IAKhD,yBAAyB;IAMzB,oBAAoB;IAIpB,UAAU;IAIV,WAAW;IAIX,QAAQ;IAIR,MAAM,CAAC,MAAM,EAAE,MAAM;CAgB7B"}
|
|
@@ -18,7 +18,7 @@ import { buildHeaderFromCircuitOutputs, toProofData } from './block-building-hel
|
|
|
18
18
|
lastArchiveTreeSnapshot;
|
|
19
19
|
lastArchiveSiblingPath;
|
|
20
20
|
lastL1ToL2MessageTreeSnapshot;
|
|
21
|
-
|
|
21
|
+
lastL1ToL2MessageSubtreeRootSiblingPath;
|
|
22
22
|
newL1ToL2MessageTreeSnapshot;
|
|
23
23
|
headerOfLastBlockInPreviousCheckpoint;
|
|
24
24
|
startSpongeBlob;
|
|
@@ -32,7 +32,7 @@ import { buildHeaderFromCircuitOutputs, toProofData } from './block-building-hel
|
|
|
32
32
|
txs;
|
|
33
33
|
isFirstBlock;
|
|
34
34
|
error;
|
|
35
|
-
constructor(index, blockNumber, totalNumTxs, constants, timestamp, lastArchiveTreeSnapshot, lastArchiveSiblingPath, lastL1ToL2MessageTreeSnapshot,
|
|
35
|
+
constructor(index, blockNumber, totalNumTxs, constants, timestamp, lastArchiveTreeSnapshot, lastArchiveSiblingPath, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, headerOfLastBlockInPreviousCheckpoint, startSpongeBlob, parentCheckpoint){
|
|
36
36
|
this.index = index;
|
|
37
37
|
this.blockNumber = blockNumber;
|
|
38
38
|
this.totalNumTxs = totalNumTxs;
|
|
@@ -41,7 +41,7 @@ import { buildHeaderFromCircuitOutputs, toProofData } from './block-building-hel
|
|
|
41
41
|
this.lastArchiveTreeSnapshot = lastArchiveTreeSnapshot;
|
|
42
42
|
this.lastArchiveSiblingPath = lastArchiveSiblingPath;
|
|
43
43
|
this.lastL1ToL2MessageTreeSnapshot = lastL1ToL2MessageTreeSnapshot;
|
|
44
|
-
this.
|
|
44
|
+
this.lastL1ToL2MessageSubtreeRootSiblingPath = lastL1ToL2MessageSubtreeRootSiblingPath;
|
|
45
45
|
this.newL1ToL2MessageTreeSnapshot = newL1ToL2MessageTreeSnapshot;
|
|
46
46
|
this.headerOfLastBlockInPreviousCheckpoint = headerOfLastBlockInPreviousCheckpoint;
|
|
47
47
|
this.startSpongeBlob = startSpongeBlob;
|
|
@@ -238,12 +238,12 @@ import { buildHeaderFromCircuitOutputs, toProofData } from './block-building-hel
|
|
|
238
238
|
if (!leftRollup) {
|
|
239
239
|
return {
|
|
240
240
|
rollupType: 'rollup-block-root-first-empty-tx',
|
|
241
|
-
inputs: new BlockRootEmptyTxFirstRollupPrivateInputs(l1ToL2Roots, this.lastArchiveTreeSnapshot, this.headerOfLastBlockInPreviousCheckpoint.state, this.constants, this.startSpongeBlob, this.timestamp, this.
|
|
241
|
+
inputs: new BlockRootEmptyTxFirstRollupPrivateInputs(l1ToL2Roots, this.lastArchiveTreeSnapshot, this.headerOfLastBlockInPreviousCheckpoint.state, this.constants, this.startSpongeBlob, this.timestamp, this.lastL1ToL2MessageSubtreeRootSiblingPath, this.lastArchiveSiblingPath)
|
|
242
242
|
};
|
|
243
243
|
} else if (!rightRollup) {
|
|
244
244
|
return {
|
|
245
245
|
rollupType: 'rollup-block-root-first-single-tx',
|
|
246
|
-
inputs: new BlockRootSingleTxFirstRollupPrivateInputs(l1ToL2Roots, leftRollup, this.lastL1ToL2MessageTreeSnapshot, this.
|
|
246
|
+
inputs: new BlockRootSingleTxFirstRollupPrivateInputs(l1ToL2Roots, leftRollup, this.lastL1ToL2MessageTreeSnapshot, this.lastL1ToL2MessageSubtreeRootSiblingPath, this.lastArchiveSiblingPath)
|
|
247
247
|
};
|
|
248
248
|
} else {
|
|
249
249
|
return {
|
|
@@ -251,7 +251,7 @@ import { buildHeaderFromCircuitOutputs, toProofData } from './block-building-hel
|
|
|
251
251
|
inputs: new BlockRootFirstRollupPrivateInputs(l1ToL2Roots, [
|
|
252
252
|
leftRollup,
|
|
253
253
|
rightRollup
|
|
254
|
-
], this.lastL1ToL2MessageTreeSnapshot, this.
|
|
254
|
+
], this.lastL1ToL2MessageTreeSnapshot, this.lastL1ToL2MessageSubtreeRootSiblingPath, this.lastArchiveSiblingPath)
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
257
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BatchedBlobAccumulator, type FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
2
|
-
import { type ARCHIVE_HEIGHT, type
|
|
2
|
+
import { type ARCHIVE_HEIGHT, type L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import type { Tuple } from '@aztec/foundation/serialize';
|
|
5
5
|
import { type TreeNodeLocation } from '@aztec/foundation/trees';
|
|
@@ -23,9 +23,9 @@ export declare class CheckpointProvingState {
|
|
|
23
23
|
private readonly lastArchiveSiblingPath;
|
|
24
24
|
private readonly l1ToL2Messages;
|
|
25
25
|
private readonly lastL1ToL2MessageTreeSnapshot;
|
|
26
|
-
private readonly
|
|
26
|
+
private readonly lastL1ToL2MessageSubtreeRootSiblingPath;
|
|
27
27
|
private readonly newL1ToL2MessageTreeSnapshot;
|
|
28
|
-
private readonly
|
|
28
|
+
private readonly newL1ToL2MessageSubtreeRootSiblingPath;
|
|
29
29
|
parentEpoch: EpochProvingState;
|
|
30
30
|
private onBlobAccumulatorSet;
|
|
31
31
|
private blockProofs;
|
|
@@ -35,7 +35,7 @@ export declare class CheckpointProvingState {
|
|
|
35
35
|
private endBlobAccumulator;
|
|
36
36
|
private error;
|
|
37
37
|
readonly firstBlockNumber: number;
|
|
38
|
-
constructor(index: number, constants: CheckpointConstantData, totalNumBlocks: number, totalNumBlobFields: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges, headerOfLastBlockInPreviousCheckpoint: BlockHeader, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, l1ToL2Messages: Fr[], lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
38
|
+
constructor(index: number, constants: CheckpointConstantData, totalNumBlocks: number, totalNumBlobFields: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges, headerOfLastBlockInPreviousCheckpoint: BlockHeader, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, l1ToL2Messages: Fr[], lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, parentEpoch: EpochProvingState, onBlobAccumulatorSet: (checkpoint: CheckpointProvingState) => void);
|
|
39
39
|
get epochNumber(): number;
|
|
40
40
|
startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number, lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>): BlockProvingState;
|
|
41
41
|
isAcceptingBlocks(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/checkpoint-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,KAAK,2BAA2B,EAEjC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,
|
|
1
|
+
{"version":3,"file":"checkpoint-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/checkpoint-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,KAAK,2BAA2B,EAEjC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,6CAA6C,EAClD,KAAK,yCAAyC,EAE/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAc,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AACrF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAE5B,iCAAiC,EACjC,4CAA4C,EAC7C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAA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AIN,MAAM,CAAC,MAAM,EAAE,MAAM;CAW7B"}
|
|
@@ -17,9 +17,9 @@ export class CheckpointProvingState {
|
|
|
17
17
|
lastArchiveSiblingPath;
|
|
18
18
|
l1ToL2Messages;
|
|
19
19
|
lastL1ToL2MessageTreeSnapshot;
|
|
20
|
-
|
|
20
|
+
lastL1ToL2MessageSubtreeRootSiblingPath;
|
|
21
21
|
newL1ToL2MessageTreeSnapshot;
|
|
22
|
-
|
|
22
|
+
newL1ToL2MessageSubtreeRootSiblingPath;
|
|
23
23
|
parentEpoch;
|
|
24
24
|
onBlobAccumulatorSet;
|
|
25
25
|
blockProofs;
|
|
@@ -30,8 +30,8 @@ export class CheckpointProvingState {
|
|
|
30
30
|
error;
|
|
31
31
|
firstBlockNumber;
|
|
32
32
|
constructor(index, constants, totalNumBlocks, totalNumBlobFields, finalBlobBatchingChallenges, headerOfLastBlockInPreviousCheckpoint, lastArchiveSiblingPath, l1ToL2Messages, // The snapshot and sibling path before the new l1 to l2 message subtree is inserted.
|
|
33
|
-
lastL1ToL2MessageTreeSnapshot,
|
|
34
|
-
newL1ToL2MessageTreeSnapshot,
|
|
33
|
+
lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, // The snapshot and sibling path after the new l1 to l2 message subtree is inserted.
|
|
34
|
+
newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath, parentEpoch, onBlobAccumulatorSet){
|
|
35
35
|
this.index = index;
|
|
36
36
|
this.constants = constants;
|
|
37
37
|
this.totalNumBlocks = totalNumBlocks;
|
|
@@ -41,9 +41,9 @@ export class CheckpointProvingState {
|
|
|
41
41
|
this.lastArchiveSiblingPath = lastArchiveSiblingPath;
|
|
42
42
|
this.l1ToL2Messages = l1ToL2Messages;
|
|
43
43
|
this.lastL1ToL2MessageTreeSnapshot = lastL1ToL2MessageTreeSnapshot;
|
|
44
|
-
this.
|
|
44
|
+
this.lastL1ToL2MessageSubtreeRootSiblingPath = lastL1ToL2MessageSubtreeRootSiblingPath;
|
|
45
45
|
this.newL1ToL2MessageTreeSnapshot = newL1ToL2MessageTreeSnapshot;
|
|
46
|
-
this.
|
|
46
|
+
this.newL1ToL2MessageSubtreeRootSiblingPath = newL1ToL2MessageSubtreeRootSiblingPath;
|
|
47
47
|
this.parentEpoch = parentEpoch;
|
|
48
48
|
this.onBlobAccumulatorSet = onBlobAccumulatorSet;
|
|
49
49
|
this.blocks = [];
|
|
@@ -62,12 +62,12 @@ export class CheckpointProvingState {
|
|
|
62
62
|
// Otherwise, we use the snapshot and sibling path after the new l1 to l2 messages are inserted, which will always
|
|
63
63
|
// happen in the first block.
|
|
64
64
|
const lastL1ToL2MessageTreeSnapshot = index === 0 ? this.lastL1ToL2MessageTreeSnapshot : this.newL1ToL2MessageTreeSnapshot;
|
|
65
|
-
const
|
|
65
|
+
const lastL1ToL2MessageSubtreeRootSiblingPath = index === 0 ? this.lastL1ToL2MessageSubtreeRootSiblingPath : this.newL1ToL2MessageSubtreeRootSiblingPath;
|
|
66
66
|
const startSpongeBlob = index === 0 ? SpongeBlob.init(this.totalNumBlobFields) : this.blocks[index - 1]?.getEndSpongeBlob();
|
|
67
67
|
if (!startSpongeBlob) {
|
|
68
68
|
throw new Error('Cannot start a new block before the trees have progressed from the tx effects in the previous block.');
|
|
69
69
|
}
|
|
70
|
-
const block = new BlockProvingState(index, blockNumber, totalNumTxs, this.constants, timestamp, lastArchiveTreeSnapshot, lastArchiveSiblingPath, lastL1ToL2MessageTreeSnapshot,
|
|
70
|
+
const block = new BlockProvingState(index, blockNumber, totalNumTxs, this.constants, timestamp, lastArchiveTreeSnapshot, lastArchiveSiblingPath, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, this.newL1ToL2MessageTreeSnapshot, this.headerOfLastBlockInPreviousCheckpoint, startSpongeBlob, this);
|
|
71
71
|
this.blocks[index] = block;
|
|
72
72
|
return block;
|
|
73
73
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { BatchedBlob, type FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
2
|
-
import type { ARCHIVE_HEIGHT,
|
|
2
|
+
import type { ARCHIVE_HEIGHT, L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
3
3
|
import type { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import type { Tuple } from '@aztec/foundation/serialize';
|
|
5
5
|
import { type TreeNodeLocation } from '@aztec/foundation/trees';
|
|
6
6
|
import type { PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
7
|
-
import type { PrivateToPublicKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
8
7
|
import type { Proof } from '@aztec/stdlib/proofs';
|
|
9
|
-
import { CheckpointConstantData, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, RootRollupPrivateInputs, type RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
8
|
+
import { CheckpointConstantData, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, PublicTubePublicInputs, RootRollupPrivateInputs, type RootRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
10
9
|
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
11
10
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
12
11
|
import { CheckpointProvingState } from './checkpoint-proving-state.js';
|
|
@@ -39,9 +38,9 @@ export declare class EpochProvingState {
|
|
|
39
38
|
private endBlobAccumulator;
|
|
40
39
|
private finalBatchedBlob;
|
|
41
40
|
private provingStateLifecycle;
|
|
42
|
-
readonly cachedTubeProofs: Map<string, Promise<PublicInputsAndRecursiveProof<
|
|
41
|
+
readonly cachedTubeProofs: Map<string, Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, 535>>>;
|
|
43
42
|
constructor(epochNumber: number, totalNumCheckpoints: number, finalBlobBatchingChallenges: FinalBlobBatchingChallenges, onCheckpointBlobAccumulatorSet: (checkpoint: CheckpointProvingState) => void, completionCallback: (result: ProvingResult) => void, rejectionCallback: (reason: string) => void);
|
|
44
|
-
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, totalNumBlocks: number, totalNumBlobFields: number, previousBlockHeader: BlockHeader, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, l1ToL2Messages: Fr[], lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot,
|
|
43
|
+
startNewCheckpoint(checkpointIndex: number, constants: CheckpointConstantData, totalNumBlocks: number, totalNumBlobFields: number, previousBlockHeader: BlockHeader, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, l1ToL2Messages: Fr[], lastL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>): CheckpointProvingState;
|
|
45
44
|
getCheckpointProvingState(index: number): CheckpointProvingState | undefined;
|
|
46
45
|
getCheckpointProvingStateByBlockNumber(blockNumber: number): CheckpointProvingState | undefined;
|
|
47
46
|
getBlockProvingStateByBlockNumber(blockNumber: number): import("./block-proving-state.js").BlockProvingState | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epoch-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/epoch-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA0B,KAAK,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACxG,OAAO,KAA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AsB;IAItB,4BAA4B,CACjC,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,6BAA6B,CAC1C,4BAA4B,EAC5B,OAAO,yCAAyC,CACjD,GACA,gBAAgB;IAIZ,8BAA8B,CAAC,QAAQ,EAAE,gBAAgB;IASzD,6BAA6B,CAClC,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,6BAA6B,CAC1C,4BAA4B,EAC5B,OAAO,yCAAyC,CACjD;IAKI,yBAAyB;IASzB,kBAAkB,CAAC,aAAa,EAAE,6BAA6B,CAAC,sBAAsB,CAAC;IAIvF,gCAAgC;IAShC,yBAAyB,CAC9B,aAAa,EAAE,6BAA6B,CAC1C,4BAA4B,EAC5B,OAAO,yCAAyC,CACjD;IAKU,mBAAmB;IAwBnB,mBAAmB;IAOzB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB;IAI5C,8BAA8B,CAAC,aAAa,EAAE,gBAAgB;IAS9D,mBAAmB;IAWnB,0BAA0B;IAI1B,mBAAmB,IAAI;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,YAAY,EAAE,sBAAsB,CAAC;QAAC,iBAAiB,EAAE,WAAW,CAAA;KAAE;IAc7G,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB;IAKpD,oBAAoB;IAMpB,MAAM;IAMN,MAAM,CAAC,MAAM,EAAE,MAAM;IAUrB,OAAO,CAAC,MAAM,EAAE,aAAa;CAerC"}
|
|
@@ -47,11 +47,11 @@ var PROVING_STATE_LIFECYCLE = /*#__PURE__*/ function(PROVING_STATE_LIFECYCLE) {
|
|
|
47
47
|
}
|
|
48
48
|
// Adds a block to the proving state, returns its index
|
|
49
49
|
// Will update the proving life cycle if this is the last block
|
|
50
|
-
startNewCheckpoint(checkpointIndex, constants, totalNumBlocks, totalNumBlobFields, previousBlockHeader, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot,
|
|
50
|
+
startNewCheckpoint(checkpointIndex, constants, totalNumBlocks, totalNumBlobFields, previousBlockHeader, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath) {
|
|
51
51
|
if (checkpointIndex >= this.totalNumCheckpoints) {
|
|
52
52
|
throw new Error(`Unable to start a new checkpoint at index ${checkpointIndex}. Expected at most ${this.totalNumCheckpoints} checkpoints.`);
|
|
53
53
|
}
|
|
54
|
-
const checkpoint = new CheckpointProvingState(checkpointIndex, constants, totalNumBlocks, totalNumBlobFields, this.finalBlobBatchingChallenges, previousBlockHeader, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot,
|
|
54
|
+
const checkpoint = new CheckpointProvingState(checkpointIndex, constants, totalNumBlocks, totalNumBlobFields, this.finalBlobBatchingChallenges, previousBlockHeader, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath, this, this.onCheckpointBlobAccumulatorSet);
|
|
55
55
|
this.checkpoints[checkpointIndex] = checkpoint;
|
|
56
56
|
if (this.checkpoints.filter((c)=>!!c).length === this.totalNumCheckpoints) {
|
|
57
57
|
this.provingStateLifecycle = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA+B,2BAA2B,EAAc,MAAM,iBAAiB,CAAC;AAUpH,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAQ9C,OAAO,EAAE,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EAGxB,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":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AO,CAAC,2BAA2B;IA6DnC,OAAO,CAAC,4BAA4B;IA+BpC,OAAO,CAAC,mBAAmB;IAkC3B,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,8BAA8B;IAatC,OAAO,CAAC,8BAA8B;IAStC,OAAO,CAAC,mCAAmC;IAa3C,OAAO,CAAC,mCAAmC;IAQ3C,OAAO,CAAC,wCAAwC;IAahD,OAAO,CAAC,yBAAyB;IASjC;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAoDjB,OAAO,CAAC,yBAAyB;CAWlC"}
|
|
@@ -5,7 +5,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
7
|
import { BlobAccumulatorPublicInputs } from '@aztec/blob-lib';
|
|
8
|
-
import { L1_TO_L2_MSG_SUBTREE_HEIGHT,
|
|
8
|
+
import { L1_TO_L2_MSG_SUBTREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_BASE_PARITY_PER_ROOT_PARITY } from '@aztec/constants';
|
|
9
9
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
10
10
|
import { AbortError } from '@aztec/foundation/error';
|
|
11
11
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -93,8 +93,8 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
93
93
|
// Get archive sibling path before any block in this checkpoint lands.
|
|
94
94
|
const lastArchiveSiblingPath = await getLastSiblingPath(MerkleTreeId.ARCHIVE, db);
|
|
95
95
|
// Insert all the l1 to l2 messages into the db. And get the states before and after the insertion.
|
|
96
|
-
const { lastL1ToL2MessageTreeSnapshot,
|
|
97
|
-
this.provingState.startNewCheckpoint(checkpointIndex, constants, totalNumBlocks, totalNumBlobFields, headerOfLastBlockInPreviousCheckpoint, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot,
|
|
96
|
+
const { lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath } = await this.updateL1ToL2MessageTree(l1ToL2Messages, db);
|
|
97
|
+
this.provingState.startNewCheckpoint(checkpointIndex, constants, totalNumBlocks, totalNumBlobFields, headerOfLastBlockInPreviousCheckpoint, lastArchiveSiblingPath, l1ToL2Messages, lastL1ToL2MessageTreeSnapshot, lastL1ToL2MessageSubtreeRootSiblingPath, newL1ToL2MessageTreeSnapshot, newL1ToL2MessageSubtreeRootSiblingPath);
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
100
|
* Starts off a new block
|
|
@@ -186,7 +186,7 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
186
186
|
throw new Error(`Unable to add transaction, preparing base inputs failed`);
|
|
187
187
|
}
|
|
188
188
|
await spongeBlobState.absorb(tx.txEffect.toBlobFields());
|
|
189
|
-
const txProvingState = new TxProvingState(tx, hints, treeSnapshots);
|
|
189
|
+
const txProvingState = new TxProvingState(tx, hints, treeSnapshots, this.proverId.toField());
|
|
190
190
|
const txIndex = provingState.addNewTx(txProvingState);
|
|
191
191
|
if (txProvingState.requireAvmProof) {
|
|
192
192
|
this.getOrEnqueueTube(provingState, txIndex);
|
|
@@ -219,7 +219,7 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
219
219
|
const publicTxs = txs.filter((tx)=>tx.data.forPublic);
|
|
220
220
|
for (const tx of publicTxs){
|
|
221
221
|
const txHash = tx.getTxHash().toString();
|
|
222
|
-
const privateInputs = getPublicTubePrivateInputsFromTx(tx);
|
|
222
|
+
const privateInputs = getPublicTubePrivateInputsFromTx(tx, this.proverId.toField());
|
|
223
223
|
const tubeProof = promiseWithResolvers();
|
|
224
224
|
logger.debug(`Starting tube circuit for tx ${txHash}`);
|
|
225
225
|
this.doEnqueueTube(txHash, privateInputs, (proof)=>{
|
|
@@ -392,16 +392,16 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
392
392
|
async updateL1ToL2MessageTree(l1ToL2Messages, db) {
|
|
393
393
|
const l1ToL2MessagesPadded = padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, 'Too many L1 to L2 messages');
|
|
394
394
|
const lastL1ToL2MessageTreeSnapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
|
|
395
|
-
const
|
|
395
|
+
const lastL1ToL2MessageSubtreeRootSiblingPath = assertLength(await getSubtreeSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, L1_TO_L2_MSG_SUBTREE_HEIGHT, db), L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH);
|
|
396
396
|
// Update the local trees to include the new l1 to l2 messages
|
|
397
397
|
await db.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, l1ToL2MessagesPadded);
|
|
398
398
|
const newL1ToL2MessageTreeSnapshot = await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db);
|
|
399
|
-
const
|
|
399
|
+
const newL1ToL2MessageSubtreeRootSiblingPath = assertLength(await getSubtreeSiblingPath(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, L1_TO_L2_MSG_SUBTREE_HEIGHT, db), L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH);
|
|
400
400
|
return {
|
|
401
401
|
lastL1ToL2MessageTreeSnapshot,
|
|
402
|
-
|
|
402
|
+
lastL1ToL2MessageSubtreeRootSiblingPath,
|
|
403
403
|
newL1ToL2MessageTreeSnapshot,
|
|
404
|
-
|
|
404
|
+
newL1ToL2MessageSubtreeRootSiblingPath
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
407
|
// Updates the merkle trees for a transaction. The first enqueued job for a transaction
|
|
@@ -455,7 +455,7 @@ const logger = createLogger('prover-client:orchestrator');
|
|
|
455
455
|
}
|
|
456
456
|
}), (result)=>{
|
|
457
457
|
logger.debug(`Completed proof for ${rollupType} for tx ${processedTx.hash.toString()}`);
|
|
458
|
-
validatePartialState(result.inputs.
|
|
458
|
+
validatePartialState(result.inputs.endTreeSnapshots, txProvingState.treeSnapshots);
|
|
459
459
|
const leafLocation = provingState.setBaseRollupProof(txIndex, result);
|
|
460
460
|
if (provingState.totalNumTxs === 1) {
|
|
461
461
|
this.checkAndEnqueueBlockRootRollup(provingState);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
3
4
|
import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
4
|
-
import type
|
|
5
|
-
import { type BaseRollupHints, PrivateTxBaseRollupPrivateInputs, PublicTxBaseRollupPrivateInputs } from '@aztec/stdlib/rollup';
|
|
5
|
+
import { type BaseRollupHints, PrivateTxBaseRollupPrivateInputs, PublicTubePublicInputs, PublicTxBaseRollupPrivateInputs } from '@aztec/stdlib/rollup';
|
|
6
6
|
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
7
7
|
import type { ProcessedTx } from '@aztec/stdlib/tx';
|
|
8
8
|
/**
|
|
@@ -15,9 +15,10 @@ export declare class TxProvingState {
|
|
|
15
15
|
readonly processedTx: ProcessedTx;
|
|
16
16
|
private readonly baseRollupHints;
|
|
17
17
|
readonly treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot>;
|
|
18
|
+
private readonly proverId;
|
|
18
19
|
private publicTube?;
|
|
19
20
|
private avm?;
|
|
20
|
-
constructor(processedTx: ProcessedTx, baseRollupHints: BaseRollupHints, treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot
|
|
21
|
+
constructor(processedTx: ProcessedTx, baseRollupHints: BaseRollupHints, treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot>, proverId: Fr);
|
|
21
22
|
get requireAvmProof(): boolean;
|
|
22
23
|
ready(): boolean;
|
|
23
24
|
getAvmInputs(): AvmCircuitInputs;
|
|
@@ -29,7 +30,7 @@ export declare class TxProvingState {
|
|
|
29
30
|
rollupType: string;
|
|
30
31
|
inputs: PrivateTxBaseRollupPrivateInputs;
|
|
31
32
|
};
|
|
32
|
-
setPublicTubeProof(publicTubeProofAndVk: PublicInputsAndRecursiveProof<
|
|
33
|
+
setPublicTubeProof(publicTubeProofAndVk: PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): void;
|
|
33
34
|
setAvmProof(avmProofAndVk: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>): void;
|
|
34
35
|
}
|
|
35
36
|
//# sourceMappingURL=tx-proving-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/tx-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EAEpC,yCAAyC,EAC1C,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"tx-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/tx-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oCAAoC,EAEpC,yCAAyC,EAC1C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,6B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