@aztec/stdlib 0.0.1-commit.03f7ef2 → 0.0.1-commit.1142ef1

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 (258) hide show
  1. package/dest/abi/contract_artifact.d.ts +2 -2
  2. package/dest/abi/contract_artifact.d.ts.map +1 -1
  3. package/dest/abi/contract_artifact.js +1 -1
  4. package/dest/abi/selector.js +3 -1
  5. package/dest/avm/avm_accumulated_data.js +5 -2
  6. package/dest/avm/avm_circuit_public_inputs.js +3 -1
  7. package/dest/avm/public_data_update_request.js +3 -1
  8. package/dest/avm/public_inner_call_request.js +3 -1
  9. package/dest/avm/revert_code.js +3 -1
  10. package/dest/aztec-address/index.js +4 -2
  11. package/dest/block/attestation_info.d.ts +5 -5
  12. package/dest/block/attestation_info.d.ts.map +1 -1
  13. package/dest/block/attestation_info.js +4 -4
  14. package/dest/block/body.js +3 -1
  15. package/dest/block/l2_block.d.ts +6 -3
  16. package/dest/block/l2_block.d.ts.map +1 -1
  17. package/dest/block/l2_block.js +6 -4
  18. package/dest/block/l2_block_code_to_purge.d.ts +2 -3
  19. package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
  20. package/dest/block/l2_block_code_to_purge.js +2 -8
  21. package/dest/block/l2_block_header.d.ts +8 -12
  22. package/dest/block/l2_block_header.d.ts.map +1 -1
  23. package/dest/block/l2_block_header.js +25 -18
  24. package/dest/block/l2_block_new.d.ts +1 -2
  25. package/dest/block/l2_block_new.d.ts.map +1 -1
  26. package/dest/block/l2_block_new.js +4 -1
  27. package/dest/block/l2_block_source.d.ts +245 -41
  28. package/dest/block/l2_block_source.d.ts.map +1 -1
  29. package/dest/block/l2_block_source.js +23 -5
  30. package/dest/block/l2_block_stream/index.d.ts +2 -1
  31. package/dest/block/l2_block_stream/index.d.ts.map +1 -1
  32. package/dest/block/l2_block_stream/index.js +1 -0
  33. package/dest/block/l2_block_stream/interfaces.d.ts +12 -5
  34. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  35. package/dest/block/l2_block_stream/l2_block_stream.d.ts +4 -2
  36. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  37. package/dest/block/l2_block_stream/l2_block_stream.js +102 -30
  38. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +24 -16
  39. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
  40. package/dest/block/l2_block_stream/l2_tips_memory_store.js +55 -61
  41. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +49 -0
  42. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -0
  43. package/dest/block/l2_block_stream/l2_tips_store_base.js +179 -0
  44. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  45. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  46. package/dest/block/test/l2_tips_store_test_suite.js +483 -38
  47. package/dest/block/validate_block_result.d.ts +24 -24
  48. package/dest/block/validate_block_result.d.ts.map +1 -1
  49. package/dest/block/validate_block_result.js +13 -13
  50. package/dest/checkpoint/checkpoint.d.ts +1 -1
  51. package/dest/checkpoint/checkpoint.d.ts.map +1 -1
  52. package/dest/checkpoint/checkpoint.js +1 -0
  53. package/dest/checkpoint/checkpoint_info.d.ts +32 -3
  54. package/dest/checkpoint/checkpoint_info.d.ts.map +1 -1
  55. package/dest/checkpoint/checkpoint_info.js +34 -1
  56. package/dest/checkpoint/index.d.ts +2 -1
  57. package/dest/checkpoint/index.d.ts.map +1 -1
  58. package/dest/checkpoint/index.js +1 -0
  59. package/dest/database-version/version_manager.js +3 -1
  60. package/dest/gas/gas.js +3 -1
  61. package/dest/gas/gas_fees.js +3 -1
  62. package/dest/interfaces/api_limit.d.ts +2 -1
  63. package/dest/interfaces/api_limit.d.ts.map +1 -1
  64. package/dest/interfaces/api_limit.js +1 -0
  65. package/dest/interfaces/archiver.d.ts +6 -6
  66. package/dest/interfaces/archiver.d.ts.map +1 -1
  67. package/dest/interfaces/archiver.js +6 -4
  68. package/dest/interfaces/aztec-node-admin.d.ts +16 -10
  69. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  70. package/dest/interfaces/aztec-node-admin.js +3 -3
  71. package/dest/interfaces/aztec-node.d.ts +11 -10
  72. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  73. package/dest/interfaces/aztec-node.js +10 -5
  74. package/dest/interfaces/configs.d.ts +6 -1
  75. package/dest/interfaces/configs.d.ts.map +1 -1
  76. package/dest/interfaces/configs.js +2 -1
  77. package/dest/interfaces/p2p.d.ts +7 -9
  78. package/dest/interfaces/p2p.d.ts.map +1 -1
  79. package/dest/interfaces/p2p.js +3 -4
  80. package/dest/interfaces/proving-job.d.ts +170 -170
  81. package/dest/interfaces/proving-job.d.ts.map +1 -1
  82. package/dest/interfaces/proving-job.js +1 -7
  83. package/dest/interfaces/server_circuit_prover.d.ts +4 -3
  84. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  85. package/dest/interfaces/validator.d.ts +41 -7
  86. package/dest/interfaces/validator.d.ts.map +1 -1
  87. package/dest/interfaces/validator.js +3 -1
  88. package/dest/interfaces/world_state.d.ts +8 -6
  89. package/dest/interfaces/world_state.d.ts.map +1 -1
  90. package/dest/kernel/claimed_length_array.js +3 -1
  91. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -5
  92. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
  93. package/dest/kernel/hints/build_note_hash_read_request_hints.js +5 -6
  94. package/dest/kernel/hints/transient_data_squashing_hint.js +3 -1
  95. package/dest/kernel/log_hash.js +3 -1
  96. package/dest/kernel/private_log_data.js +5 -2
  97. package/dest/kernel/private_to_avm_accumulated_data.js +5 -2
  98. package/dest/kernel/private_to_public_accumulated_data.js +3 -1
  99. package/dest/kernel/private_to_rollup_accumulated_data.js +3 -1
  100. package/dest/kernel/private_validation_requests.js +3 -1
  101. package/dest/kernel/public_call_request.js +5 -2
  102. package/dest/logs/contract_class_log.js +3 -1
  103. package/dest/logs/index.d.ts +1 -2
  104. package/dest/logs/index.d.ts.map +1 -1
  105. package/dest/logs/index.js +0 -1
  106. package/dest/logs/private_log.js +3 -1
  107. package/dest/logs/public_log.js +3 -1
  108. package/dest/logs/tx_scoped_l2_log.d.ts +18 -39
  109. package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
  110. package/dest/logs/tx_scoped_l2_log.js +29 -50
  111. package/dest/messaging/in_hash.d.ts +4 -2
  112. package/dest/messaging/in_hash.d.ts.map +1 -1
  113. package/dest/messaging/in_hash.js +3 -1
  114. package/dest/messaging/l2_to_l1_membership.d.ts +88 -6
  115. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  116. package/dest/messaging/l2_to_l1_membership.js +158 -42
  117. package/dest/messaging/out_hash.d.ts +2 -1
  118. package/dest/messaging/out_hash.d.ts.map +1 -1
  119. package/dest/messaging/out_hash.js +13 -4
  120. package/dest/p2p/attestation_utils.d.ts +3 -3
  121. package/dest/p2p/attestation_utils.d.ts.map +1 -1
  122. package/dest/p2p/attestation_utils.js +1 -1
  123. package/dest/p2p/block_proposal.d.ts +85 -21
  124. package/dest/p2p/block_proposal.d.ts.map +1 -1
  125. package/dest/p2p/block_proposal.js +120 -37
  126. package/dest/p2p/checkpoint_attestation.d.ts +77 -0
  127. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -0
  128. package/dest/p2p/{block_attestation.js → checkpoint_attestation.js} +22 -19
  129. package/dest/p2p/checkpoint_proposal.d.ts +154 -0
  130. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -0
  131. package/dest/p2p/checkpoint_proposal.js +217 -0
  132. package/dest/p2p/consensus_payload.d.ts +6 -7
  133. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  134. package/dest/p2p/consensus_payload.js +3 -2
  135. package/dest/p2p/gossipable.d.ts +4 -3
  136. package/dest/p2p/gossipable.d.ts.map +1 -1
  137. package/dest/p2p/gossipable.js +16 -5
  138. package/dest/p2p/index.d.ts +4 -2
  139. package/dest/p2p/index.d.ts.map +1 -1
  140. package/dest/p2p/index.js +3 -1
  141. package/dest/p2p/signature_utils.d.ts +5 -3
  142. package/dest/p2p/signature_utils.d.ts.map +1 -1
  143. package/dest/p2p/signature_utils.js +3 -1
  144. package/dest/p2p/signed_txs.d.ts +40 -0
  145. package/dest/p2p/signed_txs.d.ts.map +1 -0
  146. package/dest/p2p/signed_txs.js +70 -0
  147. package/dest/p2p/topic_type.d.ts +3 -2
  148. package/dest/p2p/topic_type.d.ts.map +1 -1
  149. package/dest/p2p/topic_type.js +8 -2
  150. package/dest/rollup/block_rollup_public_inputs.d.ts +4 -9
  151. package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
  152. package/dest/rollup/block_rollup_public_inputs.js +6 -10
  153. package/dest/rollup/checkpoint_constant_data.js +3 -1
  154. package/dest/rollup/checkpoint_header.d.ts +15 -12
  155. package/dest/rollup/checkpoint_header.d.ts.map +1 -1
  156. package/dest/rollup/checkpoint_header.js +33 -19
  157. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +6 -1
  158. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
  159. package/dest/rollup/checkpoint_rollup_public_inputs.js +6 -2
  160. package/dest/rollup/root_rollup_public_inputs.d.ts +8 -3
  161. package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
  162. package/dest/rollup/root_rollup_public_inputs.js +6 -3
  163. package/dest/tests/factories.d.ts +38 -7
  164. package/dest/tests/factories.d.ts.map +1 -1
  165. package/dest/tests/factories.js +77 -13
  166. package/dest/tests/mocks.d.ts +59 -10
  167. package/dest/tests/mocks.d.ts.map +1 -1
  168. package/dest/tests/mocks.js +89 -41
  169. package/dest/trees/append_only_tree_snapshot.js +3 -1
  170. package/dest/tx/block_header.js +3 -1
  171. package/dest/tx/call_context.js +3 -1
  172. package/dest/tx/global_variable_builder.d.ts +2 -2
  173. package/dest/tx/global_variable_builder.d.ts.map +1 -1
  174. package/dest/tx/global_variables.js +3 -1
  175. package/dest/tx/index.d.ts +1 -2
  176. package/dest/tx/index.d.ts.map +1 -1
  177. package/dest/tx/index.js +0 -1
  178. package/dest/tx/private_execution_result.d.ts +1 -5
  179. package/dest/tx/private_execution_result.d.ts.map +1 -1
  180. package/dest/tx/private_execution_result.js +3 -20
  181. package/dest/tx/public_call_request_with_calldata.js +3 -1
  182. package/dest/tx/state_reference.js +3 -1
  183. package/dest/tx/tree_snapshots.js +3 -1
  184. package/dest/tx/tx.d.ts +10 -3
  185. package/dest/tx/tx.d.ts.map +1 -1
  186. package/dest/tx/tx.js +12 -3
  187. package/dest/tx/tx_effect.d.ts +1 -1
  188. package/dest/tx/tx_effect.d.ts.map +1 -1
  189. package/dest/tx/tx_effect.js +6 -2
  190. package/dest/tx/tx_execution_request.d.ts +1 -1
  191. package/dest/tx/tx_execution_request.d.ts.map +1 -1
  192. package/dest/tx/tx_execution_request.js +6 -2
  193. package/package.json +8 -8
  194. package/src/abi/contract_artifact.ts +10 -10
  195. package/src/block/attestation_info.ts +9 -6
  196. package/src/block/l2_block.ts +6 -5
  197. package/src/block/l2_block_code_to_purge.ts +3 -11
  198. package/src/block/l2_block_header.ts +26 -17
  199. package/src/block/l2_block_new.ts +5 -1
  200. package/src/block/l2_block_source.ts +66 -16
  201. package/src/block/l2_block_stream/index.ts +1 -0
  202. package/src/block/l2_block_stream/interfaces.ts +12 -4
  203. package/src/block/l2_block_stream/l2_block_stream.ts +121 -38
  204. package/src/block/l2_block_stream/l2_tips_memory_store.ts +62 -56
  205. package/src/block/l2_block_stream/l2_tips_store_base.ts +226 -0
  206. package/src/block/test/l2_tips_store_test_suite.ts +485 -36
  207. package/src/block/validate_block_result.ts +35 -31
  208. package/src/checkpoint/checkpoint.ts +1 -0
  209. package/src/checkpoint/checkpoint_info.ts +45 -2
  210. package/src/checkpoint/index.ts +1 -0
  211. package/src/interfaces/api_limit.ts +1 -0
  212. package/src/interfaces/archiver.ts +14 -6
  213. package/src/interfaces/aztec-node-admin.ts +7 -4
  214. package/src/interfaces/aztec-node.ts +43 -13
  215. package/src/interfaces/configs.ts +5 -0
  216. package/src/interfaces/p2p.ts +8 -12
  217. package/src/interfaces/proving-job.ts +2 -11
  218. package/src/interfaces/server_circuit_prover.ts +3 -2
  219. package/src/interfaces/validator.ts +57 -7
  220. package/src/interfaces/world_state.ts +9 -7
  221. package/src/kernel/hints/build_note_hash_read_request_hints.ts +5 -8
  222. package/src/logs/index.ts +0 -1
  223. package/src/logs/tx_scoped_l2_log.ts +37 -53
  224. package/src/messaging/in_hash.ts +3 -1
  225. package/src/messaging/l2_to_l1_membership.ts +176 -52
  226. package/src/messaging/out_hash.ts +17 -7
  227. package/src/p2p/attestation_utils.ts +3 -3
  228. package/src/p2p/block_proposal.ts +185 -41
  229. package/src/p2p/{block_attestation.ts → checkpoint_attestation.ts} +31 -25
  230. package/src/p2p/checkpoint_proposal.ts +337 -0
  231. package/src/p2p/consensus_payload.ts +5 -2
  232. package/src/p2p/gossipable.ts +14 -4
  233. package/src/p2p/index.ts +3 -1
  234. package/src/p2p/signature_utils.ts +3 -1
  235. package/src/p2p/signed_txs.ts +83 -0
  236. package/src/p2p/topic_type.ts +3 -2
  237. package/src/rollup/block_rollup_public_inputs.ts +3 -9
  238. package/src/rollup/checkpoint_header.ts +43 -20
  239. package/src/rollup/checkpoint_rollup_public_inputs.ts +6 -0
  240. package/src/rollup/root_rollup_public_inputs.ts +6 -0
  241. package/src/tests/factories.ts +98 -17
  242. package/src/tests/mocks.ts +166 -64
  243. package/src/tx/global_variable_builder.ts +1 -1
  244. package/src/tx/index.ts +0 -1
  245. package/src/tx/private_execution_result.ts +0 -15
  246. package/src/tx/tx.ts +11 -2
  247. package/src/tx/tx_effect.ts +3 -1
  248. package/src/tx/tx_execution_request.ts +2 -0
  249. package/dest/logs/log_with_tx_data.d.ts +0 -19
  250. package/dest/logs/log_with_tx_data.d.ts.map +0 -1
  251. package/dest/logs/log_with_tx_data.js +0 -49
  252. package/dest/p2p/block_attestation.d.ts +0 -80
  253. package/dest/p2p/block_attestation.d.ts.map +0 -1
  254. package/dest/tx/content_commitment.d.ts +0 -49
  255. package/dest/tx/content_commitment.d.ts.map +0 -1
  256. package/dest/tx/content_commitment.js +0 -90
  257. package/src/logs/log_with_tx_data.ts +0 -46
  258. package/src/tx/content_commitment.ts +0 -113
