@aztec/stdlib 0.0.1-commit.96bb3f7 → 0.0.1-commit.993d52e

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 (688) hide show
  1. package/dest/abi/decoder.d.ts +1 -1
  2. package/dest/abi/decoder.d.ts.map +1 -1
  3. package/dest/abi/decoder.js +1 -4
  4. package/dest/abi/encoder.d.ts +1 -1
  5. package/dest/abi/encoder.d.ts.map +1 -1
  6. package/dest/abi/encoder.js +9 -5
  7. package/dest/abi/function_call.d.ts +47 -9
  8. package/dest/abi/function_call.d.ts.map +1 -1
  9. package/dest/abi/function_call.js +20 -3
  10. package/dest/abi/utils.d.ts +7 -1
  11. package/dest/abi/utils.d.ts.map +1 -1
  12. package/dest/abi/utils.js +7 -0
  13. package/dest/auth_witness/auth_witness.d.ts +2 -1
  14. package/dest/auth_witness/auth_witness.d.ts.map +1 -1
  15. package/dest/auth_witness/auth_witness.js +3 -3
  16. package/dest/avm/avm.d.ts +362 -362
  17. package/dest/avm/avm_accumulated_data.d.ts +30 -3
  18. package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
  19. package/dest/avm/avm_circuit_public_inputs.d.ts +9 -9
  20. package/dest/avm/avm_proving_request.d.ts +465 -465
  21. package/dest/avm/contract_storage_read.d.ts +13 -1
  22. package/dest/avm/contract_storage_read.d.ts.map +1 -1
  23. package/dest/avm/contract_storage_update_request.d.ts +13 -1
  24. package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
  25. package/dest/avm/public_call_stack_item_compressed.d.ts +3 -1
  26. package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -1
  27. package/dest/avm/public_data_read.d.ts +10 -1
  28. package/dest/avm/public_data_read.d.ts.map +1 -1
  29. package/dest/avm/public_data_update_request.d.ts +10 -1
  30. package/dest/avm/public_data_update_request.d.ts.map +1 -1
  31. package/dest/avm/public_data_write.d.ts +7 -1
  32. package/dest/avm/public_data_write.d.ts.map +1 -1
  33. package/dest/avm/public_inner_call_request.d.ts +4 -1
  34. package/dest/avm/public_inner_call_request.d.ts.map +1 -1
  35. package/dest/avm/revert_code.d.ts +19 -4
  36. package/dest/avm/revert_code.d.ts.map +1 -1
  37. package/dest/avm/revert_code.js +15 -5
  38. package/dest/block/block_data.d.ts +52 -0
  39. package/dest/block/block_data.d.ts.map +1 -0
  40. package/dest/block/block_data.js +12 -0
  41. package/dest/block/block_hash.d.ts +18 -14
  42. package/dest/block/block_hash.d.ts.map +1 -1
  43. package/dest/block/block_hash.js +22 -20
  44. package/dest/block/block_parameter.d.ts +4 -3
  45. package/dest/block/block_parameter.d.ts.map +1 -1
  46. package/dest/block/block_parameter.js +2 -0
  47. package/dest/block/body.d.ts +1 -1
  48. package/dest/block/body.d.ts.map +1 -1
  49. package/dest/block/body.js +2 -1
  50. package/dest/block/checkpointed_l2_block.d.ts +20 -137
  51. package/dest/block/checkpointed_l2_block.d.ts.map +1 -1
  52. package/dest/block/checkpointed_l2_block.js +7 -45
  53. package/dest/block/in_block.d.ts +9 -9
  54. package/dest/block/in_block.d.ts.map +1 -1
  55. package/dest/block/in_block.js +5 -5
  56. package/dest/block/index.d.ts +2 -3
  57. package/dest/block/index.d.ts.map +1 -1
  58. package/dest/block/index.js +1 -2
  59. package/dest/block/l2_block.d.ts +56 -59
  60. package/dest/block/l2_block.d.ts.map +1 -1
  61. package/dest/block/l2_block.js +64 -110
  62. package/dest/block/l2_block_source.d.ts +84 -39
  63. package/dest/block/l2_block_source.d.ts.map +1 -1
  64. package/dest/block/l2_block_source.js +2 -1
  65. package/dest/block/l2_block_stream/interfaces.d.ts +9 -6
  66. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  67. package/dest/block/l2_block_stream/l2_block_stream.d.ts +6 -3
  68. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  69. package/dest/block/l2_block_stream/l2_block_stream.js +47 -34
  70. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +3 -3
  71. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  72. package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
  73. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  74. package/dest/block/test/l2_tips_store_test_suite.js +2 -7
  75. package/dest/block/validate_block_result.d.ts +1 -1
  76. package/dest/block/validate_block_result.d.ts.map +1 -1
  77. package/dest/block/validate_block_result.js +5 -4
  78. package/dest/checkpoint/checkpoint.d.ts +43 -19
  79. package/dest/checkpoint/checkpoint.d.ts.map +1 -1
  80. package/dest/checkpoint/checkpoint.js +37 -14
  81. package/dest/checkpoint/checkpoint_data.d.ts +120 -0
  82. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -0
  83. package/dest/checkpoint/checkpoint_data.js +26 -0
  84. package/dest/checkpoint/index.d.ts +2 -1
  85. package/dest/checkpoint/index.d.ts.map +1 -1
  86. package/dest/checkpoint/index.js +1 -0
  87. package/dest/checkpoint/published_checkpoint.d.ts +33 -16
  88. package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
  89. package/dest/checkpoint/published_checkpoint.js +5 -5
  90. package/dest/config/index.d.ts +2 -1
  91. package/dest/config/index.d.ts.map +1 -1
  92. package/dest/config/index.js +1 -0
  93. package/dest/config/node-rpc-config.js +1 -1
  94. package/dest/config/sequencer-config.d.ts +12 -0
  95. package/dest/config/sequencer-config.d.ts.map +1 -0
  96. package/dest/config/sequencer-config.js +25 -0
  97. package/dest/contract/complete_address.d.ts +4 -1
  98. package/dest/contract/complete_address.d.ts.map +1 -1
  99. package/dest/contract/contract_address.js +4 -4
  100. package/dest/contract/contract_class.d.ts +2 -3
  101. package/dest/contract/contract_class.d.ts.map +1 -1
  102. package/dest/contract/contract_class_id.d.ts +2 -2
  103. package/dest/contract/contract_class_id.d.ts.map +1 -1
  104. package/dest/contract/contract_class_id.js +6 -5
  105. package/dest/contract/contract_deployment_data.d.ts +5 -5
  106. package/dest/contract/index.d.ts +1 -3
  107. package/dest/contract/index.d.ts.map +1 -1
  108. package/dest/contract/index.js +0 -2
  109. package/dest/contract/interfaces/contract_instance.d.ts +16 -16
  110. package/dest/contract/interfaces/node-info.d.ts +3 -1
  111. package/dest/contract/interfaces/node-info.d.ts.map +1 -1
  112. package/dest/contract/interfaces/node-info.js +2 -1
  113. package/dest/contract/private_function.d.ts +1 -1
  114. package/dest/contract/private_function.d.ts.map +1 -1
  115. package/dest/contract/private_function.js +3 -4
  116. package/dest/contract/private_function_membership_proof.d.ts +1 -1
  117. package/dest/contract/private_function_membership_proof.js +1 -1
  118. package/dest/database-version/database_version.d.ts +58 -0
  119. package/dest/database-version/database_version.d.ts.map +1 -0
  120. package/dest/database-version/database_version.js +69 -0
  121. package/dest/database-version/version_manager.d.ts +3 -49
  122. package/dest/database-version/version_manager.d.ts.map +1 -1
  123. package/dest/database-version/version_manager.js +1 -66
  124. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +2 -2
  125. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
  126. package/dest/delayed_public_mutable/delayed_public_mutable_values.js +7 -10
  127. package/dest/deserialization/index.d.ts +11 -0
  128. package/dest/deserialization/index.d.ts.map +1 -0
  129. package/dest/deserialization/index.js +10 -0
  130. package/dest/epoch-helpers/index.d.ts +7 -1
  131. package/dest/epoch-helpers/index.d.ts.map +1 -1
  132. package/dest/epoch-helpers/index.js +9 -3
  133. package/dest/errors/proving_error.d.ts +2 -2
  134. package/dest/errors/proving_error.d.ts.map +1 -1
  135. package/dest/file-store/local.d.ts +3 -3
  136. package/dest/file-store/local.d.ts.map +1 -1
  137. package/dest/file-store/local.js +13 -4
  138. package/dest/file-store/s3.d.ts +1 -1
  139. package/dest/file-store/s3.d.ts.map +1 -1
  140. package/dest/file-store/s3.js +11 -3
  141. package/dest/hash/hash.d.ts +2 -1
  142. package/dest/hash/hash.d.ts.map +1 -1
  143. package/dest/hash/hash.js +16 -10
  144. package/dest/hash/map_slot.d.ts +1 -1
  145. package/dest/hash/map_slot.d.ts.map +1 -1
  146. package/dest/hash/map_slot.js +4 -3
  147. package/dest/interfaces/api_limit.d.ts +2 -1
  148. package/dest/interfaces/api_limit.d.ts.map +1 -1
  149. package/dest/interfaces/api_limit.js +1 -0
  150. package/dest/interfaces/archiver.d.ts +1 -1
  151. package/dest/interfaces/archiver.d.ts.map +1 -1
  152. package/dest/interfaces/archiver.js +23 -15
  153. package/dest/interfaces/aztec-node-admin.d.ts +110 -31
  154. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  155. package/dest/interfaces/aztec-node-admin.js +12 -4
  156. package/dest/interfaces/aztec-node.d.ts +66 -69
  157. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  158. package/dest/interfaces/aztec-node.js +10 -16
  159. package/dest/interfaces/block-builder.d.ts +22 -14
  160. package/dest/interfaces/block-builder.d.ts.map +1 -1
  161. package/dest/interfaces/block-builder.js +7 -0
  162. package/dest/interfaces/configs.d.ts +34 -9
  163. package/dest/interfaces/configs.d.ts.map +1 -1
  164. package/dest/interfaces/configs.js +6 -1
  165. package/dest/interfaces/get_logs_response.d.ts +16 -9
  166. package/dest/interfaces/get_logs_response.d.ts.map +1 -1
  167. package/dest/interfaces/l2_logs_source.d.ts +14 -5
  168. package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
  169. package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
  170. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  171. package/dest/interfaces/p2p.d.ts +4 -9
  172. package/dest/interfaces/p2p.d.ts.map +1 -1
  173. package/dest/interfaces/prover-broker.d.ts +16 -1
  174. package/dest/interfaces/prover-broker.d.ts.map +1 -1
  175. package/dest/interfaces/prover-broker.js +4 -1
  176. package/dest/interfaces/prover-client.d.ts +15 -1
  177. package/dest/interfaces/prover-client.d.ts.map +1 -1
  178. package/dest/interfaces/prover-client.js +12 -1
  179. package/dest/interfaces/proving-job.d.ts +216 -216
  180. package/dest/interfaces/slasher.d.ts +9 -1
  181. package/dest/interfaces/slasher.d.ts.map +1 -1
  182. package/dest/interfaces/slasher.js +2 -0
  183. package/dest/interfaces/tx_provider.d.ts +3 -3
  184. package/dest/interfaces/tx_provider.d.ts.map +1 -1
  185. package/dest/interfaces/validator.d.ts +121 -16
  186. package/dest/interfaces/validator.d.ts.map +1 -1
  187. package/dest/interfaces/validator.js +7 -3
  188. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +1 -1
  189. package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
  190. package/dest/kernel/hints/build_note_hash_read_request_hints.js +16 -6
  191. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -3
  192. package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
  193. package/dest/kernel/hints/build_nullifier_read_request_hints.js +16 -8
  194. package/dest/kernel/hints/index.d.ts +2 -2
  195. package/dest/kernel/hints/index.js +2 -2
  196. package/dest/kernel/hints/key_validation_hint.d.ts +2 -1
  197. package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
  198. package/dest/kernel/hints/key_validation_request.d.ts +2 -1
  199. package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
  200. package/dest/kernel/hints/key_validation_request_and_separator.d.ts +24 -0
  201. package/dest/kernel/hints/key_validation_request_and_separator.d.ts.map +1 -0
  202. package/dest/kernel/hints/{key_validation_request_and_generator.js → key_validation_request_and_separator.js} +12 -15
  203. package/dest/kernel/hints/private_kernel_reset_hints.d.ts +13 -1
  204. package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
  205. package/dest/kernel/hints/read_request.d.ts +7 -1
  206. package/dest/kernel/hints/read_request.d.ts.map +1 -1
  207. package/dest/kernel/hints/read_request_hints.d.ts +7 -1
  208. package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
  209. package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts → scoped_key_validation_request_and_separator.d.ts} +8 -8
  210. package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts.map → scoped_key_validation_request_and_separator.d.ts.map} +1 -1
  211. package/dest/kernel/hints/{scoped_key_validation_request_and_generator.js → scoped_key_validation_request_and_separator.js} +6 -6
  212. package/dest/kernel/private_accumulated_data.d.ts +23 -1
  213. package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
  214. package/dest/kernel/private_call_data.d.ts +25 -1
  215. package/dest/kernel/private_call_data.d.ts.map +1 -1
  216. package/dest/kernel/private_call_request.d.ts +16 -1
  217. package/dest/kernel/private_call_request.d.ts.map +1 -1
  218. package/dest/kernel/private_circuit_public_inputs.d.ts +81 -8
  219. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  220. package/dest/kernel/private_circuit_public_inputs.js +16 -16
  221. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +33 -3
  222. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  223. package/dest/kernel/private_kernel_circuit_public_inputs.js +4 -4
  224. package/dest/kernel/private_kernel_data.d.ts +7 -1
  225. package/dest/kernel/private_kernel_data.d.ts.map +1 -1
  226. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +22 -1
  227. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
  228. package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts +7 -1
  229. package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts.map +1 -1
  230. package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +4 -1
  231. package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
  232. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +12 -3
  233. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
  234. package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +4 -4
  235. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +25 -3
  236. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
  237. package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +7 -7
  238. package/dest/kernel/private_to_avm_accumulated_data.d.ts +2 -2
  239. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +3 -3
  240. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
  241. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +7 -7
  242. package/dest/kernel/private_to_rollup_accumulated_data.d.ts +17 -1
  243. package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
  244. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +18 -3
  245. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
  246. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +7 -7
  247. package/dest/kernel/private_validation_requests.d.ts +13 -4
  248. package/dest/kernel/private_validation_requests.d.ts.map +1 -1
  249. package/dest/kernel/private_validation_requests.js +9 -9
  250. package/dest/kernel/public_call_request.d.ts +22 -1
  251. package/dest/kernel/public_call_request.d.ts.map +1 -1
  252. package/dest/kernel/utils/optional_number.d.ts +7 -1
  253. package/dest/kernel/utils/optional_number.d.ts.map +1 -1
  254. package/dest/keys/derivation.d.ts +3 -3
  255. package/dest/keys/derivation.js +15 -15
  256. package/dest/keys/key_types.d.ts +3 -3
  257. package/dest/keys/key_types.d.ts.map +1 -1
  258. package/dest/keys/public_keys.d.ts +5 -1
  259. package/dest/keys/public_keys.d.ts.map +1 -1
  260. package/dest/keys/public_keys.js +2 -2
  261. package/dest/keys/utils.d.ts +1 -1
  262. package/dest/keys/utils.d.ts.map +1 -1
  263. package/dest/keys/utils.js +8 -4
  264. package/dest/l1-contracts/slash_factory.d.ts +1 -1
  265. package/dest/l1-contracts/slash_factory.d.ts.map +1 -1
  266. package/dest/l1-contracts/slash_factory.js +1 -0
  267. package/dest/logs/debug_log_store.d.ts +30 -0
  268. package/dest/logs/debug_log_store.d.ts.map +1 -0
  269. package/dest/logs/debug_log_store.js +30 -0
  270. package/dest/logs/extended_contract_class_log.d.ts +3 -1
  271. package/dest/logs/extended_contract_class_log.d.ts.map +1 -1
  272. package/dest/logs/extended_directional_app_tagging_secret.d.ts +47 -0
  273. package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -0
  274. package/dest/logs/{directional_app_tagging_secret.js → extended_directional_app_tagging_secret.js} +23 -15
  275. package/dest/logs/extended_public_log.d.ts +17 -9
  276. package/dest/logs/extended_public_log.d.ts.map +1 -1
  277. package/dest/logs/index.d.ts +3 -2
  278. package/dest/logs/index.d.ts.map +1 -1
  279. package/dest/logs/index.js +2 -1
  280. package/dest/logs/log_id.d.ts +21 -14
  281. package/dest/logs/log_id.d.ts.map +1 -1
  282. package/dest/logs/log_id.js +20 -17
  283. package/dest/logs/pre_tag.d.ts +16 -11
  284. package/dest/logs/pre_tag.d.ts.map +1 -1
  285. package/dest/logs/pre_tag.js +2 -2
  286. package/dest/logs/private_log.d.ts +2 -2
  287. package/dest/logs/private_log.d.ts.map +1 -1
  288. package/dest/logs/siloed_tag.d.ts +5 -3
  289. package/dest/logs/siloed_tag.d.ts.map +1 -1
  290. package/dest/logs/siloed_tag.js +8 -6
  291. package/dest/logs/tag.js +1 -1
  292. package/dest/messaging/inbox_leaf.d.ts +3 -1
  293. package/dest/messaging/inbox_leaf.d.ts.map +1 -1
  294. package/dest/messaging/l1_actor.d.ts +7 -1
  295. package/dest/messaging/l1_actor.d.ts.map +1 -1
  296. package/dest/messaging/l1_to_l2_message.d.ts +6 -1
  297. package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
  298. package/dest/messaging/l2_actor.d.ts +7 -1
  299. package/dest/messaging/l2_actor.d.ts.map +1 -1
  300. package/dest/messaging/l2_to_l1_membership.d.ts +3 -3
  301. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  302. package/dest/messaging/l2_to_l1_membership.js +8 -6
  303. package/dest/messaging/out_hash.d.ts +41 -4
  304. package/dest/messaging/out_hash.d.ts.map +1 -1
  305. package/dest/messaging/out_hash.js +52 -26
  306. package/dest/note/index.d.ts +1 -2
  307. package/dest/note/index.d.ts.map +1 -1
  308. package/dest/note/index.js +0 -1
  309. package/dest/note/note_dao.d.ts +36 -5
  310. package/dest/note/note_dao.d.ts.map +1 -1
  311. package/dest/note/note_dao.js +15 -12
  312. package/dest/p2p/attestation_utils.d.ts +11 -1
  313. package/dest/p2p/attestation_utils.d.ts.map +1 -1
  314. package/dest/p2p/attestation_utils.js +45 -0
  315. package/dest/p2p/block_proposal.d.ts +23 -8
  316. package/dest/p2p/block_proposal.d.ts.map +1 -1
  317. package/dest/p2p/block_proposal.js +26 -10
  318. package/dest/p2p/checkpoint_attestation.d.ts +6 -1
  319. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  320. package/dest/p2p/checkpoint_attestation.js +1 -1
  321. package/dest/p2p/checkpoint_proposal.d.ts +34 -9
  322. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  323. package/dest/p2p/checkpoint_proposal.js +46 -20
  324. package/dest/p2p/client_type.d.ts +2 -5
  325. package/dest/p2p/client_type.d.ts.map +1 -1
  326. package/dest/p2p/client_type.js +0 -7
  327. package/dest/p2p/consensus_payload.d.ts +15 -5
  328. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  329. package/dest/p2p/consensus_payload.js +22 -18
  330. package/dest/p2p/constants.d.ts +5 -0
  331. package/dest/p2p/constants.d.ts.map +1 -0
  332. package/dest/p2p/constants.js +3 -0
  333. package/dest/p2p/index.d.ts +2 -2
  334. package/dest/p2p/index.d.ts.map +1 -1
  335. package/dest/p2p/index.js +1 -1
  336. package/dest/p2p/message_validator.d.ts +18 -3
  337. package/dest/p2p/message_validator.d.ts.map +1 -1
  338. package/dest/p2p/message_validator.js +2 -1
  339. package/dest/p2p/signed_txs.d.ts +3 -1
  340. package/dest/p2p/signed_txs.d.ts.map +1 -1
  341. package/dest/p2p/signed_txs.js +6 -1
  342. package/dest/p2p/topic_type.d.ts +3 -4
  343. package/dest/p2p/topic_type.d.ts.map +1 -1
  344. package/dest/p2p/topic_type.js +7 -23
  345. package/dest/parity/parity_base_private_inputs.d.ts +3 -1
  346. package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
  347. package/dest/parity/parity_public_inputs.d.ts +4 -1
  348. package/dest/parity/parity_public_inputs.d.ts.map +1 -1
  349. package/dest/parity/parity_root_private_inputs.d.ts +2 -1
  350. package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
  351. package/dest/proofs/chonk_proof.d.ts +1 -1
  352. package/dest/proofs/chonk_proof.d.ts.map +1 -1
  353. package/dest/proofs/chonk_proof.js +9 -4
  354. package/dest/proofs/proof.d.ts +4 -1
  355. package/dest/proofs/proof.d.ts.map +1 -1
  356. package/dest/proofs/recursive_proof.d.ts +10 -1
  357. package/dest/proofs/recursive_proof.d.ts.map +1 -1
  358. package/dest/rollup/base_rollup_hints.d.ts +34 -1
  359. package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
  360. package/dest/rollup/block_constant_data.d.ts +12 -1
  361. package/dest/rollup/block_constant_data.d.ts.map +1 -1
  362. package/dest/rollup/block_headers_hash.js +1 -1
  363. package/dest/rollup/block_merge_rollup_private_inputs.d.ts +4 -1
  364. package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
  365. package/dest/rollup/block_rollup_public_inputs.d.ts +44 -3
  366. package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
  367. package/dest/rollup/block_rollup_public_inputs.js +2 -2
  368. package/dest/rollup/block_root_rollup_private_inputs.d.ts +64 -1
  369. package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
  370. package/dest/rollup/checkpoint_constant_data.d.ts +10 -1
  371. package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
  372. package/dest/rollup/checkpoint_header.d.ts +31 -4
  373. package/dest/rollup/checkpoint_header.d.ts.map +1 -1
  374. package/dest/rollup/checkpoint_header.js +23 -7
  375. package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +4 -1
  376. package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
  377. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +45 -10
  378. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
  379. package/dest/rollup/checkpoint_rollup_public_inputs.js +11 -7
  380. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +44 -3
  381. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
  382. package/dest/rollup/checkpoint_root_rollup_private_inputs.js +13 -2
  383. package/dest/rollup/epoch_constant_data.d.ts +16 -1
  384. package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
  385. package/dest/rollup/root_rollup_private_inputs.d.ts +6 -1
  386. package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
  387. package/dest/rollup/root_rollup_public_inputs.d.ts +17 -7
  388. package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
  389. package/dest/rollup/root_rollup_public_inputs.js +7 -4
  390. package/dest/rollup/tree_snapshot_diff_hints.d.ts +24 -1
  391. package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -1
  392. package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +4 -1
  393. package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
  394. package/dest/rollup/tx_rollup_public_inputs.d.ts +29 -1
  395. package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
  396. package/dest/schemas/schemas.d.ts +1 -1
  397. package/dest/slashing/empire.d.ts +1 -1
  398. package/dest/slashing/empire.d.ts.map +1 -1
  399. package/dest/slashing/empire.js +2 -0
  400. package/dest/slashing/helpers.d.ts +2 -2
  401. package/dest/slashing/helpers.d.ts.map +1 -1
  402. package/dest/slashing/helpers.js +6 -0
  403. package/dest/slashing/tally.d.ts +2 -1
  404. package/dest/slashing/tally.d.ts.map +1 -1
  405. package/dest/slashing/tally.js +6 -2
  406. package/dest/slashing/types.d.ts +7 -3
  407. package/dest/slashing/types.d.ts.map +1 -1
  408. package/dest/slashing/types.js +13 -1
  409. package/dest/stats/stats.d.ts +1 -3
  410. package/dest/stats/stats.d.ts.map +1 -1
  411. package/dest/tests/factories.d.ts +4 -4
  412. package/dest/tests/factories.d.ts.map +1 -1
  413. package/dest/tests/factories.js +26 -27
  414. package/dest/tests/jest.js +1 -1
  415. package/dest/tests/mocks.d.ts +24 -15
  416. package/dest/tests/mocks.d.ts.map +1 -1
  417. package/dest/tests/mocks.js +63 -40
  418. package/dest/timetable/index.d.ts +37 -0
  419. package/dest/timetable/index.d.ts.map +1 -0
  420. package/dest/timetable/index.js +39 -0
  421. package/dest/trees/append_only_tree_snapshot.d.ts +13 -1
  422. package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
  423. package/dest/trees/nullifier_leaf.d.ts +13 -1
  424. package/dest/trees/nullifier_leaf.d.ts.map +1 -1
  425. package/dest/trees/nullifier_membership_witness.d.ts +10 -1
  426. package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
  427. package/dest/trees/public_data_leaf.d.ts +17 -1
  428. package/dest/trees/public_data_leaf.d.ts.map +1 -1
  429. package/dest/trees/public_data_leaf.js +7 -6
  430. package/dest/trees/public_data_witness.d.ts +11 -1
  431. package/dest/trees/public_data_witness.d.ts.map +1 -1
  432. package/dest/tx/block_header.d.ts +14 -2
  433. package/dest/tx/block_header.d.ts.map +1 -1
  434. package/dest/tx/block_header.js +6 -2
  435. package/dest/tx/call_context.d.ts +13 -1
  436. package/dest/tx/call_context.d.ts.map +1 -1
  437. package/dest/tx/capsule.d.ts +4 -1
  438. package/dest/tx/capsule.d.ts.map +1 -1
  439. package/dest/tx/execution_payload.d.ts +9 -1
  440. package/dest/tx/execution_payload.d.ts.map +1 -1
  441. package/dest/tx/function_data.d.ts +4 -2
  442. package/dest/tx/function_data.d.ts.map +1 -1
  443. package/dest/tx/global_variables.d.ts +12 -4
  444. package/dest/tx/global_variables.d.ts.map +1 -1
  445. package/dest/tx/hashed_values.d.ts +7 -1
  446. package/dest/tx/hashed_values.d.ts.map +1 -1
  447. package/dest/tx/in_tx.d.ts +4 -4
  448. package/dest/tx/indexed_tx_effect.d.ts +5 -5
  449. package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
  450. package/dest/tx/indexed_tx_effect.js +3 -2
  451. package/dest/tx/partial_state_reference.d.ts +4 -1
  452. package/dest/tx/partial_state_reference.d.ts.map +1 -1
  453. package/dest/tx/private_execution_result.d.ts +23 -2
  454. package/dest/tx/private_execution_result.d.ts.map +1 -1
  455. package/dest/tx/private_execution_result.js +1 -1
  456. package/dest/tx/private_tx_constant_data.d.ts +16 -1
  457. package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
  458. package/dest/tx/profiling.d.ts +152 -29
  459. package/dest/tx/profiling.d.ts.map +1 -1
  460. package/dest/tx/profiling.js +47 -10
  461. package/dest/tx/protocol_contracts.d.ts +2 -2
  462. package/dest/tx/protocol_contracts.d.ts.map +1 -1
  463. package/dest/tx/protocol_contracts.js +2 -2
  464. package/dest/tx/public_call_request_with_calldata.d.ts +7 -1
  465. package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
  466. package/dest/tx/public_simulation_output.d.ts +4 -2
  467. package/dest/tx/public_simulation_output.d.ts.map +1 -1
  468. package/dest/tx/public_simulation_output.js +7 -3
  469. package/dest/tx/state_reference.d.ts +3 -1
  470. package/dest/tx/state_reference.d.ts.map +1 -1
  471. package/dest/tx/tx.d.ts +24 -1
  472. package/dest/tx/tx.d.ts.map +1 -1
  473. package/dest/tx/tx.js +6 -3
  474. package/dest/tx/tx_context.d.ts +2 -1
  475. package/dest/tx/tx_context.d.ts.map +1 -1
  476. package/dest/tx/tx_effect.d.ts +32 -6
  477. package/dest/tx/tx_effect.d.ts.map +1 -1
  478. package/dest/tx/tx_effect.js +0 -7
  479. package/dest/tx/tx_execution_request.d.ts +30 -1
  480. package/dest/tx/tx_execution_request.d.ts.map +1 -1
  481. package/dest/tx/tx_hash.d.ts +2 -1
  482. package/dest/tx/tx_hash.d.ts.map +1 -1
  483. package/dest/tx/tx_receipt.d.ts +62 -14
  484. package/dest/tx/tx_receipt.d.ts.map +1 -1
  485. package/dest/tx/tx_receipt.js +55 -16
  486. package/dest/tx/tx_request.d.ts +6 -1
  487. package/dest/tx/tx_request.d.ts.map +1 -1
  488. package/dest/tx/tx_request.js +2 -2
  489. package/dest/tx/validator/empty_validator.d.ts +2 -2
  490. package/dest/tx/validator/empty_validator.d.ts.map +1 -1
  491. package/dest/tx/validator/error_texts.d.ts +3 -2
  492. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  493. package/dest/tx/validator/error_texts.js +3 -1
  494. package/dest/tx/validator/tx_validator.d.ts +2 -2
  495. package/dest/tx/validator/tx_validator.d.ts.map +1 -1
  496. package/dest/types/shared.d.ts +4 -1
  497. package/dest/types/shared.d.ts.map +1 -1
  498. package/dest/update-checker/index.d.ts +3 -2
  499. package/dest/update-checker/index.d.ts.map +1 -1
  500. package/dest/update-checker/index.js +2 -1
  501. package/dest/update-checker/package_version.d.ts +3 -0
  502. package/dest/update-checker/package_version.d.ts.map +1 -0
  503. package/dest/update-checker/package_version.js +11 -0
  504. package/dest/update-checker/version_checker.d.ts +25 -0
  505. package/dest/update-checker/version_checker.d.ts.map +1 -0
  506. package/dest/update-checker/version_checker.js +50 -0
  507. package/dest/validators/schemas.d.ts +38 -38
  508. package/dest/validators/schemas.d.ts.map +1 -1
  509. package/dest/validators/schemas.js +4 -3
  510. package/dest/validators/types.d.ts +3 -3
  511. package/dest/validators/types.d.ts.map +1 -1
  512. package/dest/vks/verification_key.d.ts +22 -1
  513. package/dest/vks/verification_key.d.ts.map +1 -1
  514. package/dest/vks/vk_data.d.ts +7 -1
  515. package/dest/vks/vk_data.d.ts.map +1 -1
  516. package/dest/zkpassport/index.d.ts +3 -4
  517. package/dest/zkpassport/index.d.ts.map +1 -1
  518. package/dest/zkpassport/index.js +9 -9
  519. package/package.json +28 -14
  520. package/src/abi/decoder.ts +1 -4
  521. package/src/abi/encoder.ts +8 -5
  522. package/src/abi/function_call.ts +25 -3
  523. package/src/abi/utils.ts +17 -0
  524. package/src/auth_witness/auth_witness.ts +3 -3
  525. package/src/avm/revert_code.ts +15 -0
  526. package/src/block/block_data.ts +26 -0
  527. package/src/block/block_hash.ts +26 -25
  528. package/src/block/block_parameter.ts +4 -2
  529. package/src/block/body.ts +2 -1
  530. package/src/block/checkpointed_l2_block.ts +8 -58
  531. package/src/block/in_block.ts +6 -6
  532. package/src/block/index.ts +1 -2
  533. package/src/block/l2_block.ts +102 -150
  534. package/src/block/l2_block_source.ts +93 -42
  535. package/src/block/l2_block_stream/interfaces.ts +8 -5
  536. package/src/block/l2_block_stream/l2_block_stream.ts +66 -37
  537. package/src/block/l2_block_stream/l2_tips_store_base.ts +2 -2
  538. package/src/block/test/l2_tips_store_test_suite.ts +4 -9
  539. package/src/block/validate_block_result.ts +5 -4
  540. package/src/checkpoint/checkpoint.ts +61 -21
  541. package/src/checkpoint/checkpoint_data.ts +51 -0
  542. package/src/checkpoint/index.ts +1 -0
  543. package/src/checkpoint/published_checkpoint.ts +7 -4
  544. package/src/config/index.ts +1 -0
  545. package/src/config/node-rpc-config.ts +1 -1
  546. package/src/config/sequencer-config.ts +37 -0
  547. package/src/contract/contract_address.ts +4 -4
  548. package/src/contract/contract_class.ts +3 -3
  549. package/src/contract/contract_class_id.ts +6 -5
  550. package/src/contract/index.ts +0 -2
  551. package/src/contract/interfaces/node-info.ts +3 -0
  552. package/src/contract/private_function.ts +3 -4
  553. package/src/contract/private_function_membership_proof.ts +1 -1
  554. package/src/database-version/database_version.ts +87 -0
  555. package/src/database-version/version_manager.ts +1 -77
  556. package/src/delayed_public_mutable/delayed_public_mutable_values.ts +9 -10
  557. package/src/deserialization/index.ts +21 -0
  558. package/src/epoch-helpers/index.ts +13 -1
  559. package/src/file-store/local.ts +15 -5
  560. package/src/file-store/s3.ts +12 -3
  561. package/src/hash/hash.ts +14 -10
  562. package/src/hash/map_slot.ts +3 -2
  563. package/src/interfaces/api_limit.ts +1 -0
  564. package/src/interfaces/archiver.ts +23 -24
  565. package/src/interfaces/aztec-node-admin.ts +26 -2
  566. package/src/interfaces/aztec-node.ts +86 -135
  567. package/src/interfaces/block-builder.ts +41 -23
  568. package/src/interfaces/configs.ts +19 -4
  569. package/src/interfaces/l2_logs_source.ts +17 -4
  570. package/src/interfaces/merkle_tree_operations.ts +1 -1
  571. package/src/interfaces/p2p.ts +3 -14
  572. package/src/interfaces/prover-broker.ts +22 -0
  573. package/src/interfaces/prover-client.ts +22 -0
  574. package/src/interfaces/slasher.ts +4 -0
  575. package/src/interfaces/tx_provider.ts +2 -2
  576. package/src/interfaces/validator.ts +22 -13
  577. package/src/kernel/hints/build_note_hash_read_request_hints.ts +17 -6
  578. package/src/kernel/hints/build_nullifier_read_request_hints.ts +17 -14
  579. package/src/kernel/hints/index.ts +2 -2
  580. package/src/kernel/hints/{key_validation_request_and_generator.ts → key_validation_request_and_separator.ts} +12 -15
  581. package/src/kernel/hints/{scoped_key_validation_request_and_generator.ts → scoped_key_validation_request_and_separator.ts} +10 -10
  582. package/src/kernel/private_circuit_public_inputs.ts +14 -14
  583. package/src/kernel/private_kernel_circuit_public_inputs.ts +2 -2
  584. package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +2 -2
  585. package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +5 -5
  586. package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +5 -5
  587. package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +5 -5
  588. package/src/kernel/private_validation_requests.ts +8 -8
  589. package/src/keys/derivation.ts +15 -15
  590. package/src/keys/key_types.ts +6 -2
  591. package/src/keys/public_keys.ts +2 -2
  592. package/src/keys/utils.ts +8 -4
  593. package/src/l1-contracts/slash_factory.ts +1 -0
  594. package/src/logs/debug_log_store.ts +54 -0
  595. package/src/logs/{directional_app_tagging_secret.ts → extended_directional_app_tagging_secret.ts} +24 -16
  596. package/src/logs/index.ts +2 -1
  597. package/src/logs/log_id.ts +22 -18
  598. package/src/logs/pre_tag.ts +5 -5
  599. package/src/logs/siloed_tag.ts +10 -4
  600. package/src/logs/tag.ts +1 -1
  601. package/src/messaging/l2_to_l1_membership.ts +8 -6
  602. package/src/messaging/out_hash.ts +60 -29
  603. package/src/note/index.ts +0 -1
  604. package/src/note/note_dao.ts +18 -13
  605. package/src/p2p/attestation_utils.ts +56 -0
  606. package/src/p2p/block_proposal.ts +36 -15
  607. package/src/p2p/checkpoint_attestation.ts +6 -1
  608. package/src/p2p/checkpoint_proposal.ts +74 -24
  609. package/src/p2p/client_type.ts +0 -6
  610. package/src/p2p/consensus_payload.ts +25 -17
  611. package/src/p2p/constants.ts +6 -0
  612. package/src/p2p/index.ts +1 -1
  613. package/src/p2p/message_validator.ts +14 -2
  614. package/src/p2p/signed_txs.ts +6 -1
  615. package/src/p2p/topic_type.ts +8 -15
  616. package/src/proofs/chonk_proof.ts +9 -5
  617. package/src/rollup/block_headers_hash.ts +1 -1
  618. package/src/rollup/block_rollup_public_inputs.ts +2 -2
  619. package/src/rollup/checkpoint_header.ts +22 -2
  620. package/src/rollup/checkpoint_rollup_public_inputs.ts +16 -10
  621. package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
  622. package/src/rollup/root_rollup_public_inputs.ts +11 -8
  623. package/src/slashing/empire.ts +3 -1
  624. package/src/slashing/helpers.ts +8 -0
  625. package/src/slashing/tally.ts +8 -2
  626. package/src/slashing/types.ts +14 -0
  627. package/src/stats/stats.ts +0 -2
  628. package/src/tests/factories.ts +32 -43
  629. package/src/tests/jest.ts +1 -1
  630. package/src/tests/mocks.ts +90 -55
  631. package/src/timetable/index.ts +66 -0
  632. package/src/trees/public_data_leaf.ts +11 -5
  633. package/src/tx/block_header.ts +12 -4
  634. package/src/tx/global_variables.ts +3 -3
  635. package/src/tx/indexed_tx_effect.ts +3 -2
  636. package/src/tx/private_execution_result.ts +1 -1
  637. package/src/tx/profiling.ts +51 -9
  638. package/src/tx/protocol_contracts.ts +2 -2
  639. package/src/tx/public_simulation_output.ts +4 -0
  640. package/src/tx/tx.ts +8 -9
  641. package/src/tx/tx_effect.ts +0 -9
  642. package/src/tx/tx_receipt.ts +85 -18
  643. package/src/tx/tx_request.ts +2 -2
  644. package/src/tx/validator/empty_validator.ts +1 -1
  645. package/src/tx/validator/error_texts.ts +4 -1
  646. package/src/tx/validator/tx_validator.ts +1 -1
  647. package/src/update-checker/index.ts +2 -1
  648. package/src/update-checker/package_version.ts +17 -0
  649. package/src/update-checker/version_checker.ts +65 -0
  650. package/src/validators/schemas.ts +8 -1
  651. package/src/validators/types.ts +5 -4
  652. package/src/zkpassport/index.ts +11 -12
  653. package/dest/block/l2_block_code_to_purge.d.ts +0 -11
  654. package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
  655. package/dest/block/l2_block_code_to_purge.js +0 -55
  656. package/dest/block/l2_block_header.d.ts +0 -94
  657. package/dest/block/l2_block_header.d.ts.map +0 -1
  658. package/dest/block/l2_block_header.js +0 -160
  659. package/dest/block/l2_block_new.d.ts +0 -134
  660. package/dest/block/l2_block_new.d.ts.map +0 -1
  661. package/dest/block/l2_block_new.js +0 -155
  662. package/dest/contract/contract_class_metadata.d.ts +0 -8
  663. package/dest/contract/contract_class_metadata.d.ts.map +0 -1
  664. package/dest/contract/contract_class_metadata.js +0 -1
  665. package/dest/contract/contract_metadata.d.ts +0 -7
  666. package/dest/contract/contract_metadata.d.ts.map +0 -1
  667. package/dest/contract/contract_metadata.js +0 -1
  668. package/dest/database-version/index.d.ts +0 -2
  669. package/dest/database-version/index.d.ts.map +0 -1
  670. package/dest/database-version/index.js +0 -1
  671. package/dest/kernel/hints/key_validation_request_and_generator.d.ts +0 -25
  672. package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +0 -1
  673. package/dest/logs/directional_app_tagging_secret.d.ts +0 -40
  674. package/dest/logs/directional_app_tagging_secret.d.ts.map +0 -1
  675. package/dest/note/notes_filter.d.ts +0 -27
  676. package/dest/note/notes_filter.d.ts.map +0 -1
  677. package/dest/note/notes_filter.js +0 -11
  678. package/dest/update-checker/update-checker.d.ts +0 -49
  679. package/dest/update-checker/update-checker.d.ts.map +0 -1
  680. package/dest/update-checker/update-checker.js +0 -130
  681. package/src/block/l2_block_code_to_purge.ts +0 -80
  682. package/src/block/l2_block_header.ts +0 -255
  683. package/src/block/l2_block_new.ts +0 -211
  684. package/src/contract/contract_class_metadata.ts +0 -8
  685. package/src/contract/contract_metadata.ts +0 -7
  686. package/src/database-version/index.ts +0 -1
  687. package/src/note/notes_filter.ts +0 -38
  688. package/src/update-checker/update-checker.ts +0 -166
