@aztec/stdlib 1.2.1 → 2.0.0-nightly.20250813

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 (324) hide show
  1. package/dest/abi/abi.d.ts +0 -67
  2. package/dest/abi/abi.d.ts.map +1 -1
  3. package/dest/abi/abi.js +1 -14
  4. package/dest/abi/authorization_selector.d.ts +52 -0
  5. package/dest/abi/authorization_selector.d.ts.map +1 -0
  6. package/dest/abi/authorization_selector.js +70 -0
  7. package/dest/abi/contract_artifact.d.ts.map +1 -1
  8. package/dest/abi/contract_artifact.js +0 -40
  9. package/dest/abi/decoder.d.ts.map +1 -1
  10. package/dest/abi/decoder.js +3 -6
  11. package/dest/abi/index.d.ts +1 -0
  12. package/dest/abi/index.d.ts.map +1 -1
  13. package/dest/abi/index.js +1 -0
  14. package/dest/avm/avm.d.ts +278 -412
  15. package/dest/avm/avm.d.ts.map +1 -1
  16. package/dest/avm/avm.js +12 -12
  17. package/dest/avm/avm_proving_request.d.ts +160 -186
  18. package/dest/avm/avm_proving_request.d.ts.map +1 -1
  19. package/dest/block/l2_block.d.ts +8 -0
  20. package/dest/block/l2_block.d.ts.map +1 -1
  21. package/dest/block/l2_block.js +9 -0
  22. package/dest/block/l2_block_source.d.ts +446 -2
  23. package/dest/block/l2_block_source.d.ts.map +1 -1
  24. package/dest/block/l2_block_source.js +29 -0
  25. package/dest/block/proposal/committee_attestation.d.ts +3 -1
  26. package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
  27. package/dest/block/proposal/committee_attestation.js +3 -0
  28. package/dest/block/published_l2_block.d.ts +2 -1
  29. package/dest/block/published_l2_block.d.ts.map +1 -1
  30. package/dest/block/published_l2_block.js +6 -1
  31. package/dest/contract/contract_instance.d.ts +3 -3
  32. package/dest/contract/contract_instance.d.ts.map +1 -1
  33. package/dest/contract/contract_instance.js +3 -3
  34. package/dest/contract/interfaces/contract_class.d.ts +2 -2
  35. package/dest/contract/interfaces/protocol_contract_addresses.d.ts +9 -9
  36. package/dest/contract/interfaces/protocol_contract_addresses.d.ts.map +1 -1
  37. package/dest/contract/interfaces/protocol_contract_addresses.js +4 -4
  38. package/dest/contract/private_function_membership_proof.d.ts +1 -1
  39. package/dest/contract/private_function_membership_proof.js +1 -1
  40. package/dest/contract/utility_function_membership_proof.d.ts +1 -1
  41. package/dest/contract/utility_function_membership_proof.js +1 -1
  42. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +20 -0
  43. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -0
  44. package/dest/{shared_mutable/shared_mutable_values.js → delayed_public_mutable/delayed_public_mutable_values.js} +9 -9
  45. package/dest/{shared_mutable/shared_mutable_values_with_hash.d.ts → delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts} +6 -6
  46. package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts.map +1 -0
  47. package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.js +30 -0
  48. package/dest/delayed_public_mutable/index.d.ts +5 -0
  49. package/dest/delayed_public_mutable/index.d.ts.map +1 -0
  50. package/dest/delayed_public_mutable/index.js +4 -0
  51. package/dest/delayed_public_mutable/scheduled_delay_change.d.ts.map +1 -0
  52. package/dest/delayed_public_mutable/scheduled_value_change.d.ts.map +1 -0
  53. package/dest/gas/gas.d.ts +1 -0
  54. package/dest/gas/gas.d.ts.map +1 -1
  55. package/dest/gas/gas.js +3 -0
  56. package/dest/hash/hash.d.ts.map +1 -1
  57. package/dest/hash/hash.js +1 -4
  58. package/dest/interfaces/archiver.d.ts.map +1 -1
  59. package/dest/interfaces/archiver.js +4 -2
  60. package/dest/interfaces/aztec-node-admin.d.ts +210 -8
  61. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  62. package/dest/interfaces/aztec-node-admin.js +8 -3
  63. package/dest/interfaces/configs.d.ts +27 -0
  64. package/dest/interfaces/configs.d.ts.map +1 -1
  65. package/dest/interfaces/configs.js +6 -1
  66. package/dest/interfaces/get_logs_response.d.ts +1 -1
  67. package/dest/interfaces/proving-job.d.ts +166 -192
  68. package/dest/interfaces/proving-job.d.ts.map +1 -1
  69. package/dest/interfaces/pxe.d.ts +3 -1
  70. package/dest/interfaces/pxe.d.ts.map +1 -1
  71. package/dest/interfaces/pxe.js +1 -1
  72. package/dest/interfaces/server.d.ts +1 -1
  73. package/dest/interfaces/server.d.ts.map +1 -1
  74. package/dest/interfaces/server.js +1 -1
  75. package/dest/interfaces/slasher.d.ts +21 -0
  76. package/dest/interfaces/slasher.d.ts.map +1 -1
  77. package/dest/interfaces/slasher.js +6 -1
  78. package/dest/interfaces/tx_provider.d.ts +24 -0
  79. package/dest/interfaces/tx_provider.d.ts.map +1 -0
  80. package/dest/kernel/claimed_length_array.d.ts +34 -0
  81. package/dest/kernel/claimed_length_array.d.ts.map +1 -0
  82. package/dest/kernel/claimed_length_array.js +58 -0
  83. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -6
  84. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
  85. package/dest/kernel/hints/build_note_hash_read_request_hints.js +18 -20
  86. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +7 -10
  87. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
  88. package/dest/kernel/hints/build_nullifier_read_request_hints.js +17 -32
  89. package/dest/kernel/hints/build_transient_data_hints.d.ts +4 -3
  90. package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
  91. package/dest/kernel/hints/build_transient_data_hints.js +9 -10
  92. package/dest/kernel/hints/index.d.ts +1 -2
  93. package/dest/kernel/hints/index.d.ts.map +1 -1
  94. package/dest/kernel/hints/index.js +1 -2
  95. package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
  96. package/dest/kernel/hints/note_hash_read_request_hints.js +4 -4
  97. package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
  98. package/dest/kernel/hints/nullifier_read_request_hints.js +4 -4
  99. package/dest/kernel/hints/private_kernel_reset_hints.d.ts +5 -5
  100. package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
  101. package/dest/kernel/hints/private_kernel_reset_hints.js +9 -9
  102. package/dest/kernel/hints/read_request_hints.d.ts +17 -17
  103. package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
  104. package/dest/kernel/hints/read_request_hints.js +28 -28
  105. package/dest/kernel/hints/{transient_data_index_hint.d.ts → transient_data_squashing_hint.d.ts} +5 -5
  106. package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -0
  107. package/dest/kernel/hints/{transient_data_index_hint.js → transient_data_squashing_hint.js} +5 -5
  108. package/dest/kernel/index.d.ts +1 -0
  109. package/dest/kernel/index.d.ts.map +1 -1
  110. package/dest/kernel/index.js +1 -0
  111. package/dest/kernel/private_accumulated_data.d.ts +16 -15
  112. package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
  113. package/dest/kernel/private_accumulated_data.js +3 -3
  114. package/dest/kernel/private_call_data.d.ts +4 -4
  115. package/dest/kernel/private_call_data.d.ts.map +1 -1
  116. package/dest/kernel/private_call_data.js +2 -2
  117. package/dest/kernel/private_circuit_public_inputs.d.ts +26 -25
  118. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  119. package/dest/kernel/private_circuit_public_inputs.js +33 -15
  120. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +9 -0
  121. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  122. package/dest/kernel/private_kernel_circuit_public_inputs.js +8 -4
  123. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
  124. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
  125. package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +9 -6
  126. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +11 -4
  127. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
  128. package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +20 -18
  129. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +4 -4
  130. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
  131. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +9 -10
  132. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +11 -11
  133. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
  134. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +11 -12
  135. package/dest/kernel/private_validation_requests.d.ts +8 -20
  136. package/dest/kernel/private_validation_requests.d.ts.map +1 -1
  137. package/dest/kernel/private_validation_requests.js +9 -21
  138. package/dest/kernel/utils/order_and_comparison.d.ts +0 -3
  139. package/dest/kernel/utils/order_and_comparison.d.ts.map +1 -1
  140. package/dest/kernel/utils/order_and_comparison.js +0 -19
  141. package/dest/logs/extended_public_log.d.ts +1 -1
  142. package/dest/logs/shared_secret_derivation.d.ts +1 -1
  143. package/dest/logs/shared_secret_derivation.js +1 -1
  144. package/dest/messaging/l2_to_l1_membership.d.ts +4 -1
  145. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  146. package/dest/messaging/l2_to_l1_membership.js +49 -54
  147. package/dest/messaging/l2_to_l1_message.d.ts +2 -0
  148. package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
  149. package/dest/messaging/l2_to_l1_message.js +7 -0
  150. package/dest/note/notes_filter.d.ts +5 -2
  151. package/dest/note/notes_filter.d.ts.map +1 -1
  152. package/dest/note/notes_filter.js +1 -1
  153. package/dest/p2p/attestation_utils.d.ts +10 -0
  154. package/dest/p2p/attestation_utils.d.ts.map +1 -0
  155. package/dest/p2p/attestation_utils.js +21 -0
  156. package/dest/p2p/block_attestation.d.ts +3 -4
  157. package/dest/p2p/block_attestation.d.ts.map +1 -1
  158. package/dest/p2p/block_attestation.js +3 -4
  159. package/dest/p2p/block_proposal.d.ts +8 -1
  160. package/dest/p2p/block_proposal.d.ts.map +1 -1
  161. package/dest/p2p/block_proposal.js +21 -8
  162. package/dest/p2p/consensus_payload.d.ts +3 -11
  163. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  164. package/dest/p2p/consensus_payload.js +13 -22
  165. package/dest/p2p/index.d.ts +1 -0
  166. package/dest/p2p/index.d.ts.map +1 -1
  167. package/dest/p2p/index.js +1 -0
  168. package/dest/p2p/topic_type.d.ts.map +1 -1
  169. package/dest/p2p/topic_type.js +5 -3
  170. package/dest/rollup/block_root_rollup.d.ts +1 -1
  171. package/dest/slashing/index.d.ts +51 -0
  172. package/dest/slashing/index.d.ts.map +1 -0
  173. package/dest/slashing/index.js +54 -0
  174. package/dest/stats/stats.d.ts +2 -2
  175. package/dest/stats/stats.d.ts.map +1 -1
  176. package/dest/tests/factories.d.ts +0 -2
  177. package/dest/tests/factories.d.ts.map +1 -1
  178. package/dest/tests/factories.js +25 -24
  179. package/dest/tests/mocks.d.ts +2 -0
  180. package/dest/tests/mocks.d.ts.map +1 -1
  181. package/dest/tests/mocks.js +31 -22
  182. package/dest/tx/index.d.ts +0 -1
  183. package/dest/tx/index.d.ts.map +1 -1
  184. package/dest/tx/index.js +0 -1
  185. package/dest/tx/private_execution_result.d.ts +2 -2
  186. package/dest/tx/private_execution_result.d.ts.map +1 -1
  187. package/dest/tx/private_execution_result.js +11 -11
  188. package/dest/tx/processed_tx.d.ts +2 -2
  189. package/dest/tx/processed_tx.d.ts.map +1 -1
  190. package/dest/tx/processed_tx.js +4 -4
  191. package/dest/tx/proven_tx.d.ts +1 -1
  192. package/dest/tx/proven_tx.d.ts.map +1 -1
  193. package/dest/tx/proven_tx.js +7 -3
  194. package/dest/tx/simulated_tx.d.ts +11 -17
  195. package/dest/tx/simulated_tx.d.ts.map +1 -1
  196. package/dest/tx/simulated_tx.js +12 -12
  197. package/dest/tx/tx.d.ts +25 -25
  198. package/dest/tx/tx.d.ts.map +1 -1
  199. package/dest/tx/tx.js +60 -48
  200. package/dest/tx/tx_effect.d.ts +2 -2
  201. package/dest/tx/tx_effect.d.ts.map +1 -1
  202. package/dest/tx/tx_effect.js +3 -18
  203. package/dest/tx/tx_execution_request.js +2 -2
  204. package/dest/tx/tx_hash.d.ts +7 -0
  205. package/dest/tx/tx_hash.d.ts.map +1 -1
  206. package/dest/tx/tx_hash.js +19 -1
  207. package/dest/tx/tx_request.d.ts +5 -5
  208. package/dest/tx/tx_request.d.ts.map +1 -1
  209. package/dest/tx/tx_request.js +7 -7
  210. package/dest/tx/validator/error_texts.d.ts +1 -0
  211. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  212. package/dest/tx/validator/error_texts.js +1 -0
  213. package/dest/tx/validator/tx_validator.d.ts +6 -4
  214. package/dest/tx/validator/tx_validator.d.ts.map +1 -1
  215. package/dest/tx/validator/tx_validator.js +3 -0
  216. package/dest/versioning/versioning.d.ts.map +1 -1
  217. package/dest/vks/verification_key.d.ts.map +1 -1
  218. package/dest/vks/verification_key.js +4 -4
  219. package/package.json +10 -9
  220. package/src/abi/abi.ts +0 -38
  221. package/src/abi/authorization_selector.ts +95 -0
  222. package/src/abi/contract_artifact.ts +0 -49
  223. package/src/abi/decoder.ts +3 -6
  224. package/src/abi/index.ts +1 -0
  225. package/src/avm/avm.ts +7 -9
  226. package/src/block/l2_block.ts +18 -0
  227. package/src/block/l2_block_source.ts +70 -1
  228. package/src/block/proposal/committee_attestation.ts +5 -1
  229. package/src/block/published_l2_block.ts +14 -5
  230. package/src/contract/contract_instance.ts +3 -3
  231. package/src/contract/interfaces/protocol_contract_addresses.ts +5 -10
  232. package/src/contract/private_function_membership_proof.ts +1 -1
  233. package/src/contract/utility_function_membership_proof.ts +1 -1
  234. package/src/{shared_mutable/shared_mutable_values.ts → delayed_public_mutable/delayed_public_mutable_values.ts} +10 -10
  235. package/src/delayed_public_mutable/delayed_public_mutable_values_with_hash.ts +38 -0
  236. package/src/delayed_public_mutable/index.ts +4 -0
  237. package/src/gas/gas.ts +4 -0
  238. package/src/hash/hash.ts +1 -4
  239. package/src/interfaces/archiver.ts +3 -1
  240. package/src/interfaces/aztec-node-admin.ts +18 -11
  241. package/src/interfaces/configs.ts +17 -0
  242. package/src/interfaces/pxe.ts +4 -2
  243. package/src/interfaces/server.ts +1 -1
  244. package/src/interfaces/slasher.ts +11 -0
  245. package/src/interfaces/tx_provider.ts +16 -0
  246. package/src/kernel/claimed_length_array.ts +104 -0
  247. package/src/kernel/hints/build_note_hash_read_request_hints.ts +28 -30
  248. package/src/kernel/hints/build_nullifier_read_request_hints.ts +28 -59
  249. package/src/kernel/hints/build_transient_data_hints.ts +12 -14
  250. package/src/kernel/hints/index.ts +1 -2
  251. package/src/kernel/hints/note_hash_read_request_hints.ts +4 -16
  252. package/src/kernel/hints/nullifier_read_request_hints.ts +4 -16
  253. package/src/kernel/hints/private_kernel_reset_hints.ts +7 -7
  254. package/src/kernel/hints/read_request_hints.ts +22 -22
  255. package/src/kernel/hints/{transient_data_index_hint.ts → transient_data_squashing_hint.ts} +5 -5
  256. package/src/kernel/index.ts +1 -0
  257. package/src/kernel/private_accumulated_data.ts +23 -23
  258. package/src/kernel/private_call_data.ts +3 -3
  259. package/src/kernel/private_circuit_public_inputs.ts +92 -68
  260. package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -1
  261. package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +13 -4
  262. package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +20 -20
  263. package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +7 -7
  264. package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +16 -10
  265. package/src/kernel/private_validation_requests.ts +19 -50
  266. package/src/kernel/utils/order_and_comparison.ts +0 -25
  267. package/src/logs/shared_secret_derivation.ts +1 -1
  268. package/src/messaging/l2_to_l1_membership.ts +76 -85
  269. package/src/messaging/l2_to_l1_message.ts +9 -0
  270. package/src/note/notes_filter.ts +6 -3
  271. package/src/p2p/attestation_utils.ts +35 -0
  272. package/src/p2p/block_attestation.ts +3 -4
  273. package/src/p2p/block_proposal.ts +23 -5
  274. package/src/p2p/consensus_payload.ts +10 -29
  275. package/src/p2p/index.ts +1 -0
  276. package/src/p2p/topic_type.ts +3 -1
  277. package/src/slashing/index.ts +74 -0
  278. package/src/stats/stats.ts +2 -2
  279. package/src/tests/factories.ts +37 -27
  280. package/src/tests/mocks.ts +24 -22
  281. package/src/tx/index.ts +0 -1
  282. package/src/tx/private_execution_result.ts +11 -9
  283. package/src/tx/processed_tx.ts +6 -6
  284. package/src/tx/proven_tx.ts +7 -8
  285. package/src/tx/simulated_tx.ts +13 -19
  286. package/src/tx/tx.ts +70 -57
  287. package/src/tx/tx_effect.ts +5 -20
  288. package/src/tx/tx_execution_request.ts +2 -2
  289. package/src/tx/tx_hash.ts +21 -1
  290. package/src/tx/tx_request.ts +7 -6
  291. package/src/tx/validator/error_texts.ts +1 -0
  292. package/src/tx/validator/tx_validator.ts +5 -0
  293. package/src/versioning/versioning.ts +0 -3
  294. package/src/vks/verification_key.ts +4 -7
  295. package/dest/interfaces/tx-collector.d.ts +0 -15
  296. package/dest/interfaces/tx-collector.d.ts.map +0 -1
  297. package/dest/kernel/hints/rollup_validation_requests.d.ts +0 -34
  298. package/dest/kernel/hints/rollup_validation_requests.d.ts.map +0 -1
  299. package/dest/kernel/hints/rollup_validation_requests.js +0 -55
  300. package/dest/kernel/hints/transient_data_index_hint.d.ts.map +0 -1
  301. package/dest/shared_mutable/index.d.ts +0 -5
  302. package/dest/shared_mutable/index.d.ts.map +0 -1
  303. package/dest/shared_mutable/index.js +0 -4
  304. package/dest/shared_mutable/scheduled_delay_change.d.ts.map +0 -1
  305. package/dest/shared_mutable/scheduled_value_change.d.ts.map +0 -1
  306. package/dest/shared_mutable/shared_mutable_values.d.ts +0 -20
  307. package/dest/shared_mutable/shared_mutable_values.d.ts.map +0 -1
  308. package/dest/shared_mutable/shared_mutable_values_with_hash.d.ts.map +0 -1
  309. package/dest/shared_mutable/shared_mutable_values_with_hash.js +0 -30
  310. package/dest/tx/include_by_timestamp.d.ts +0 -54
  311. package/dest/tx/include_by_timestamp.d.ts.map +0 -1
  312. package/dest/tx/include_by_timestamp.js +0 -72
  313. package/src/interfaces/tx-collector.ts +0 -17
  314. package/src/kernel/hints/rollup_validation_requests.ts +0 -71
  315. package/src/shared_mutable/index.ts +0 -4
  316. package/src/shared_mutable/shared_mutable_values_with_hash.ts +0 -38
  317. package/src/tx/include_by_timestamp.ts +0 -90
  318. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.d.ts +0 -0
  319. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.js +0 -0
  320. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.d.ts +0 -0
  321. /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.js +0 -0
  322. /package/dest/interfaces/{tx-collector.js → tx_provider.js} +0 -0
  323. /package/src/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.ts +0 -0
  324. /package/src/{shared_mutable → delayed_public_mutable}/scheduled_value_change.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"verification_key.d.ts","sourceRoot":"","sources":["../../src/vks/verification_key.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAI9E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;GAEG;AACH,qBAAa,eAAe;IAC1B;;OAEG;IACI,CAAC,EAAE,EAAE,CAAC;IACb;;OAEG;IACI,CAAC,EAAE,EAAE,CAAC;gBAED,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,MAAM;IAI1C;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GA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,EAAE,MAAM,GAAG,YAAY,GAAG,eAAe;IAYjE;;;OAGG;IACH,MAAM,CAAC,cAAc,IAAI,eAAe;IAWxC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,eAAe;CAUnC;AAED,qBAAa,mBAAmB;aAEZ,WAAW,EAAE,uBAAuB;aACpC,UAAU,EAAE,MAAM;gBADlB,WAAW,EAAE,uBAAuB,EACpC,UAAU,EAAE,MAAM;IAGpC,IAAW,eAAe,WAEzB;IAED,IAAW,WAAW,WAErB;IAED,IAAW,WAAW,YAErB;IAED,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,YAAY,IAAI,mBAAmB;IAI1C,MAAM,CAAC,kBAAkB,IAAI,mBAAmB;IAOhD,MAAM,CAAC,QAAQ,CAAC,GAAG,SAA4B,GAAG,mBAAmB;IAIrE;;;OAGG;IACH,QAAQ;IAIR,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,mBAAmB;IAQrE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB;IAI5C,KAAK;IAIZ,2DAA2D;IAC3D,MAAM;IAIN,6CAA6C;IAC7C,MAAM,KAAK,MAAM,4DAEhB;CACF"}
