@aztec/prover-client 3.0.0-canary.a9708bd → 3.0.0-manual.20251030

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.
Files changed (74) hide show
  1. package/dest/block-factory/light.d.ts +5 -3
  2. package/dest/block-factory/light.d.ts.map +1 -1
  3. package/dest/block-factory/light.js +16 -9
  4. package/dest/config.js +1 -1
  5. package/dest/mocks/fixtures.d.ts +4 -1
  6. package/dest/mocks/fixtures.d.ts.map +1 -1
  7. package/dest/mocks/fixtures.js +31 -3
  8. package/dest/mocks/test_context.d.ts +32 -9
  9. package/dest/mocks/test_context.d.ts.map +1 -1
  10. package/dest/mocks/test_context.js +78 -22
  11. package/dest/orchestrator/block-building-helpers.d.ts +33 -31
  12. package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
  13. package/dest/orchestrator/block-building-helpers.js +126 -137
  14. package/dest/orchestrator/block-proving-state.d.ts +60 -53
  15. package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
  16. package/dest/orchestrator/block-proving-state.js +214 -187
  17. package/dest/orchestrator/checkpoint-proving-state.d.ts +63 -0
  18. package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -0
  19. package/dest/orchestrator/checkpoint-proving-state.js +211 -0
  20. package/dest/orchestrator/epoch-proving-state.d.ts +34 -28
  21. package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
  22. package/dest/orchestrator/epoch-proving-state.js +128 -84
  23. package/dest/orchestrator/orchestrator.d.ts +31 -30
  24. package/dest/orchestrator/orchestrator.d.ts.map +1 -1
  25. package/dest/orchestrator/orchestrator.js +368 -236
  26. package/dest/orchestrator/tx-proving-state.d.ts +11 -9
  27. package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
  28. package/dest/orchestrator/tx-proving-state.js +26 -23
  29. package/dest/prover-client/server-epoch-prover.d.ts +9 -8
  30. package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
  31. package/dest/prover-client/server-epoch-prover.js +9 -9
  32. package/dest/proving_broker/broker_prover_facade.d.ts +20 -15
  33. package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
  34. package/dest/proving_broker/broker_prover_facade.js +36 -21
  35. package/dest/proving_broker/config.d.ts +8 -8
  36. package/dest/proving_broker/config.js +5 -5
  37. package/dest/proving_broker/factory.js +1 -1
  38. package/dest/proving_broker/fixtures.js +1 -1
  39. package/dest/proving_broker/proof_store/index.d.ts +1 -0
  40. package/dest/proving_broker/proof_store/index.d.ts.map +1 -1
  41. package/dest/proving_broker/proof_store/index.js +1 -0
  42. package/dest/proving_broker/proving_broker.d.ts.map +1 -1
  43. package/dest/proving_broker/proving_broker.js +29 -18
  44. package/dest/proving_broker/proving_broker_database/persisted.js +5 -5
  45. package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
  46. package/dest/proving_broker/proving_job_controller.js +38 -18
  47. package/dest/test/mock_prover.d.ts +22 -17
  48. package/dest/test/mock_prover.d.ts.map +1 -1
  49. package/dest/test/mock_prover.js +35 -20
  50. package/package.json +16 -17
  51. package/src/block-factory/light.ts +35 -9
  52. package/src/config.ts +1 -1
  53. package/src/mocks/fixtures.ts +39 -11
  54. package/src/mocks/test_context.ts +137 -31
  55. package/src/orchestrator/block-building-helpers.ts +211 -211
  56. package/src/orchestrator/block-proving-state.ts +235 -245
  57. package/src/orchestrator/checkpoint-proving-state.ts +299 -0
  58. package/src/orchestrator/epoch-proving-state.ts +172 -127
  59. package/src/orchestrator/orchestrator.ts +545 -303
  60. package/src/orchestrator/tx-proving-state.ts +49 -43
  61. package/src/prover-client/server-epoch-prover.ts +28 -18
  62. package/src/proving_broker/broker_prover_facade.ts +157 -86
  63. package/src/proving_broker/config.ts +7 -7
  64. package/src/proving_broker/factory.ts +1 -1
  65. package/src/proving_broker/fixtures.ts +1 -1
  66. package/src/proving_broker/proof_store/index.ts +1 -0
  67. package/src/proving_broker/proving_broker.ts +36 -18
  68. package/src/proving_broker/proving_broker_database/persisted.ts +5 -5
  69. package/src/proving_broker/proving_job_controller.ts +38 -18
  70. package/src/test/mock_prover.ts +142 -60
  71. package/dest/bin/get-proof-inputs.d.ts +0 -2
  72. package/dest/bin/get-proof-inputs.d.ts.map +0 -1
  73. package/dest/bin/get-proof-inputs.js +0 -51
  74. package/src/bin/get-proof-inputs.ts +0 -59