@@ -1,63 +1,179 @@
1
+ import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
1
2
  import { Fr } from '@aztec/foundation/curves/bn254';
2
3
  import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedShaRoot } from '@aztec/foundation/trees';
3
- export async function computeL2ToL1MembershipWitness(messageRetriever, l2BlockNumber, message) {
4
- const messagesForAllTxs = await messageRetriever.getL2ToL1Messages(l2BlockNumber);
5
- if (!messagesForAllTxs) {
4
+ /**
5
+ * # L2-to-L1 Message Tree Structure and Leaf IDs
6
+ *
7
+ * ## Overview
8
+ * L2-to-L1 messages are organized in a hierarchical 4-level tree structure within each epoch:
9
+ * Epoch → Checkpoints → Blocks → Transactions → Messages
10
+ *
11
+ * Each level uses an unbalanced Merkle tree, and some levels use compression (skipping zero hashes).
12
+ *
13
+ * ## Tree Levels
14
+ *
15
+ * 1. **Message Tree (TX Out Hash)**
16
+ * - Leaves: Individual L2-to-L1 messages within a transaction
17
+ * - Root: TX out hash
18
+ * - Type: Unbalanced, non-compressed (the circuits ensure that all messages are not empty.)
19
+ *
20
+ * 2. **Block Tree**
21
+ * - Leaves: TX out hashes from all transactions in a block
22
+ * - Root: Block out hash
23
+ * - Type: Unbalanced, compressed (zero hashes are skipped)
24
+ * - Compression: If a tx has no messages (out hash = 0), that branch is ignored
25
+ *
26
+ * 3. **Checkpoint Tree**
27
+ * - Leaves: Block out hashes from all blocks in a checkpoint
28
+ * - Root: Checkpoint out hash
29
+ * - Type: Unbalanced, compressed (zero hashes are skipped)
30
+ * - Compression: If a block has no messages (out hash = 0), that branch is ignored
31
+ *
32
+ * 4. **Epoch Tree**
33
+ * - Leaves: Checkpoint out hashes from all checkpoints in an epoch (padded to AZTEC_MAX_EPOCH_DURATION)
34
+ * - Root: Epoch out hash (set in the root rollup's public inputs and inserted into the Outbox on L1 when the epoch is proven)
35
+ * - Type: Unbalanced, non-compressed
36
+ * - **Important**: Padded with zeros up to AZTEC_MAX_EPOCH_DURATION to allow for proofs of partial epochs
37
+ *
38
+ * ## Combined Membership Proof
39
+ * To prove a message exists in an epoch, we combine the sibling paths from all 4 trees:
40
+ * [message siblings] + [tx siblings] + [block siblings] + [checkpoint siblings]
41
+ *
42
+ * ## Leaf ID: Stable Message Identification
43
+ *
44
+ * Each message gets a unique, stable **leaf ID** that identifies its position in the combined tree.
45
+ * The leaf ID is computed as:
46
+ * leafId = 2^pathSize + leafIndex
47
+ *
48
+ * Where:
49
+ * - `pathSize`: Total length of the combined sibling path (from all 4 tree levels)
50
+ * - `leafIndex`: The message's index in a balanced tree representation at that height
51
+ *
52
+ * ### Why Leaf IDs Are Stable
53
+ *
54
+ * The leaf ID is based on the message's position in the tree structure, which is determined by:
55
+ * - The checkpoint index within the epoch
56
+ * - The block index within the checkpoint
57
+ * - The transaction index within the block
58
+ * - The message index within the transaction
59
+ *
60
+ * These indices are structural and do NOT depend on the total number of blocks/checkpoints in the epoch.
61
+ *
62
+ * ### Critical Property: Preserving Consumed Status
63
+ *
64
+ * **Problem**: On L1, epoch proofs can be submitted incrementally. For example:
65
+ * - First, a proof for checkpoints 1-10 of epoch 0 is submitted (proves the first 10 checkpoints)
66
+ * - Later, a proof for checkpoints 1-20 of epoch 0 is submitted (proves all 20 checkpoints)
67
+ *
68
+ * When the longer proof is submitted, it updates the epoch's out hash root on L1 to reflect the complete epoch (all 20
69
+ * checkpoints). However, some messages from checkpoints 1-10 may have already been consumed.
70
+ *
71
+ * **Solution**: The Outbox on L1 tracks consumed messages using a bitmap indexed by leaf ID.
72
+ * Because leaf IDs are stable (they don't change when more checkpoints are added to the epoch), messages that were consumed
73
+ * under the shorter proof remain marked as consumed under the longer proof.
74
+ *
75
+ * This prevents double-spending of L2-to-L1 messages when longer epoch proofs are submitted.
76
+ */ /**
77
+ * Computes the unique leaf ID for an L2-to-L1 message.
78
+ *
79
+ * The leaf ID is stable across different epoch proof lengths and is used by the Outbox
80
+ * on L1 to track which messages have been consumed.
81
+ *
82
+ * @param membershipWitness - Contains the leafIndex and siblingPath for the message
83
+ * @returns The unique leaf ID used for tracking message consumption on L1
84
+ */ export function getL2ToL1MessageLeafId(membershipWitness) {
85
+ return 2n ** BigInt(membershipWitness.siblingPath.pathSize) + membershipWitness.leafIndex;
86
+ }
87
+ export async function computeL2ToL1MembershipWitness(messageRetriever, epoch, message) {
88
+ const messagesInEpoch = await messageRetriever.getL2ToL1Messages(epoch);
89
+ if (messagesInEpoch.length === 0) {
6
90
  return undefined;
7
91
  }
8
- return computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message);
92
+ return computeL2ToL1MembershipWitnessFromMessagesInEpoch(messagesInEpoch, message);
9
93
  }
10
94
  // TODO: Allow to specify the message to consume by its index or by an offset, in case there are multiple messages with
11
95
  // the same value.
12
- export function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message) {
13
- // Find index of message in subtree and index of tx in a block.
96
+ export function computeL2ToL1MembershipWitnessFromMessagesInEpoch(messagesInEpoch, message) {
97
+ // Find the index of the message in the tx, index of the tx in the block, and index of the block in the epoch.
14
98
  let messageIndexInTx = -1;
15
- const txIndex = messagesForAllTxs.findIndex((messages)=>{
16
- messageIndexInTx = messages.findIndex((msg)=>msg.equals(message));
17
- return messageIndexInTx !== -1;
99
+ let txIndex = -1;
100
+ let blockIndex = -1;
101
+ const checkpointIndex = messagesInEpoch.findIndex((messagesInCheckpoint)=>{
102
+ blockIndex = messagesInCheckpoint.findIndex((messagesInBlock)=>{
103
+ txIndex = messagesInBlock.findIndex((messagesInTx)=>{
104
+ messageIndexInTx = messagesInTx.findIndex((msg)=>msg.equals(message));
105
+ return messageIndexInTx !== -1;
106
+ });
107
+ return txIndex !== -1;
108
+ });
109
+ return blockIndex !== -1;
18
110
  });
19
- if (txIndex === -1) {
111
+ if (checkpointIndex === -1) {
20
112
  throw new Error('The L2ToL1Message you are trying to prove inclusion of does not exist');
21
113
  }
22
- // Get the txOutHash and the sibling path of the message in the tx subtree.
23
- const txMessages = messagesForAllTxs[txIndex];
24
- const txOutHashTree = UnbalancedMerkleTreeCalculator.create(txMessages.map((msg)=>msg.toBuffer()));
25
- const txOutHash = txOutHashTree.getRoot();
26
- const messagePathInSubtree = txOutHashTree.getSiblingPath(message.toBuffer());
27
- // Calculate txOutHash for all txs.
28
- const txSubtreeRoots = messagesForAllTxs.map((messages, i)=>{
29
- // For a tx with no messages, we have to set an out hash of 0 to match what the circuit does.
30
- if (messages.length === 0) {
31
- return Fr.ZERO;
114
+ // Build the tx tree.
115
+ const messagesInTx = messagesInEpoch[checkpointIndex][blockIndex][txIndex];
116
+ const txTree = UnbalancedMerkleTreeCalculator.create(messagesInTx.map((msg)=>msg.toBuffer()));
117
+ // Get the sibling path of the target message in the tx tree.
118
+ const pathToMessageInTxSubtree = txTree.getSiblingPathByLeafIndex(messageIndexInTx);
119
+ // Build the tree of the block containing the target message.
120
+ const blockTree = buildBlockTree(messagesInEpoch[checkpointIndex][blockIndex]);
121
+ // Get the sibling path of the tx out hash in the block tree.
122
+ const pathToTxOutHashInBlockTree = blockTree.getSiblingPathByLeafIndex(txIndex);
123
+ // Build the tree of the checkpoint containing the target message.
124
+ const checkpointTree = buildCheckpointTree(messagesInEpoch[checkpointIndex]);
125
+ // Get the sibling path of the block out hash in the checkpoint tree.
126
+ const pathToBlockOutHashInCheckpointTree = checkpointTree.getSiblingPathByLeafIndex(blockIndex);
127
+ // Compute the out hashes of all checkpoints in the epoch.
128
+ let checkpointOutHashes = messagesInEpoch.map((messagesInCheckpoint, i)=>{
129
+ if (i === checkpointIndex) {
130
+ return checkpointTree.getRoot();
32
131
  }
33
- if (i === txIndex) {
34
- return Fr.fromBuffer(txOutHash);
35
- }
36
- const root = computeUnbalancedShaRoot(messages.map((msg)=>msg.toBuffer()));
37
- return Fr.fromBuffer(root);
132
+ return buildCheckpointTree(messagesInCheckpoint).getRoot();
38
133
  });
39
- // Construct the top tree.
40
- // The leaves of this tree are the `txOutHashes`.
41
- // The root of this tree should match the `out_hash` calculated in the circuits. Zero hashes are compressed to reduce
42
- // cost if the non-zero leaves result in a shorter path.
43
- const valueToCompress = Buffer.alloc(32);
44
- const topTree = UnbalancedMerkleTreeCalculator.create(txSubtreeRoots.map((root)=>root.toBuffer()), valueToCompress);
45
- const root = Fr.fromBuffer(topTree.getRoot());
46
- // Compute the combined sibling path by appending the tx subtree path to the top tree path.
47
- const txPathInTopTree = topTree.getSiblingPath(txOutHash);
48
- const combinedPath = messagePathInSubtree.toBufferArray().concat(txPathInTopTree.toBufferArray());
134
+ // Pad to AZTEC_MAX_EPOCH_DURATION with zeros.
135
+ checkpointOutHashes = checkpointOutHashes.concat(Array.from({
136
+ length: AZTEC_MAX_EPOCH_DURATION - messagesInEpoch.length
137
+ }, ()=>Buffer.alloc(32)));
138
+ // Build the epoch tree with all the checkpoint out hashes, including the padded zeros
139
+ const epochTree = UnbalancedMerkleTreeCalculator.create(checkpointOutHashes);
140
+ // Get the sibling path of the checkpoint out hash in the epoch tree.
141
+ const pathToCheckpointOutHashInEpochTree = epochTree.getSiblingPathByLeafIndex(checkpointIndex);
142
+ // The root of the epoch tree should match the `out_hash` in the root rollup's public inputs.
143
+ const root = Fr.fromBuffer(epochTree.getRoot());
144
+ // Compute the combined sibling path by appending the tx subtree path to the block tree path, then to the checkpoint
145
+ // tree path, then to the epoch tree path.
146
+ const combinedPath = pathToMessageInTxSubtree.toBufferArray().concat(pathToTxOutHashInBlockTree.toBufferArray()).concat(pathToBlockOutHashInCheckpointTree.toBufferArray()).concat(pathToCheckpointOutHashInEpochTree.toBufferArray());
49
147
  // Compute the combined index.
50
- // It is the index of the message in the balanced tree at its current height.
51
- const txLeafIndexAtLevel = topTree.getLeafLocation(txIndex).index;
52
- const messageLeafPosition = txOutHashTree.getLeafLocation(messageIndexInTx);
53
- const numLeavesInLeftSubtrees = txLeafIndexAtLevel * (1 << messageLeafPosition.level);
54
- const combinedIndex = numLeavesInLeftSubtrees + messageLeafPosition.index;
148
+ // It is the index of the message in the balanced tree (by filling up the wonky tree with empty nodes) at its current
149
+ // height. It's used to validate the membership proof.
150
+ const messageLeafPosition = txTree.getLeafLocation(messageIndexInTx);
151
+ const txLeafPosition = blockTree.getLeafLocation(txIndex);
152
+ const blockLeafPosition = checkpointTree.getLeafLocation(blockIndex);
153
+ const checkpointLeafPosition = epochTree.getLeafLocation(checkpointIndex);
154
+ const numLeavesInLeftCheckpoints = checkpointLeafPosition.index * (1 << blockLeafPosition.level);
155
+ const indexAtCheckpointLevel = numLeavesInLeftCheckpoints + blockLeafPosition.index;
156
+ const numLeavesInLeftBlocks = indexAtCheckpointLevel * (1 << txLeafPosition.level);
157
+ const indexAtTxLevel = numLeavesInLeftBlocks + txLeafPosition.index;
158
+ const numLeavesInLeftTxs = indexAtTxLevel * (1 << messageLeafPosition.level);
159
+ const combinedIndex = numLeavesInLeftTxs + messageLeafPosition.index;
55
160
  return {
56
161
  root,
57
162
  leafIndex: BigInt(combinedIndex),
58
163
  siblingPath: new SiblingPath(combinedPath.length, combinedPath)
59
164
  };
60
165
  }
61
- export function getL2ToL1MessageLeafId(membershipWitness) {
62
- return 2n ** BigInt(membershipWitness.siblingPath.pathSize) + membershipWitness.leafIndex;
166
+ function buildCheckpointTree(messagesInCheckpoint) {
167
+ const blockOutHashes = messagesInCheckpoint.map((messagesInBlock)=>buildBlockTree(messagesInBlock).getRoot());
168
+ return buildCompressedTree(blockOutHashes);
169
+ }
170
+ function buildBlockTree(messagesInBlock) {
171
+ const txOutHashes = messagesInBlock.map((messages)=>computeUnbalancedShaRoot(messages.map((msg)=>msg.toBuffer())));
172
+ return buildCompressedTree(txOutHashes);
173
+ }
174
+ function buildCompressedTree(leaves) {
175
+ // Note: If a block or tx has no messages (i.e. leaf == Buffer.alloc(32)), we ignore that branch and only accumulate
176
+ // the non-zero hashes to match what the circuits do.
177
+ const valueToCompress = Buffer.alloc(32);
178
+ return UnbalancedMerkleTreeCalculator.create(leaves, valueToCompress);
63
179
  }
@@ -2,4 +2,5 @@ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  export declare function computeTxOutHash(messages: Fr[]): Fr;
3
3
  export declare function computeBlockOutHash(messagesPerBlock: Fr[][]): Fr;
4
4
  export declare function computeCheckpointOutHash(messagesForAllTxs: Fr[][][]): Fr;
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0X2hhc2guZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tZXNzYWdpbmcvb3V0X2hhc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBR3BELHdCQUFnQixnQkFBZ0IsQ0FBQyxRQUFRLEVBQUUsRUFBRSxFQUFFLEdBQUcsRUFBRSxDQU9uRDtBQUVELHdCQUFnQixtQkFBbUIsQ0FBQyxnQkFBZ0IsRUFBRSxFQUFFLEVBQUUsRUFBRSxHQUFHLEVBQUUsQ0FHaEU7QUFFRCx3QkFBZ0Isd0JBQXdCLENBQUMsaUJBQWlCLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxHQUFHLEVBQUUsQ0FHeEUifQ==
5
+ export declare function computeEpochOutHash(messagesInEpoch: Fr[][][][]): Fr;
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0X2hhc2guZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tZXNzYWdpbmcvb3V0X2hhc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBR3BELHdCQUFnQixnQkFBZ0IsQ0FBQyxRQUFRLEVBQUUsRUFBRSxFQUFFLEdBQUcsRUFBRSxDQU9uRDtBQUVELHdCQUFnQixtQkFBbUIsQ0FBQyxnQkFBZ0IsRUFBRSxFQUFFLEVBQUUsRUFBRSxHQUFHLEVBQUUsQ0FHaEU7QUFFRCx3QkFBZ0Isd0JBQXdCLENBQUMsaUJBQWlCLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxHQUFHLEVBQUUsQ0FHeEU7QUFFRCx3QkFBZ0IsbUJBQW1CLENBQUMsZUFBZSxFQUFFLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxHQUFHLEVBQUUsQ0FXbkUifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"out_hash.d.ts","sourceRoot":"","sources":["../../src/messaging/out_hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,CAOnD;AAED,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAGhE;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAGxE"}
1
+ {"version":3,"file":"out_hash.d.ts","sourceRoot":"","sources":["../../src/messaging/out_hash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,CAOnD;AAED,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAGhE;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAGxE;AAED,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAWnE"}
@@ -1,5 +1,7 @@
1
+ import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
2
+ import { padArrayEnd } from '@aztec/foundation/collection';
1
3
  import { Fr } from '@aztec/foundation/curves/bn254';
2
- import { UnbalancedMerkleTreeCalculator, computeUnbalancedShaRoot } from '@aztec/foundation/trees';
4
+ import { computeCompressedUnbalancedShaRoot, computeUnbalancedShaRoot } from '@aztec/foundation/trees';
3
5
  export function computeTxOutHash(messages) {
4
6
  if (!messages.length) {
5
7
  return Fr.ZERO;
@@ -16,13 +18,20 @@ export function computeCheckpointOutHash(messagesForAllTxs) {
16
18
  const blockOutHashes = messagesForAllTxs.map((block)=>computeBlockOutHash(block));
17
19
  return aggregateOutHashes(blockOutHashes);
18
20
  }
21
+ export function computeEpochOutHash(messagesInEpoch) {
22
+ // Must match the implementation in `compute_epoch_out_hash.nr`.
23
+ const checkpointOutHashes = messagesInEpoch.map((checkpoint)=>computeCheckpointOutHash(checkpoint)).map((hash)=>hash.toBuffer());
24
+ if (checkpointOutHashes.every((hash)=>hash.equals(Buffer.alloc(32)))) {
25
+ return Fr.ZERO;
26
+ }
27
+ const paddedOutHashes = padArrayEnd(checkpointOutHashes, Buffer.alloc(32), AZTEC_MAX_EPOCH_DURATION);
28
+ return Fr.fromBuffer(computeUnbalancedShaRoot(paddedOutHashes));
29
+ }
19
30
  // The root of this tree should match the `out_hash` calculated in the circuits. Zero hashes are compressed to reduce
20
31
  // cost if the non-zero leaves result in a shorter path.
21
32
  function aggregateOutHashes(outHashes) {
22
33
  if (!outHashes.length) {
23
34
  return Fr.ZERO;
24
35
  }
25
- const valueToCompress = Buffer.alloc(32);
26
- const tree = UnbalancedMerkleTreeCalculator.create(outHashes.map((hash)=>hash.toBuffer()), valueToCompress);
27
- return Fr.fromBuffer(tree.getRoot());
36
+ return Fr.fromBuffer(computeCompressedUnbalancedShaRoot(outHashes.map((hash)=>hash.toBuffer())));
28
37
  }
@@ -1,10 +1,10 @@
1
1
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
2
  import { CommitteeAttestation } from '../block/index.js';
3
- import type { BlockAttestation } from './block_attestation.js';
3
+ import type { CheckpointAttestation } from './checkpoint_attestation.js';
4
4
  /**
5
5
  * Returns attestation signatures in the order of a series of provided ethereum addresses
6
6
  * The rollup smart contract expects attestations to appear in the order of the committee
7
7
  * @todo: perform this logic within the memory attestation store instead?
8
8
  */
9
- export declare function orderAttestations(attestations: BlockAttestation[], orderAddresses: EthAddress[]): CommitteeAttestation[];
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ZXN0YXRpb25fdXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wMnAvYXR0ZXN0YXRpb25fdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFaEUsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUUvRDs7OztHQUlHO0FBQ0gsd0JBQWdCLGlCQUFpQixDQUMvQixZQUFZLEVBQUUsZ0JBQWdCLEVBQUUsRUFDaEMsY0FBYyxFQUFFLFVBQVUsRUFBRSxHQUMzQixvQkFBb0IsRUFBRSxDQXFCeEIifQ==
9
+ export declare function orderAttestations(attestations: CheckpointAttestation[], orderAddresses: EthAddress[]): CommitteeAttestation[];
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ZXN0YXRpb25fdXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wMnAvYXR0ZXN0YXRpb25fdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFaEUsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUscUJBQXFCLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUV6RTs7OztHQUlHO0FBQ0gsd0JBQWdCLGlCQUFpQixDQUMvQixZQUFZLEVBQUUscUJBQXFCLEVBQUUsRUFDckMsY0FBYyxFQUFFLFVBQVUsRUFBRSxHQUMzQixvQkFBb0IsRUFBRSxDQXFCeEIifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"attestation_utils.d.ts","sourceRoot":"","sources":["../../src/p2p/attestation_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,gBAAgB,EAAE,EAChC,cAAc,EAAE,UAAU,EAAE,GAC3B,oBAAoB,EAAE,CAqBxB"}
1
+ {"version":3,"file":"attestation_utils.d.ts","sourceRoot":"","sources":["../../src/p2p/attestation_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,qBAAqB,EAAE,EACrC,cAAc,EAAE,UAAU,EAAE,GAC3B,oBAAoB,EAAE,CAqBxB"}
@@ -4,7 +4,7 @@ import { CommitteeAttestation } from '../block/index.js';
4
4
  * The rollup smart contract expects attestations to appear in the order of the committee
5
5
  * @todo: perform this logic within the memory attestation store instead?
6
6
  */ export function orderAttestations(attestations, orderAddresses) {
7
- // Create a map of sender addresses to BlockAttestations
7
+ // Create a map of sender addresses to attestations
8
8
  const attestationMap = new Map();
9
9
  for (const attestation of attestations){
10
10
  const sender = attestation.getSender();
@@ -1,14 +1,17 @@
1
- import { SlotNumber } from '@aztec/foundation/branded-types';
1
+ import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
2
2
  import { Buffer32 } from '@aztec/foundation/buffer';
3
3
  import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import type { EthAddress } from '@aztec/foundation/eth-address';
5
5
  import { Signature } from '@aztec/foundation/eth-signature';
6
6
  import { BufferReader } from '@aztec/foundation/serialize';
7
+ import type { L2Block } from '../block/l2_block.js';
7
8
  import type { L2BlockInfo } from '../block/l2_block_info.js';
9
+ import { BlockHeader } from '../tx/block_header.js';
8
10
  import { TxHash } from '../tx/index.js';
9
- import { Tx } from '../tx/tx.js';
10
- import { ConsensusPayload } from './consensus_payload.js';
11
+ import type { Tx } from '../tx/tx.js';
11
12
  import { Gossipable } from './gossipable.js';
13
+ import { SignatureDomainSeparator } from './signature_utils.js';
14
+ import { SignedTxs } from './signed_txs.js';
12
15
  import { TopicType } from './topic_type.js';
13
16
  export declare class BlockProposalHash extends Buffer32 {
14
17
  constructor(hash: Buffer);
@@ -19,40 +22,101 @@ export type BlockProposalOptions = {
19
22
  broadcastInvalidBlockProposal?: boolean;
20
23
  };
21
24
  /**
22
- * BlockProposal
23
- *
24
- * A block proposal is created by the leader of the chain proposing a sequence of transactions to
25
- * be included in the head of the chain
25
+ * A block proposal is created by the leader of the chain proposing a sequence of transactions
26
+ * to be included in a block within a checkpoint. This is used for non-last blocks in a slot.
27
+ * The last block is sent as part of a CheckpointProposal.
26
28
  */
27
29
  export declare class BlockProposal extends Gossipable {
28
- readonly payload: ConsensusPayload;
29
- readonly signature: Signature;
30
+ readonly blockHeader: BlockHeader;
31
+ readonly indexWithinCheckpoint: number;
32
+ readonly inHash: Fr;
33
+ readonly archiveRoot: Fr;
30
34
  readonly txHashes: TxHash[];
31
- readonly txs?: Tx[] | undefined;
35
+ readonly signature: Signature;
36
+ readonly signedTxs?: SignedTxs | undefined;
32
37
  static p2pTopic: TopicType;
33
38
  private sender;
34
39
  constructor(
35
- /** The payload of the message, and what the signature is over */
36
- payload: ConsensusPayload,
37
- /** The signer of the BlockProposal over the header of the new block*/
38
- signature: Signature,
40
+ /** The per-block header containing block state and global variables */
41
+ blockHeader: BlockHeader,
42
+ /** Index of this block within the checkpoint (0-indexed) */
43
+ indexWithinCheckpoint: number,
44
+ /** Hash of L1 to L2 messages for this checkpoint (constant across all blocks in checkpoint) */
45
+ inHash: Fr,
46
+ /** Archive root after this block is applied */
47
+ archiveRoot: Fr,
39
48
  /** The sequence of transactions in the block */
40
49
  txHashes: TxHash[],
41
- /** The transactions in the block */
42
- txs?: Tx[] | undefined);
50
+ /** The proposer's signature over the block data */
51
+ signature: Signature,
52
+ /** The signed transactions in the block (optional, for DA guarantees) */
53
+ signedTxs?: SignedTxs | undefined);
43
54
  generateP2PMessageIdentifier(): Promise<Buffer32>;
44
55
  get archive(): Fr;
45
56
  get slotNumber(): SlotNumber;
57
+ get blockNumber(): BlockNumber;
58
+ /** Convenience getter for txs from signedTxs */
59
+ get txs(): Tx[] | undefined;
46
60
  toBlockInfo(): Omit<L2BlockInfo, 'blockNumber'>;
47
- static createProposalFromSigner(payload: ConsensusPayload, txHashes: TxHash[], txs: Tx[] | undefined, payloadSigner: (payload: Buffer32) => Promise<Signature>): Promise<BlockProposal>;
48
- /**Get Sender
49
- * Lazily evaluate the sender of the proposal; result is cached
50
- * @returns The sender address, or undefined if signature recovery fails
61
+ /**
62
+ * Get the payload to sign for this block proposal.
63
+ * The signature is over: blockHeader + indexWithinCheckpoint + inHash + archiveRoot + txHashes
64
+ */
65
+ getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer;
66
+ static createProposalFromSigner(blockHeader: BlockHeader, indexWithinCheckpoint: number, inHash: Fr, archiveRoot: Fr, txHashes: TxHash[], txs: Tx[] | undefined, payloadSigner: (payload: Buffer32) => Promise<Signature>): Promise<BlockProposal>;
67
+ /**
68
+ * Lazily evaluate the sender of the proposal; result is cached.
69
+ * If there's signedTxs, also verifies the signedTxs sender matches the block proposal sender.
70
+ * @returns The sender address, or undefined if signature recovery fails or senders don't match
51
71
  */
52
72
  getSender(): EthAddress | undefined;
53
73
  getPayload(): Buffer<ArrayBufferLike>;
54
74
  toBuffer(): Buffer;
55
75
  static fromBuffer(buf: Buffer | BufferReader): BlockProposal;
56
76
  getSize(): number;
77
+ static empty(): BlockProposal;
78
+ static random(): BlockProposal;
79
+ toInspect(): {
80
+ blockHeader: {
81
+ lastArchive: `0x${string}`;
82
+ state: {
83
+ l1ToL2MessageTree: `0x${string}`;
84
+ noteHashTree: `0x${string}`;
85
+ nullifierTree: `0x${string}`;
86
+ publicDataTree: `0x${string}`;
87
+ };
88
+ spongeBlobHash: bigint;
89
+ globalVariables: {
90
+ chainId: number;
91
+ version: number;
92
+ blockNumber: BlockNumber;
93
+ slotNumber: SlotNumber;
94
+ timestamp: bigint;
95
+ coinbase: `0x${string}`;
96
+ feeRecipient: `0x${string}`;
97
+ feePerDaGas: number;
98
+ feePerL2Gas: number;
99
+ };
100
+ totalFees: bigint;
101
+ totalManaUsed: bigint;
102
+ };
103
+ indexWithinCheckpoint: number;
104
+ inHash: `0x${string}`;
105
+ archiveRoot: `0x${string}`;
106
+ signature: `0x${string}`;
107
+ txHashes: `0x${string}`[];
108
+ };
109
+ /**
110
+ * Check if this proposal matches the given block.
111
+ * Compares the archive root and block header.
112
+ * @param block - The L2Block to compare against
113
+ * @returns True if the proposal matches the block
114
+ */
115
+ matchesBlock(block: L2Block): boolean;
116
+ /**
117
+ * Returns a copy of this proposal without signedTxs.
118
+ * Used when storing proposals in attestation pool to avoid storing full tx data.
119
+ */
120
+ withoutSignedTxs(): BlockProposal;
57
121
  }
58
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfcHJvcG9zYWwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wMnAvYmxvY2tfcHJvcG9zYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzdELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUdwRCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDaEUsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzVELE9BQU8sRUFBRSxZQUFZLEVBQXFCLE1BQU0sNkJBQTZCLENBQUM7QUFFOUUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDN0QsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3hDLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDakMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDMUQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBTTdDLE9BQU8sRUFB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