@@ -1,4 +1,4 @@
1
- import { HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, ROLLUP_HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS } from '@aztec/constants';
1
+ import { ULTRA_VK_LENGTH_IN_FIELDS } from '@aztec/constants';
2
2
  import { makeTuple } from '@aztec/foundation/array';
3
3
  import { times } from '@aztec/foundation/collection';
4
4
  import { Fq, Fr } from '@aztec/foundation/fields';
@@ -122,10 +122,10 @@ export const CIRCUIT_RECURSIVE_INDEX = 3;
122
122
  return new VerificationKeyAsFields(makeTuple(size, Fr.random, seed), Fr.random());
123
123
  }
124
124
  static makeFakeHonk(seed = 1) {
125
- return new VerificationKeyAsFields(makeTuple(HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, Fr.random, seed), Fr.random());
125
+ return new VerificationKeyAsFields(makeTuple(ULTRA_VK_LENGTH_IN_FIELDS, Fr.random, seed), Fr.random());
126
126
  }
127
127
  static makeFakeRollupHonk(seed = 1) {
128
- return new VerificationKeyAsFields(makeTuple(ROLLUP_HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, (i)=>new Fr(i), seed), new Fr(seed + 1));
128
+ return new VerificationKeyAsFields(makeTuple(ULTRA_VK_LENGTH_IN_FIELDS, (i)=>new Fr(i), seed), new Fr(seed + 1));
129
129
  }
