@aztec/prover-client 0.0.0-test.0 → 0.0.1-commit.21caa21

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 (147) hide show
  1. package/dest/block-factory/index.d.ts +2 -0
  2. package/dest/block-factory/index.d.ts.map +1 -0
  3. package/dest/block-factory/light.d.ts +38 -0
  4. package/dest/block-factory/light.d.ts.map +1 -0
  5. package/dest/block-factory/light.js +108 -0
  6. package/dest/config.d.ts +7 -7
  7. package/dest/config.d.ts.map +1 -1
  8. package/dest/config.js +11 -1
  9. package/dest/index.d.ts +1 -1
  10. package/dest/light/lightweight_checkpoint_builder.d.ts +28 -0
  11. package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -0
  12. package/dest/light/lightweight_checkpoint_builder.js +107 -0
  13. package/dest/mocks/fixtures.d.ts +8 -8
  14. package/dest/mocks/fixtures.d.ts.map +1 -1
  15. package/dest/mocks/fixtures.js +32 -14
  16. package/dest/mocks/test_context.d.ts +40 -31
  17. package/dest/mocks/test_context.d.ts.map +1 -1
  18. package/dest/mocks/test_context.js +134 -86
  19. package/dest/orchestrator/block-building-helpers.d.ts +36 -29
  20. package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
  21. package/dest/orchestrator/block-building-helpers.js +168 -188
  22. package/dest/orchestrator/block-proving-state.d.ts +68 -47
  23. package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
  24. package/dest/orchestrator/block-proving-state.js +281 -176
  25. package/dest/orchestrator/checkpoint-proving-state.d.ts +62 -0
  26. package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -0
  27. package/dest/orchestrator/checkpoint-proving-state.js +208 -0
  28. package/dest/orchestrator/epoch-proving-state.d.ts +40 -26
  29. package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
  30. package/dest/orchestrator/epoch-proving-state.js +143 -73
  31. package/dest/orchestrator/index.d.ts +1 -1
  32. package/dest/orchestrator/orchestrator.d.ts +35 -32
  33. package/dest/orchestrator/orchestrator.d.ts.map +1 -1
  34. package/dest/orchestrator/orchestrator.js +389 -239
  35. package/dest/orchestrator/orchestrator_metrics.d.ts +3 -1
  36. package/dest/orchestrator/orchestrator_metrics.d.ts.map +1 -1
  37. package/dest/orchestrator/orchestrator_metrics.js +9 -0
  38. package/dest/orchestrator/tx-proving-state.d.ts +13 -11
  39. package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
  40. package/dest/orchestrator/tx-proving-state.js +23 -40
  41. package/dest/prover-client/factory.d.ts +1 -1
  42. package/dest/prover-client/index.d.ts +1 -1
  43. package/dest/prover-client/prover-client.d.ts +4 -4
  44. package/dest/prover-client/prover-client.d.ts.map +1 -1
  45. package/dest/prover-client/prover-client.js +5 -4
  46. package/dest/prover-client/server-epoch-prover.d.ts +15 -11
  47. package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
  48. package/dest/prover-client/server-epoch-prover.js +11 -11
  49. package/dest/proving_broker/broker_prover_facade.d.ts +23 -16
  50. package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
  51. package/dest/proving_broker/broker_prover_facade.js +67 -41
  52. package/dest/proving_broker/config.d.ts +18 -9
  53. package/dest/proving_broker/config.d.ts.map +1 -1
  54. package/dest/proving_broker/config.js +22 -5
  55. package/dest/proving_broker/factory.d.ts +2 -2
  56. package/dest/proving_broker/factory.d.ts.map +1 -1
  57. package/dest/proving_broker/factory.js +5 -1
  58. package/dest/proving_broker/fixtures.d.ts +3 -2
  59. package/dest/proving_broker/fixtures.d.ts.map +1 -1
  60. package/dest/proving_broker/fixtures.js +2 -1
  61. package/dest/proving_broker/index.d.ts +1 -1
  62. package/dest/proving_broker/proof_store/factory.d.ts +2 -2
  63. package/dest/proving_broker/proof_store/factory.js +1 -1
  64. package/dest/proving_broker/proof_store/gcs_proof_store.d.ts +1 -1
  65. package/dest/proving_broker/proof_store/gcs_proof_store.d.ts.map +1 -1
  66. package/dest/proving_broker/proof_store/gcs_proof_store.js +1 -0
  67. package/dest/proving_broker/proof_store/index.d.ts +2 -1
  68. package/dest/proving_broker/proof_store/index.d.ts.map +1 -1
  69. package/dest/proving_broker/proof_store/index.js +1 -0
  70. package/dest/proving_broker/proof_store/inline_proof_store.d.ts +1 -1
  71. package/dest/proving_broker/proof_store/inline_proof_store.d.ts.map +1 -1
  72. package/dest/proving_broker/proof_store/proof_store.d.ts +1 -1
  73. package/dest/proving_broker/proving_agent.d.ts +4 -4
  74. package/dest/proving_broker/proving_agent.d.ts.map +1 -1
  75. package/dest/proving_broker/proving_agent.js +83 -47
  76. package/dest/proving_broker/proving_agent_instrumentation.d.ts +1 -1
  77. package/dest/proving_broker/proving_agent_instrumentation.d.ts.map +1 -1
  78. package/dest/proving_broker/proving_broker.d.ts +13 -4
  79. package/dest/proving_broker/proving_broker.d.ts.map +1 -1
  80. package/dest/proving_broker/proving_broker.js +36 -23
  81. package/dest/proving_broker/proving_broker_database/memory.d.ts +3 -2
  82. package/dest/proving_broker/proving_broker_database/memory.d.ts.map +1 -1
  83. package/dest/proving_broker/proving_broker_database/memory.js +1 -1
  84. package/dest/proving_broker/proving_broker_database/persisted.d.ts +3 -2
  85. package/dest/proving_broker/proving_broker_database/persisted.d.ts.map +1 -1
  86. package/dest/proving_broker/proving_broker_database/persisted.js +12 -10
  87. package/dest/proving_broker/proving_broker_database.d.ts +3 -2
  88. package/dest/proving_broker/proving_broker_database.d.ts.map +1 -1
  89. package/dest/proving_broker/proving_broker_instrumentation.d.ts +1 -1
  90. package/dest/proving_broker/proving_broker_instrumentation.d.ts.map +1 -1
  91. package/dest/proving_broker/proving_job_controller.d.ts +9 -9
  92. package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
  93. package/dest/proving_broker/proving_job_controller.js +89 -61
  94. package/dest/proving_broker/rpc.d.ts +4 -6
  95. package/dest/proving_broker/rpc.d.ts.map +1 -1
  96. package/dest/proving_broker/rpc.js +1 -4
  97. package/dest/test/mock_proof_store.d.ts +9 -0
  98. package/dest/test/mock_proof_store.d.ts.map +1 -0
  99. package/dest/test/mock_proof_store.js +10 -0
  100. package/dest/test/mock_prover.d.ts +23 -17
  101. package/dest/test/mock_prover.d.ts.map +1 -1
  102. package/dest/test/mock_prover.js +38 -20
  103. package/package.json +32 -31
  104. package/src/block-factory/index.ts +1 -0
  105. package/src/block-factory/light.ts +137 -0
  106. package/src/config.ts +24 -8
  107. package/src/light/lightweight_checkpoint_builder.ts +142 -0
  108. package/src/mocks/fixtures.ts +42 -37
  109. package/src/mocks/test_context.ts +207 -115
  110. package/src/orchestrator/block-building-helpers.ts +256 -333
  111. package/src/orchestrator/block-proving-state.ts +323 -230
  112. package/src/orchestrator/checkpoint-proving-state.ts +301 -0
  113. package/src/orchestrator/epoch-proving-state.ts +187 -112
  114. package/src/orchestrator/orchestrator.ts +592 -299
  115. package/src/orchestrator/orchestrator_metrics.ts +20 -1
  116. package/src/orchestrator/tx-proving-state.ts +50 -64
  117. package/src/prover-client/prover-client.ts +16 -14
  118. package/src/prover-client/server-epoch-prover.ts +39 -21
  119. package/src/proving_broker/broker_prover_facade.ts +214 -126
  120. package/src/proving_broker/config.ts +24 -6
  121. package/src/proving_broker/factory.ts +2 -1
  122. package/src/proving_broker/fixtures.ts +7 -2
  123. package/src/proving_broker/proof_store/factory.ts +1 -1
  124. package/src/proving_broker/proof_store/gcs_proof_store.ts +5 -1
  125. package/src/proving_broker/proof_store/index.ts +1 -0
  126. package/src/proving_broker/proof_store/inline_proof_store.ts +1 -1
  127. package/src/proving_broker/proving_agent.ts +89 -47
  128. package/src/proving_broker/proving_broker.ts +53 -33
  129. package/src/proving_broker/proving_broker_database/memory.ts +3 -2
  130. package/src/proving_broker/proving_broker_database/persisted.ts +14 -12
  131. package/src/proving_broker/proving_broker_database.ts +2 -1
  132. package/src/proving_broker/proving_job_controller.ts +94 -82
  133. package/src/proving_broker/rpc.ts +1 -6
  134. package/src/test/mock_proof_store.ts +14 -0
  135. package/src/test/mock_prover.ts +164 -60
  136. package/dest/bin/get-proof-inputs.d.ts +0 -2
  137. package/dest/bin/get-proof-inputs.d.ts.map +0 -1
  138. package/dest/bin/get-proof-inputs.js +0 -51
  139. package/dest/block_builder/index.d.ts +0 -6
  140. package/dest/block_builder/index.d.ts.map +0 -1
  141. package/dest/block_builder/light.d.ts +0 -33
  142. package/dest/block_builder/light.d.ts.map +0 -1
  143. package/dest/block_builder/light.js +0 -82
  144. package/src/bin/get-proof-inputs.ts +0 -59
  145. package/src/block_builder/index.ts +0 -6
  146. package/src/block_builder/light.ts +0 -101
  147. /package/dest/{block_builder → block-factory}/index.js +0 -0