@@ -1,170 +1,190 @@
1
- import { Blob } from '@aztec/blob-lib';
2
- import { ARCHIVE_HEIGHT, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NOTE_HASH_SUBTREE_HEIGHT, NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_HEIGHT, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants';
1
+ import { BatchedBlob, SpongeBlob, computeBlobsHashFromBlobs, getBlobCommitmentsFromBlobs, getBlobsPerL1Block } from '@aztec/blob-lib';
2
+ import { ARCHIVE_HEIGHT, CHONK_PROOF_LENGTH, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NOTE_HASH_SUBTREE_HEIGHT, 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
- import { sha256ToField, sha256Trunc } from '@aztec/foundation/crypto';
6
- import { BLS12Point, Fr } from '@aztec/foundation/fields';
5
+ import { sha256Trunc } from '@aztec/foundation/crypto';
6
+ import { Fr } from '@aztec/foundation/fields';
7
7
  import { assertLength, toFriendlyJSON } from '@aztec/foundation/serialize';
8
- import { MembershipWitness, MerkleTreeCalculator, computeUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
9
- import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
10
- import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
8
+ import { MembershipWitness, MerkleTreeCalculator, computeCompressedUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
9
+ import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
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
- import { Body } from '@aztec/stdlib/block';
12
+ import { Body, L2BlockHeader, getBlockBlobFields } from '@aztec/stdlib/block';
13
+ import { getCheckpointBlobFields } from '@aztec/stdlib/checkpoint';
14
14
  import { ContractClassLogFields } from '@aztec/stdlib/logs';
15
- import { BlockConstantData, PrivateBaseRollupHints, PrivateBaseStateDiffHints, PublicBaseRollupHints } from '@aztec/stdlib/rollup';
16
- import { AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafPreimage, PublicDataTreeLeaf, PublicDataTreeLeafPreimage, getTreeHeight } from '@aztec/stdlib/trees';
17
- import { BlockHeader, ContentCommitment, PartialStateReference, StateReference } from '@aztec/stdlib/tx';
15
+ import { Proof, ProofData, RecursiveProof } from '@aztec/stdlib/proofs';
16
+ import { BlockConstantData, PrivateBaseRollupHints, PublicBaseRollupHints, PublicChonkVerifierPrivateInputs, TreeSnapshotDiffHints } from '@aztec/stdlib/rollup';
17
+ import { AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafPreimage, PublicDataTreeLeaf, getTreeHeight } from '@aztec/stdlib/trees';
18
+ import { BlockHeader, ContentCommitment, GlobalVariables, PartialStateReference, StateReference } from '@aztec/stdlib/tx';
19
+ import { VkData } from '@aztec/stdlib/vks';
18
20
  import { Attributes, runInSpan } from '@aztec/telemetry-client';
19
21
  // Builds the hints for base rollup. Updating the contract, nullifier, and data trees in the process.
20
- export const insertSideEffectsAndBuildBaseRollupHints = runInSpan('BlockBuilderHelpers', 'buildBaseRollupHints', async (span, tx, globalVariables, newL1ToL2MessageTreeSnapshot, db, startSpongeBlob)=>{
22
+ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan('BlockBuilderHelpers', 'buildBaseRollupHints', async (span, tx, lastArchive, newL1ToL2MessageTreeSnapshot, startSpongeBlob, proverId, db)=>{
21
23
  span.setAttribute(Attributes.TX_HASH, tx.hash.toString());
22
24
  // Get trees info before any changes hit
23
- const lastArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
24
25
  const start = new PartialStateReference(await getTreeSnapshot(MerkleTreeId.NOTE_HASH_TREE, db), await getTreeSnapshot(MerkleTreeId.NULLIFIER_TREE, db), await getTreeSnapshot(MerkleTreeId.PUBLIC_DATA_TREE, db));
25
- // Get the subtree sibling paths for the circuit
26
- const noteHashSubtreeSiblingPathArray = await getSubtreeSiblingPath(MerkleTreeId.NOTE_HASH_TREE, NOTE_HASH_SUBTREE_HEIGHT, db);
27
- const noteHashSubtreeSiblingPath = makeTuple(NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, (i)=>i < noteHashSubtreeSiblingPathArray.length ? noteHashSubtreeSiblingPathArray[i] : Fr.ZERO);
26
+ // Get the note hash subtree root sibling path for insertion.
27
+ const noteHashSubtreeRootSiblingPath = assertLength(await getSubtreeSiblingPath(MerkleTreeId.NOTE_HASH_TREE, NOTE_HASH_SUBTREE_HEIGHT, db), NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH);
28
28
  // Update the note hash trees with the new items being inserted to get the new roots
29
29
  // that will be used by the next iteration of the base rollup circuit, skipping the empty ones
30
30
  const noteHashes = padArrayEnd(tx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX);
31
31
  await db.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, noteHashes);
32
- // Create data hint for reading fee payer initial balance in Fee Juice
33
- const leafSlot = await computeFeePayerBalanceLeafSlot(tx.data.feePayer);
34
- const feePayerFeeJuiceBalanceReadHint = await getPublicDataHint(db, leafSlot.toBigInt());
35
32
  // The read witnesses for a given TX should be generated before the writes of the same TX are applied.
36
33
  // All reads that refer to writes in the same tx are transient and can be simplified out.
37
34
  const txPublicDataUpdateRequestInfo = await processPublicDataUpdateRequests(tx, db);
38
35
  // Update the nullifier tree, capturing the low nullifier info for each individual operation
39
- const { lowLeavesWitnessData: nullifierWitnessLeaves, newSubtreeSiblingPath: nullifiersSubtreeSiblingPath, 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);
36
+ 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);
40
37
  if (nullifierWitnessLeaves === undefined) {
41
38
  throw new Error(`Could not craft nullifier batch insertion proofs`);
42
39
  }
43
- // Extract witness objects from returned data
44
- const nullifierPredecessorMembershipWitnessesWithoutPadding = nullifierWitnessLeaves.map((l)=>MembershipWitness.fromBufferArray(l.index, assertLength(l.siblingPath.toBufferArray(), NULLIFIER_TREE_HEIGHT)));
45
- const nullifierSubtreeSiblingPathArray = nullifiersSubtreeSiblingPath.toFields();
46
- const nullifierSubtreeSiblingPath = makeTuple(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, (i)=>i < nullifierSubtreeSiblingPathArray.length ? nullifierSubtreeSiblingPathArray[i] : Fr.ZERO);
47
- // Append new data to startSpongeBlob
48
- const inputSpongeBlob = startSpongeBlob.clone();
49
- await startSpongeBlob.absorb(tx.txEffect.toBlobFields());
40
+ const blockHash = await tx.data.constants.anchorBlockHeader.hash();
41
+ const anchorBlockArchiveSiblingPath = (await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db)).siblingPath;
50
42
  const contractClassLogsFields = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, (i)=>tx.txEffect.contractClassLogs[i]?.fields || ContractClassLogFields.empty());
51
43
  if (tx.avmProvingRequest) {
52
- const blockHash = await tx.data.constants.historicalHeader.hash();
53
- const archiveRootMembershipWitness = await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db);
54
44
  return PublicBaseRollupHints.from({
55
- startSpongeBlob: inputSpongeBlob,
45
+ startSpongeBlob,
56
46
  lastArchive,
57
- archiveRootMembershipWitness,
47
+ anchorBlockArchiveSiblingPath,
58
48
  contractClassLogsFields
59
49
  });
60
50
  } else {
61
51
  if (txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses.length > 1 || txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages.length > 1 || txPublicDataUpdateRequestInfo.publicDataWritesSiblingPaths.length > 1) {
62
52
  throw new Error(`More than one public data write in a private only tx`);
63
53
  }
64
- const feeWriteLowLeafPreimage = txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages[0] || PublicDataTreeLeafPreimage.empty();
65
- const feeWriteLowLeafMembershipWitness = txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses[0] || MembershipWitness.empty(PUBLIC_DATA_TREE_HEIGHT);
66
- const feeWriteSiblingPath = txPublicDataUpdateRequestInfo.publicDataWritesSiblingPaths[0] || makeTuple(PUBLIC_DATA_TREE_HEIGHT, ()=>Fr.ZERO);
67
- const stateDiffHints = PrivateBaseStateDiffHints.from({
68
- nullifierPredecessorPreimages: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>i < nullifierWitnessLeaves.length ? nullifierWitnessLeaves[i].leafPreimage : NullifierLeafPreimage.empty()),
54
+ // Get hints for reading fee payer's balance in the public data tree.
55
+ const feePayerBalanceMembershipWitness = txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses[0];
56
+ const feePayerBalanceLeafPreimage = txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages[0];
57
+ const leafSlot = await computeFeePayerBalanceLeafSlot(tx.data.feePayer);
58
+ if (!feePayerBalanceMembershipWitness || !leafSlot.equals(feePayerBalanceLeafPreimage?.leaf.slot)) {
59
+ throw new Error(`Cannot find the public data tree leaf for the fee payer's balance`);
60
+ }
61
+ // Extract witness objects from returned data
62
+ const nullifierPredecessorMembershipWitnessesWithoutPadding = nullifierWitnessLeaves.map((l)=>MembershipWitness.fromBufferArray(l.index, assertLength(l.siblingPath.toBufferArray(), NULLIFIER_TREE_HEIGHT)));
63
+ const treeSnapshotDiffHints = TreeSnapshotDiffHints.from({
64
+ noteHashSubtreeRootSiblingPath,
65
+ nullifierPredecessorPreimages: padArrayEnd(nullifierWitnessLeaves.map((l)=>l.leafPreimage), NullifierLeafPreimage.empty(), MAX_NULLIFIERS_PER_TX),
69
66
  nullifierPredecessorMembershipWitnesses: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>i < nullifierPredecessorMembershipWitnessesWithoutPadding.length ? nullifierPredecessorMembershipWitnessesWithoutPadding[i] : makeEmptyMembershipWitness(NULLIFIER_TREE_HEIGHT)),
70
- sortedNullifiers: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>Fr.fromBuffer(sortednullifiers[i])),
71
- sortedNullifierIndexes: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>sortedNewLeavesIndexes[i]),
72
- noteHashSubtreeSiblingPath,
73
- nullifierSubtreeSiblingPath,
74
- feeWriteLowLeafPreimage,
75
- feeWriteLowLeafMembershipWitness,
76
- feeWriteSiblingPath
67
+ sortedNullifiers: assertLength(sortedNullifiers.map((n)=>Fr.fromBuffer(n)), MAX_NULLIFIERS_PER_TX),
68
+ sortedNullifierIndexes: assertLength(sortedNewLeavesIndexes, MAX_NULLIFIERS_PER_TX),
69
+ nullifierSubtreeRootSiblingPath: assertLength(nullifiersSubtreeRootSiblingPath.toFields(), NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH),
70
+ feePayerBalanceMembershipWitness
77
71
  });
78
- const blockHash = await tx.data.constants.historicalHeader.hash();
79
- const archiveRootMembershipWitness = await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db);
80
72
  const constants = BlockConstantData.from({
81
73
  lastArchive,
82
- newL1ToL2: newL1ToL2MessageTreeSnapshot,
83
- vkTreeRoot: getVKTreeRoot(),
84
- protocolContractTreeRoot,
85
- globalVariables
74
+ l1ToL2TreeSnapshot: newL1ToL2MessageTreeSnapshot,
75
+ vkTreeRoot: tx.data.constants.vkTreeRoot,
76
+ protocolContractsHash: tx.data.constants.protocolContractsHash,
77
+ globalVariables: tx.globalVariables,
78
+ proverId
86
79
  });
87
80
  return PrivateBaseRollupHints.from({
88
81
  start,
89
- startSpongeBlob: inputSpongeBlob,
90
- stateDiffHints,
91
- feePayerFeeJuiceBalanceReadHint,
92
- archiveRootMembershipWitness,
82
+ startSpongeBlob,
83
+ treeSnapshotDiffHints,
84
+ feePayerBalanceLeafPreimage,
85
+ anchorBlockArchiveSiblingPath,
93
86
  contractClassLogsFields,
94
87
  constants
95
88
  });
96
89
  }