130
130
  /**
131
131
  * Builds an 'empty' verification key
@@ -212,7 +212,7 @@ export class VerificationKeyData {
212
212
  static makeFakeRollupHonk() {
213
213
  return new VerificationKeyData(VerificationKeyAsFields.makeFakeRollupHonk(), VerificationKey.makeRollupFake().toBuffer());
214
214
  }
215
- static makeFake(len = ROLLUP_HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS) {
215
+ static makeFake(len = ULTRA_VK_LENGTH_IN_FIELDS) {
216
216
  return new VerificationKeyData(VerificationKeyAsFields.makeFake(len), VerificationKey.makeFake().toBuffer());
217
217
  }
218
218
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/stdlib",
3
- "version": "1.2.1",
3
+ "version": "2.0.0-nightly.20250813",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -24,7 +24,7 @@
24
24
  "./avm": "./dest/avm/index.js",
25
25
  "./schemas": "./dest/schemas/index.js",
26
26
  "./noir": "./dest/noir/index.js",
27
- "./shared-mutable": "./dest/shared_mutable/index.js",
27
+ "./delayed-public-mutable": "./dest/delayed_public_mutable/index.js",
28
28
  "./parity": "./dest/parity/index.js",
29
29
  "./vks": "./dest/vks/index.js",
30
30
  "./proofs": "./dest/proofs/index.js",
@@ -50,7 +50,8 @@
50
50
  "./file-store": "./dest/file-store/index.js",
51
51
  "./snapshots": "./dest/snapshots/index.js",
52
52
  "./update-checker": "./dest/update-checker/index.js",
53
- "./zkpassport": "./dest/zkpassport/index.js"
53
+ "./zkpassport": "./dest/zkpassport/index.js",
54
+ "./slashing": "./dest/slashing/index.js"
54
55
  },
55
56
  "typedocOptions": {
56
57
  "entryPoints": [
@@ -67,12 +68,12 @@
67
68
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
68
69
  },
69
70
  "dependencies": {
70
- "@aztec/bb.js": "1.2.1",
71
- "@aztec/blob-lib": "1.2.1",
72
- "@aztec/constants": "1.2.1",
73
- "@aztec/ethereum": "1.2.1",
74
- "@aztec/foundation": "1.2.1",
75
- "@aztec/noir-noirc_abi": "1.2.1",
71
+ "@aztec/bb.js": "2.0.0-nightly.20250813",
72
+ "@aztec/blob-lib": "2.0.0-nightly.20250813",
73
+ "@aztec/constants": "2.0.0-nightly.20250813",
74
+ "@aztec/ethereum": "2.0.0-nightly.20250813",
75
+ "@aztec/foundation": "2.0.0-nightly.20250813",
76
+ "@aztec/noir-noirc_abi": "2.0.0-nightly.20250813",
76
77
  "@google-cloud/storage": "^7.15.0",
77
78
  "axios": "^1.9.0",
78
79
  "json-stringify-deterministic": "1.0.12",
package/src/abi/abi.ts CHANGED
@@ -7,7 +7,6 @@ import { inflate } from 'pako';
7
7
  import { z } from 'zod';
8
8
 
9
9
  import { FunctionSelector } from './function_selector.js';
10
- import { NoteSelector } from './note_selector.js';
11
10
 
12
11
  /** A basic value. */
