@aztec/stdlib 3.0.0-nightly.20250917 → 3.0.0-nightly.20250919

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 (234) hide show
  1. package/dest/avm/avm.d.ts +6 -0
  2. package/dest/avm/avm.d.ts.map +1 -1
  3. package/dest/avm/avm_circuit_public_inputs.d.ts +6 -1
  4. package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
  5. package/dest/avm/avm_circuit_public_inputs.js +11 -6
  6. package/dest/avm/avm_proving_request.d.ts +7 -0
  7. package/dest/avm/avm_proving_request.d.ts.map +1 -1
  8. package/dest/block/body.d.ts +4 -1
  9. package/dest/block/body.d.ts.map +1 -1
  10. package/dest/block/body.js +16 -5
  11. package/dest/block/index.d.ts +1 -0
  12. package/dest/block/index.d.ts.map +1 -1
  13. package/dest/block/index.js +1 -0
  14. package/dest/block/l2_block.d.ts +8 -5
  15. package/dest/block/l2_block.d.ts.map +1 -1
  16. package/dest/block/l2_block.js +14 -7
  17. package/dest/block/l2_block_code_to_purge.d.ts +3 -14
  18. package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
  19. package/dest/block/l2_block_code_to_purge.js +23 -13
  20. package/dest/block/l2_block_header.d.ts +100 -0
  21. package/dest/block/l2_block_header.d.ts.map +1 -0
  22. package/dest/block/l2_block_header.js +146 -0
  23. package/dest/block/l2_block_stream/l2_tips_memory_store.js +1 -1
  24. package/dest/block/published_l2_block.d.ts +2 -2
  25. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  26. package/dest/block/test/l2_tips_store_test_suite.js +1 -3
  27. package/dest/interfaces/block-builder.d.ts +2 -2
  28. package/dest/interfaces/block-builder.d.ts.map +1 -1
  29. package/dest/interfaces/epoch-prover.d.ts +26 -9
  30. package/dest/interfaces/epoch-prover.d.ts.map +1 -1
  31. package/dest/interfaces/proving-job.d.ts +233 -125
  32. package/dest/interfaces/proving-job.d.ts.map +1 -1
  33. package/dest/interfaces/proving-job.js +120 -102
  34. package/dest/interfaces/pxe.d.ts +192 -90
  35. package/dest/interfaces/pxe.d.ts.map +1 -1
  36. package/dest/interfaces/pxe.js +5 -31
  37. package/dest/interfaces/server_circuit_prover.d.ts +31 -27
  38. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  39. package/dest/interfaces/validator.d.ts +3 -2
  40. package/dest/interfaces/validator.d.ts.map +1 -1
  41. package/dest/kernel/private_circuit_public_inputs.d.ts +4 -4
  42. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  43. package/dest/kernel/private_circuit_public_inputs.js +7 -7
  44. package/dest/kernel/private_context_inputs.d.ts +2 -2
  45. package/dest/kernel/private_context_inputs.d.ts.map +1 -1
  46. package/dest/kernel/private_context_inputs.js +4 -4
  47. package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +1 -1
  48. package/dest/p2p/consensus_payload.d.ts +7 -6
  49. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  50. package/dest/p2p/consensus_payload.js +7 -6
  51. package/dest/parity/index.d.ts +2 -3
  52. package/dest/parity/index.d.ts.map +1 -1
  53. package/dest/parity/index.js +2 -3
  54. package/dest/parity/{base_parity_inputs.d.ts → parity_base_private_inputs.d.ts} +6 -6
  55. package/dest/parity/parity_base_private_inputs.d.ts.map +1 -0
  56. package/dest/parity/{base_parity_inputs.js → parity_base_private_inputs.js} +5 -5
  57. package/dest/parity/parity_root_private_inputs.d.ts +39 -0
  58. package/dest/parity/parity_root_private_inputs.d.ts.map +1 -0
  59. package/dest/parity/{root_parity_inputs.js → parity_root_private_inputs.js} +12 -13
  60. package/dest/proofs/proof_data.d.ts +4 -3
  61. package/dest/proofs/proof_data.d.ts.map +1 -1
  62. package/dest/proofs/proof_data.js +2 -2
  63. package/dest/proofs/proving_request_type.d.ts +16 -11
  64. package/dest/proofs/proving_request_type.d.ts.map +1 -1
  65. package/dest/proofs/proving_request_type.js +16 -11
  66. package/dest/rollup/base_rollup_hints.d.ts +12 -3
  67. package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
  68. package/dest/rollup/base_rollup_hints.js +11 -5
  69. package/dest/rollup/block_constant_data.d.ts +20 -6
  70. package/dest/rollup/block_constant_data.d.ts.map +1 -1
  71. package/dest/rollup/block_constant_data.js +15 -7
  72. package/dest/rollup/{block_merge_rollup.d.ts → block_merge_rollup_private_inputs.d.ts} +17 -10
  73. package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -0
  74. package/dest/rollup/{block_merge_rollup.js → block_merge_rollup_private_inputs.js} +14 -13
  75. package/dest/rollup/block_rollup_public_inputs.d.ts +124 -0
  76. package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -0
  77. package/dest/rollup/block_rollup_public_inputs.js +85 -0
  78. package/dest/rollup/block_root_rollup_private_inputs.d.ts +236 -0
  79. package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -0
  80. package/dest/rollup/block_root_rollup_private_inputs.js +257 -0
  81. package/dest/rollup/checkpoint_constant_data.d.ts +54 -0
  82. package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -0
  83. package/dest/rollup/checkpoint_constant_data.js +55 -0
  84. package/dest/{tx/proposed_block_header.d.ts → rollup/checkpoint_header.d.ts} +11 -12
  85. package/dest/rollup/checkpoint_header.d.ts.map +1 -0
  86. package/dest/{tx/proposed_block_header.js → rollup/checkpoint_header.js} +9 -9
  87. package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +30 -0
  88. package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -0
  89. package/dest/rollup/checkpoint_merge_rollup_private_inputs.js +37 -0
  90. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +105 -0
  91. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -0
  92. package/dest/rollup/checkpoint_rollup_public_inputs.js +105 -0
  93. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +123 -0
  94. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -0
  95. package/dest/rollup/checkpoint_root_rollup_private_inputs.js +178 -0
  96. package/dest/rollup/epoch_constant_data.d.ts +19 -2
  97. package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
  98. package/dest/rollup/epoch_constant_data.js +20 -7
  99. package/dest/rollup/index.d.ts +14 -12
  100. package/dest/rollup/index.d.ts.map +1 -1
  101. package/dest/rollup/index.js +14 -12
  102. package/dest/rollup/{private_base_rollup_inputs.d.ts → private_tx_base_rollup_private_inputs.d.ts} +7 -7
  103. package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -0
  104. package/dest/rollup/{private_base_rollup_inputs.js → private_tx_base_rollup_private_inputs.js} +6 -6
  105. package/dest/rollup/{public_base_rollup_inputs.d.ts → public_tx_base_rollup_private_inputs.d.ts} +7 -7
  106. package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -0
  107. package/dest/rollup/{public_base_rollup_inputs.js → public_tx_base_rollup_private_inputs.js} +6 -6
  108. package/dest/rollup/root_rollup_private_inputs.d.ts +67 -0
  109. package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -0
  110. package/dest/rollup/root_rollup_private_inputs.js +69 -0
  111. package/dest/rollup/root_rollup_public_inputs.d.ts +46 -0
  112. package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -0
  113. package/dest/rollup/root_rollup_public_inputs.js +71 -0
  114. package/dest/rollup/{merge_rollup.d.ts → tx_merge_rollup_private_inputs.d.ts} +11 -10
  115. package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -0
  116. package/dest/rollup/{merge_rollup.js → tx_merge_rollup_private_inputs.js} +14 -13
  117. package/dest/rollup/{base_or_merge_rollup_public_inputs.d.ts → tx_rollup_public_inputs.d.ts} +12 -12
  118. package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -0
  119. package/dest/rollup/{base_or_merge_rollup_public_inputs.js → tx_rollup_public_inputs.js} +14 -14
  120. package/dest/stats/stats.d.ts +1 -1
  121. package/dest/stats/stats.d.ts.map +1 -1
  122. package/dest/tests/factories.d.ts +28 -68
  123. package/dest/tests/factories.d.ts.map +1 -1
  124. package/dest/tests/factories.js +90 -115
  125. package/dest/tests/mocks.d.ts +3 -2
  126. package/dest/tests/mocks.d.ts.map +1 -1
  127. package/dest/tests/mocks.js +3 -3
  128. package/dest/tx/block_header.d.ts +12 -13
  129. package/dest/tx/block_header.d.ts.map +1 -1
  130. package/dest/tx/block_header.js +16 -21
  131. package/dest/tx/global_variables.d.ts.map +1 -1
  132. package/dest/tx/global_variables.js +0 -1
  133. package/dest/tx/index.d.ts +0 -1
  134. package/dest/tx/index.d.ts.map +1 -1
  135. package/dest/tx/index.js +0 -1
  136. package/dest/tx/private_execution_result.d.ts +2 -2
  137. package/dest/tx/private_execution_result.d.ts.map +1 -1
  138. package/dest/tx/private_execution_result.js +3 -3
  139. package/dest/tx/tx_constant_data.d.ts +4 -4
  140. package/dest/tx/tx_constant_data.d.ts.map +1 -1
  141. package/dest/tx/tx_constant_data.js +6 -6
  142. package/dest/tx/tx_effect.d.ts +0 -3
  143. package/dest/tx/tx_effect.d.ts.map +1 -1
  144. package/dest/tx/tx_effect.js +2 -7
  145. package/package.json +8 -8
  146. package/src/avm/avm_circuit_public_inputs.ts +10 -0
  147. package/src/block/body.ts +23 -6
  148. package/src/block/index.ts +1 -0
  149. package/src/block/l2_block.ts +18 -8
  150. package/src/block/l2_block_code_to_purge.ts +30 -31
  151. package/src/block/l2_block_header.ts +232 -0
  152. package/src/block/l2_block_stream/l2_tips_memory_store.ts +1 -1
  153. package/src/block/test/l2_tips_store_test_suite.ts +1 -2
  154. package/src/interfaces/block-builder.ts +2 -6
  155. package/src/interfaces/epoch-prover.ts +35 -11
  156. package/src/interfaces/proving-job.ts +199 -123
  157. package/src/interfaces/pxe.ts +3 -138
  158. package/src/interfaces/server_circuit_prover.ts +83 -52
  159. package/src/interfaces/validator.ts +3 -2
  160. package/src/kernel/private_circuit_public_inputs.ts +5 -5
  161. package/src/kernel/private_context_inputs.ts +2 -2
  162. package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +1 -1
  163. package/src/p2p/consensus_payload.ts +8 -7
  164. package/src/parity/index.ts +2 -3
  165. package/src/parity/{base_parity_inputs.ts → parity_base_private_inputs.ts} +6 -6
  166. package/src/parity/{root_parity_inputs.ts → parity_root_private_inputs.ts} +16 -18
  167. package/src/proofs/proof_data.ts +5 -8
  168. package/src/proofs/proving_request_type.ts +14 -8
  169. package/src/rollup/base_rollup_hints.ts +9 -1
  170. package/src/rollup/block_constant_data.ts +13 -3
  171. package/src/rollup/{block_merge_rollup.ts → block_merge_rollup_private_inputs.ts} +15 -11
  172. package/src/rollup/block_rollup_public_inputs.ts +123 -0
  173. package/src/rollup/block_root_rollup_private_inputs.ts +312 -0
  174. package/src/rollup/checkpoint_constant_data.ts +84 -0
  175. package/src/{tx/proposed_block_header.ts → rollup/checkpoint_header.ts} +16 -17
  176. package/src/rollup/checkpoint_merge_rollup_private_inputs.ts +49 -0
  177. package/src/rollup/{block_root_or_block_merge_public_inputs.ts → checkpoint_rollup_public_inputs.ts} +26 -52
  178. package/src/rollup/checkpoint_root_rollup_private_inputs.ts +218 -0
  179. package/src/rollup/epoch_constant_data.ts +32 -8
  180. package/src/rollup/index.ts +14 -12
  181. package/src/rollup/{private_base_rollup_inputs.ts → private_tx_base_rollup_private_inputs.ts} +9 -9
  182. package/src/rollup/{public_base_rollup_inputs.ts → public_tx_base_rollup_private_inputs.ts} +9 -9
  183. package/src/rollup/root_rollup_private_inputs.ts +90 -0
  184. package/src/rollup/{root_rollup.ts → root_rollup_public_inputs.ts} +8 -104
  185. package/src/rollup/{merge_rollup.ts → tx_merge_rollup_private_inputs.ts} +13 -9
  186. package/src/rollup/{base_or_merge_rollup_public_inputs.ts → tx_rollup_public_inputs.ts} +12 -12
  187. package/src/stats/stats.ts +18 -12
  188. package/src/tests/factories.ts +144 -199
  189. package/src/tests/mocks.ts +6 -13
  190. package/src/tx/block_header.ts +17 -32
  191. package/src/tx/global_variables.ts +0 -1
  192. package/src/tx/index.ts +0 -1
  193. package/src/tx/private_execution_result.ts +3 -3
  194. package/src/tx/tx_constant_data.ts +4 -4
  195. package/src/tx/tx_effect.ts +2 -7
  196. package/dest/parity/base_parity_inputs.d.ts.map +0 -1
  197. package/dest/parity/root_parity_input.d.ts +0 -52
  198. package/dest/parity/root_parity_input.d.ts.map +0 -1
  199. package/dest/parity/root_parity_input.js +0 -50
  200. package/dest/parity/root_parity_inputs.d.ts +0 -37
  201. package/dest/parity/root_parity_inputs.d.ts.map +0 -1
  202. package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +0 -1
  203. package/dest/rollup/block_merge_rollup.d.ts.map +0 -1
  204. package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts +0 -134
  205. package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +0 -1
  206. package/dest/rollup/block_root_or_block_merge_public_inputs.js +0 -125
  207. package/dest/rollup/block_root_rollup.d.ts +0 -283
  208. package/dest/rollup/block_root_rollup.d.ts.map +0 -1
  209. package/dest/rollup/block_root_rollup.js +0 -306
  210. package/dest/rollup/empty_block_root_rollup_inputs.d.ts +0 -51
  211. package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +0 -1
  212. package/dest/rollup/empty_block_root_rollup_inputs.js +0 -65
  213. package/dest/rollup/merge_rollup.d.ts.map +0 -1
  214. package/dest/rollup/padding_block_root_rollup_inputs.d.ts +0 -20
  215. package/dest/rollup/padding_block_root_rollup_inputs.d.ts.map +0 -1
  216. package/dest/rollup/padding_block_root_rollup_inputs.js +0 -39
  217. package/dest/rollup/previous_rollup_block_data.d.ts +0 -47
  218. package/dest/rollup/previous_rollup_block_data.d.ts.map +0 -1
  219. package/dest/rollup/previous_rollup_block_data.js +0 -37
  220. package/dest/rollup/previous_rollup_data.d.ts +0 -47
  221. package/dest/rollup/previous_rollup_data.d.ts.map +0 -1
  222. package/dest/rollup/previous_rollup_data.js +0 -37
  223. package/dest/rollup/private_base_rollup_inputs.d.ts.map +0 -1
  224. package/dest/rollup/public_base_rollup_inputs.d.ts.map +0 -1
  225. package/dest/rollup/root_rollup.d.ts +0 -106
  226. package/dest/rollup/root_rollup.d.ts.map +0 -1
  227. package/dest/rollup/root_rollup.js +0 -147
  228. package/dest/tx/proposed_block_header.d.ts.map +0 -1
  229. package/src/parity/root_parity_input.ts +0 -71
  230. package/src/rollup/block_root_rollup.ts +0 -380
  231. package/src/rollup/empty_block_root_rollup_inputs.ts +0 -80
  232. package/src/rollup/padding_block_root_rollup_inputs.ts +0 -47
  233. package/src/rollup/previous_rollup_block_data.ts +0 -48
  234. package/src/rollup/previous_rollup_data.ts +0 -48