@@ -1,209 +1,206 @@
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 { BatchedBlobAccumulator, computeBlobsHashFromBlobs, encodeBlockBlobData, 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, 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 { sha256Trunc } from '@aztec/foundation/crypto';
6
5
  import { Fr } from '@aztec/foundation/fields';
7
- import { assertLength, serializeToBuffer, toFriendlyJSON } from '@aztec/foundation/serialize';
8
- import { MembershipWitness, MerkleTreeCalculator, computeUnbalancedMerkleRoot } from '@aztec/foundation/trees';
9
- import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
10
- import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
6
+ import { assertLength, toFriendlyJSON } from '@aztec/foundation/serialize';
7
+ import { MembershipWitness } from '@aztec/foundation/trees';
8
+ import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
9
+ import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
11
10
  import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
12
- import { PublicDataHint } from '@aztec/stdlib/avm';
13
11
  import { Body } from '@aztec/stdlib/block';
14
- import { ContractClassLog } from '@aztec/stdlib/logs';
15
- import { ConstantRollupData, 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, TxEffect } from '@aztec/stdlib/tx';
12
+ import { ContractClassLogFields } from '@aztec/stdlib/logs';
13
+ import { Proof, ProofData, RecursiveProof } from '@aztec/stdlib/proofs';
14
+ import { BlockConstantData, PrivateBaseRollupHints, PublicBaseRollupHints, PublicChonkVerifierPrivateInputs, TreeSnapshotDiffHints } from '@aztec/stdlib/rollup';
15
+ import { AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafPreimage, getTreeHeight } from '@aztec/stdlib/trees';
16
+ import { BlockHeader, GlobalVariables, PartialStateReference } from '@aztec/stdlib/tx';
17
+ import { VkData } from '@aztec/stdlib/vks';
18
18
  import { Attributes, runInSpan } from '@aztec/telemetry-client';
19
- import { inspect } from 'util';
20
19
  // Builds the hints for base rollup. Updating the contract, nullifier, and data trees in the process.
21
- export const buildBaseRollupHints = runInSpan('BlockBuilderHelpers', 'buildBaseRollupHints', async (span, tx, globalVariables, db, startSpongeBlob)=>{
20
+ export const insertSideEffectsAndBuildBaseRollupHints = runInSpan('BlockBuilderHelpers', 'buildBaseRollupHints', async (span, tx, lastArchive, newL1ToL2MessageTreeSnapshot, startSpongeBlob, proverId, db)=>{
22
21
  span.setAttribute(Attributes.TX_HASH, tx.hash.toString());
23
22
  // Get trees info before any changes hit
24
- const constants = await getConstantRollupData(globalVariables, db);
25
23
  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 paths for the circuit
27
- const noteHashSubtreeSiblingPathArray = await getSubtreeSiblingPath(MerkleTreeId.NOTE_HASH_TREE, NOTE_HASH_SUBTREE_HEIGHT, db);
28
- const noteHashSubtreeSiblingPath = makeTuple(NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, (i)=>i < noteHashSubtreeSiblingPathArray.length ? noteHashSubtreeSiblingPathArray[i] : Fr.ZERO);
29
- // Update the note hash trees with the new items being inserted to get the new roots
30
- // that will be used by the next iteration of the base rollup circuit, skipping the empty ones
31
- const noteHashes = padArrayEnd(tx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX);
32
- 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
- // The read witnesses for a given TX should be generated before the writes of the same TX are applied.
37
- // All reads that refer to writes in the same tx are transient and can be simplified out.
38
- const txPublicDataUpdateRequestInfo = await processPublicDataUpdateRequests(tx, db);
39
- // Update the nullifier tree, capturing the low nullifier info for each individual operation
40
- 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);
41
- if (nullifierWitnessLeaves === undefined) {
42
- throw new Error(`Could not craft nullifier batch insertion proofs`);
43
- }
44
- // Extract witness objects from returned data
45
- const nullifierPredecessorMembershipWitnessesWithoutPadding = nullifierWitnessLeaves.map((l)=>MembershipWitness.fromBufferArray(l.index, assertLength(l.siblingPath.toBufferArray(), NULLIFIER_TREE_HEIGHT)));
46
- const nullifierSubtreeSiblingPathArray = nullifiersSubtreeSiblingPath.toFields();
47
- const nullifierSubtreeSiblingPath = makeTuple(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, (i)=>i < nullifierSubtreeSiblingPathArray.length ? nullifierSubtreeSiblingPathArray[i] : Fr.ZERO);
48
- // Append new data to startSpongeBlob
49
- const inputSpongeBlob = startSpongeBlob.clone();
50
- await startSpongeBlob.absorb(tx.txEffect.toBlobFields());
51
- const contractClassLogsPreimages = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, (i)=>tx.txEffect.contractClassLogs[i]?.toUnsiloed() || ContractClassLog.empty());
24
+ // Get the note hash subtree root sibling path for insertion.
25
+ const noteHashSubtreeRootSiblingPath = assertLength(await getSubtreeSiblingPath(MerkleTreeId.NOTE_HASH_TREE, NOTE_HASH_SUBTREE_HEIGHT, db), NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH);
26
+ const { nullifierInsertionResult, publicDataInsertionResult } = await insertSideEffects(tx, db);
27
+ const blockHash = await tx.data.constants.anchorBlockHeader.hash();
28
+ const anchorBlockArchiveSiblingPath = (await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db)).siblingPath;
29
+ const contractClassLogsFields = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, (i)=>tx.txEffect.contractClassLogs[i]?.fields || ContractClassLogFields.empty());
52
30
  if (tx.avmProvingRequest) {
53
- const blockHash = await tx.constants.historicalHeader.hash();
54
- const archiveRootMembershipWitness = await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db);
55
31
  return PublicBaseRollupHints.from({
56
- startSpongeBlob: inputSpongeBlob,
57
- archiveRootMembershipWitness,
58
- contractClassLogsPreimages,
59
- constants
32
+ startSpongeBlob,
33
+ lastArchive,
34
+ anchorBlockArchiveSiblingPath,
35
+ contractClassLogsFields
60
36
  });
61
37
  } else {
62
- if (txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses.length > 1 || txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages.length > 1 || txPublicDataUpdateRequestInfo.publicDataWritesSiblingPaths.length > 1) {
38
+ if (tx.txEffect.publicDataWrites.length > 1) {
63
39
  throw new Error(`More than one public data write in a private only tx`);
64
40
  }
65
- const feeWriteLowLeafPreimage = txPublicDataUpdateRequestInfo.lowPublicDataWritesPreimages[0] || PublicDataTreeLeafPreimage.empty();
66
- const feeWriteLowLeafMembershipWitness = txPublicDataUpdateRequestInfo.lowPublicDataWritesMembershipWitnesses[0] || MembershipWitness.empty(PUBLIC_DATA_TREE_HEIGHT);
67
- const feeWriteSiblingPath = txPublicDataUpdateRequestInfo.publicDataWritesSiblingPaths[0] || makeTuple(PUBLIC_DATA_TREE_HEIGHT, ()=>Fr.ZERO);
68
- const stateDiffHints = PrivateBaseStateDiffHints.from({
69
- nullifierPredecessorPreimages: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>i < nullifierWitnessLeaves.length ? nullifierWitnessLeaves[i].leafPreimage : NullifierLeafPreimage.empty()),
70
- nullifierPredecessorMembershipWitnesses: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>i < nullifierPredecessorMembershipWitnessesWithoutPadding.length ? nullifierPredecessorMembershipWitnessesWithoutPadding[i] : makeEmptyMembershipWitness(NULLIFIER_TREE_HEIGHT)),
71
- sortedNullifiers: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>Fr.fromBuffer(sortednullifiers[i])),
72
- sortedNullifierIndexes: makeTuple(MAX_NULLIFIERS_PER_TX, (i)=>sortedNewLeavesIndexes[i]),
73
- noteHashSubtreeSiblingPath,
74
- nullifierSubtreeSiblingPath,
75
- feeWriteLowLeafPreimage,
76
- feeWriteLowLeafMembershipWitness,
77
- feeWriteSiblingPath
41
+ // Get hints for reading fee payer's balance in the public data tree.
42
+ const feePayerBalanceLeafWitnessData = publicDataInsertionResult.lowLeavesWitnessData[0];
43
+ const feePayerBalanceMembershipWitness = MembershipWitness.fromBufferArray(feePayerBalanceLeafWitnessData.index, assertLength(feePayerBalanceLeafWitnessData.siblingPath.toBufferArray(), PUBLIC_DATA_TREE_HEIGHT));
44
+ const feePayerBalanceLeafPreimage = feePayerBalanceLeafWitnessData.leafPreimage;
45
+ const leafSlot = await computeFeePayerBalanceLeafSlot(tx.data.feePayer);
46
+ if (!leafSlot.equals(feePayerBalanceLeafPreimage.leaf.slot)) {
47
+ throw new Error(`Cannot find the public data tree leaf for the fee payer's balance`);
48
+ }
49
+ // Get hints for inserting the nullifiers.
50
+ const nullifierLowLeavesWitnessData = nullifierInsertionResult.lowLeavesWitnessData;
51
+ const nullifierPredecessorPreimages = padArrayEnd(nullifierLowLeavesWitnessData.map((l)=>l.leafPreimage), NullifierLeafPreimage.empty(), MAX_NULLIFIERS_PER_TX);
52
+ const nullifierPredecessorMembershipWitnesses = padArrayEnd(nullifierLowLeavesWitnessData.map((l)=>MembershipWitness.fromBufferArray(l.index, assertLength(l.siblingPath.toBufferArray(), NULLIFIER_TREE_HEIGHT))), makeEmptyMembershipWitness(NULLIFIER_TREE_HEIGHT), MAX_NULLIFIERS_PER_TX);
53
+ const sortedNullifiers = assertLength(nullifierInsertionResult.sortedNewLeaves.map((n)=>Fr.fromBuffer(n)), MAX_NULLIFIERS_PER_TX);
54
+ const sortedNullifierIndexes = assertLength(nullifierInsertionResult.sortedNewLeavesIndexes, MAX_NULLIFIERS_PER_TX);
55
+ const nullifierSubtreeRootSiblingPath = assertLength(nullifierInsertionResult.newSubtreeSiblingPath.toFields(), NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH);
56
+ const treeSnapshotDiffHints = TreeSnapshotDiffHints.from({
57
+ noteHashSubtreeRootSiblingPath,
58
+ nullifierPredecessorPreimages,
59
+ nullifierPredecessorMembershipWitnesses,
60
+ sortedNullifiers,
61
+ sortedNullifierIndexes,
62
+ nullifierSubtreeRootSiblingPath,
63
+ feePayerBalanceMembershipWitness
64
+ });
65
+ const constants = BlockConstantData.from({
66
+ lastArchive,
67
+ l1ToL2TreeSnapshot: newL1ToL2MessageTreeSnapshot,
68
+ vkTreeRoot: tx.data.constants.vkTreeRoot,
69
+ protocolContractsHash: tx.data.constants.protocolContractsHash,
70
+ globalVariables: tx.globalVariables,
71
+ proverId
78
72
  });
79
- const blockHash = await tx.constants.historicalHeader.hash();
80
- const archiveRootMembershipWitness = await getMembershipWitnessFor(blockHash, MerkleTreeId.ARCHIVE, ARCHIVE_HEIGHT, db);
81
73
  return PrivateBaseRollupHints.from({
82
74
  start,
83
- startSpongeBlob: inputSpongeBlob,
84
- stateDiffHints,
85
- feePayerFeeJuiceBalanceReadHint,
86
- archiveRootMembershipWitness,
87
- contractClassLogsPreimages,
75
+ startSpongeBlob,
76
+ treeSnapshotDiffHints,
77
+ feePayerBalanceLeafPreimage,
78
+ anchorBlockArchiveSiblingPath,
79
+ contractClassLogsFields,
88
80
  constants
89
81
  });
90
82
  }