13
12
  export interface BasicValue<T extends string, V> {
@@ -313,38 +312,6 @@ export type DebugFileMap = Record<
313
312
  }
314
313
  >;
315
314
 
316
- /** Type representing a field of a note (e.g. `amount` in `TokenNote`). */
317
- export type NoteField = {
318
- /** Name of the field (e.g. `amount`). */
319
- name: string;
320
- /** Index where the note field starts in the serialized note array. */
321
- index: number;
322
- /** Whether the field can be unset when creating the note (in the partial notes flow). */
323
- nullable: boolean;
324
- };
325
-
326
- export const NoteFieldSchema = z.object({
327
- name: z.string(),
328
- index: z.number(),
329
- nullable: z.boolean(),
330
- }) satisfies z.ZodType<NoteField>;
331
-
332
- /** Type representing a note in use in the contract. */
333
- export type ContractNote = {
334
- /** Note identifier */
335
- id: NoteSelector;
336
- /** Type of the note (e.g., 'TransparentNote') */
337
- typ: string;
338
- /** Fields of the note. */
339
- fields: NoteField[];
340
- };
341
-
342
- export const ContractNoteSchema = z.object({
343
- id: NoteSelector.schema,
344
- typ: z.string(),
345
- fields: z.array(NoteFieldSchema),
346
- }) satisfies ZodFor<ContractNote>;
347
-
348
315
  /** Type representing a field layout in the storage of a contract. */