@@ -69,7 +69,6 @@ import { schemas } from '../schemas/index.js';
69
69
  return new GlobalVariables(reader.readField(), reader.readField(), reader.readU32(), reader.readField(), reader.readField().toBigInt(), EthAddress.fromField(reader.readField()), AztecAddress.fromField(reader.readField()), GasFees.fromFields(reader));
70
70
  }
71
71
  static getFields(fields) {
72
- // Note: The order here must match the order in the ProposedHeaderLib solidity library.
73
72
  return [
74
73
  fields.chainId,
75
74
  fields.version,
@@ -10,7 +10,6 @@ export * from './tx_constant_data.js';
10
10
  export * from './tx_context.js';
11
11
  export * from './tx_request.js';
12
12
  export * from './private_execution_result.js';
13
- export * from './proposed_block_header.js';
14
13
  export * from './public_call_request_with_calldata.js';
15
14
  export * from './tx_hash.js';
16
15
  export * from './tx_receipt.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tx/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAA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,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
package/dest/tx/index.js CHANGED
@@ -10,7 +10,6 @@ export * from './tx_constant_data.js';
10
10
  export * from './tx_context.js';
11
11
  export * from './tx_request.js';
12
12
  export * from './private_execution_result.js';
13
- export * from './proposed_block_header.js';
14
13
  export * from './public_call_request_with_calldata.js';
15
14
  export * from './tx_hash.js';
16
15
  export * from './tx_receipt.js';
@@ -94,9 +94,9 @@ export declare class PrivateExecutionResult {
94
94
  static from(fields: FieldsOf<PrivateExecutionResult>): PrivateExecutionResult;
95
95
  static random(nested?: number): Promise<PrivateExecutionResult>;
96
96
  /**
97
- * The block number that this execution was simulated with.
97
+ * The anchor block number that this execution was simulated with.
98
98
  */
99
- getSimulationBlockNumber(): UInt32;
99
+ getSimulationAnchorBlockNumber(): UInt32;
100
100
  }
101
101
  /**
102
102
  * The result of executing a call to a private function.
@@ -1 +1 @@
1
- {"version":3,"file":"private_execution_result.d.ts","sourceRoot":"","sources":["../../src/tx/private_execution_result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,gB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A0B,CAAC,CAgBtD;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,0BAA0B,CAAC;WAgB3C,MAAM,CAAC,MAAM,SAAI,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAmBrE;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,uBAQ7E;AAED,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,sBAAsB,uBAWpF;AAWD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,sBAAsB,GAAG,sBAAsB,EAAE,CAI3G;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,sBAAsB,GAAG,cAAc,EAAE,CAW3F;AAED,wBAAgB,sCAAsC,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,CAQjG;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,cAAc,EAAE,0BAA0B,EAAE,EAC5C,qBAAqB,EAAE,CAAC,SAAS,EAAE,0BAA0B,KAAK,CAAC,EAAE,GACpE,CAAC,EAAE,CAQL;AAED,qBAAa,6BAA6B;IACrB,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAA;KAAE;gBAA1E,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAA;KAAE;CAC9F"}
@@ -80,9 +80,9 @@ export class PrivateExecutionResult {
80
80
  ]);
81
81
  }
82
82
  /**
83
- * The block number that this execution was simulated with.
84
- */ getSimulationBlockNumber() {
85
- return this.entrypoint.publicInputs.historicalHeader.globalVariables.blockNumber;
83
+ * The anchor block number that this execution was simulated with.
84
+ */ getSimulationAnchorBlockNumber() {
85
+ return this.entrypoint.publicInputs.anchorBlockHeader.globalVariables.blockNumber;
86
86
  }
87
87
  }
88
88
  /**
@@ -8,12 +8,12 @@ import { TxContext } from './tx_context.js';
8
8
  */
9
9
  export declare class TxConstantData {
10
10
  /** Header of a block whose state is used during execution (not the block the transaction is included in). */
11
- historicalHeader: BlockHeader;
11
+ anchorBlockHeader: BlockHeader;
12
12
  /**
13
13
  * Context of the transaction.
14
14
  *
15
15
  * Note: `chainId` and `version` in txContext are not redundant to the values in
16
- * self.historical_header.global_variables because they can be different in case of a protocol upgrade. In such
16
+ * self.anchor_block_header.global_variables because they can be different in case of a protocol upgrade. In such
17
17
  * a situation we could be using header from a block before the upgrade took place but be using the updated
18
18
  * protocol to execute and prove the transaction.
19
19
  */
@@ -28,12 +28,12 @@ export declare class TxConstantData {
28
28
  protocolContractTreeRoot: Fr;
29
29
  constructor(
30
30
  /** Header of a block whose state is used during execution (not the block the transaction is included in). */
31
- historicalHeader: BlockHeader,
31
+ anchorBlockHeader: BlockHeader,
32
32
  /**
33
33
  * Context of the transaction.
34
34
  *
35
35
  * Note: `chainId` and `version` in txContext are not redundant to the values in
36
- * self.historical_header.global_variables because they can be different in case of a protocol upgrade. In such
36
+ * self.anchor_block_header.global_variables because they can be different in case of a protocol upgrade. In such
37
37
  * a situation we could be using header from a block before the upgrade took place but be using the updated
38
38
  * protocol to execute and prove the transaction.
39
39
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tx_constant_data.d.ts","sourceRoot":"","sources":["../../src/tx/tx_constant_data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAC9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAi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,EAAE,SAAS;IAC3B;;OAEG;IACI,UAAU,EAAE,EAAE;IACrB;;OAEG;IACI,wBAAwB,EAAE,EAAE;;IAlBnC,6GAA6G;IACtG,iBAAiB,EAAE,WAAW;IACrC;;;;;;;OAOG;IACI,SAAS,EAAE,SAAS;IAC3B;;OAEG;IACI,UAAU,EAAE,EAAE;IACrB;;OAEG;IACI,wBAAwB,EAAE,EAAE;IAGrC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC;IAI5C,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC;IAIjD,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,cAAc;IAU7D,QAAQ,IAAI,EAAE,EAAE;IAUhB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,cAAc;IAUhE,QAAQ;IAIR,MAAM,CAAC,KAAK;IAIZ,OAAO;IASP,KAAK,IAAI,cAAc;CAGxB"}
@@ -6,15 +6,15 @@ import { TxContext } from './tx_context.js';
6
6
  /**
7
7
  * Data that is constant/not modified by neither of the kernels.
8
8
  */ export class TxConstantData {
9
- historicalHeader;
9
+ anchorBlockHeader;
10
10
  txContext;
11
11
  vkTreeRoot;
12
12
  protocolContractTreeRoot;
13
- constructor(/** Header of a block whose state is used during execution (not the block the transaction is included in). */ historicalHeader, /**
13
+ constructor(/** Header of a block whose state is used during execution (not the block the transaction is included in). */ anchorBlockHeader, /**
14
14
  * Context of the transaction.
15
15
  *
16
16
  * Note: `chainId` and `version` in txContext are not redundant to the values in
17
- * self.historical_header.global_variables because they can be different in case of a protocol upgrade. In such
17
+ * self.anchor_block_header.global_variables because they can be different in case of a protocol upgrade. In such
18
18
  * a situation we could be using header from a block before the upgrade took place but be using the updated
19
19
  * protocol to execute and prove the transaction.
20
20
  */ txContext, /**
@@ -22,7 +22,7 @@ import { TxContext } from './tx_context.js';
22
22
  */ vkTreeRoot, /**
23
23
  * Root of the tree for the protocol contracts.
24
24
  */ protocolContractTreeRoot){
25
- this.historicalHeader = historicalHeader;
25
+ this.anchorBlockHeader = anchorBlockHeader;
26
26
  this.txContext = txContext;
27
27
  this.vkTreeRoot = vkTreeRoot;
28
28
  this.protocolContractTreeRoot = protocolContractTreeRoot;
@@ -32,7 +32,7 @@ import { TxContext } from './tx_context.js';
32
32
  }
33
33
  static getFields(fields) {
34
34
  return [
35
- fields.historicalHeader,
35
+ fields.anchorBlockHeader,
36
36
  fields.txContext,
37
37
  fields.vkTreeRoot,
38
38
  fields.protocolContractTreeRoot
@@ -60,7 +60,7 @@ import { TxContext } from './tx_context.js';
60
60
  return new TxConstantData(BlockHeader.empty(), TxContext.empty(), Fr.ZERO, Fr.ZERO);
61
61
  }
62
62
  getSize() {
63
- return this.historicalHeader.getSize() + this.txContext.getSize() + this.vkTreeRoot.size + this.protocolContractTreeRoot.size;
63
+ return this.anchorBlockHeader.getSize() + this.txContext.getSize() + this.vkTreeRoot.size + this.protocolContractTreeRoot.size;
64
64
  }
65
65
  clone() {
66
66
  return TxConstantData.fromBuffer(this.toBuffer());
@@ -9,9 +9,6 @@ import { ContractClassLog } from '../logs/contract_class_log.js';
9
9
  import { PrivateLog } from '../logs/private_log.js';
10
10
  import { PublicLog } from '../logs/public_log.js';
11
11
  import { TxHash } from './tx_hash.js';
12
- export declare const TX_START_PREFIX = 8392562855083340404n;
13
- export declare const TX_START_PREFIX_BYTES_LENGTH: number;
14
- export declare const TX_EFFECT_PREFIX_BYTE_LENGTH: number;
15
12
  export declare class TxEffect {
16
13
  /**
17
14
  * Whether the transaction reverted during public app logic.
@@ -1 +1 @@
1
- {"version":3,"file":"tx_effect.d.ts","sourceRoot":"","sources":["../../src/tx/tx_effect.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,QAAQ,EAA6B,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA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;IA0EhD,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAetC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAepC;IAED,CAAC,OAAO,CAAC,MAAM,CAAC;IAsBhB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;CAG9B"}
@@ -1,4 +1,5 @@
1
- import { CONTRACT_CLASS_LOGS_PREFIX, L2_L1_MSGS_PREFIX, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_LOGS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, NOTES_PREFIX, NULLIFIERS_PREFIX, PRIVATE_LOGS_PREFIX, PUBLIC_DATA_UPDATE_REQUESTS_PREFIX, PUBLIC_LOGS_PREFIX, REVERT_CODE_PREFIX, TX_FEE_PREFIX } from '@aztec/constants';
1
+ import { TX_EFFECT_PREFIX_BYTE_LENGTH, TX_START_PREFIX_BYTES_LENGTH } from '@aztec/blob-lib/encoding';
2
+ import { CONTRACT_CLASS_LOGS_PREFIX, L2_L1_MSGS_PREFIX, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_LOGS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, NOTES_PREFIX, NULLIFIERS_PREFIX, PRIVATE_LOGS_PREFIX, PUBLIC_DATA_UPDATE_REQUESTS_PREFIX, PUBLIC_LOGS_PREFIX, REVERT_CODE_PREFIX, TX_FEE_PREFIX, TX_START_PREFIX } from '@aztec/constants';
2
3
  import { makeTuple, makeTupleAsync } from '@aztec/foundation/array';
3
4
  import { toBufferBE } from '@aztec/foundation/bigint-buffer';
4
5
  import { Fr } from '@aztec/foundation/fields';
@@ -14,12 +15,6 @@ import { ContractClassLog } from '../logs/contract_class_log.js';
14
15
  import { PrivateLog } from '../logs/private_log.js';
15
16
  import { PublicLog } from '../logs/public_log.js';
16
17
  import { TxHash } from './tx_hash.js';
17
- // This will appear as 0x74785f7374617274 in logs
18
- export const TX_START_PREFIX = 8392562855083340404n;
19
- // These are helper constants to decode tx effects from blob encoded fields
20
- export const TX_START_PREFIX_BYTES_LENGTH = TX_START_PREFIX.toString(16).length / 2;
21
- // 7 bytes for: | 0 | txlen[0] | txlen[1] | 0 | REVERT_CODE_PREFIX | 0 | revertCode |
22
- export const TX_EFFECT_PREFIX_BYTE_LENGTH = TX_START_PREFIX_BYTES_LENGTH + 7;
23
18
  export class TxEffect {
24
19
  revertCode;
25
20
  txHash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/stdlib",
3
- "version": "3.0.0-nightly.20250917",
3
+ "version": "3.0.0-nightly.20250919",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -69,13 +69,13 @@
69
69
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
70
70
  },
71
71
  "dependencies": {
72
- "@aztec/bb.js": "3.0.0-nightly.20250917",
73
- "@aztec/blob-lib": "3.0.0-nightly.20250917",
74
- "@aztec/constants": "3.0.0-nightly.20250917",
75
- "@aztec/ethereum": "3.0.0-nightly.20250917",
76
- "@aztec/foundation": "3.0.0-nightly.20250917",
77
- "@aztec/l1-artifacts": "3.0.0-nightly.20250917",
78
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20250917",
72
+ "@aztec/bb.js": "3.0.0-nightly.20250919",
73
+ "@aztec/blob-lib": "3.0.0-nightly.20250919",
74
+ "@aztec/constants": "3.0.0-nightly.20250919",
75
+ "@aztec/ethereum": "3.0.0-nightly.20250919",
76
+ "@aztec/foundation": "3.0.0-nightly.20250919",
77
+ "@aztec/l1-artifacts": "3.0.0-nightly.20250919",
78
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20250919",
79
79
  "@google-cloud/storage": "^7.15.0",
80
80
  "axios": "^1.9.0",
81
81
  "json-stringify-deterministic": "1.0.12",
@@ -27,6 +27,7 @@ export class AvmCircuitPublicInputs {
27
27
  ///////////////////////////////////
28
28
  // Inputs.
29
29
  public globalVariables: GlobalVariables,
30
+ public protocolContractTreeRoot: Fr,
30
31
  public startTreeSnapshots: TreeSnapshots,
31
32
  public startGasUsed: Gas,
32
33
  public gasSettings: GasSettings,
@@ -54,6 +55,7 @@ export class AvmCircuitPublicInputs {
54
55
  return z
55
56
  .object({
56
57
  globalVariables: GlobalVariables.schema,
58
+ protocolContractTreeRoot: schemas.Fr,
57
59
  startTreeSnapshots: TreeSnapshots.schema,
58
60
  startGasUsed: Gas.schema,
59
61
  gasSettings: GasSettings.schema,
@@ -77,6 +79,7 @@ export class AvmCircuitPublicInputs {
77
79
  .transform(
78
80
  ({
79
81
  globalVariables,
82
+ protocolContractTreeRoot,
80
83
  startTreeSnapshots,
81
84
  startGasUsed,
82
85
  gasSettings,
@@ -99,6 +102,7 @@ export class AvmCircuitPublicInputs {
99
102
  }) =>
100
103
  new AvmCircuitPublicInputs(
101
104
  globalVariables,
105
+ protocolContractTreeRoot,
102
106
  startTreeSnapshots,
103
107
  startGasUsed,
104
108
  gasSettings,
@@ -126,6 +130,7 @@ export class AvmCircuitPublicInputs {
126
130
  const reader = BufferReader.asReader(buffer);
127
131
  return new AvmCircuitPublicInputs(
128
132
  reader.readObject(GlobalVariables),
133
+ reader.readObject(Fr),
129
134
  reader.readObject(TreeSnapshots),
130
135
  reader.readObject(Gas),
131
136
  reader.readObject(GasSettings),
@@ -151,6 +156,7 @@ export class AvmCircuitPublicInputs {
151
156
  toBuffer() {
152
157
  return serializeToBuffer(
153
158
  this.globalVariables,
159
+ this.protocolContractTreeRoot,
154
160
  this.startTreeSnapshots,
155
161
  this.startGasUsed,
156
162
  this.gasSettings,
@@ -185,6 +191,7 @@ export class AvmCircuitPublicInputs {
185
191
  const reader = FieldReader.asReader(fields);
186
192
  return new AvmCircuitPublicInputs(
187
193
  GlobalVariables.fromFields(reader),
194
+ reader.readField(),
188
195
  TreeSnapshots.fromFields(reader),
189
196
  Gas.fromFields(reader),
190
197
  GasSettings.fromFields(reader),
@@ -210,6 +217,7 @@ export class AvmCircuitPublicInputs {
210
217
  toFields() {
211
218
  return [
212
219
  ...this.globalVariables.toFields(),
220
+ this.protocolContractTreeRoot,
213
221
  ...this.startTreeSnapshots.toFields(),
214
222
  ...this.startGasUsed.toFields(),
215
223
  ...this.gasSettings.toFields(),
@@ -235,6 +243,7 @@ export class AvmCircuitPublicInputs {
235
243
  static empty() {
236
244
  return new AvmCircuitPublicInputs(
237
245
  GlobalVariables.empty(),
246
+ Fr.zero(),
238
247
  TreeSnapshots.empty(),
239
248
  Gas.empty(),
240
249
  GasSettings.empty(),
@@ -264,6 +273,7 @@ export class AvmCircuitPublicInputs {
264
273
  [inspect.custom]() {
265
274
  return `AvmCircuitPublicInputs {
266
275
  globalVariables: ${inspect(this.globalVariables)},
276
+ protocolContractTreeRoot: ${inspect(this.protocolContractTreeRoot)},
267
277
  startTreeSnapshots: ${inspect(this.startTreeSnapshots)},
268
278
  startGasUsed: ${inspect(this.startGasUsed)},
269
279
  gasSettings: ${inspect(this.gasSettings)},
package/src/block/body.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import { createBlockEndMarker, getNumTxsFromBlockEndMarker, isBlockEndMarker } from '@aztec/blob-lib/encoding';
1
2
  import { BLOBS_PER_BLOCK, FIELDS_PER_BLOB } from '@aztec/constants';
2
3
  import { timesParallel } from '@aztec/foundation/collection';
3
- import type { Fr } from '@aztec/foundation/fields';
4
+ import { Fr } from '@aztec/foundation/fields';
4
5
  import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
5
6
 
6
7
  import { inspect } from 'util';
@@ -9,6 +10,14 @@ import { z } from 'zod';
9
10
  import type { ZodFor } from '../schemas/index.js';
10
11
  import { TxEffect } from '../tx/tx_effect.js';
11
12
 
13
+ export { createBlockEndMarker };
14
+
15
+ export function getBlockBlobFields(txEffects: TxEffect[]) {
16
+ const blobFields = txEffects.flatMap(txEffect => txEffect.toBlobFields());
17
+ blobFields.push(createBlockEndMarker(txEffects.length));
18
+ return blobFields;
19
+ }
20
+
12
21
  export class Body {
13
22
  constructor(public txEffects: TxEffect[]) {
14
23
  txEffects.forEach(txEffect => {
@@ -54,10 +63,8 @@ export class Body {
54
63
  * Returns a flat packed array of fields of all tx effects - used for blobs.
55
64
  */
56
65
  toBlobFields() {
57
- let flattened: Fr[] = [];
58
- this.txEffects.forEach((effect: TxEffect) => {
59
- flattened = flattened.concat(effect.toBlobFields());
60
- });
66
+ const flattened = getBlockBlobFields(this.txEffects);
67
+
61
68
  if (flattened.length > BLOBS_PER_BLOCK * FIELDS_PER_BLOB) {
62
69
  throw new Error(
63
70
  `Attempted to overfill block's blobs with ${flattened.length} elements. The maximum is ${
@@ -74,10 +81,20 @@ export class Body {
74
81
  */
75
82
  static fromBlobFields(fields: Fr[]) {
76
83
  const txEffects: TxEffect[] = [];
77
- const reader = new FieldReader(fields);
84
+ const reader = new FieldReader(fields.slice(0, -1));
78
85
  while (!reader.isFinished()) {
79
86
  txEffects.push(TxEffect.fromBlobFields(reader));
80
87
  }
88
+
89
+ if (!isBlockEndMarker(fields[fields.length - 1])) {
90
+ throw new Error('Block end marker not found');
91
+ }
92
+
93
+ const numTxs = getNumTxsFromBlockEndMarker(fields[fields.length - 1]);
94
+ if (numTxs !== txEffects.length) {
95
+ throw new Error(`Expected ${numTxs} txs, but got ${txEffects.length}`);
96
+ }
97
+
81
98
  return new this(txEffects);
82
99
  }
83
100
 
@@ -1,4 +1,5 @@
1
1
  export * from './l2_block.js';
2
+ export * from './l2_block_header.js';
2
3
  export * from './l2_block_stream/index.js';
3
4
  export * from './in_block.js';
4
5
  export * from './body.js';
@@ -5,9 +5,10 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
5
5
  import { z } from 'zod';
6
6
 
7
7
  import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
8
- import { BlockHeader } from '../tx/block_header.js';
8
+ import type { BlockHeader } from '../tx/block_header.js';
9
9
  import { Body } from './body.js';
10
- import { makeAppendOnlyTreeSnapshot, makeHeader } from './l2_block_code_to_purge.js';
10
+ import { makeAppendOnlyTreeSnapshot, makeL2BlockHeader } from './l2_block_code_to_purge.js';
11
+ import { L2BlockHeader } from './l2_block_header.js';
11
12
  import type { L2BlockInfo } from './l2_block_info.js';
12
13
 
13
14
  /**
@@ -18,7 +19,7 @@ export class L2Block {
18
19
  /** Snapshot of archive tree after the block is applied. */
19
20
  public archive: AppendOnlyTreeSnapshot,
20
21
  /** L2 block header. */
21
- public header: BlockHeader,
22
+ public header: L2BlockHeader,
22
23
  /** L2 block body. */
23
24
  public body: Body,
24
25
  private blockHash: Fr | undefined = undefined,
@@ -28,7 +29,7 @@ export class L2Block {
28
29
  return z
29
30
  .object({
30
31
  archive: AppendOnlyTreeSnapshot.schema,
31
- header: BlockHeader.schema,
32
+ header: L2BlockHeader.schema,
32
33
  body: Body.schema,
33
34
  })
34
35
  .transform(({ archive, header, body }) => new L2Block(archive, header, body));
@@ -40,7 +41,7 @@ export class L2Block {
40
41
  */
41
42
  static fromBuffer(buf: Buffer | BufferReader) {
42
43
  const reader = BufferReader.asReader(buf);
43
- const header = reader.readObject(BlockHeader);
44
+ const header = reader.readObject(L2BlockHeader);
44
45
  const archive = reader.readObject(AppendOnlyTreeSnapshot);
45
46
  const body = reader.readObject(Body);
46
47
 
@@ -94,7 +95,7 @@ export class L2Block {
94
95
 
95
96
  return new L2Block(
96
97
  makeAppendOnlyTreeSnapshot(l2BlockNum + 1),
97
- makeHeader(0, l2BlockNum, slotNumber ?? l2BlockNum, inHash),
98
+ makeL2BlockHeader(0, l2BlockNum, slotNumber ?? l2BlockNum, {}, inHash),
98
99
  body,
99
100
  );
100
101
  }
@@ -104,7 +105,7 @@ export class L2Block {
104
105
  * @returns The L2 block.
105
106
  */
106
107
  static empty(): L2Block {
107
- return new L2Block(AppendOnlyTreeSnapshot.empty(), BlockHeader.empty(), Body.empty());
108
+ return new L2Block(AppendOnlyTreeSnapshot.empty(), L2BlockHeader.empty(), Body.empty());
108
109
  }
109
110
 
110
111
  get number(): number {
@@ -125,11 +126,20 @@ export class L2Block {
125
126
  */
126
127
  public async hash(): Promise<Fr> {
127
128
  if (this.blockHash === undefined) {
128
- this.blockHash = await this.header.hash();
129
+ this.blockHash = await this.getBlockHeader().hash();
129
130
  }
130
131
  return this.blockHash;
131
132
  }
132
133
 
134
+ public getCheckpointHeader() {
135
+ return this.header.toCheckpointHeader();
136
+ }
137
+
138
+ // Temporary helper to get the actual block header.
139
+ public getBlockHeader(): BlockHeader {
140
+ return this.header.toBlockHeader();
141
+ }
142
+
133
143
  /**
134
144
  * Returns stats used for logging.
135
145
  * @returns Stats on tx count, number, and log size and count.
@@ -1,26 +1,35 @@
1
+ import { compact } from '@aztec/foundation/collection';
1
2
  import { EthAddress } from '@aztec/foundation/eth-address';
2
3
  import { Fr } from '@aztec/foundation/fields';
4
+ import type { FieldsOf } from '@aztec/foundation/types';
3
5
 
4
6
  import { AztecAddress } from '../aztec-address/index.js';
5
7
  import { GasFees } from '../gas/gas_fees.js';
6
8
  import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
7
- import { BlockHeader } from '../tx/block_header.js';
8
9
  import { ContentCommitment } from '../tx/content_commitment.js';
9
10
  import { GlobalVariables } from '../tx/global_variables.js';
10
11
  import { PartialStateReference } from '../tx/partial_state_reference.js';
11
12
  import { StateReference } from '../tx/state_reference.js';
13
+ import { L2BlockHeader } from './l2_block_header.js';
12
14
 
13
- /**
14
- * Makes header.
15
- */
16
- export function makeHeader(seed = 0, blockNumber?: number, slotNumber?: number, inHash?: Fr): BlockHeader {
17
- return new BlockHeader(
15
+ export function makeL2BlockHeader(
16
+ seed = 0,
17
+ blockNumber?: number,
18
+ slotNumber?: number,
19
+ overrides: Partial<FieldsOf<L2BlockHeader>> = {},
20
+ inHash?: Fr,
21
+ ) {
22
+ return new L2BlockHeader(
18
23
  makeAppendOnlyTreeSnapshot(seed + 0x100),
19
- makeContentCommitment(seed + 0x200, inHash),
20
- makeStateReference(seed + 0x600),
21
- makeGlobalVariables((seed += 0x700), blockNumber, slotNumber ?? blockNumber),
24
+ overrides?.contentCommitment ?? makeContentCommitment(seed + 0x200, inHash),
25
+ overrides?.state ?? makeStateReference(seed + 0x600),
26
+ makeGlobalVariables((seed += 0x700), {
27
+ ...(blockNumber ? { blockNumber } : {}),
28
+ ...(slotNumber ? { slotNumber: new Fr(slotNumber) } : {}),
29
+ }),
22
30
  new Fr(seed + 0x800),
23
31
  new Fr(seed + 0x900),
32
+ new Fr(seed + 0xa00),
24
33
  );
25
34
  }
26
35
 
@@ -62,26 +71,16 @@ function makePartialStateReference(seed = 0): PartialStateReference {
62
71
  );
63
72
  }
64
73
 
65
- /**
66
- * Makes global variables.
67
- * @param seed - The seed to use for generating the global variables.
68
- * @param blockNumber - The block number to use for generating the global variables.
69
- * If blockNumber is undefined, it will be set to seed + 2.
70
- * @returns Global variables.
71
- */
72
- export function makeGlobalVariables(
73
- seed = 1,
74
- blockNumber: number | undefined = undefined,
75
- slotNumber: number | undefined = undefined,
76
- ): GlobalVariables {
77
- return new GlobalVariables(
78
- new Fr(seed),
79
- new Fr(seed + 1),
80
- blockNumber ?? seed + 2,
81
- new Fr(slotNumber ?? seed + 3),
82
- BigInt(seed + 4),
83
- EthAddress.fromField(new Fr(seed + 5)),
84
- AztecAddress.fromField(new Fr(seed + 6)),
85
- new GasFees(seed + 7, seed + 8),
86
- );
74
+ function makeGlobalVariables(seed = 1, overrides: Partial<FieldsOf<GlobalVariables>> = {}): GlobalVariables {
75
+ return GlobalVariables.from({
76
+ chainId: new Fr(seed),
77
+ version: new Fr(seed + 1),
78
+ blockNumber: seed + 2,
79
+ slotNumber: new Fr(seed + 3),
80
+ timestamp: BigInt(seed + 4),
81
+ coinbase: EthAddress.fromField(new Fr(seed + 5)),
82
+ feeRecipient: AztecAddress.fromField(new Fr(seed + 6)),
83
+ gasFees: new GasFees(seed + 7, seed + 8),
84
+ ...compact(overrides),
85
+ });
87
86
  }