91
83
  });
92
- export async function getPublicDataHint(db, leafSlot) {
93
- const { index } = await db.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot) ?? {};
94
- if (index === undefined) {
95
- throw new Error(`Cannot find the previous value index for public data ${leafSlot}.`);
84
+ export const insertSideEffects = runInSpan('BlockBuilderHelpers', 'buildBaseRollupHints', async (span, tx, db)=>{
85
+ span.setAttribute(Attributes.TX_HASH, tx.hash.toString());
86
+ // Insert the note hashes. Padded with zeros to the max number of note hashes per tx.
87
+ const noteHashes = padArrayEnd(tx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX);
88
+ await db.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, noteHashes);
89
+ // Insert the nullifiers. Padded with zeros to the max number of nullifiers per tx.
90
+ // Capturing the low nullifier info for each individual operation.
91
+ const nullifierInsertionResult = await db.batchInsert(MerkleTreeId.NULLIFIER_TREE, padArrayEnd(tx.txEffect.nullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX).map((n)=>n.toBuffer()), NULLIFIER_SUBTREE_HEIGHT);
92
+ if (nullifierInsertionResult.lowLeavesWitnessData === undefined) {
93
+ throw new Error(`Failed to batch insert nullifiers.`);
96
94
  }
97
- const siblingPath = await db.getSiblingPath(MerkleTreeId.PUBLIC_DATA_TREE, index);
98
- const membershipWitness = new MembershipWitness(PUBLIC_DATA_TREE_HEIGHT, index, siblingPath.toTuple());
99
- const leafPreimage = await db.getLeafPreimage(MerkleTreeId.PUBLIC_DATA_TREE, index);
100
- if (!leafPreimage) {
101
- throw new Error(`Cannot find the leaf preimage for public data tree at index ${index}.`);
95
+ if (tx.txEffect.publicDataWrites.some((write)=>write.isEmpty())) {
96
+ throw new Error(`Empty public data write in tx: ${toFriendlyJSON(tx)}.`);
102
97
  }
103
- const exists = leafPreimage.slot.toBigInt() === leafSlot;
104
- const value = exists ? leafPreimage.value : Fr.ZERO;
105
- return new PublicDataHint(new Fr(leafSlot), value, membershipWitness, leafPreimage);
98
+ // Insert the public data writes sequentially. No need to pad them to the max array size.
99
+ // Capturing the low leaf info for each individual operation.
100
+ const publicDataInsertionResult = await db.sequentialInsert(MerkleTreeId.PUBLIC_DATA_TREE, tx.txEffect.publicDataWrites.map((write)=>write.toBuffer()));
101
+ return {
102
+ nullifierInsertionResult,
103
+ publicDataInsertionResult
104
+ };
105
+ });
106
+ export function getChonkProofFromTx(tx) {
107
+ const publicInputs = tx.data.publicInputs().toFields();
108
+ const binaryProof = new Proof(Buffer.concat(tx.chonkProof.attachPublicInputs(publicInputs).fieldsWithPublicInputs.map((field)=>field.toBuffer())), publicInputs.length);
109
+ return new RecursiveProof(tx.chonkProof.fields, binaryProof, true, CHONK_PROOF_LENGTH);
106
110
  }
107
- export const buildBlobHints = runInSpan('BlockBuilderHelpers', 'buildBlobHints', async (_span, txEffects)=>{
108
- const blobFields = txEffects.flatMap((tx)=>tx.toBlobFields());
109
- const blobs = await Blob.getBlobs(blobFields);
110
- const blobCommitments = blobs.map((b)=>b.commitmentToFields());
111
- const blobsHash = new Fr(getBlobsHashFromBlobs(blobs));
111
+ export function getPublicChonkVerifierPrivateInputsFromTx(tx, proverId) {
112
+ const proofData = new ProofData(tx.data.toPrivateToPublicKernelCircuitPublicInputs(), getChonkProofFromTx(tx), getVkData('HidingKernelToPublic'));
113
+ return new PublicChonkVerifierPrivateInputs(proofData, proverId);
114
+ }
115
+ // Build "hints" as the private inputs for the checkpoint root rollup circuit.
116
+ // The `blobCommitments` will be accumulated and checked in the root rollup against the `finalBlobChallenges`.
117
+ // The `blobsHash` will be validated on L1 against the submitted blob data.
118
+ export const buildBlobHints = (blobFields)=>{
119
+ const blobs = getBlobsPerL1Block(blobFields);
120
+ const blobCommitments = getBlobCommitmentsFromBlobs(blobs);
121
+ const blobsHash = computeBlobsHashFromBlobs(blobs);
112
122
  return {
113
- blobFields,
114
123
  blobCommitments,
115
124
  blobs,
116
125
  blobsHash
117
126
  };
127
+ };
128
+ export const buildFinalBlobChallenges = async (blobFieldsPerCheckpoint)=>{
129
+ return await BatchedBlobAccumulator.precomputeBatchedBlobChallenges(blobFieldsPerCheckpoint);
130
+ };
131
+ export const accumulateBlobs = runInSpan('BlockBuilderHelpers', 'accumulateBlobs', async (_span, blobFields, startBlobAccumulator)=>{
132
+ const endBlobAccumulator = await startBlobAccumulator.accumulateFields(blobFields);
133
+ return endBlobAccumulator;
118
134
  });
119
- export const buildHeaderFromCircuitOutputs = runInSpan('BlockBuilderHelpers', 'buildHeaderFromCircuitOutputs', async (_span, previousRollupData, parityPublicInputs, rootRollupOutputs, endState, logger)=>{
120
- if (previousRollupData.length > 2) {
121
- throw new Error(`There can't be more than 2 previous rollups. Received ${previousRollupData.length}.`);
122
- }
123
- const blobsHash = rootRollupOutputs.blobPublicInputs[0].getBlobsHash();
124
- const numTxs = previousRollupData.reduce((sum, d)=>sum + d.numTxs, 0);
125
- const outHash = previousRollupData.length === 0 ? Fr.ZERO.toBuffer() : previousRollupData.length === 1 ? previousRollupData[0].outHash.toBuffer() : sha256Trunc(Buffer.concat([
126
- previousRollupData[0].outHash.toBuffer(),
127
- previousRollupData[1].outHash.toBuffer()
128
- ]));
129
- const contentCommitment = new ContentCommitment(new Fr(numTxs), blobsHash, parityPublicInputs.shaRoot.toBuffer(), outHash);
130
- const accumulatedFees = previousRollupData.reduce((sum, d)=>sum.add(d.accumulatedFees), Fr.ZERO);
131
- const accumulatedManaUsed = previousRollupData.reduce((sum, d)=>sum.add(d.accumulatedManaUsed), Fr.ZERO);
132
- const header = new BlockHeader(rootRollupOutputs.previousArchive, contentCommitment, endState, rootRollupOutputs.endGlobalVariables, accumulatedFees, accumulatedManaUsed);
133
- if (!(await header.hash()).equals(rootRollupOutputs.endBlockHash)) {
134
- logger?.error(`Block header mismatch when building header from circuit outputs.` + `\n\nHeader: ${inspect(header)}` + `\n\nCircuit: ${toFriendlyJSON(rootRollupOutputs)}`);
135
- throw new Error(`Block header mismatch when building from circuit outputs`);
136
- }
137
- return header;
135
+ export const buildHeaderFromCircuitOutputs = runInSpan('BlockBuilderHelpers', 'buildHeaderFromCircuitOutputs', async (_span, blockRootRollupOutput)=>{
136
+ const constants = blockRootRollupOutput.constants;
137
+ const globalVariables = GlobalVariables.from({
138
+ chainId: constants.chainId,
139
+ version: constants.version,
140
+ blockNumber: blockRootRollupOutput.previousArchive.nextAvailableLeafIndex,
141
+ timestamp: blockRootRollupOutput.endTimestamp,
142
+ slotNumber: constants.slotNumber,
143
+ coinbase: constants.coinbase,
144
+ feeRecipient: constants.feeRecipient,
145
+ gasFees: constants.gasFees
146
+ });
147
+ const spongeBlobHash = await blockRootRollupOutput.endSpongeBlob.clone().squeeze();
148
+ return new BlockHeader(blockRootRollupOutput.previousArchive, blockRootRollupOutput.endState, spongeBlobHash, globalVariables, blockRootRollupOutput.accumulatedFees, blockRootRollupOutput.accumulatedManaUsed);
138
149
  });
139
- export const buildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'buildHeaderAndBodyFromTxs', async (span, txs, globalVariables, l1ToL2Messages, db)=>{
140
- span.setAttribute(Attributes.BLOCK_NUMBER, globalVariables.blockNumber.toNumber());
141
- 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)));
142
- const previousArchive = await getTreeSnapshot(MerkleTreeId.ARCHIVE, db);
150
+ export const buildHeaderAndBodyFromTxs = runInSpan('BlockBuilderHelpers', 'buildHeaderAndBodyFromTxs', async (span, txs, lastArchive, endState, globalVariables, startSpongeBlob, isFirstBlock)=>{
151
+ span.setAttribute(Attributes.BLOCK_NUMBER, globalVariables.blockNumber);
143
152
  const txEffects = txs.map((tx)=>tx.txEffect);
144
153
  const body = new Body(txEffects);
145
- const numTxs = body.txEffects.length;
146
- const outHash = numTxs === 0 ? Fr.ZERO.toBuffer() : numTxs === 1 ? body.txEffects[0].txOutHash() : computeUnbalancedMerkleRoot(body.txEffects.map((tx)=>tx.txOutHash()), TxEffect.empty().txOutHash());
147
- l1ToL2Messages = padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
148
- const hasher = (left, right)=>Promise.resolve(sha256Trunc(Buffer.concat([
149
- left,
150
- right
151
- ])));
152
- const parityHeight = Math.ceil(Math.log2(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
153
- const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
154
- const parityShaRoot = await parityCalculator.computeTreeRoot(l1ToL2Messages.map((msg)=>msg.toBuffer()));
155
- const blobsHash = getBlobsHashFromBlobs(await Blob.getBlobs(body.toBlobFields()));
156
- const contentCommitment = new ContentCommitment(new Fr(numTxs), blobsHash, parityShaRoot, outHash);
157
- const fees = body.txEffects.reduce((acc, tx)=>acc.add(tx.transactionFee), Fr.ZERO);
158
- const manaUsed = txs.reduce((acc, tx)=>acc.add(new Fr(tx.gasUsed.billedGas.l2Gas)), Fr.ZERO);
159
- const header = new BlockHeader(previousArchive, contentCommitment, stateReference, globalVariables, fees, manaUsed);
154
+ const totalFees = txEffects.reduce((acc, tx)=>acc.add(tx.transactionFee), Fr.ZERO);
155
+ const totalManaUsed = txs.reduce((acc, tx)=>acc.add(new Fr(tx.gasUsed.billedGas.l2Gas)), Fr.ZERO);
156
+ const { l1ToL2MessageTree, partial } = endState;
157
+ const blockBlobFields = encodeBlockBlobData({
158
+ blockEndMarker: {
159
+ timestamp: globalVariables.timestamp,
160
+ blockNumber: globalVariables.blockNumber,
161
+ numTxs: txs.length
162
+ },
163
+ blockEndStateField: {
164
+ l1ToL2MessageNextAvailableLeafIndex: l1ToL2MessageTree.nextAvailableLeafIndex,
165
+ noteHashNextAvailableLeafIndex: partial.noteHashTree.nextAvailableLeafIndex,
166
+ nullifierNextAvailableLeafIndex: partial.nullifierTree.nextAvailableLeafIndex,
167
+ publicDataNextAvailableLeafIndex: partial.publicDataTree.nextAvailableLeafIndex,
168
+ totalManaUsed: totalManaUsed.toBigInt()
169
+ },
170
+ lastArchiveRoot: lastArchive.root,
171
+ noteHashRoot: partial.noteHashTree.root,
172
+ nullifierRoot: partial.nullifierTree.root,
173
+ publicDataRoot: partial.publicDataTree.root,
174
+ l1ToL2MessageRoot: isFirstBlock ? l1ToL2MessageTree.root : undefined,
175
+ txs: body.toTxBlobData()
176
+ });
177
+ const endSpongeBlob = startSpongeBlob.clone();
178
+ await endSpongeBlob.absorb(blockBlobFields);
179
+ const spongeBlobHash = await endSpongeBlob.squeeze();
180
+ const header = BlockHeader.from({
181
+ lastArchive,
182
+ state: endState,
183
+ spongeBlobHash,
184
+ globalVariables,
185
+ totalFees,
186
+ totalManaUsed
187
+ });
160
188
  return {
161
189
  header,
162
- body
190
+ body,
191
+ blockBlobFields
163
192
  };
164
193
  });
165
- export function getBlobsHashFromBlobs(inputs) {
166
- const blobHashes = serializeToBuffer(inputs.map((b)=>b.getEthVersionedBlobHash()));
167
- return sha256Trunc(serializeToBuffer(blobHashes));
168
- }
169
- // Validate that the roots of all local trees match the output of the root circuit simulation
170
- export async function validateBlockRootOutput(blockRootOutput, blockHeader, db) {
171
- await Promise.all([
172
- validateState(blockHeader.state, db),
173
- validateSimulatedTree(await getTreeSnapshot(MerkleTreeId.ARCHIVE, db), blockRootOutput.newArchive, 'Archive')
174
- ]);
194
+ export async function getLastSiblingPath(treeId, db) {
195
+ const { size } = await db.getTreeInfo(treeId);
196
+ const path = await db.getSiblingPath(treeId, size - 1n);
197
+ return padArrayEnd(path.toFields(), Fr.ZERO, getTreeHeight(treeId));
175
198
  }
176
- export const validateState = runInSpan('BlockBuilderHelpers', 'validateState', async (_span, state, db)=>{
177
- const promises = [
178
- MerkleTreeId.NOTE_HASH_TREE,
179
- MerkleTreeId.NULLIFIER_TREE,
180
- MerkleTreeId.PUBLIC_DATA_TREE
181
- ].map(async (id)=>{
182
- return {
183
- key: id,
184
- value: await getTreeSnapshot(id, db)
185
- };
186
- });
187
- const snapshots = new Map((await Promise.all(promises)).map((obj)=>[
188
- obj.key,
189
- obj.value
190
- ]));
191
- validatePartialState(state.partial, snapshots);
192
- validateSimulatedTree(await getTreeSnapshot(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, db), state.l1ToL2MessageTree, 'L1ToL2MessageTree');
193
- });
194
199
  export async function getRootTreeSiblingPath(treeId, db) {
195
200
  const { size } = await db.getTreeInfo(treeId);
196
201
  const path = await db.getSiblingPath(treeId, size);
197
202
  return padArrayEnd(path.toFields(), Fr.ZERO, getTreeHeight(treeId));
198
203
  }
199
- export const getConstantRollupData = runInSpan('BlockBuilderHelpers', 'getConstantRollupData', async (_span, globalVariables, db)=>{
200
- return ConstantRollupData.from({
201
- vkTreeRoot: getVKTreeRoot(),
202
- protocolContractTreeRoot,
203
- lastArchive: await getTreeSnapshot(MerkleTreeId.ARCHIVE, db),
204
- globalVariables
205
- });
206
- });
207
204
  export async function getTreeSnapshot(id, db) {
208
205
  const treeInfo = await db.getTreeInfo(id);
209
206
  return new AppendOnlyTreeSnapshot(Fr.fromBuffer(treeInfo.root), Number(treeInfo.size));
@@ -211,28 +208,6 @@ export async function getTreeSnapshot(id, db) {
211
208
  export function makeEmptyMembershipWitness(height) {
212
209
  return new MembershipWitness(height, 0n, makeTuple(height, ()=>Fr.ZERO));
213
210
  }
214
- const processPublicDataUpdateRequests = runInSpan('BlockBuilderHelpers', 'processPublicDataUpdateRequests', async (span, tx, db)=>{
215
- span.setAttribute(Attributes.TX_HASH, tx.hash.toString());
216
- const allPublicDataWrites = tx.txEffect.publicDataWrites.map(({ leafSlot, value })=>new PublicDataTreeLeaf(leafSlot, value));
217
- const { lowLeavesWitnessData, insertionWitnessData } = await db.sequentialInsert(MerkleTreeId.PUBLIC_DATA_TREE, allPublicDataWrites.map((write)=>{
218
- if (write.isEmpty()) {
219
- throw new Error(`Empty public data write in tx: ${toFriendlyJSON(tx)}`);
220
- }
221
- return write.toBuffer();
222
- }));
223
- const lowPublicDataWritesPreimages = lowLeavesWitnessData.map((lowLeafWitness)=>lowLeafWitness.leafPreimage);
224
- const lowPublicDataWritesMembershipWitnesses = lowLeavesWitnessData.map((lowLeafWitness)=>MembershipWitness.fromBufferArray(lowLeafWitness.index, assertLength(lowLeafWitness.siblingPath.toBufferArray(), PUBLIC_DATA_TREE_HEIGHT)));
225
- const publicDataWritesSiblingPaths = insertionWitnessData.map((w)=>{
226
- const insertionSiblingPath = w.siblingPath.toFields();
227
- assertLength(insertionSiblingPath, PUBLIC_DATA_TREE_HEIGHT);
228
- return insertionSiblingPath;
229
- });
230
- return {
231
- lowPublicDataWritesPreimages,
232
- lowPublicDataWritesMembershipWitnesses,
233
- publicDataWritesSiblingPaths
234
- };
235
- });
236
211
  export async function getSubtreeSiblingPath(treeId, subtreeHeight, db) {
237
212
  const nextAvailableLeafIndex = await db.getTreeInfo(treeId).then((t)=>t.size);
238
213
  const fullSiblingPath = await db.getSiblingPath(treeId, nextAvailableLeafIndex);
@@ -269,17 +244,22 @@ function validateSimulatedTree(localTree, simulatedTree, name, label) {
269
244
  }
270
245
  }
271
246
  export function validateTx(tx) {
272
- const txHeader = tx.constants.historicalHeader;
273
- if (txHeader.state.l1ToL2MessageTree.isZero()) {
247
+ const txHeader = tx.data.constants.anchorBlockHeader;
248
+ if (txHeader.state.l1ToL2MessageTree.isEmpty()) {
274
249
  throw new Error(`Empty L1 to L2 messages tree in tx: ${toFriendlyJSON(tx)}`);
275
250
  }
276
- if (txHeader.state.partial.noteHashTree.isZero()) {
251
+ if (txHeader.state.partial.noteHashTree.isEmpty()) {
277
252
  throw new Error(`Empty note hash tree in tx: ${toFriendlyJSON(tx)}`);
278
253
  }
279
- if (txHeader.state.partial.nullifierTree.isZero()) {
254
+ if (txHeader.state.partial.nullifierTree.isEmpty()) {
280
255
  throw new Error(`Empty nullifier tree in tx: ${toFriendlyJSON(tx)}`);
281
256
  }
282
- if (txHeader.state.partial.publicDataTree.isZero()) {
257
+ if (txHeader.state.partial.publicDataTree.isEmpty()) {
283
258
  throw new Error(`Empty public data tree in tx: ${toFriendlyJSON(tx)}`);
284
259
  }
285
260
  }
261
+ export function toProofData({ inputs, proof, verificationKey }, vkIndex) {
262
+ const leafIndex = vkIndex || getVKIndex(verificationKey.keyAsFields);
263
+ const vkData = new VkData(verificationKey, leafIndex, getVKSiblingPath(leafIndex));
264
+ return new ProofData(inputs, proof, vkData);
265
+ }
@@ -1,18 +1,20 @@
1
- import { 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 BlockBlobData, type BlockEndBlobData, 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 { Logger } from '@aztec/foundation/log';
5
- import type { Tuple } from '@aztec/foundation/serialize';
4
+ import { type Tuple } from '@aztec/foundation/serialize';
6
5
  import { type TreeNodeLocation } from '@aztec/foundation/trees';
7
- import type { L2Block } from '@aztec/stdlib/block';
8
6
  import type { PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
9
- import { type ParityPublicInputs, RootParityInputs } from '@aztec/stdlib/parity';
10
- import { type BaseOrMergeRollupPublicInputs, type BlockRootOrBlockMergePublicInputs, BlockRootRollupInputs, EmptyBlockRootRollupInputs, MergeRollupInputs, SingleTxBlockRootRollupInputs } from '@aztec/stdlib/rollup';
11
- import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
12
- import { type BlockHeader, type GlobalVariables } from '@aztec/stdlib/tx';
13
- 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 { BlockHeader, StateReference } from '@aztec/stdlib/tx';
11
+ import type { UInt64 } from '@aztec/stdlib/types';
12
+ import type { CheckpointProvingState } from './checkpoint-proving-state.js';
14
13
  import type { TxProvingState } from './tx-proving-state.js';
15
- 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
+ };
16
18
  /**
17
19
  * The current state of the proving schedule for a given block. Managed by ProvingState.
18
20
  * Contains the raw inputs and intermediate state to generate every constituent proof in the tree.
@@ -20,57 +22,76 @@ export type TreeSnapshots = Map<MerkleTreeId, AppendOnlyTreeSnapshot>;
20
22
  export declare class BlockProvingState {
21
23
  #private;
22
24
  readonly index: number;
23
- readonly globalVariables: GlobalVariables;
24
- readonly newL1ToL2Messages: Fr[];
25
- private readonly l1ToL2MessageSubtreeSiblingPath;
26
- private readonly l1ToL2MessageTreeSnapshotAfterInsertion;
27
- private readonly lastArchiveSnapshot;
28
- private readonly newArchiveSiblingPath;
29
- private readonly previousBlockHeader;
30
- private readonly parentEpoch;
31
- private baseOrMergeProvingOutputs;
32
- private baseParityProvingOutputs;
33
- private rootParityProvingOutput;
34
- private blockRootProvingOutput;
35
- blockRootRollupStarted: boolean;
36
- block: L2Block | undefined;
37
- spongeBlobState: SpongeBlob | undefined;
38
- totalNumTxs: number;
25
+ readonly blockNumber: number;
26
+ readonly totalNumTxs: number;
27
+ private readonly constants;
28
+ private readonly timestamp;
29
+ readonly lastArchiveTreeSnapshot: AppendOnlyTreeSnapshot;
30
+ private readonly lastArchiveSiblingPath;
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 endState;
43
+ private endSpongeBlob;
39
44
  private txs;
40
- error: string | undefined;
41
- constructor(index: number, globalVariables: GlobalVariables, newL1ToL2Messages: Fr[], l1ToL2MessageSubtreeSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH>, l1ToL2MessageTreeSnapshotAfterInsertion: AppendOnlyTreeSnapshot, lastArchiveSnapshot: AppendOnlyTreeSnapshot, newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>, previousBlockHeader: BlockHeader, parentEpoch: EpochProvingState);
42
- get blockNumber(): number;
43
- startNewBlock(numTxs: number, numBlobFields: number): void;
45
+ private isFirstBlock;
46
+ private error;
47
+ 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);
48
+ get epochNumber(): number;
44
49
  addNewTx(tx: TxProvingState): number;
45
- setBaseRollupProof(txIndex: number, provingOutput: PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
46
- setMergeRollupProof(location: TreeNodeLocation, provingOutput: PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): void;
50
+ isAcceptingTxs(): boolean;
51
+ getProcessedTxs(): import("@aztec/stdlib/tx").ProcessedTx[];
52
+ tryStartProvingBase(txIndex: number): boolean;
53
+ setBaseRollupProof(txIndex: number, provingOutput: PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
54
+ tryStartProvingMerge(location: TreeNodeLocation): boolean;
55
+ setMergeRollupProof(location: TreeNodeLocation, provingOutput: PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): void;
56
+ tryStartProvingBaseParity(index: number): boolean;
47
57
  setBaseParityProof(index: number, provingOutput: PublicInputsAndRecursiveProof<ParityPublicInputs>): void;
58
+ tryStartProvingRootParity(): boolean;
48
59
  setRootParityProof(provingOutput: PublicInputsAndRecursiveProof<ParityPublicInputs>): void;
49
- setBlockRootRollupProof(provingOutput: PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): void;
50
- get allTxs(): TxProvingState[];
51
- /** Returns the block number as an epoch number. Used for prioritizing proof requests. */
52
- get epochNumber(): number;
60
+ tryStartProvingBlockRoot(): boolean;
61
+ setBlockRootRollupProof(provingOutput: PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>): TreeNodeLocation;
62
+ getBlockRootRollupOutput(): BlockRollupPublicInputs | undefined;
63
+ buildBlockHeader(): Promise<BlockHeader>;
64
+ getBuiltBlockHeader(): BlockHeader | undefined;
65
+ getStartSpongeBlob(): SpongeBlob;
66
+ setEndSpongeBlob(endSpongeBlob: SpongeBlob): void;
67
+ getEndSpongeBlob(): SpongeBlob | undefined;
68
+ setEndState(endState: StateReference): void;
69
+ hasEndState(): boolean;
70
+ getBlockEndBlobFields(): Fr[];
71
+ getBlockEndBlobData(): BlockEndBlobData;
72
+ getBlockBlobData(): BlockBlobData;
73
+ getTxEffects(): import("@aztec/stdlib/tx").TxEffect[];
53
74
  getParentLocation(location: TreeNodeLocation): TreeNodeLocation;
54
- getMergeRollupInputs(mergeLocation: TreeNodeLocation): MergeRollupInputs;
55
- getBlockRootRollupTypeAndInputs(proverId: Fr): Promise<{
75
+ getMergeRollupInputs(mergeLocation: TreeNodeLocation): TxMergeRollupPrivateInputs;
76
+ getBlockRootRollupTypeAndInputs(): {
56
77
  rollupType: string;
57
- inputs: EmptyBlockRootRollupInputs;
78
+ inputs: BlockRootSingleTxRollupPrivateInputs;
58
79
  } | {
59
80
  rollupType: string;
60
- inputs: SingleTxBlockRootRollupInputs;
81
+ inputs: BlockRootRollupPrivateInputs;
61
82
  } | {
62
83
  rollupType: string;
63
- inputs: BlockRootRollupInputs;
64
- }>;
65
- getPaddingBlockRootInputs(proverId: Fr): Promise<EmptyBlockRootRollupInputs>;
66
- getRootParityInputs(): RootParityInputs;
84
+ inputs: BlockRootEmptyTxFirstRollupPrivateInputs;
85
+ };
86
+ getParityRootInputs(): ParityRootPrivateInputs;
67
87
  getTxProvingState(txIndex: number): TxProvingState;
68
- buildHeaderFromProvingOutputs(logger?: Logger): Promise<BlockHeader>;
88
+ buildHeaderFromProvingOutputs(): Promise<BlockHeader>;
69
89
  isReadyForMergeRollup(location: TreeNodeLocation): boolean;
70
90
  isReadyForBlockRootRollup(): boolean;
71
91
  isReadyForRootParity(): boolean;
72
92
  isComplete(): boolean;
73
93
  verifyState(): boolean;
94
+ getError(): string | undefined;
74
95
  reject(reason: string): void;
75
96
  }
76
- //# sourceMappingURL=block-proving-state.d.ts.map
97
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2stcHJvdmluZy1zdGF0ZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL29yY2hlc3RyYXRvci9ibG9jay1wcm92aW5nLXN0YXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGFBQWEsRUFBRSxLQUFLLGdCQUFnQixFQUFFLEtBQUssVUFBVSxFQUEwQixNQUFNLGlCQUFpQixDQUFDO0FBQ3JILE9BQU8sRUFDTCxLQUFLLGNBQWMsRUFDbkIsS0FBSyw2Q0FBNkMsRUFFbEQsS0FBSyx5Q0FBeUMsRUFFL0MsTUFBTSxrQkFBa0IsQ0FBQztBQUMxQixPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDOUMsT0FBTyxFQUFFLEtBQUssS0FBSyxFQUFnQixNQUFNLDZCQUE2QixDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxLQUFLLGdCQUFnQixFQUF1QixNQUFNLHlCQUF5QixDQUFDO0FBQ3JGLE9BQU8sS0FBSyxFQUFFLDZCQUE2QixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDckYsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUV4RixPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLHdDQUF3QyxFQUV4Qyw0QkFBNEIsRUFFNUIsb0NBQW9DLEVBQ3BDLHNCQUFzQixFQUN0QiwwQkFBMEIsRUFDMUIsS0FBS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