349
316
  export type FieldLayout = {
350
317
  /** Slot in which the field is stored. */
@@ -371,9 +338,6 @@ export interface ContractArtifact {
371
338
  /** Storage layout */
372
339
  storageLayout: Record<string, FieldLayout>;
373
340
 
374
- /** The notes used in the contract. */
375
- notes: Record<string, ContractNote>;
376
-
377
341
  /** The map of file ID to the source code and path of the file. */
378
342
  fileMap: DebugFileMap;
379
343
  }
@@ -398,7 +362,6 @@ export const ContractArtifactSchema: ZodFor<ContractArtifact> = z.object({
398
362
  globals: z.record(z.array(AbiValueSchema)),
399
363
  }),
400
364
  storageLayout: z.record(z.object({ slot: schemas.Fr })),
401
- notes: z.record(ContractNoteSchema),
402
365
  fileMap: z.record(z.coerce.number(), z.object({ source: z.string(), path: z.string() })),
403
366
  });
404
367
 
@@ -567,6 +530,5 @@ export function emptyContractArtifact(): ContractArtifact {
567
530
  },
568
531
  storageLayout: {},
569
532
  fileMap: {},
570
- notes: {},
571
533
  };
572
534
  }
@@ -0,0 +1,95 @@
1
+ import { fromHex, toBigIntBE } from '@aztec/foundation/bigint-buffer';
2
+ import { poseidon2HashBytes, randomBytes } from '@aztec/foundation/crypto';
3
+ import type { Fr } from '@aztec/foundation/fields';
4
+ import { hexSchemaFor } from '@aztec/foundation/schemas';
5
+ import { BufferReader } from '@aztec/foundation/serialize';
6
+
7
+ import { Selector } from './selector.js';
8
+
9
+ /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
10
+
11
+ /** Authorization selector branding */
12
+ export interface AuthorizationSelector {
13
+ /** Brand. */
14
+ _branding: 'AuthorizationSelector';
15
+ }
16
+
17
+ /**
18
+ * An authorization selector is the first 4 bytes of the hash of an authorization struct signature.
19
+ */
20
+ export class AuthorizationSelector extends Selector {
21
+ /**
22
+ * Deserializes from a buffer or reader, corresponding to a write in cpp.
23
+ * @param buffer - Buffer or BufferReader to read from.
24
+ * @returns The Selector.
25
+ */
26
+ static fromBuffer(buffer: Buffer | BufferReader) {
27
+ const reader = BufferReader.asReader(buffer);
28
+ const value = Number(toBigIntBE(reader.readBytes(Selector.SIZE)));
29
+ return new AuthorizationSelector(value);
30
+ }
31
+
32
+ /**
33
+ * Converts a field to selector.
34
+ * @param fr - The field to convert.
35
+ * @returns The selector.
36
+ */
37
+ static fromField(fr: Fr) {
38
+ return new AuthorizationSelector(Number(fr.toBigInt()));
39
+ }
40
+
41
+ /**
42
+ * Creates a selector from a signature.
43
+ * @param signature - Signature to generate the selector for (e.g. "CallAuthorization(field,field)").
44
+ * @returns selector.
45
+ */
46
+ static async fromSignature(signature: string) {
47
+ // throw if signature contains whitespace
48
+ if (/\s/.test(signature)) {
49
+ throw new Error('Signature cannot contain whitespace');
50
+ }
51
+ const hash = await poseidon2HashBytes(Buffer.from(signature));
52
+ // We take the last Selector.SIZE big endian bytes
53
+ const bytes = hash.toBuffer().slice(-Selector.SIZE);
54
+ return AuthorizationSelector.fromBuffer(bytes);
55
+ }
56
+
57
+ /**
58
+ * Create a Selector instance from a hex-encoded string.
59
+ *
60
+ * @param selector - The hex-encoded string representing the Selector.
61
+ * @returns An Selector instance.
62
+ * @throws If the selector length is invalid.
63
+ */
64
+ static fromString(selector: string) {
65
+ const buf = fromHex(selector);
66
+ if (buf.length !== Selector.SIZE) {
67
+ throw new Error(`Invalid AuthorizationSelector length ${buf.length} (expected ${Selector.SIZE}).`);
68
+ }
69
+ return AuthorizationSelector.fromBuffer(buf);
70
+ }
71
+
72
+ /**
73
+ * Creates an empty selector.
74
+ * @returns An empty selector.
75
+ */
76
+ static empty() {
77
+ return new AuthorizationSelector(0);
78
+ }
79
+
80
+ /**
81
+ * Creates a random selector.
82
+ * @returns A random selector.
83
+ */
84
+ static random() {
85
+ return AuthorizationSelector.fromBuffer(randomBytes(Selector.SIZE));
86
+ }
87
+
88
+ toJSON() {
89
+ return this.toString();
90
+ }
91
+
92
+ static get schema() {
93
+ return hexSchemaFor(AuthorizationSelector);
94
+ }
95
+ }
@@ -7,7 +7,6 @@ import {
7
7
  type BasicValue,
8
8
  type ContractArtifact,
9
9
  ContractArtifactSchema,
10
- type ContractNote,
11
10
  type FieldLayout,
12
11
  type FunctionAbi,
13
12
  type FunctionArtifact,
@@ -276,52 +275,6 @@ function getStorageLayout(input: NoirCompiledContract) {
276
275
  }, {});