@@ -1,4 +1,5 @@
1
1
  import { toBigIntBE, toBufferBE } from '@aztec/foundation/bigint-buffer';
2
+ import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
2
3
  import { Fr } from '@aztec/foundation/curves/bn254';
3
4
  import { schemas } from '@aztec/foundation/schemas';
4
5
  import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
@@ -81,11 +82,15 @@ export class PublicDataTreeLeafPreimage implements IndexedTreeLeafPreimage {
81
82
  toHashInputs(): Buffer[] {
82
83
  return [
83
84
  ...this.leaf.toHashInputs(),
84
- Buffer.from(toBufferBE(this.nextIndex, 32)),
85
85
  Buffer.from(this.nextKey.toBuffer()),
86
+ Buffer.from(toBufferBE(this.nextIndex, 32)),
86
87
  ];
87
88
  }
88
89
 
90
+ hash(): Promise<Fr> {
91
+ return poseidon2Hash(this.toHashInputs());
92
+ }
93
+
89
94
  clone(): PublicDataTreeLeafPreimage {
90
95
  return new PublicDataTreeLeafPreimage(this.leaf.clone(), this.nextKey, this.nextIndex);
91
96
  }
@@ -104,10 +109,11 @@ export class PublicDataTreeLeafPreimage implements IndexedTreeLeafPreimage {
104
109
 
105
110
  static fromBuffer(buffer: Buffer | BufferReader): PublicDataTreeLeafPreimage {
106
111
  const reader = BufferReader.asReader(buffer);
107
- const value = PublicDataTreeLeaf.fromBuffer(reader);
108
- const nextIndex = toBigIntBE(reader.readBytes(32));
109
- const nextSlot = Fr.fromBuffer(reader);
110
- return new PublicDataTreeLeafPreimage(value, nextSlot, nextIndex);
112
+ return new PublicDataTreeLeafPreimage(
113
+ PublicDataTreeLeaf.fromBuffer(reader),
114
+ Fr.fromBuffer(reader),
115
+ toBigIntBE(reader.readBytes(32)),
116
+ );
111
117
  }
112
118
 
113
119
  static fromLeaf(leaf: PublicDataTreeLeaf, nextKey: bigint, nextIndex: bigint): PublicDataTreeLeafPreimage {
@@ -1,4 +1,4 @@
1
- import { BLOCK_HEADER_LENGTH, GeneratorIndex } from '@aztec/constants';
1
+ import { BLOCK_HEADER_LENGTH, DomainSeparator } from '@aztec/constants';
2
2
  import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
3
3
  import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
4
4
  import { randomInt } from '@aztec/foundation/crypto/random';
@@ -11,13 +11,14 @@ import type { FieldsOf } from '@aztec/foundation/types';
11
11
  import { inspect } from 'util';
12
12
  import { z } from 'zod';
13
13
 
14
+ import { BlockHash } from '../block/block_hash.js';
14
15
  import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
15
16
  import { GlobalVariables } from './global_variables.js';
16
17
  import { StateReference } from './state_reference.js';
17
18
 
18
19
  /** A header of an L2 block. */
19
20
  export class BlockHeader {
20
- private _cachedHash?: Promise<Fr>;
21
+ private _cachedHash?: Promise<BlockHash>;
21
22
 
22
23
  constructor(
23
24
  /** Snapshot of archive before the block is applied. */
@@ -161,13 +162,20 @@ export class BlockHeader {
161
162
  return BlockHeader.fromBuffer(hexToBuffer(str));
162
163
  }
163
164
 
164
- hash(): Promise<Fr> {
165
+ hash(): Promise<BlockHash> {
165
166
  if (!this._cachedHash) {
166
- this._cachedHash = poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.BLOCK_HASH);
167
+ this._cachedHash = poseidon2HashWithSeparator(this.toFields(), DomainSeparator.BLOCK_HEADER_HASH).then(
168
+ fr => new BlockHash(fr),
169
+ );
167
170
  }
168
171
  return this._cachedHash;
169
172
  }
170
173
 
174
+ /** Manually set the hash for this block header if already computed */
175
+ setHash(hashed: Fr) {
176
+ this._cachedHash = Promise.resolve(new BlockHash(hashed));
177
+ }
178
+
171
179
  static random(overrides: Partial<FieldsOf<BlockHeader>> & Partial<FieldsOf<GlobalVariables>> = {}): BlockHeader {
172
180
  return BlockHeader.from({
173
181
  lastArchive: AppendOnlyTreeSnapshot.random(),
@@ -22,10 +22,10 @@ import { schemas } from '../schemas/index.js';
22
22
  import type { UInt64 } from '../types/index.js';
23
23
 
24
24
  /**
25
- * Global variables that are constant across the entire slot.
26
- * TODO(palla/mbps): Should timestamp be included here as well?
25
+ * Global variables that are constant across the entire checkpoint (slot).
26
+ * Excludes blockNumber since that varies per block within a checkpoint.
27
27
  */
28
- export type CheckpointGlobalVariables = Omit<FieldsOf<GlobalVariables>, 'blockNumber' | 'timestamp'>;
28
+ export type CheckpointGlobalVariables = Omit<FieldsOf<GlobalVariables>, 'blockNumber'>;
29
29
 
30
30
  /**
31
31
  * Global variables of the L2 block.
@@ -1,8 +1,9 @@
1
1
  import { BlockNumber } from '@aztec/foundation/branded-types';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
3
  import { schemas } from '@aztec/foundation/schemas';
3
4
  import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
4
5
 
5
- import { L2BlockHash } from '../block/block_hash.js';
6
+ import { BlockHash } from '../block/block_hash.js';
6
7
  import { type DataInBlock, dataInBlockSchemaFor, randomDataInBlock } from '../block/in_block.js';
7
8
  import { TxEffect } from './tx_effect.js';
8
9
 
@@ -26,7 +27,7 @@ export function serializeIndexedTxEffect(effect: IndexedTxEffect): Buffer {
26
27
  export function deserializeIndexedTxEffect(buffer: Buffer): IndexedTxEffect {
27
28
  const reader = BufferReader.asReader(buffer);
28
29
 
29
- const l2BlockHash = reader.readObject(L2BlockHash);
30
+ const l2BlockHash = new BlockHash(reader.readObject(Fr));
30
31
  const l2BlockNumber = BlockNumber(reader.readNumber());
31
32
  const txIndexInBlock = reader.readNumber();
32
33
  const data = reader.readObject(TxEffect);
@@ -79,7 +79,7 @@ export class CountedContractClassLog implements IsEmpty {
79
79
  export class PrivateExecutionResult {
80
80
  constructor(
81
81
  public entrypoint: PrivateCallExecutionResult,
82
- /** The first non revertible nullifier, or zero if there was none. */
82
+ /** The first non-revertible nullifier emitted by any private call, or the protocol nullifier if there was none. */
83
83
  public firstNullifier: Fr,
84
84
  /** An array of calldata for the enqueued public function calls and the teardown function call. */
85
85
  public publicFunctionCalldata: HashedValues[],
@@ -6,9 +6,35 @@ import { z } from 'zod';
6
6
  import type { AztecNode } from '../interfaces/aztec-node.js';
7
7
  import { type PrivateExecutionStep, PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
8
8
 
9
- export type NodeStats = Partial<Record<keyof AztecNode, { times: number[] }>>;
9
+ export type RoundTripStats = {
10
+ /** Number of round trips (times we blocked waiting for node responses) */
11
+ roundTrips: number;
12
+ /** Total wall-clock time spent waiting on node (excludes parallel overlap) */
13
+ totalBlockingTime: number;
14
+ /** Individual round trip durations */
15
+ roundTripDurations: number[];
16
+ /** Methods called in each round trip (parallel calls grouped together) */
17
+ roundTripMethods: string[][];
18
+ };
19
+
20
+ const RoundTripStatsSchema = z.object({
21
+ roundTrips: z.number(),
22
+ totalBlockingTime: z.number(),
23
+ roundTripDurations: z.array(z.number()),
24
+ roundTripMethods: z.array(z.array(z.string())),
25
+ });
26
+
27
+ export type NodeStats = {
28
+ /** Per-method call stats */
29
+ perMethod: Partial<Record<keyof AztecNode, { times: number[] }>>;
30
+ /** Round trip stats tracking actual blocking waits */
31
+ roundTrips: RoundTripStats;
32
+ };
10
33
 
11
- const NodeStatsSchema = z.record(z.string(), z.object({ times: z.array(z.number()) }));
34
+ const NodeStatsSchema = z.object({
35
+ perMethod: z.record(z.string(), z.object({ times: z.array(z.number()) })),
36
+ roundTrips: RoundTripStatsSchema,
37
+ });
12
38
 
13
39
  type FunctionTiming = {
14
40
  functionName: string;
@@ -105,7 +131,15 @@ export class TxProfileResult {
105
131
  },
106
132
  ],
107
133
  {
108
- nodeRPCCalls: { getBlockHeader: { times: [1] } },
134
+ nodeRPCCalls: {
135
+ perMethod: { getBlockHeader: { times: [1] } },
136
+ roundTrips: {
137
+ roundTrips: 1,
138
+ totalBlockingTime: 1,
139
+ roundTripDurations: [1],
140
+ roundTripMethods: [['getBlockHeader']],
141
+ },
142
+ },
109
143
  timings: {
110
144
  sync: 1,
111
145
  proving: 1,
@@ -123,24 +157,32 @@ export class TxProfileResult {
123
157
  }
124
158
  }
125
159
 
126
- export class UtilitySimulationResult {
160
+ export class UtilityExecutionResult {
127
161
  constructor(
128
162
  public result: Fr[],
129
163
  public stats?: SimulationStats,
130
164
  ) {}
131
165
 
132
- static get schema(): ZodFor<UtilitySimulationResult> {
166
+ static get schema(): ZodFor<UtilityExecutionResult> {
133
167
  return z
134
168
  .object({
135
169
  result: z.array(schemas.Fr),
136
170
  stats: optional(SimulationStatsSchema),
137
171
  })
138
- .transform(({ result, stats }) => new UtilitySimulationResult(result, stats));
172
+ .transform(({ result, stats }) => new UtilityExecutionResult(result, stats));
139
173
  }
140
174
 
141
- static random(): UtilitySimulationResult {
142
- return new UtilitySimulationResult([Fr.random()], {
143
- nodeRPCCalls: { getBlockHeader: { times: [1] } },
175
+ static random(): UtilityExecutionResult {
176
+ return new UtilityExecutionResult([Fr.random()], {
177
+ nodeRPCCalls: {
178
+ perMethod: { getBlockHeader: { times: [1] } },
179
+ roundTrips: {
180
+ roundTrips: 1,
181
+ totalBlockingTime: 1,
182
+ roundTripDurations: [1],
183
+ roundTripMethods: [['getBlockHeader']],
184
+ },
185
+ },
144
186
  timings: {
145
187
  sync: 1,
146
188
  publicSimulation: 1,
@@ -1,4 +1,4 @@
1
- import { GeneratorIndex, MAX_PROTOCOL_CONTRACTS } from '@aztec/constants';
1
+ import { DomainSeparator, MAX_PROTOCOL_CONTRACTS } from '@aztec/constants';
2
2
  import { makeTuple } from '@aztec/foundation/array';
3
3
  import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection';
4
4
  import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
@@ -71,7 +71,7 @@ export class ProtocolContracts {
71
71
  }
72
72
 
73
73
  hash() {
74
- return poseidon2HashWithSeparator(this.derivedAddresses, GeneratorIndex.PROTOCOL_CONTRACTS);
74
+ return poseidon2HashWithSeparator(this.derivedAddresses, DomainSeparator.PROTOCOL_CONTRACTS);
75
75
  }
76
76
 
77
77
  static get schema() {
@@ -7,6 +7,7 @@ import { z } from 'zod';
7
7
  import { SimulationError } from '../errors/simulation_error.js';
8
8
  import { Gas } from '../gas/gas.js';
9
9
  import type { GasUsed } from '../gas/gas_used.js';
10
+ import { DebugLog } from '../logs/debug_log.js';
10
11
  import { NullishToUndefined } from '../schemas/schemas.js';
11
12
  import { TxEffect } from '../tx/tx_effect.js';
12
13
  import { GlobalVariables } from './global_variables.js';
@@ -71,6 +72,7 @@ export class PublicSimulationOutput {
71
72
  public txEffect: TxEffect,
72
73
  public publicReturnValues: NestedProcessReturnValues[],
73
74
  public gasUsed: GasUsed,
75
+ public debugLogs: DebugLog[] = [],
74
76
  ) {}
75
77
 
76
78
  static get schema(): ZodFor<PublicSimulationOutput> {
@@ -86,6 +88,7 @@ export class PublicSimulationOutput {
86
88
  publicGas: Gas.schema,
87
89
  billedGas: Gas.schema,
88
90
  }),
91
+ debugLogs: z.array(DebugLog.schema).default([]),
89
92
  })
90
93
  .transform(
91
94
  fields =>
@@ -95,6 +98,7 @@ export class PublicSimulationOutput {
95
98
  fields.txEffect,
96
99
  fields.publicReturnValues,
97
100
  fields.gasUsed,
101
+ fields.debugLogs,
98
102
  ),
99
103
  );
100
104
  }
package/src/tx/tx.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Buffer32 } from '@aztec/foundation/buffer';
2
- import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection';
3
2
  import { Fr } from '@aztec/foundation/curves/bn254';
4
3
  import type { ZodFor } from '@aztec/foundation/schemas';
5
4
  import { BufferReader, serializeArrayOfBufferableToVector, serializeToBuffer } from '@aztec/foundation/serialize';
@@ -247,7 +246,7 @@ export class Tx extends Gossipable {
247
246
  contractClassLogSize: this.data.getEmittedContractClassLogsLength(),
248
247
 
249
248
  proofSize: this.chonkProof.fields.length,
250
- size: this.toBuffer().length,
249
+ size: this.getSize(),
251
250
 
252
251
  feePaymentMethod:
253
252
  // needsSetup? then we pay through a fee payment contract
@@ -255,13 +254,13 @@ export class Tx extends Gossipable {
255
254
  };
256
255
  }
257
256
 
258
- getSize() {
259
- return (
260
- this.data.getSize() +
261
- this.chonkProof.fields.length * Fr.SIZE_IN_BYTES +
262
- arraySerializedSizeOfNonEmpty(this.contractClassLogFields) +
263
- this.publicFunctionCalldata.reduce((accum, cd) => accum + cd.getSize(), 0)
264
- );
257
+ private sizeCache: number | undefined;
258
+
259
+ getSize(): number {
260
+ if (this.sizeCache == undefined) {
261
+ this.sizeCache = this.toBuffer().length;
262
+ }
263
+ return this.sizeCache;
265
264
  }
266
265
 
267
266
  /**
@@ -28,7 +28,6 @@ import { RevertCode } from '../avm/revert_code.js';
28
28
  import { ContractClassLog } from '../logs/contract_class_log.js';
29
29
  import { PrivateLog } from '../logs/private_log.js';
30
30
  import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
31
- import { computeTxOutHash } from '../messaging/out_hash.js';
32
31
  import { TxHash } from './tx_hash.js';
33
32
 
34
33
  export class TxEffect {
@@ -184,14 +183,6 @@ export class TxEffect {
184
183
  );
185
184
  }
186
185
 
187
- /**
188
- * Computes txOutHash of this tx effect.
189
- * @dev Follows new_sha in unbalanced_merkle_tree.nr
190
- */
191
- txOutHash(): Fr {
192
- return computeTxOutHash(this.l2ToL1Msgs);
193
- }
194
-
195
186
  static async random({
196
187
  numNoteHashes,
197
188
  numNullifiers,
@@ -1,19 +1,35 @@
1
1
  import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
2
- import type { FieldsOf } from '@aztec/foundation/types';
3
2
 
4
3
  import { z } from 'zod';
5
4
 
6
5
  import { RevertCode } from '../avm/revert_code.js';
7
- import { L2BlockHash } from '../block/block_hash.js';
6
+ import { BlockHash } from '../block/block_hash.js';
7
+ import { DebugLog } from '../logs/debug_log.js';
8
8
  import { type ZodFor, schemas } from '../schemas/schemas.js';
9
9
  import { TxHash } from './tx_hash.js';
10
10
 
11
- /**
12
- * Possible status of a transaction.
13
- */
11
+ /** Block inclusion/finalization status. */
14
12
  export enum TxStatus {
15
13
  DROPPED = 'dropped',
16
14
  PENDING = 'pending',
15
+ PROPOSED = 'proposed',
16
+ CHECKPOINTED = 'checkpointed',
17
+ PROVEN = 'proven',
18
+ FINALIZED = 'finalized', // TODO(#13569): Implement finalized status properly
19
+ }
20
+
21
+ /** Tx status sorted by finalization progress. */
22
+ export const SortedTxStatuses: TxStatus[] = [
23
+ TxStatus.DROPPED,
24
+ TxStatus.PENDING,
25
+ TxStatus.PROPOSED,
26
+ TxStatus.CHECKPOINTED,
27
+ TxStatus.PROVEN,
28
+ TxStatus.FINALIZED,
29
+ ];
30
+
31
+ /** Execution result - only set when tx is in a block. */
32
+ export enum TxExecutionResult {
17
33
  SUCCESS = 'success',
18
34
  APP_LOGIC_REVERTED = 'app_logic_reverted',
19
35
  TEARDOWN_REVERTED = 'teardown_reverted',
@@ -30,20 +46,58 @@ export class TxReceipt {
30
46
  constructor(
31
47
  /** A unique identifier for a transaction. */
32
48
  public txHash: TxHash,
33
- /** The transaction's status. */
49
+ /** The transaction's block finalization status. */
34
50
  public status: TxStatus,
51
+ /** The execution result of the transaction, only set when tx is in a block. */
52
+ public executionResult: TxExecutionResult | undefined,
35
53
  /** Description of transaction error, if any. */
36
- public error: string,
54
+ public error: string | undefined,
37
55
  /** The transaction fee paid for the transaction. */
38
56
  public transactionFee?: bigint,
39
57
  /** The hash of the block containing the transaction. */
40
- public blockHash?: L2BlockHash,
58
+ public blockHash?: BlockHash,
41
59
  /** The block number in which the transaction was included. */
42
60
  public blockNumber?: BlockNumber,
61
+ /**
62
+ * Debug logs collected during public function execution. Served only when the node is in test mode and placed on
63
+ * the receipt only because it's a convenient place for it (the logs are printed out by the wallet when a mined
64
+ * tx receipt is obtained).
65
+ */
66
+ public debugLogs?: DebugLog[],
43
67
  ) {}
44
68
 
69
+ /** Returns true if the transaction was executed successfully. */
70
+ hasExecutionSucceeded(): boolean {
71
+ return this.executionResult === TxExecutionResult.SUCCESS;
72
+ }
73
+
74
+ /** Returns true if the transaction execution reverted. */
75
+ hasExecutionReverted(): boolean {
76
+ return this.executionResult !== undefined && this.executionResult !== TxExecutionResult.SUCCESS;
77
+ }
78
+
79
+ /** Returns true if the transaction has been included in a block (proposed, checkpointed, proven, or finalized). */
80
+ isMined(): boolean {
81
+ return (
82
+ this.status === TxStatus.PROPOSED ||
83
+ this.status === TxStatus.CHECKPOINTED ||
84
+ this.status === TxStatus.PROVEN ||
85
+ this.status === TxStatus.FINALIZED
86
+ );
87
+ }
88
+
89
+ /** Returns true if the transaction is pending. */
90
+ isPending(): boolean {
91
+ return this.status === TxStatus.PENDING;
92
+ }
93
+
94
+ /** Returns true if the transaction was dropped. */
95
+ isDropped(): boolean {
96
+ return this.status === TxStatus.DROPPED;
97
+ }
98
+
45
99
  static empty() {
46
- return new TxReceipt(TxHash.zero(), TxStatus.DROPPED, '');
100
+ return new TxReceipt(TxHash.zero(), TxStatus.DROPPED, undefined, undefined);
47
101
  }
48
102
 
49
103
  static get schema(): ZodFor<TxReceipt> {
@@ -51,34 +105,47 @@ export class TxReceipt {
51
105
  .object({
52
106
  txHash: TxHash.schema,
53
107
  status: z.nativeEnum(TxStatus),
54
- error: z.string(),
55
- blockHash: L2BlockHash.schema.optional(),
108
+ executionResult: z.nativeEnum(TxExecutionResult).optional(),
109
+ error: z.string().optional(),
110
+ blockHash: BlockHash.schema.optional(),
56
111
  blockNumber: BlockNumberSchema.optional(),
57
112
  transactionFee: schemas.BigInt.optional(),
113
+ debugLogs: z.array(DebugLog.schema).optional(),
58
114
  })
59
- .transform(TxReceipt.from);
115
+ .transform(fields => TxReceipt.from(fields));
60
116
  }
61
117
 
62
- static from(fields: FieldsOf<TxReceipt>) {
118
+ static from(fields: {
119
+ txHash: TxHash;
120
+ status: TxStatus;
121
+ executionResult?: TxExecutionResult;
122
+ error?: string;
123
+ transactionFee?: bigint;
124
+ blockHash?: BlockHash;
125
+ blockNumber?: BlockNumber;
126
+ debugLogs?: DebugLog[];
127
+ }) {
63
128
  return new TxReceipt(
64
129
  fields.txHash,
65
130
  fields.status,
131
+ fields.executionResult,
66
132
  fields.error,
67
133
  fields.transactionFee,
68
134
  fields.blockHash,
69
135
  fields.blockNumber,
136
+ fields.debugLogs,
70
137
  );
71
138
  }
72
139
 
73
- public static statusFromRevertCode(revertCode: RevertCode) {
140
+ public static executionResultFromRevertCode(revertCode: RevertCode): TxExecutionResult {
74
141
  if (revertCode.equals(RevertCode.OK)) {
75
- return TxStatus.SUCCESS;
142
+ return TxExecutionResult.SUCCESS;
76
143
  } else if (revertCode.equals(RevertCode.APP_LOGIC_REVERTED)) {
77
- return TxStatus.APP_LOGIC_REVERTED;
144
+ return TxExecutionResult.APP_LOGIC_REVERTED;
78
145
  } else if (revertCode.equals(RevertCode.TEARDOWN_REVERTED)) {
79
- return TxStatus.TEARDOWN_REVERTED;
146
+ return TxExecutionResult.TEARDOWN_REVERTED;
80
147
  } else if (revertCode.equals(RevertCode.BOTH_REVERTED)) {
81
- return TxStatus.BOTH_REVERTED;
148
+ return TxExecutionResult.BOTH_REVERTED;
82
149
  } else {
83
150
  throw new Error(`Unknown revert code: ${revertCode.getCode()}`);
84
151
  }
@@ -1,4 +1,4 @@
1
- import { GeneratorIndex, TX_REQUEST_LENGTH } from '@aztec/constants';
1
+ import { DomainSeparator, TX_REQUEST_LENGTH } from '@aztec/constants';
2
2
  import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
3
3
  import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
@@ -68,7 +68,7 @@ export class TxRequest {
68
68
  }
69
69
 
70
70
  hash() {
71
- return poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.TX_REQUEST);
71
+ return poseidon2HashWithSeparator(this.toFields(), DomainSeparator.TX_REQUEST);
72
72
  }
73
73
 
74
74
  static empty() {
@@ -1,6 +1,6 @@
1
1
  import type { AnyTx, TxValidationResult, TxValidator } from './tx_validator.js';
2
2
 
3
- export class EmptyTxValidator<T extends AnyTx = AnyTx> implements TxValidator<T> {
3
+ export class EmptyTxValidator<T = AnyTx> implements TxValidator<T> {
4
4
  public validateTx(_tx: T): Promise<TxValidationResult> {
5
5
  return Promise.resolve({ result: 'valid' });
6
6
  }
@@ -12,7 +12,7 @@ export const TX_ERROR_DUPLICATE_NULLIFIER_IN_TX = 'Duplicate nullifier in tx';
12
12
  export const TX_ERROR_EXISTING_NULLIFIER = 'Existing nullifier';
13
13
 
14
14
  // Metadata
15
- export const TX_ERROR_INVALID_INCLUDE_BY_TIMESTAMP = 'Invalid expiration timestamp';
15
+ export const TX_ERROR_INVALID_EXPIRATION_TIMESTAMP = 'Invalid expiration timestamp';
16
16
  export const TX_ERROR_INCORRECT_L1_CHAIN_ID = 'Incorrect L1 chain id';
17
17
  export const TX_ERROR_INCORRECT_ROLLUP_VERSION = 'Incorrect rollup version';
18
18
  export const TX_ERROR_INCORRECT_VK_TREE_ROOT = 'Incorrect verification keys tree root';
@@ -31,6 +31,9 @@ export const TX_ERROR_CONTRACT_CLASS_LOGS = 'Mismatched contract class logs';
31
31
  export const TX_ERROR_CONTRACT_CLASS_LOG_SORTING = 'Incorrectly sorted contract class logs';
32
32
  export const TX_ERROR_INCORRECT_HASH = 'Incorrect tx hash';
33
33
 
34
+ // Size
35
+ export const TX_ERROR_SIZE_ABOVE_LIMIT = 'Transaction size above size limit';
36
+
34
37
  // Block header
35
38
  export const TX_ERROR_BLOCK_HEADER = 'Block header not found';
36
39
 
@@ -20,7 +20,7 @@ export type TxValidationResult =
20
20
  | { result: 'invalid'; reason: string[] }
21
21
  | { result: 'skipped'; reason: string[] };
22
22
 
23
- export interface TxValidator<T extends AnyTx = AnyTx> {
23
+ export interface TxValidator<T = AnyTx> {
24
24
  validateTx(tx: T): Promise<TxValidationResult>;
25
25
  }
26
26
 
@@ -1 +1,2 @@
1
- export { UpdateChecker, getPackageVersion } from './update-checker.js';
1
+ export * from './package_version.js';
2
+ export * from './version_checker.js';
@@ -0,0 +1,17 @@
1
+ import { fileURLToPath } from '@aztec/foundation/url';
2
+
3
+ import { readFileSync } from 'fs';
4
+ import { dirname, resolve } from 'path';
5
+
6
+ /** Returns the package version from the release-please manifest, or undefined if not found. */
7
+ export function getPackageVersion(): string | undefined {
8
+ try {
9
+ const releasePleaseManifestPath = resolve(
10
+ dirname(fileURLToPath(import.meta.url)),
11
+ '../../../../.release-please-manifest.json',
12
+ );
13
+ return JSON.parse(readFileSync(releasePleaseManifestPath).toString())['.'];
14
+ } catch {
15
+ return undefined;
16
+ }
17
+ }
@@ -0,0 +1,65 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { RunningPromise } from '@aztec/foundation/promise';
3
+
4
+ import { EventEmitter } from 'node:events';
5
+
6
+ export type EventMap = {
7
+ newVersion: [{ name: string; currentVersion: string; latestVersion: string }];
8
+ };
9
+
10
+ export type VersionCheck = {
11
+ name: string;
12
+ currentVersion: string;
13
+ getLatestVersion: () => Promise<string | undefined>;
14
+ };
15
+
16
+ export class VersionChecker extends EventEmitter<EventMap> {
17
+ private runningPromise: RunningPromise;
18
+ constructor(
19
+ private checks: Array<VersionCheck>,
20
+ intervalCheckMs = 60_000,
21
+ private logger = createLogger('version_checker'),
22
+ ) {
23
+ super();
24
+ this.runningPromise = new RunningPromise(this.run, logger, intervalCheckMs);
25
+ }
26
+
27
+ public start(): void {
28
+ if (this.runningPromise.isRunning()) {
29
+ this.logger.warn('VersionChecker is already running');
30
+ return;
31
+ }
32
+
33
+ this.runningPromise.start();
34
+ this.logger.info('Version check started');
35
+ }
36
+
37
+ public trigger(): Promise<void> {
38
+ return this.runningPromise.trigger();
39
+ }
40
+
41
+ public async stop(): Promise<void> {
42
+ if (!this.runningPromise.isRunning()) {
43
+ this.logger.warn('VersionChecker is not running');
44
+ return;
45
+ }
46
+
47
+ await this.runningPromise.stop();
48
+ this.logger.info('Version checker stopped');
49
+ }
50
+
51
+ private run = async () => {
52
+ await Promise.allSettled(this.checks.map(check => this.checkVersion(check)));
53
+ };
54
+
55
+ private async checkVersion({ name, currentVersion, getLatestVersion }: VersionCheck): Promise<void> {
56
+ try {
57
+ const latestVersion = await getLatestVersion();
58
+ if (latestVersion && latestVersion !== currentVersion) {
59
+ this.emit('newVersion', { name, latestVersion, currentVersion });
60
+ }
61
+ } catch (err) {
62
+ this.logger.warn(`Error checking for new ${name} versions: ${err}`, { err });
63
+ }
64
+ }
65
+ }
@@ -12,7 +12,14 @@ import type {
12
12
  } from './types.js';
13
13
 
14
14
  export const ValidatorStatusInSlotSchema = zodFor<ValidatorStatusInSlot>()(
15
- z.enum(['block-mined', 'block-proposed', 'block-missed', 'attestation-sent', 'attestation-missed']),
15
+ z.enum([
16
+ 'checkpoint-mined',
17
+ 'checkpoint-proposed',
18
+ 'checkpoint-missed',
19
+ 'blocks-missed',
20
+ 'attestation-sent',
21
+ 'attestation-missed',
22
+ ]),
16
23
  );
17
24
 
18
25
  export const ValidatorStatusHistorySchema = zodFor<ValidatorStatusHistory>()(