97
90
  });
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);
91
+ export function getChonkProofFromTx(tx) {
92
+ const publicInputs = tx.data.publicInputs().toFields();
93
+ const binaryProof = new Proof(Buffer.concat(tx.chonkProof.attachPublicInputs(publicInputs).fieldsWithPublicInputs.map((field)=>field.toBuffer())), publicInputs.length);
94
+ return new RecursiveProof(tx.chonkProof.fields, binaryProof, true, CHONK_PROOF_LENGTH);
112
95
  }
113
- export const buildBlobHints = runInSpan('BlockBuilderHelpers', 'buildBlobHints', async (_span, txEffects)=>{
114
- const blobFields = txEffects.flatMap((tx)=>tx.toBlobFields());
115
- const blobs = await Blob.getBlobsPerBlock(blobFields);
116
- // TODO(#13430): The blobsHash is confusingly similar to blobCommitmentsHash, calculated from below blobCommitments:
117
- // - blobsHash := sha256([blobhash_0, ..., blobhash_m]) = a hash of all blob hashes in a block with m+1 blobs inserted into the header, exists so a user can cross check blobs.
118
- // - blobCommitmentsHash := sha256( ...sha256(sha256(C_0), C_1) ... C_n) = iteratively calculated hash of all blob commitments in an epoch with n+1 blobs (see calculateBlobCommitmentsHash()),
119
- // exists so we can validate injected commitments to the rollup circuits correspond to the correct real blobs.
120
- // We may be able to combine these values e.g. blobCommitmentsHash := sha256( ...sha256(sha256(blobshash_0), blobshash_1) ... blobshash_l) for an epoch with l+1 blocks.
121
- const blobCommitments = blobs.map((b)=>BLS12Point.decompress(b.commitment));
122
- const blobsHash = new Fr(getBlobsHashFromBlobs(blobs));
96
+ export function getPublicChonkVerifierPrivateInputsFromTx(tx, proverId) {
97
+ const proofData = new ProofData(tx.data.toPrivateToPublicKernelCircuitPublicInputs(), getChonkProofFromTx(tx), getVkData('HidingKernelToPublic'));
98
+ return new PublicChonkVerifierPrivateInputs(proofData, proverId);
99
+ }
100
+ // Build "hints" as the private inputs for the checkpoint root rollup circuit.
101
+ // The `blobCommitments` will be accumulated and checked in the root rollup against the `finalBlobChallenges`.
102
+ // The `blobsHash` will be validated on L1 against the submitted blob data.
103
+ export const buildBlobHints = (blobFields)=>{
104
+ const blobs = getBlobsPerL1Block(blobFields);
105
+ const blobCommitments = getBlobCommitmentsFromBlobs(blobs);
106
+ const blobsHash = computeBlobsHashFromBlobs(blobs);
123
107
  return {
124
- blobFields,
125
108
  blobCommitments,
126
109
  blobs,
127
110
  blobsHash
128
111
  };
129
- });
130
- export const accumulateBlobs = runInSpan('BlockBuilderHelpers', 'accumulateBlobs', async (_span, txs, startBlobAccumulator)=>{
131
- const blobFields = txs.flatMap((tx)=>tx.txEffect.toBlobFields());
132
- const blobs = await Blob.getBlobsPerBlock(blobFields);
133
- const endBlobAccumulator = startBlobAccumulator.accumulateBlobs(blobs);
112
+ };
113
+ // Build the data required to prove the txs in an epoch. Currently only used in tests. It assumes 1 block per checkpoint.
114
+ export const buildBlobDataFromTxs = async (txsPerCheckpoint)=>{
115
+ const blobFields = txsPerCheckpoint.map((txs)=>getCheckpointBlobFields([
116
+ txs.map((tx)=>tx.txEffect)
117
+ ]));
118
+ const finalBlobChallenges = await buildFinalBlobChallenges(blobFields);
119
+ return {
120
+ blobFieldsLengths: blobFields.map((fields)=>fields.length),
121
+ finalBlobChallenges
122
+ };
123
+ };
124
+ export const buildFinalBlobChallenges = async (blobFieldsPerCheckpoint)=>{
125
+ const blobs = blobFieldsPerCheckpoint.map((blobFields)=>getBlobsPerL1Block(blobFields));
126
+ return await BatchedBlob.precomputeBatchedBlobChallenges(blobs);
127
+ };
128
+ export const accumulateBlobs = runInSpan('BlockBuilderHelpers', 'accumulateBlobs', async (_span, blobFields, startBlobAccumulator)=>{
129
+ const blobs = getBlobsPerL1Block(blobFields);
130
+ const endBlobAccumulator = await startBlobAccumulator.accumulateBlobs(blobs);
134
131
  return endBlobAccumulator;
135
132
  });
136
- export const buildHeaderFromCircuitOutputs = runInSpan('BlockBuilderHelpers', 'buildHeaderFromCircuitOutputs', (_span, previousRollupData, parityPublicInputs, rootRollupOutputs, blobsHash, endState)=>{
137
- if (previousRollupData.length > 2) {
138
- throw new Error(`There can't be more than 2 previous rollups. Received ${previousRollupData.length}.`);
139
- }
140
- const outHash = previousRollupData.length === 0 ? Fr.ZERO : previousRollupData.length === 1 ? previousRollupData[0].outHash : sha256ToField([
141
- previousRollupData[0].outHash,
142
- previousRollupData[1].outHash
143
- ]);
144
- const contentCommitment = new ContentCommitment(blobsHash, parityPublicInputs.shaRoot, outHash);
145
- const accumulatedFees = previousRollupData.reduce((sum, d)=>sum.add(d.accumulatedFees), Fr.ZERO);
146
- const accumulatedManaUsed = previousRollupData.reduce((sum, d)=>sum.add(d.accumulatedManaUsed), Fr.ZERO);
147
- return new BlockHeader(rootRollupOutputs.previousArchive, contentCommitment, endState, rootRollupOutputs.endGlobalVariables, accumulatedFees, accumulatedManaUsed);
133
+ export const buildHeaderFromCircuitOutputs = runInSpan('BlockBuilderHelpers', 'buildHeaderFromCircuitOutputs', async (_span, blockRootRollupOutput)=>{
134
+ const constants = blockRootRollupOutput.constants;
135
+ const globalVariables = GlobalVariables.from({
136
+ chainId: constants.chainId,
137
+ version: constants.version,
138
+ blockNumber: blockRootRollupOutput.previousArchive.nextAvailableLeafIndex,
139
+ timestamp: blockRootRollupOutput.endTimestamp,
140
+ slotNumber: constants.slotNumber,
141
+ coinbase: constants.coinbase,
142
+ feeRecipient: constants.feeRecipient,
143
+ gasFees: constants.gasFees
144
+ });
145
+ const spongeBlobHash = await blockRootRollupOutput.endSpongeBlob.clone().squeeze();
146
+ return new BlockHeader(blockRootRollupOutput.previousArchive, blockRootRollupOutput.endState, spongeBlobHash, globalVariables, blockRootRollupOutput.accumulatedFees, blockRootRollupOutput.accumulatedManaUsed);
148
147
  });
149
- export const buildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'buildHeaderAndBodyFromTxs', async (span, txs, globalVariables, l1ToL2Messages, db)=>{
148
+ export const buildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'buildHeaderAndBodyFromTxs', async (span, txs, globalVariables, l1ToL2Messages, db, startSpongeBlob)=>{
150
149
  span.setAttribute(Attributes.BLOCK_NUMBER, globalVariables.blockNumber);
151
150
  const stateReference = new StateReference(await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db), new PartialStateReference(await getTreeSnapshot(MerkleTreeId.NOTE_HASH_TREE, db), await getTreeSnapshot(MerkleTreeId.NULLIFIER_TREE, db), await getTreeSnapshot(MerkleTreeId.PUBLIC_DATA_TREE, db)));
152
151
  const previousArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
153
152
  const txEffects = txs.map((tx)=>tx.txEffect);
154
153
  const body = new Body(txEffects);
155
154
  const txOutHashes = txEffects.map((tx)=>tx.txOutHash());
156
- const outHash = txOutHashes.length === 0 ? Fr.ZERO : new Fr(computeUnbalancedMerkleTreeRoot(txOutHashes));
155
+ const outHash = txOutHashes.length === 0 ? Fr.ZERO : new Fr(computeCompressedUnbalancedMerkleTreeRoot(txOutHashes));
157
156
  const parityShaRoot = await computeInHashFromL1ToL2Messages(l1ToL2Messages);
158
- const blobsHash = getBlobsHashFromBlobs(await Blob.getBlobsPerBlock(body.toBlobFields()));
157
+ const blockBlobFields = body.toBlobFields();
158
+ // TODO(#17027): This only works when there's one block per checkpoint.
159
+ const blobFields = [
160
+ new Fr(blockBlobFields.length + 1)
161
+ ].concat(blockBlobFields);
162
+ const blobsHash = computeBlobsHashFromBlobs(getBlobsPerL1Block(blobFields));
159
163
  const contentCommitment = new ContentCommitment(blobsHash, parityShaRoot, outHash);
160
164
  const fees = txEffects.reduce((acc, tx)=>acc.add(tx.transactionFee), Fr.ZERO);
161
165
  const manaUsed = txs.reduce((acc, tx)=>acc.add(new Fr(tx.gasUsed.billedGas.l2Gas)), Fr.ZERO);
162
- const header = new BlockHeader(previousArchive, contentCommitment, stateReference, globalVariables, fees, manaUsed);
166
+ const endSpongeBlob = startSpongeBlob?.clone() ?? await SpongeBlob.init(blobFields.length);
167
+ await endSpongeBlob.absorb(blockBlobFields);
168
+ const spongeBlobHash = await endSpongeBlob.squeeze();
169
+ const header = new L2BlockHeader(previousArchive, contentCommitment, stateReference, globalVariables, fees, manaUsed, spongeBlobHash);
163
170
  return {
164
171
  header,
165
172
  body
166
173
  };
167
174
  });
175
+ export const buildBlockHeaderFromTxs = runInSpan('BlockBuilderHelpers', 'buildBlockHeaderFromTxs', async (span, txs, globalVariables, startSpongeBlob, db)=>{
176
+ span.setAttribute(Attributes.BLOCK_NUMBER, globalVariables.blockNumber);
177
+ const stateReference = new StateReference(await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db), new PartialStateReference(await getTreeSnapshot(MerkleTreeId.NOTE_HASH_TREE, db), await getTreeSnapshot(MerkleTreeId.NULLIFIER_TREE, db), await getTreeSnapshot(MerkleTreeId.PUBLIC_DATA_TREE, db)));
178
+ const previousArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
179
+ const blobFields = getBlockBlobFields(txs.map((tx)=>tx.txEffect));
180
+ const endSpongeBlob = startSpongeBlob.clone();
181
+ await endSpongeBlob.absorb(blobFields);
182
+ const spongeBlobHash = await endSpongeBlob.squeeze();
183
+ const txEffects = txs.map((tx)=>tx.txEffect);
184
+ const fees = txEffects.reduce((acc, tx)=>acc.add(tx.transactionFee), Fr.ZERO);
185
+ const manaUsed = txs.reduce((acc, tx)=>acc.add(new Fr(tx.gasUsed.billedGas.l2Gas)), Fr.ZERO);
186
+ return new BlockHeader(previousArchive, stateReference, spongeBlobHash, globalVariables, fees, manaUsed);
187
+ });
168
188
  /** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */ export async function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages) {
169
189
  const l1ToL2Messages = padArrayEnd(unpaddedL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
170
190
  const hasher = (left, right)=>Promise.resolve(sha256Trunc(Buffer.concat([
@@ -175,42 +195,6 @@ export const buildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'build
175
195
  const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
176
196
  return new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map((msg)=>msg.toBuffer())));
177
197
  }
178
- export function getBlobsHashFromBlobs(inputs) {
179
- return sha256ToField(inputs.map((b)=>b.getEthVersionedBlobHash()));
180
- }
181
- // Note: tested against the constant values in block_root/empty_block_root_rollup_inputs.nr, set by block_building_helpers.test.ts.
182
- // Having this separate fn hopefully makes it clear how we treat empty blocks and their blobs, and won't break if we decide to change how
183
- // getBlobsPerBlock() works on empty input.
184
- export async function getEmptyBlockBlobsHash() {
185
- const blobHash = (await Blob.getBlobsPerBlock([])).map((b)=>b.getEthVersionedBlobHash());
186
- return sha256ToField(blobHash);
187
- }
188
- // Validate that the roots of all local trees match the output of the root circuit simulation
189
- // TODO: does this get called?
190
- export async function validateBlockRootOutput(blockRootOutput, blockHeader, db) {
191
- await Promise.all([
192
- validateState(blockHeader.state, db),
193
- validateSimulatedTree(await getTreeSnapshot(MerkleTreeId.ARCHIVE, db), blockRootOutput.newArchive, 'Archive')
194
- ]);
195
- }
196
- export const validateState = runInSpan('BlockBuilderHelpers', 'validateState', async (_span, state, db)=>{
197
- const promises = [
198
- MerkleTreeId.NOTE_HASH_TREE,
199
- MerkleTreeId.NULLIFIER_TREE,
200
- MerkleTreeId.PUBLIC_DATA_TREE
201
- ].map(async (id)=>{
202
- return {
203
- key: id,
204
- value: await getTreeSnapshot(id, db)
205
- };
206
- });
207
- const snapshots = new Map((await Promise.all(promises)).map((obj)=>[
208
- obj.key,
209
- obj.value
210
- ]));
211
- validatePartialState(state.partial, snapshots);
212
- validateSimulatedTree(await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db), state.l1ToL2MessageTree, 'L1ToL2MessageTree');
213
- });
214
198
  export async function getLastSiblingPath(treeId, db) {
215
199
  const { size } = await db.getTreeInfo(treeId);
216
200
  const path = await db.getSiblingPath(treeId, size - 1n);
@@ -286,7 +270,7 @@ function validateSimulatedTree(localTree, simulatedTree, name, label) {
286
270
  }
287
271
  }
288
272
  export function validateTx(tx) {
289
- const txHeader = tx.data.constants.historicalHeader;
273
+ const txHeader = tx.data.constants.anchorBlockHeader;
290
274
  if (txHeader.state.l1ToL2MessageTree.isEmpty()) {
291
275
  throw new Error(`Empty L1 to L2 messages tree in tx: ${toFriendlyJSON(tx)}`);
292
276
  }
@@ -300,3 +284,8 @@ export function validateTx(tx) {
300
284
  throw new Error(`Empty public data tree in tx: ${toFriendlyJSON(tx)}`);
301
285
  }
302
286
  }
287
+ export function toProofData({ inputs, proof, verificationKey }, vkIndex) {
288
+ const leafIndex = vkIndex || getVKIndex(verificationKey.keyAsFields);
289
+ const vkData = new VkData(verificationKey, leafIndex, getVKSiblingPath(leafIndex));
290
+ return new ProofData(inputs, proof, vkData);
291
+ }
@@ -1,17 +1,20 @@
1
- import { BatchedBlobAccumulator, SpongeBlob } from '@aztec/blob-lib';
2
- import { type ARCHIVE_HEIGHT, type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
1
+ import type { SpongeBlob } from '@aztec/blob-lib';
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
- import type { Tuple } from '@aztec/foundation/serialize';
4
+ import { type Tuple } from '@aztec/foundation/serialize';
5
5
  import { type TreeNodeLocation } from '@aztec/foundation/trees';
6
- import type { EthAddress, L2Block } from '@aztec/stdlib/block';
7
6
  import type { PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
8
- import { type ParityPublicInputs, RootParityInputs } from '@aztec/stdlib/parity';
9
- import { type BaseOrMergeRollupPublicInputs, type BlockRootOrBlockMergePublicInputs, BlockRootRollupInputs, EmptyBlockRootRollupInputs, MergeRollupInputs, PaddingBlockRootRollupInputs, SingleTxBlockRootRollupInputs } from '@aztec/stdlib/rollup';
10
- import { AppendOnlyTreeSnapshot, type MerkleTreeId } from '@aztec/stdlib/trees';
11
- import { type BlockHeader, type GlobalVariables } from '@aztec/stdlib/tx';
12
- import type { EpochProvingState } from './epoch-proving-state.js';
7
+ import { type ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
8
+ import { BlockRollupPublicInputs, BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, CheckpointConstantData, TxMergeRollupPrivateInputs, type TxRollupPublicInputs } from '@aztec/stdlib/rollup';
9
+ import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
10
+ import { type BlockHeader, GlobalVariables } from '@aztec/stdlib/tx';
11
+ import type { UInt64 } from '@aztec/stdlib/types';
12
+ import type { CheckpointProvingState } from './checkpoint-proving-state.js';
13
13
  import type { TxProvingState } from './tx-proving-state.js';
14
- export type TreeSnapshots = Map<MerkleTreeId, AppendOnlyTreeSnapshot>;
14
+ export type ProofState<T, PROOF_LENGTH extends number> = {
15
+ provingOutput?: PublicInputsAndRecursiveProof<T, PROOF_LENGTH>;
16
+ isProving?: boolean;
17
+ };
15
18
  /**
16
19
  * The current state of the proving schedule for a given block. Managed by ProvingState.
17
20
  * Contains the raw inputs and intermediate state to generate every constituent proof in the tree.
@@ -19,60 +22,63 @@ export type TreeSnapshots = Map<MerkleTreeId, AppendOnlyTreeSnapshot>;
19
22
  export declare class BlockProvingState {
20
23
  #private;
21
24
  readonly index: number;
22
- readonly globalVariables: GlobalVariables;
23
- readonly newL1ToL2Messages: Fr[];
24
- readonly l1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot;
25
- private readonly l1ToL2MessageSubtreeSiblingPath;
26
- readonly l1ToL2MessageTreeSnapshotAfterInsertion: AppendOnlyTreeSnapshot;
27
- private readonly lastArchiveSnapshot;
25
+ readonly blockNumber: number;
26
+ readonly totalNumTxs: number;
27
+ private readonly constants;
28
+ private readonly timestamp;
29
+ readonly lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot;
28
30
  private readonly lastArchiveSiblingPath;
29
- private readonly newArchiveSiblingPath;
30
- private readonly previousBlockHeader;
31
- private readonly proverId;
32
- private readonly parentEpoch;
33
- private baseOrMergeProvingOutputs;
34
- private baseParityProvingOutputs;
35
- private rootParityProvingOutput;
36
- private blockRootProvingOutput;
37
- blockRootRollupStarted: boolean;
38
- block: L2Block | undefined;
39
- spongeBlobState: SpongeBlob | undefined;
40
- startBlobAccumulator: BatchedBlobAccumulator | undefined;
41
- endBlobAccumulator: BatchedBlobAccumulator | undefined;
42
- blobsHash: Fr | undefined;
43
- totalNumTxs: number;
31
+ private readonly lastL1ToL2MessageTreeSnapshot;
32
+ private readonly lastL1ToL2MessageSubtreeRootSiblingPath;
33
+ readonly newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot;
34
+ private readonly headerOfLastBlockInPreviousCheckpoint;
35
+ private readonly startSpongeBlob;
36
+ parentCheckpoint: CheckpointProvingState;
37
+ private baseOrMergeProofs;
38
+ private baseParityProofs;
39
+ private rootParityProof;
40
+ private blockRootProof;
41
+ private builtBlockHeader;
42
+ private endSpongeBlob;
44
43
  private txs;
45
- error: string | undefined;
46
- constructor(index: number, globalVariables: GlobalVariables, newL1ToL2Messages: Fr[], l1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, l1ToL2MessageSubtreeSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH>, l1ToL2MessageTreeSnapshotAfterInsertion: AppendOnlyTreeSnapshot, lastArchiveSnapshot: AppendOnlyTreeSnapshot, lastArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, previousBlockHeader: BlockHeader, proverId: EthAddress, parentEpoch: EpochProvingState);
47
- get blockNumber(): number;
48
- startNewBlock(numTxs: number, numBlobFields: number): void;
44
+ private isFirstBlock;
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, lastL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>, newL1ToL2MessageTreeSnapshot: AppendOnlyTreeSnapshot, headerOfLastBlockInPreviousCheckpoint: BlockHeader, startSpongeBlob: SpongeBlob, parentCheckpoint: CheckpointProvingState);
47
+ get epochNumber(): number;
49
48
  addNewTx(tx: TxProvingState): number;
50
- setBaseRollupProof(txIndex: number, provingOutput: PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
51
- setMergeRollupProof(location: TreeNodeLocation, provingOutput: PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): void;
49
+ isAcceptingTxs(): boolean;
50
+ getProcessedTxs(): import("@aztec/stdlib/tx").ProcessedTx[];
51
+ tryStartProvingBase(txIndex: number): boolean;
52
+ setBaseRollupProof(txIndex: number, provingOutput: PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
53
+ tryStartProvingMerge(location: TreeNodeLocation): boolean;
54
+ setMergeRollupProof(location: TreeNodeLocation, provingOutput: PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): void;
55
+ tryStartProvingBaseParity(index: number): boolean;
52
56
  setBaseParityProof(index: number, provingOutput: PublicInputsAndRecursiveProof<ParityPublicInputs>): void;
57
+ tryStartProvingRootParity(): boolean;
53
58
  setRootParityProof(provingOutput: PublicInputsAndRecursiveProof<ParityPublicInputs>): void;
54
- setBlockRootRollupProof(provingOutput: PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): void;
55
- setBlock(block: L2Block): void;
56
- setStartBlobAccumulator(accumulator: BatchedBlobAccumulator): void;
57
- setEndBlobAccumulator(accumulator: BatchedBlobAccumulator): void;
58
- accumulateBlobs(): Promise<void>;
59
- get allTxs(): TxProvingState[];
60
- /** Returns the block number as an epoch number. Used for prioritizing proof requests. */
61
- get epochNumber(): number;
59
+ tryStartProvingBlockRoot(): boolean;
60
+ setBlockRootRollupProof(provingOutput: PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
61
+ getBlockRootRollupOutput(): BlockRollupPublicInputs | undefined;
62
+ setBuiltBlockHeader(blockHeader: BlockHeader): void;
63
+ getBuiltBlockHeader(): BlockHeader | undefined;
64
+ getGlobalVariables(): GlobalVariables;
65
+ getStartSpongeBlob(): SpongeBlob;
66
+ setEndSpongeBlob(endSpongeBlob: SpongeBlob): void;
67
+ getEndSpongeBlob(): SpongeBlob | undefined;
68
+ getTxEffects(): import("@aztec/stdlib/tx").TxEffect[];
62
69
  getParentLocation(location: TreeNodeLocation): TreeNodeLocation;
63
- getMergeRollupInputs(mergeLocation: TreeNodeLocation): MergeRollupInputs;
64
- getBlockRootRollupTypeAndInputs(): Promise<{
70
+ getMergeRollupInputs(mergeLocation: TreeNodeLocation): TxMergeRollupPrivateInputs;
71
+ getBlockRootRollupTypeAndInputs(): {
65
72
  rollupType: string;
66
- inputs: EmptyBlockRootRollupInputs;
73
+ inputs: BlockRootEmptyTxFirstRollupPrivateInputs;
67
74
  } | {
68
75
  rollupType: string;
69
- inputs: SingleTxBlockRootRollupInputs;
76
+ inputs: BlockRootSingleTxRollupPrivateInputs;
70
77
  } | {
71
78
  rollupType: string;
72
- inputs: BlockRootRollupInputs;
73
- }>;
74
- getPaddingBlockRootInputs(): PaddingBlockRootRollupInputs;
75
- getRootParityInputs(): RootParityInputs;
79
+ inputs: BlockRootRollupPrivateInputs;
80
+ };
81
+ getParityRootInputs(): ParityRootPrivateInputs;
76
82
  getTxProvingState(txIndex: number): TxProvingState;
77
83
  buildHeaderFromProvingOutputs(): Promise<BlockHeader>;
78
84
  isReadyForMergeRollup(location: TreeNodeLocation): boolean;
@@ -80,6 +86,7 @@ export declare class BlockProvingState {
80
86
  isReadyForRootParity(): boolean;
81
87
  isComplete(): boolean;
82
88
  verifyState(): boolean;
89
+ getError(): string | undefined;
83
90
  reject(reason: string): void;
84
91
  }
85
92
  //# sourceMappingURL=block-proving-state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-proving-state.d.ts","sourceRoot":"","sources":["../../src/orchestrator/block-proving-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAA+B,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,wCAAwC,EAC7C,KAAK,yCAAyC,EAG/C,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAc,EAA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