277
276
  }
278
277
 
279
- /**
280
- * Generates records of the notes with note type ids of the artifact.
281
- * @param input - The compiled noir contract to get note types for
282
- * @return A record of the note types and their ids
283
- */
284
- function getNoteTypes(input: NoirCompiledContract) {
285
- // The type is useless here as it does not give us any guarantee (e.g. `AbiValue` can be one of many different
286
- // types) so we nuke it and later we manually check the values are as we expect.
287
- const notes = input.outputs.globals.notes as any[];
288
-
289
- if (!notes) {
290
- return {};
291
- }
292
-
293
- return notes.reduce((acc: Record<string, Omit<ContractNote, 'id'> & { id: string }>, note) => {
294
- const noteFields = note.fields;
295
-
296
- // We find note type id by looking for respective kinds as each of them is unique
297
- const rawNoteTypeId = noteFields.find((field: any) => field.kind === 'integer');
298
- const rawName = noteFields.find((field: any) => field.kind === 'string');
299
- const rawNoteFields = noteFields.find((field: any) => field.kind === 'struct');
300
-
301
- if (!rawNoteTypeId || !rawName || !rawNoteFields) {
302
- throw new Error(`Could not find note type id, name or fields for note ${note}`);
303
- }
304
-
305
- const noteTypeId = rawNoteTypeId.value as string;
306
- const name = rawName.value as string;
307
-
308
- // Note type id is encoded as a hex string
309
- const fields = rawNoteFields.fields.map((field: any) => {
310
- return {
311
- name: field.name,
312
- index: parseInt(field.value.fields[0].value.value, 16),
313
- nullable: field.value.fields[1].value.value,
314
- };
315
- });
316
- acc[name] = {
317
- id: noteTypeId,
318
- typ: name,
319
- fields,
320
- };
321
- return acc;
322
- }, {});
323
- }
324
-
325
278
  /**
326
279
  * Given a Nargo output generates an Aztec-compatible contract artifact.
327
280
  * Does not include public bytecode, apart from the public_dispatch function.
@@ -338,7 +291,6 @@ function generateContractArtifact(contract: NoirCompiledContract): ContractArtif
338
291
  .map(f => generateFunctionAbi(f, contract)),
339
292
  outputs: contract.outputs,
340
293
  storageLayout: getStorageLayout(contract),
341
- notes: getNoteTypes(contract),
342
294
  fileMap: contract.file_map,
343
295
  });
344
296
  } catch (err) {
@@ -362,7 +314,6 @@ function generateContractArtifactForPublic(contract: NoirCompiledContract): Cont
362
314
  .map(f => generateFunctionAbi(f, contract)),
363
315
  outputs: contract.outputs,
364
316
  storageLayout: getStorageLayout(contract),
365
- notes: getNoteTypes(contract),
366
317
  fileMap: contract.file_map,
367
318
  });
368
319
  } catch (err) {
@@ -95,13 +95,10 @@ class AbiDecoder {
95
95
  * @returns The decoded return values.
96
96
  */
97
97
  public decode(): AbiDecoded {
98
- if (this.types.length > 1) {
99
- throw new Error('Multiple types not supported');
98
+ if (this.types.length === 1) {
99
+ return this.decodeNext(this.types[0]);
100
100
  }
101
- if (this.types.length === 0) {
102
- return [];
103
- }
104
- return this.decodeNext(this.types[0]);
101
+ return this.types.map(type => this.decodeNext(type));
105
102
  }
106
103
  }
107
104
 
package/src/abi/index.ts CHANGED
@@ -2,6 +2,7 @@ export * from './abi.js';
2
2
  export * from './buffer.js';
3
3
  export * from './decoder.js';
4
4
  export * from './encoder.js';
5
+ export * from './authorization_selector.js';
5
6
  export * from './event_selector.js';
6
7
  export * from './function_selector.js';
7
8
  export * from './note_selector.js';
package/src/avm/avm.ts CHANGED
@@ -388,7 +388,6 @@ export class AvmRevertCheckpointHint {
388
388
  export class AvmTxHint {
389
389
  constructor(
390
390
  public readonly hash: string,
391
- public readonly globalVariables: GlobalVariables,
392
391
  public readonly gasSettings: GasSettings,
393
392
  public readonly effectiveGasFees: GasFees,
394
393
  public readonly nonRevertibleAccumulatedData: {
@@ -410,7 +409,7 @@ export class AvmTxHint {
410
409
  public readonly feePayer: AztecAddress,
411
410
  ) {}
412
411
 
413
- static async fromTx(tx: Tx): Promise<AvmTxHint> {
412
+ static fromTx(tx: Tx): AvmTxHint {
414
413
  const setupCallRequests = tx.getNonRevertiblePublicCallRequestsWithCalldata();
415
414
  const appLogicCallRequests = tx.getRevertiblePublicCallRequestsWithCalldata();
416
415
  const teardownCallRequest = tx.getTeardownPublicCallRequestWithCalldata();
@@ -421,11 +420,10 @@ export class AvmTxHint {
421
420
  );
422
421
 
423
422
  // For informational purposes. Assumed quick because it should be cached.
424
- const txHash = await tx.getTxHash();
423
+ const txHash = tx.getTxHash();
425
424
 
426
425
  return new AvmTxHint(
427
426
  txHash.hash.toString(),
428
- tx.data.constants.historicalHeader.globalVariables,
429
427
  gasSettings,
430
428
  effectiveGasFees,
431
429
  {
@@ -449,7 +447,6 @@ export class AvmTxHint {
449
447
  static empty() {
450
448
  return new AvmTxHint(
451
449
  '',
452
- GlobalVariables.empty(),
453
450
  GasSettings.empty(),
454
451
  GasFees.empty(),
455
452
  { noteHashes: [], nullifiers: [], l2ToL1Messages: [] },
@@ -466,7 +463,6 @@ export class AvmTxHint {
466
463
  return z
467
464
  .object({
468
465
  hash: z.string(),
469
- globalVariables: GlobalVariables.schema,
470
466
  gasSettings: GasSettings.schema,
471
467
  effectiveGasFees: GasFees.schema,
472
468
  nonRevertibleAccumulatedData: z.object({
@@ -488,7 +484,6 @@ export class AvmTxHint {
488
484
  .transform(
489
485
  ({
490
486
  hash,
491
- globalVariables,
492
487
  gasSettings,
493
488
  effectiveGasFees,
494
489
  nonRevertibleAccumulatedData,
@@ -501,7 +496,6 @@ export class AvmTxHint {
501
496
  }) =>
502
497
  new AvmTxHint(
503
498
  hash,
504
- globalVariables,
505
499
  gasSettings,
506
500
  effectiveGasFees,
507
501
  nonRevertibleAccumulatedData,
@@ -518,6 +512,7 @@ export class AvmTxHint {
518
512
 
519
513
  export class AvmExecutionHints {
520
514
  constructor(
515
+ public readonly globalVariables: GlobalVariables,
521
516
  public tx: AvmTxHint,
522
517
  // Contract hints.
523
518
  public readonly contractInstances: AvmContractInstanceHint[] = [],
@@ -539,12 +534,13 @@ export class AvmExecutionHints {
539
534
  ) {}
540
535
 
541
536
  static empty() {
542
- return new AvmExecutionHints(AvmTxHint.empty());
537
+ return new AvmExecutionHints(GlobalVariables.empty(), AvmTxHint.empty());
543
538
  }
544
539
 
545
540
  static get schema() {
546
541
  return z
547
542
  .object({
543
+ globalVariables: GlobalVariables.schema,
548
544
  tx: AvmTxHint.schema,
549
545
  contractInstances: AvmContractInstanceHint.schema.array(),
550
546
  contractClasses: AvmContractClassHint.schema.array(),
@@ -564,6 +560,7 @@ export class AvmExecutionHints {
564
560
  })
565
561
  .transform(
566
562
  ({
563
+ globalVariables,
567
564
  tx,
568
565
  contractInstances,
569
566
  contractClasses,
@@ -582,6 +579,7 @@ export class AvmExecutionHints {
582
579
  revertCheckpointHints,
583
580
  }) =>
584
581
  new AvmExecutionHints(
582
+ globalVariables,
585
583
  tx,
586
584
  contractInstances,
587
585
  contractClasses,
@@ -148,7 +148,25 @@ export class L2Block {
148
148
  };
149
149
  }
150
150
 
151
+ toBlockInfo(): BlockInfo {
152
+ return {
153
+ blockHash: this.blockHash?.toString(),
154
+ archive: this.archive.root.toString(),
155
+ blockNumber: this.number,
156
+ slotNumber: Number(this.header.getSlot()),
157
+ txCount: this.body.txEffects.length,
158
+ };
159
+ }
160
+
151
161
  equals(other: L2Block) {
152
162
  return this.archive.equals(other.archive) && this.header.equals(other.header) && this.body.equals(other.body);
153
163
  }
154
164
  }
165
+
166
+ export type BlockInfo = {
167
+ blockHash?: string;
168
+ archive: string;
169
+ blockNumber: number;
170
+ slotNumber: number;
171
+ txCount: number;
172
+ };
@@ -1,15 +1,17 @@
1
1
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { type ZodFor, schemas } from '@aztec/foundation/schemas';
2
3
  import type { TypedEventEmitter } from '@aztec/foundation/types';
3
4
 
4
5
  import { z } from 'zod';
5
6
 
6
7
  import type { L1RollupConstants } from '../epoch-helpers/index.js';
8
+ import { BlockAttestation } from '../p2p/block_attestation.js';
7
9
  import type { BlockHeader } from '../tx/block_header.js';
8
10
  import type { IndexedTxEffect } from '../tx/indexed_tx_effect.js';
9
11
  import type { TxHash } from '../tx/tx_hash.js';
10
12
  import type { TxReceipt } from '../tx/tx_receipt.js';
11
13
  import type { L2Block } from './l2_block.js';
12
- import type { PublishedL2Block } from './published_l2_block.js';
14
+ import { PublishedL2Block } from './published_l2_block.js';
13
15
 
14
16
  /**
15
17
  * Interface of classes allowing for the retrieval of L2 blocks.
@@ -122,10 +124,70 @@ export interface L2BlockSource {
122
124
  /** Latest synced L1 timestamp. */
123
125
  getL1Timestamp(): Promise<bigint>;
124
126
 
127
+ /**
128
+ * Returns whether the latest block in the pending chain on L1 is invalid (ie its attestations are incorrect).
129
+ * Note that invalid blocks do not get synced, so the latest block returned by the block source is always a valid one.
130
+ */
131
+ isPendingChainInvalid(): Promise<boolean>;
132
+
133
+ /**
134
+ * Returns the status of the pending chain validation. If the chain is invalid, reports the earliest consecutive block
135
+ * that is invalid, along with the reason for being invalid, which can be used to trigger an invalidation.
136
+ */
137
+ getPendingChainValidationStatus(): Promise<ValidateBlockResult>;
138
+
125
139
  /** Force a sync. */
126
140
  syncImmediate(): Promise<void>;
127
141
  }
128
142
 
143
+ /** Subtype for invalid block validation results */
144
+ export type ValidateBlockNegativeResult =
145
+ | {
146
+ valid: false;
147
+ block: PublishedL2Block;
148
+ committee: EthAddress[];
149
+ epoch: bigint;
150
+ seed: bigint;
151
+ attestations: BlockAttestation[];
152
+ reason: 'insufficient-attestations';
153
+ }
154
+ | {
155
+ valid: false;
156
+ block: PublishedL2Block;
157
+ committee: EthAddress[];
158
+ epoch: bigint;
159
+ seed: bigint;
160
+ reason: 'invalid-attestation';
161
+ attestations: BlockAttestation[];
162
+ invalidIndex: number;
163
+ };
164
+
165
+ /** Result type for validating a block attestations */
166
+ export type ValidateBlockResult = { valid: true } | ValidateBlockNegativeResult;
167
+
168
+ export const ValidateBlockResultSchema = z.union([
169
+ z.object({ valid: z.literal(true), block: PublishedL2Block.schema.optional() }),
170
+ z.object({
171
+ valid: z.literal(false),
172
+ block: PublishedL2Block.schema,
173
+ committee: z.array(schemas.EthAddress),
174
+ epoch: schemas.BigInt,
175
+ seed: schemas.BigInt,
176
+ attestations: z.array(BlockAttestation.schema),
177
+ reason: z.literal('insufficient-attestations'),
178
+ }),
179
+ z.object({
180
+ valid: z.literal(false),
181
+ block: PublishedL2Block.schema,
182
+ committee: z.array(schemas.EthAddress),
183
+ epoch: schemas.BigInt,
184
+ seed: schemas.BigInt,
185
+ attestations: z.array(BlockAttestation.schema),
186
+ reason: z.literal('invalid-attestation'),
187
+ invalidIndex: z.number(),
188
+ }),
189
+ ]) satisfies ZodFor<ValidateBlockResult>;
190
+
129
191
  /**
130
192
  * L2BlockSource that emits events upon pending / proven chain changes.
131
193
  * see L2BlockSourceEvents for the events emitted.
@@ -134,6 +196,7 @@ export interface L2BlockSource {
134
196
  export type ArchiverEmitter = TypedEventEmitter<{
135
197
  [L2BlockSourceEvents.L2PruneDetected]: (args: L2BlockPruneEvent) => void;
136
198
  [L2BlockSourceEvents.L2BlockProven]: (args: L2BlockProvenEvent) => void;
199
+ [L2BlockSourceEvents.InvalidAttestationsBlockDetected]: (args: InvalidBlockDetectedEvent) => void;
137
200
  }>;
138
201
  export interface L2BlockSourceEventEmitter extends L2BlockSource, ArchiverEmitter {}
139
202
 
@@ -180,6 +243,7 @@ export const L2TipsSchema = z.object({
180
243
  export enum L2BlockSourceEvents {
181
244
  L2PruneDetected = 'l2PruneDetected',
182
245
  L2BlockProven = 'l2BlockProven',
246
+ InvalidAttestationsBlockDetected = 'invalidBlockDetected',
183
247
  }
184
248
 
185
249
  export type L2BlockProvenEvent = {
@@ -194,3 +258,8 @@ export type L2BlockPruneEvent = {
194
258
  epochNumber: bigint;
195
259
  blocks: L2Block[];
196
260
  };
261
+
262
+ export type InvalidBlockDetectedEvent = {
263
+ type: 'invalidBlockDetected';
264
+ validationResult: ValidateBlockNegativeResult;
265
+ };
@@ -32,11 +32,15 @@ export class CommitteeAttestation {
32
32
  return new CommitteeAttestation(address, signature);
33
33
  }
34
34
 
35
+ static fromSignature(signature: Signature): CommitteeAttestation {
36
+ return new CommitteeAttestation(EthAddress.ZERO, signature);
37
+ }
38
+
35
39
  static fromViem(viem: ViemCommitteeAttestation): CommitteeAttestation {
36
40
  return new CommitteeAttestation(EthAddress.fromString(viem.addr), Signature.fromViemSignature(viem.signature));
37
41
  }
38
42
 
39
- static fromBuffer(buffer: Buffer): CommitteeAttestation {
43
+ static fromBuffer(buffer: Buffer | BufferReader): CommitteeAttestation {
40
44
  const reader = BufferReader.asReader(buffer);
41
45
  const address = reader.readObject(EthAddress);
42
46
  const signature = reader.readObject(Signature);
@@ -1,4 +1,6 @@
1
1
  // Ignoring import issue to fix portable inferred type issue in zod schema
2
+ import { Buffer32 } from '@aztec/foundation/buffer';
3
+ import { randomBigInt } from '@aztec/foundation/crypto';
2
4
  import { schemas } from '@aztec/foundation/schemas';
3
5
 
4
6
  import { z } from 'zod';
@@ -22,6 +24,14 @@ export class L1PublishedData {
22
24
  blockHash: z.string(),
23
25
  });
24
26
  }
27
+
28
+ static random() {
29
+ return new L1PublishedData(
30
+ randomBigInt(1000n) + 1n,
31
+ BigInt(Math.floor(Date.now() / 1000)),
32
+ Buffer32.random().toString(),
33
+ );
34
+ }
25
35
  }
26
36
 
27
37
  export class PublishedL2Block {
@@ -40,12 +50,11 @@ export class PublishedL2Block {
40
50
  }
41
51
  }
42
52
 
43
- export function getAttestationsFromPublishedL2Block(block: PublishedL2Block) {
53
+ export function getAttestationsFromPublishedL2Block(
54
+ block: Pick<PublishedL2Block, 'attestations' | 'block'>,
55
+ ): BlockAttestation[] {
44
56
  const payload = ConsensusPayload.fromBlock(block.block);
45
57
  return block.attestations
46
58
  .filter(attestation => !attestation.signature.isEmpty())
47
- .map(
48
- attestation =>
49
- new BlockAttestation(block.block.header.globalVariables.blockNumber, payload, attestation.signature),
50
- );
59
+ .map(attestation => new BlockAttestation(block.block.number, payload, attestation.signature));
51
60
  }
@@ -100,12 +100,12 @@ export class SerializableContractInstance {
100
100
  }
101
101
 
102
102
  /**
103
- * Generates a Contract Instance from the deployment params.
103
+ * Generates a Contract Instance from some instantiation params.
104
104
  * @param artifact - The account contract build artifact.
105
- * @param opts - Options for the deployment.
105
+ * @param opts - Options for the contract's instantiation.
106
106
  * @returns - The contract instance
107
107
  */
108
- export async function getContractInstanceFromDeployParams(
108
+ export async function getContractInstanceFromInstantiationParams(
109
109
  artifact: ContractArtifact,
110
110
  opts: {
111
111
  constructorArtifact?: FunctionAbi | string;