@aztec/stdlib 0.0.1-commit.b2a5d0dd1 → 0.0.1-commit.b3d3157a

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 (700) hide show
  1. package/dest/abi/abi.d.ts +121 -1197
  2. package/dest/abi/abi.d.ts.map +1 -1
  3. package/dest/abi/abi.js +31 -16
  4. package/dest/abi/authorization_selector.d.ts +2 -2
  5. package/dest/abi/authorization_selector.d.ts.map +1 -1
  6. package/dest/abi/contract_artifact.d.ts +1 -1
  7. package/dest/abi/contract_artifact.d.ts.map +1 -1
  8. package/dest/abi/contract_artifact.js +14 -7
  9. package/dest/abi/event_selector.d.ts +2 -2
  10. package/dest/abi/event_selector.d.ts.map +1 -1
  11. package/dest/abi/function_call.d.ts +7 -25
  12. package/dest/abi/function_call.d.ts.map +1 -1
  13. package/dest/abi/note_selector.d.ts +2 -2
  14. package/dest/abi/note_selector.d.ts.map +1 -1
  15. package/dest/abi/utils.d.ts +1 -1
  16. package/dest/abi/utils.d.ts.map +1 -1
  17. package/dest/abi/utils.js +1 -1
  18. package/dest/auth_witness/auth_witness.d.ts +2 -2
  19. package/dest/auth_witness/auth_witness.d.ts.map +1 -1
  20. package/dest/avm/avm.d.ts +1756 -10463
  21. package/dest/avm/avm.d.ts.map +1 -1
  22. package/dest/avm/avm.js +6 -3
  23. package/dest/avm/avm_accumulated_data.d.ts +22 -86
  24. package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
  25. package/dest/avm/avm_circuit_public_inputs.d.ts +180 -932
  26. package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
  27. package/dest/avm/avm_proving_request.d.ts +653 -5446
  28. package/dest/avm/avm_proving_request.d.ts.map +1 -1
  29. package/dest/avm/message_pack.js +12 -3
  30. package/dest/avm/public_data_write.d.ts +6 -12
  31. package/dest/avm/public_data_write.d.ts.map +1 -1
  32. package/dest/avm/revert_code.d.ts +1 -7
  33. package/dest/avm/revert_code.d.ts.map +1 -1
  34. package/dest/avm/revert_code.js +0 -3
  35. package/dest/aztec-address/index.d.ts +6 -3
  36. package/dest/aztec-address/index.d.ts.map +1 -1
  37. package/dest/aztec-address/index.js +7 -2
  38. package/dest/block/attestation_info.d.ts +3 -2
  39. package/dest/block/attestation_info.d.ts.map +1 -1
  40. package/dest/block/attestation_info.js +7 -5
  41. package/dest/block/block_data.d.ts +9 -34
  42. package/dest/block/block_data.d.ts.map +1 -1
  43. package/dest/block/block_parameter.d.ts +37 -4
  44. package/dest/block/block_parameter.d.ts.map +1 -1
  45. package/dest/block/block_parameter.js +53 -2
  46. package/dest/block/in_block.d.ts +5 -24
  47. package/dest/block/in_block.d.ts.map +1 -1
  48. package/dest/block/index.d.ts +1 -2
  49. package/dest/block/index.d.ts.map +1 -1
  50. package/dest/block/index.js +0 -1
  51. package/dest/block/l2_block.d.ts +13 -41
  52. package/dest/block/l2_block.d.ts.map +1 -1
  53. package/dest/block/l2_block_info.d.ts +7 -27
  54. package/dest/block/l2_block_info.d.ts.map +1 -1
  55. package/dest/block/l2_block_source.d.ts +199 -425
  56. package/dest/block/l2_block_source.d.ts.map +1 -1
  57. package/dest/block/l2_block_source.js +66 -1
  58. package/dest/block/l2_block_stream/l2_block_stream.d.ts +2 -2
  59. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  60. package/dest/block/l2_block_stream/l2_block_stream.js +44 -17
  61. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +3 -1
  62. package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
  63. package/dest/block/l2_block_stream/l2_tips_memory_store.js +3 -0
  64. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +4 -1
  65. package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
  66. package/dest/block/l2_block_stream/l2_tips_store_base.js +26 -7
  67. package/dest/block/proposal/attestations_and_signers.d.ts +19 -30
  68. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  69. package/dest/block/proposal/attestations_and_signers.js +26 -18
  70. package/dest/block/proposal/committee_attestation.d.ts +6 -12
  71. package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
  72. package/dest/block/test/l2_tips_store_test_suite.js +1 -1
  73. package/dest/checkpoint/checkpoint.d.ts +24 -96
  74. package/dest/checkpoint/checkpoint.d.ts.map +1 -1
  75. package/dest/checkpoint/checkpoint_data.d.ts +40 -129
  76. package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
  77. package/dest/checkpoint/checkpoint_data.js +2 -0
  78. package/dest/checkpoint/checkpoint_info.d.ts +7 -23
  79. package/dest/checkpoint/checkpoint_info.d.ts.map +1 -1
  80. package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts +60 -0
  81. package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts.map +1 -0
  82. package/dest/checkpoint/checkpoint_reexecution_tracker.js +108 -0
  83. package/dest/checkpoint/digest.d.ts +18 -0
  84. package/dest/checkpoint/digest.d.ts.map +1 -0
  85. package/dest/checkpoint/digest.js +12 -0
  86. package/dest/checkpoint/index.d.ts +4 -1
  87. package/dest/checkpoint/index.d.ts.map +1 -1
  88. package/dest/checkpoint/index.js +3 -0
  89. package/dest/checkpoint/previous_checkpoint_out_hashes.d.ts +33 -0
  90. package/dest/checkpoint/previous_checkpoint_out_hashes.d.ts.map +1 -0
  91. package/dest/checkpoint/previous_checkpoint_out_hashes.js +45 -0
  92. package/dest/checkpoint/published_checkpoint.d.ts +42 -194
  93. package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
  94. package/dest/config/chain-config.d.ts +4 -9
  95. package/dest/config/chain-config.d.ts.map +1 -1
  96. package/dest/config/chain-config.js +6 -11
  97. package/dest/config/index.d.ts +1 -2
  98. package/dest/config/index.d.ts.map +1 -1
  99. package/dest/config/index.js +0 -1
  100. package/dest/config/sequencer-config.d.ts +5 -3
  101. package/dest/config/sequencer-config.d.ts.map +1 -1
  102. package/dest/config/sequencer-config.js +13 -6
  103. package/dest/contract/complete_address.d.ts +3 -2
  104. package/dest/contract/complete_address.d.ts.map +1 -1
  105. package/dest/contract/complete_address.js +6 -2
  106. package/dest/contract/contract_address.d.ts +5 -5
  107. package/dest/contract/contract_address.d.ts.map +1 -1
  108. package/dest/contract/contract_address.js +5 -4
  109. package/dest/contract/contract_deployment_data.d.ts +15 -61
  110. package/dest/contract/contract_deployment_data.d.ts.map +1 -1
  111. package/dest/contract/contract_instance.d.ts +4 -2
  112. package/dest/contract/contract_instance.d.ts.map +1 -1
  113. package/dest/contract/contract_instance.js +10 -3
  114. package/dest/contract/interfaces/contract_class.d.ts +15 -86
  115. package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
  116. package/dest/contract/interfaces/contract_instance.d.ts +41 -95
  117. package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
  118. package/dest/contract/interfaces/contract_instance.js +4 -2
  119. package/dest/contract/interfaces/contract_instance_update.d.ts +6 -26
  120. package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
  121. package/dest/contract/interfaces/protocol_contract_addresses.d.ts +2 -12
  122. package/dest/contract/interfaces/protocol_contract_addresses.d.ts.map +1 -1
  123. package/dest/database-version/database_version.d.ts +5 -11
  124. package/dest/database-version/database_version.d.ts.map +1 -1
  125. package/dest/database-version/version_manager.d.ts +6 -2
  126. package/dest/database-version/version_manager.d.ts.map +1 -1
  127. package/dest/database-version/version_manager.js +12 -1
  128. package/dest/epoch-helpers/index.d.ts +4 -22
  129. package/dest/epoch-helpers/index.d.ts.map +1 -1
  130. package/dest/gas/gas.d.ts +9 -14
  131. package/dest/gas/gas.d.ts.map +1 -1
  132. package/dest/gas/gas.js +6 -3
  133. package/dest/gas/gas_fees.d.ts +9 -14
  134. package/dest/gas/gas_fees.d.ts.map +1 -1
  135. package/dest/gas/gas_fees.js +7 -3
  136. package/dest/gas/gas_settings.d.ts +27 -84
  137. package/dest/gas/gas_settings.d.ts.map +1 -1
  138. package/dest/gas/gas_settings.js +6 -3
  139. package/dest/ha-signing/config.d.ts +9 -73
  140. package/dest/ha-signing/config.d.ts.map +1 -1
  141. package/dest/ha-signing/config.js +5 -15
  142. package/dest/ha-signing/local_config.d.ts +3 -34
  143. package/dest/ha-signing/local_config.d.ts.map +1 -1
  144. package/dest/ha-signing/local_config.js +2 -2
  145. package/dest/hash/hash.d.ts +1 -1
  146. package/dest/hash/hash.d.ts.map +1 -1
  147. package/dest/hash/hash.js +2 -2
  148. package/dest/interfaces/allowed_element.d.ts +4 -28
  149. package/dest/interfaces/allowed_element.d.ts.map +1 -1
  150. package/dest/interfaces/api_limit.d.ts +1 -1
  151. package/dest/interfaces/api_limit.js +1 -1
  152. package/dest/interfaces/archiver.d.ts +16 -36
  153. package/dest/interfaces/archiver.d.ts.map +1 -1
  154. package/dest/interfaces/archiver.js +211 -71
  155. package/dest/interfaces/aztec-node-admin.d.ts +62 -292
  156. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  157. package/dest/interfaces/aztec-node-admin.js +57 -14
  158. package/dest/interfaces/aztec-node-debug.js +4 -1
  159. package/dest/interfaces/aztec-node.d.ts +100 -106
  160. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  161. package/dest/interfaces/aztec-node.js +308 -70
  162. package/dest/interfaces/block-builder.d.ts +3 -1
  163. package/dest/interfaces/block-builder.d.ts.map +1 -1
  164. package/dest/interfaces/block_response.d.ts +90 -0
  165. package/dest/interfaces/block_response.d.ts.map +1 -0
  166. package/dest/interfaces/block_response.js +30 -0
  167. package/dest/interfaces/chain_tips.d.ts +50 -0
  168. package/dest/interfaces/chain_tips.d.ts.map +1 -0
  169. package/dest/interfaces/chain_tips.js +11 -0
  170. package/dest/interfaces/checkpoint_parameter.d.ts +14 -0
  171. package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
  172. package/dest/interfaces/checkpoint_parameter.js +18 -0
  173. package/dest/interfaces/checkpoint_response.d.ts +122 -0
  174. package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
  175. package/dest/interfaces/checkpoint_response.js +26 -0
  176. package/dest/interfaces/client.d.ts +7 -2
  177. package/dest/interfaces/client.d.ts.map +1 -1
  178. package/dest/interfaces/client.js +6 -1
  179. package/dest/interfaces/configs.d.ts +41 -130
  180. package/dest/interfaces/configs.d.ts.map +1 -1
  181. package/dest/interfaces/configs.js +9 -1
  182. package/dest/interfaces/l1_publish_info.d.ts +29 -0
  183. package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
  184. package/dest/interfaces/l1_publish_info.js +26 -0
  185. package/dest/interfaces/l2_logs_source.d.ts +14 -36
  186. package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
  187. package/dest/interfaces/l2_logs_source.js +5 -0
  188. package/dest/interfaces/merkle_tree_operations.d.ts +9 -3
  189. package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
  190. package/dest/interfaces/p2p-bootstrap.js +8 -2
  191. package/dest/interfaces/p2p.d.ts +15 -5
  192. package/dest/interfaces/p2p.d.ts.map +1 -1
  193. package/dest/interfaces/p2p.js +28 -5
  194. package/dest/interfaces/private_kernel_prover.d.ts +62 -2
  195. package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
  196. package/dest/interfaces/prover-agent.d.ts +5 -23
  197. package/dest/interfaces/prover-agent.d.ts.map +1 -1
  198. package/dest/interfaces/prover-agent.js +4 -1
  199. package/dest/interfaces/prover-client.d.ts +6 -27
  200. package/dest/interfaces/prover-client.d.ts.map +1 -1
  201. package/dest/interfaces/prover-node.js +22 -8
  202. package/dest/interfaces/proving-job-source.js +24 -4
  203. package/dest/interfaces/proving-job.d.ts +725 -5776
  204. package/dest/interfaces/proving-job.d.ts.map +1 -1
  205. package/dest/interfaces/proving-job.js +1 -1
  206. package/dest/interfaces/public_storage_override.d.ts +22 -0
  207. package/dest/interfaces/public_storage_override.d.ts.map +1 -0
  208. package/dest/interfaces/public_storage_override.js +7 -0
  209. package/dest/interfaces/server.d.ts +6 -1
  210. package/dest/interfaces/server.d.ts.map +1 -1
  211. package/dest/interfaces/server.js +5 -0
  212. package/dest/interfaces/slasher.d.ts +25 -56
  213. package/dest/interfaces/slasher.d.ts.map +1 -1
  214. package/dest/interfaces/slasher.js +8 -2
  215. package/dest/interfaces/tx_provider.d.ts +6 -1
  216. package/dest/interfaces/tx_provider.d.ts.map +1 -1
  217. package/dest/interfaces/validator.d.ts +40 -229
  218. package/dest/interfaces/validator.d.ts.map +1 -1
  219. package/dest/interfaces/validator.js +5 -0
  220. package/dest/interfaces/world_state.d.ts +2 -2
  221. package/dest/interfaces/world_state.d.ts.map +1 -1
  222. package/dest/kernel/hints/key_validation_request.d.ts +12 -8
  223. package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
  224. package/dest/kernel/hints/key_validation_request.js +20 -18
  225. package/dest/kernel/index.d.ts +5 -1
  226. package/dest/kernel/index.d.ts.map +1 -1
  227. package/dest/kernel/index.js +4 -0
  228. package/dest/kernel/log_hash.d.ts +6 -2
  229. package/dest/kernel/log_hash.d.ts.map +1 -1
  230. package/dest/kernel/log_hash.js +21 -9
  231. package/dest/kernel/private_circuit_public_inputs.d.ts +2 -2
  232. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  233. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +2 -2
  234. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  235. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +23 -0
  236. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -0
  237. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +35 -0
  238. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +24 -0
  239. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -0
  240. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +37 -0
  241. package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.d.ts +16 -0
  242. package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.d.ts.map +1 -0
  243. package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.js +23 -0
  244. package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.d.ts +17 -0
  245. package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.d.ts.map +1 -0
  246. package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.js +25 -0
  247. package/dest/kernel/private_kernel_prover_output.d.ts +3 -29
  248. package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
  249. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +9 -6
  250. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
  251. package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +22 -7
  252. package/dest/kernel/private_to_avm_accumulated_data.d.ts +25 -69
  253. package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
  254. package/dest/kernel/private_to_avm_accumulated_data.js +11 -5
  255. package/dest/kernel/private_to_public_accumulated_data.d.ts +4 -3
  256. package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
  257. package/dest/kernel/private_to_public_accumulated_data.js +6 -3
  258. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +5 -4
  259. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
  260. package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +7 -3
  261. package/dest/kernel/private_to_rollup_accumulated_data.d.ts +5 -4
  262. package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
  263. package/dest/kernel/private_to_rollup_accumulated_data.js +6 -3
  264. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +5 -4
  265. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
  266. package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +7 -3
  267. package/dest/kernel/public_call_request.d.ts +15 -30
  268. package/dest/kernel/public_call_request.d.ts.map +1 -1
  269. package/dest/kernel/public_call_request.js +16 -7
  270. package/dest/keys/derivation.d.ts +6 -2
  271. package/dest/keys/derivation.d.ts.map +1 -1
  272. package/dest/keys/derivation.js +16 -6
  273. package/dest/keys/public_key.d.ts +22 -3
  274. package/dest/keys/public_key.d.ts.map +1 -1
  275. package/dest/keys/public_key.js +20 -1
  276. package/dest/keys/public_keys.d.ts +55 -82
  277. package/dest/keys/public_keys.d.ts.map +1 -1
  278. package/dest/keys/public_keys.js +102 -74
  279. package/dest/kv-store/config.d.ts +3 -6
  280. package/dest/kv-store/config.d.ts.map +1 -1
  281. package/dest/kv-store/config.js +2 -7
  282. package/dest/logs/app_tagging_secret.d.ts +46 -0
  283. package/dest/logs/app_tagging_secret.d.ts.map +1 -0
  284. package/dest/logs/{extended_directional_app_tagging_secret.js → app_tagging_secret.js} +51 -21
  285. package/dest/logs/app_tagging_secret_kind.d.ts +7 -0
  286. package/dest/logs/app_tagging_secret_kind.d.ts.map +1 -0
  287. package/dest/logs/app_tagging_secret_kind.js +17 -0
  288. package/dest/logs/contract_class_log.d.ts +16 -34
  289. package/dest/logs/contract_class_log.d.ts.map +1 -1
  290. package/dest/logs/contract_class_log.js +11 -9
  291. package/dest/logs/index.d.ts +7 -7
  292. package/dest/logs/index.d.ts.map +1 -1
  293. package/dest/logs/index.js +6 -6
  294. package/dest/logs/log_cursor.d.ts +51 -0
  295. package/dest/logs/log_cursor.d.ts.map +1 -0
  296. package/dest/logs/log_cursor.js +82 -0
  297. package/dest/logs/log_result.d.ts +54 -0
  298. package/dest/logs/log_result.d.ts.map +1 -0
  299. package/dest/logs/log_result.js +56 -0
  300. package/dest/logs/logs_query.d.ts +82 -0
  301. package/dest/logs/logs_query.d.ts.map +1 -0
  302. package/dest/logs/logs_query.js +50 -0
  303. package/dest/logs/message_context.d.ts +3 -2
  304. package/dest/logs/message_context.d.ts.map +1 -1
  305. package/dest/logs/message_context.js +4 -0
  306. package/dest/logs/pre_tag.d.ts +11 -24
  307. package/dest/logs/pre_tag.d.ts.map +1 -1
  308. package/dest/logs/pre_tag.js +2 -2
  309. package/dest/logs/private_log.d.ts +7 -12
  310. package/dest/logs/private_log.d.ts.map +1 -1
  311. package/dest/logs/private_log.js +6 -3
  312. package/dest/logs/query_all_logs_by_tags.d.ts +24 -0
  313. package/dest/logs/query_all_logs_by_tags.d.ts.map +1 -0
  314. package/dest/logs/query_all_logs_by_tags.js +64 -0
  315. package/dest/logs/siloed_tag.d.ts +1 -1
  316. package/dest/logs/siloed_tag.d.ts.map +1 -1
  317. package/dest/logs/siloed_tag.js +3 -1
  318. package/dest/logs/tagging_index_range.d.ts +13 -31
  319. package/dest/logs/tagging_index_range.d.ts.map +1 -1
  320. package/dest/logs/tagging_index_range.js +2 -2
  321. package/dest/messaging/append_l1_to_l2_messages.d.ts +9 -0
  322. package/dest/messaging/append_l1_to_l2_messages.d.ts.map +1 -0
  323. package/dest/messaging/append_l1_to_l2_messages.js +12 -0
  324. package/dest/messaging/index.d.ts +2 -1
  325. package/dest/messaging/index.d.ts.map +1 -1
  326. package/dest/messaging/index.js +1 -0
  327. package/dest/messaging/l2_to_l1_membership.d.ts +43 -6
  328. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  329. package/dest/messaging/l2_to_l1_membership.js +72 -12
  330. package/dest/messaging/l2_to_l1_message.d.ts +38 -112
  331. package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
  332. package/dest/messaging/l2_to_l1_message.js +21 -12
  333. package/dest/noir/index.d.ts +3 -1
  334. package/dest/noir/index.d.ts.map +1 -1
  335. package/dest/note/note.d.ts +2 -2
  336. package/dest/note/note.d.ts.map +1 -1
  337. package/dest/p2p/block_proposal.d.ts +29 -10
  338. package/dest/p2p/block_proposal.d.ts.map +1 -1
  339. package/dest/p2p/block_proposal.js +56 -33
  340. package/dest/p2p/checkpoint_attestation.d.ts +14 -6
  341. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  342. package/dest/p2p/checkpoint_attestation.js +24 -20
  343. package/dest/p2p/checkpoint_proposal.d.ts +31 -10
  344. package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
  345. package/dest/p2p/checkpoint_proposal.js +58 -31
  346. package/dest/p2p/consensus_payload.d.ts +26 -20
  347. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  348. package/dest/p2p/consensus_payload.js +38 -19
  349. package/dest/p2p/signature_utils.d.ts +28 -19
  350. package/dest/p2p/signature_utils.d.ts.map +1 -1
  351. package/dest/p2p/signature_utils.js +118 -21
  352. package/dest/p2p/signed_txs.d.ts +15 -13
  353. package/dest/p2p/signed_txs.d.ts.map +1 -1
  354. package/dest/p2p/signed_txs.js +26 -24
  355. package/dest/parity/parity_base_private_inputs.d.ts +8 -4
  356. package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
  357. package/dest/parity/parity_base_private_inputs.js +7 -5
  358. package/dest/parity/parity_public_inputs.d.ts +8 -4
  359. package/dest/parity/parity_public_inputs.d.ts.map +1 -1
  360. package/dest/parity/parity_public_inputs.js +6 -3
  361. package/dest/parity/parity_root_private_inputs.d.ts +2 -2
  362. package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
  363. package/dest/proofs/chonk_proof.d.ts +17 -11
  364. package/dest/proofs/chonk_proof.d.ts.map +1 -1
  365. package/dest/proofs/chonk_proof.js +44 -22
  366. package/dest/proofs/recursive_proof.d.ts +2 -2
  367. package/dest/proofs/recursive_proof.d.ts.map +1 -1
  368. package/dest/rollup/block_merge_rollup_private_inputs.d.ts +2 -2
  369. package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
  370. package/dest/rollup/block_rollup_public_inputs.d.ts +12 -2
  371. package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
  372. package/dest/rollup/block_rollup_public_inputs.js +12 -0
  373. package/dest/rollup/block_root_rollup_private_inputs.d.ts +6 -6
  374. package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
  375. package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +2 -2
  376. package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
  377. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +9 -2
  378. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
  379. package/dest/rollup/checkpoint_rollup_public_inputs.js +9 -0
  380. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +5 -5
  381. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
  382. package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts +2 -2
  383. package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -1
  384. package/dest/rollup/public_chonk_verifier_private_inputs.d.ts +2 -2
  385. package/dest/rollup/public_chonk_verifier_private_inputs.d.ts.map +1 -1
  386. package/dest/rollup/public_chonk_verifier_public_inputs.d.ts +2 -2
  387. package/dest/rollup/public_chonk_verifier_public_inputs.d.ts.map +1 -1
  388. package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +2 -2
  389. package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
  390. package/dest/rollup/root_rollup_private_inputs.d.ts +2 -2
  391. package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
  392. package/dest/rollup/root_rollup_public_inputs.d.ts +2 -2
  393. package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
  394. package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +2 -2
  395. package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
  396. package/dest/rollup/tx_rollup_public_inputs.d.ts +2 -2
  397. package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
  398. package/dest/schemas/schemas.d.ts +32 -78
  399. package/dest/schemas/schemas.d.ts.map +1 -1
  400. package/dest/schemas/schemas.js +2 -2
  401. package/dest/slashing/helpers.d.ts +2 -2
  402. package/dest/slashing/helpers.d.ts.map +1 -1
  403. package/dest/slashing/helpers.js +10 -7
  404. package/dest/slashing/types.d.ts +15 -23
  405. package/dest/slashing/types.d.ts.map +1 -1
  406. package/dest/slashing/types.js +16 -10
  407. package/dest/snapshots/types.d.ts +15 -78
  408. package/dest/snapshots/types.d.ts.map +1 -1
  409. package/dest/stats/stats.d.ts +2 -2
  410. package/dest/stats/stats.d.ts.map +1 -1
  411. package/dest/tests/factories.d.ts +23 -23
  412. package/dest/tests/factories.d.ts.map +1 -1
  413. package/dest/tests/factories.js +70 -47
  414. package/dest/tests/mocks.d.ts +8 -5
  415. package/dest/tests/mocks.d.ts.map +1 -1
  416. package/dest/tests/mocks.js +31 -38
  417. package/dest/timetable/index.d.ts +7 -10
  418. package/dest/timetable/index.d.ts.map +1 -1
  419. package/dest/timetable/index.js +60 -80
  420. package/dest/trees/append_only_tree_snapshot.d.ts +9 -14
  421. package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
  422. package/dest/trees/append_only_tree_snapshot.js +6 -3
  423. package/dest/trees/nullifier_leaf.d.ts +18 -42
  424. package/dest/trees/nullifier_leaf.d.ts.map +1 -1
  425. package/dest/trees/nullifier_membership_witness.d.ts +16 -59
  426. package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
  427. package/dest/trees/nullifier_membership_witness.js +2 -14
  428. package/dest/trees/public_data_leaf.d.ts +21 -53
  429. package/dest/trees/public_data_leaf.d.ts.map +1 -1
  430. package/dest/trees/public_data_witness.d.ts +16 -58
  431. package/dest/trees/public_data_witness.d.ts.map +1 -1
  432. package/dest/tx/block_header.d.ts +4 -3
  433. package/dest/tx/block_header.d.ts.map +1 -1
  434. package/dest/tx/block_header.js +6 -3
  435. package/dest/tx/call_context.d.ts +4 -14
  436. package/dest/tx/call_context.d.ts.map +1 -1
  437. package/dest/tx/capsule.d.ts +2 -2
  438. package/dest/tx/capsule.d.ts.map +1 -1
  439. package/dest/tx/function_data.d.ts +4 -10
  440. package/dest/tx/function_data.d.ts.map +1 -1
  441. package/dest/tx/global_variables.d.ts +16 -49
  442. package/dest/tx/global_variables.d.ts.map +1 -1
  443. package/dest/tx/global_variables.js +8 -12
  444. package/dest/tx/hashed_values.d.ts +4 -3
  445. package/dest/tx/hashed_values.d.ts.map +1 -1
  446. package/dest/tx/hashed_values.js +6 -3
  447. package/dest/tx/in_tx.d.ts +5 -17
  448. package/dest/tx/in_tx.d.ts.map +1 -1
  449. package/dest/tx/indexed_tx_effect.d.ts +8 -19
  450. package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
  451. package/dest/tx/indexed_tx_effect.js +8 -4
  452. package/dest/tx/partial_state_reference.d.ts +22 -65
  453. package/dest/tx/partial_state_reference.d.ts.map +1 -1
  454. package/dest/tx/partial_state_reference.js +6 -3
  455. package/dest/tx/private_execution_result.d.ts +6 -16
  456. package/dest/tx/private_execution_result.d.ts.map +1 -1
  457. package/dest/tx/profiling.d.ts +54 -352
  458. package/dest/tx/profiling.d.ts.map +1 -1
  459. package/dest/tx/profiling.js +4 -4
  460. package/dest/tx/protocol_contracts.d.ts +5 -9
  461. package/dest/tx/protocol_contracts.d.ts.map +1 -1
  462. package/dest/tx/proven_tx.d.ts +30 -74
  463. package/dest/tx/proven_tx.d.ts.map +1 -1
  464. package/dest/tx/proven_tx.js +6 -0
  465. package/dest/tx/public_call_request_with_calldata.d.ts +4 -3
  466. package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
  467. package/dest/tx/public_call_request_with_calldata.js +6 -3
  468. package/dest/tx/simulated_tx.d.ts +62 -1249
  469. package/dest/tx/simulated_tx.d.ts.map +1 -1
  470. package/dest/tx/simulated_tx.js +12 -10
  471. package/dest/tx/state_reference.d.ts +30 -117
  472. package/dest/tx/state_reference.d.ts.map +1 -1
  473. package/dest/tx/state_reference.js +6 -4
  474. package/dest/tx/tree_snapshots.d.ts +27 -84
  475. package/dest/tx/tree_snapshots.d.ts.map +1 -1
  476. package/dest/tx/tree_snapshots.js +6 -4
  477. package/dest/tx/tx.d.ts +12 -11
  478. package/dest/tx/tx.d.ts.map +1 -1
  479. package/dest/tx/tx.js +30 -23
  480. package/dest/tx/tx_constant_data.d.ts +4 -3
  481. package/dest/tx/tx_constant_data.d.ts.map +1 -1
  482. package/dest/tx/tx_constant_data.js +6 -3
  483. package/dest/tx/tx_context.d.ts +32 -131
  484. package/dest/tx/tx_context.d.ts.map +1 -1
  485. package/dest/tx/tx_context.js +6 -6
  486. package/dest/tx/tx_hash.d.ts +6 -4
  487. package/dest/tx/tx_hash.d.ts.map +1 -1
  488. package/dest/tx/tx_hash.js +13 -5
  489. package/dest/tx/tx_receipt.d.ts +144 -67
  490. package/dest/tx/tx_receipt.d.ts.map +1 -1
  491. package/dest/tx/tx_receipt.js +141 -51
  492. package/dest/tx/validator/tx_validator.d.ts +5 -27
  493. package/dest/tx/validator/tx_validator.d.ts.map +1 -1
  494. package/dest/tx/validator/tx_validator.js +0 -4
  495. package/dest/types/shared.d.ts +4 -3
  496. package/dest/types/shared.d.ts.map +1 -1
  497. package/dest/types/shared.js +6 -3
  498. package/dest/update-checker/dev_version.d.ts +3 -0
  499. package/dest/update-checker/dev_version.d.ts.map +1 -0
  500. package/dest/update-checker/dev_version.js +1 -0
  501. package/dest/update-checker/index.d.ts +2 -1
  502. package/dest/update-checker/index.d.ts.map +1 -1
  503. package/dest/update-checker/index.js +1 -0
  504. package/dest/update-checker/package_version.d.ts +6 -3
  505. package/dest/update-checker/package_version.d.ts.map +1 -1
  506. package/dest/update-checker/package_version.js +8 -19
  507. package/dest/validators/schemas.d.ts +147 -614
  508. package/dest/validators/schemas.d.ts.map +1 -1
  509. package/dest/validators/schemas.js +6 -4
  510. package/dest/validators/types.d.ts +20 -3
  511. package/dest/validators/types.d.ts.map +1 -1
  512. package/dest/versioning/versioning.js +1 -1
  513. package/dest/vks/verification_key.d.ts +3 -3
  514. package/dest/vks/verification_key.d.ts.map +1 -1
  515. package/dest/world-state/genesis_data.d.ts +3 -1
  516. package/dest/world-state/genesis_data.d.ts.map +1 -1
  517. package/dest/world-state/genesis_data.js +3 -0
  518. package/dest/world-state/world_state_revision.d.ts +4 -39
  519. package/dest/world-state/world_state_revision.d.ts.map +1 -1
  520. package/dest/world-state/world_state_revision.js +0 -20
  521. package/package.json +12 -11
  522. package/src/abi/abi.ts +53 -19
  523. package/src/abi/contract_artifact.ts +11 -6
  524. package/src/abi/utils.ts +6 -4
  525. package/src/avm/avm.ts +5 -0
  526. package/src/avm/message_pack.ts +12 -3
  527. package/src/avm/revert_code.ts +0 -6
  528. package/src/aztec-address/index.ts +12 -3
  529. package/src/block/attestation_info.ts +11 -11
  530. package/src/block/block_parameter.ts +72 -4
  531. package/src/block/index.ts +0 -1
  532. package/src/block/l2_block_source.ts +201 -149
  533. package/src/block/l2_block_stream/l2_block_stream.ts +39 -28
  534. package/src/block/l2_block_stream/l2_tips_memory_store.ts +5 -0
  535. package/src/block/l2_block_stream/l2_tips_store_base.ts +29 -7
  536. package/src/block/proposal/attestations_and_signers.ts +32 -17
  537. package/src/block/test/l2_tips_store_test_suite.ts +1 -1
  538. package/src/checkpoint/checkpoint_data.ts +4 -0
  539. package/src/checkpoint/checkpoint_reexecution_tracker.ts +167 -0
  540. package/src/checkpoint/digest.ts +28 -0
  541. package/src/checkpoint/index.ts +3 -0
  542. package/src/checkpoint/previous_checkpoint_out_hashes.ts +61 -0
  543. package/src/config/chain-config.ts +6 -15
  544. package/src/config/index.ts +0 -1
  545. package/src/config/sequencer-config.ts +25 -7
  546. package/src/contract/complete_address.ts +7 -3
  547. package/src/contract/contract_address.ts +6 -6
  548. package/src/contract/contract_instance.ts +11 -2
  549. package/src/contract/interfaces/contract_instance.ts +6 -2
  550. package/src/database-version/version_manager.ts +17 -0
  551. package/src/gas/gas.ts +8 -3
  552. package/src/gas/gas_fees.ts +9 -9
  553. package/src/gas/gas_settings.ts +8 -3
  554. package/src/ha-signing/config.ts +9 -16
  555. package/src/ha-signing/local_config.ts +2 -2
  556. package/src/hash/hash.ts +2 -2
  557. package/src/interfaces/api_limit.ts +1 -1
  558. package/src/interfaces/archiver.ts +80 -94
  559. package/src/interfaces/aztec-node-admin.ts +32 -15
  560. package/src/interfaces/aztec-node-debug.ts +1 -1
  561. package/src/interfaces/aztec-node.ts +296 -262
  562. package/src/interfaces/block-builder.ts +2 -0
  563. package/src/interfaces/block_response.ts +92 -0
  564. package/src/interfaces/chain_tips.ts +24 -0
  565. package/src/interfaces/checkpoint_parameter.ts +20 -0
  566. package/src/interfaces/checkpoint_response.ts +84 -0
  567. package/src/interfaces/client.ts +6 -1
  568. package/src/interfaces/configs.ts +40 -1
  569. package/src/interfaces/l1_publish_info.ts +40 -0
  570. package/src/interfaces/l2_logs_source.ts +13 -42
  571. package/src/interfaces/merkle_tree_operations.ts +9 -2
  572. package/src/interfaces/p2p-bootstrap.ts +2 -2
  573. package/src/interfaces/p2p.ts +35 -15
  574. package/src/interfaces/private_kernel_prover.ts +88 -0
  575. package/src/interfaces/prover-agent.ts +1 -1
  576. package/src/interfaces/prover-node.ts +7 -7
  577. package/src/interfaces/proving-job-source.ts +4 -4
  578. package/src/interfaces/proving-job.ts +3 -3
  579. package/src/interfaces/public_storage_override.ts +26 -0
  580. package/src/interfaces/server.ts +5 -0
  581. package/src/interfaces/slasher.ts +17 -4
  582. package/src/interfaces/tx_provider.ts +6 -0
  583. package/src/interfaces/validator.ts +18 -2
  584. package/src/interfaces/world_state.ts +1 -1
  585. package/src/kernel/hints/key_validation_request.ts +18 -16
  586. package/src/kernel/index.ts +4 -0
  587. package/src/kernel/log_hash.ts +29 -9
  588. package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +49 -0
  589. package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +52 -0
  590. package/src/kernel/private_kernel_inner_2_circuit_private_inputs.ts +29 -0
  591. package/src/kernel/private_kernel_inner_3_circuit_private_inputs.ts +31 -0
  592. package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +29 -14
  593. package/src/kernel/private_to_avm_accumulated_data.ts +16 -5
  594. package/src/kernel/private_to_public_accumulated_data.ts +9 -3
  595. package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +10 -4
  596. package/src/kernel/private_to_rollup_accumulated_data.ts +8 -3
  597. package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +9 -9
  598. package/src/kernel/public_call_request.ts +22 -7
  599. package/src/keys/derivation.ts +21 -9
  600. package/src/keys/public_key.ts +26 -2
  601. package/src/keys/public_keys.ts +124 -110
  602. package/src/kv-store/config.ts +3 -10
  603. package/src/logs/{extended_directional_app_tagging_secret.ts → app_tagging_secret.ts} +62 -23
  604. package/src/logs/app_tagging_secret_kind.ts +21 -0
  605. package/src/logs/contract_class_log.ts +15 -5
  606. package/src/logs/index.ts +6 -6
  607. package/src/logs/log_cursor.ts +110 -0
  608. package/src/logs/log_result.ts +104 -0
  609. package/src/logs/logs_query.ts +138 -0
  610. package/src/logs/message_context.ts +5 -1
  611. package/src/logs/pre_tag.ts +3 -6
  612. package/src/logs/private_log.ts +9 -3
  613. package/src/logs/query_all_logs_by_tags.ts +98 -0
  614. package/src/logs/siloed_tag.ts +6 -1
  615. package/src/logs/tagging_index_range.ts +4 -10
  616. package/src/messaging/append_l1_to_l2_messages.ts +21 -0
  617. package/src/messaging/index.ts +1 -0
  618. package/src/messaging/l2_to_l1_membership.ts +108 -19
  619. package/src/messaging/l2_to_l1_message.ts +29 -9
  620. package/src/noir/index.ts +2 -0
  621. package/src/p2p/block_proposal.ts +99 -28
  622. package/src/p2p/checkpoint_attestation.ts +26 -26
  623. package/src/p2p/checkpoint_proposal.ts +109 -39
  624. package/src/p2p/consensus_payload.ts +59 -28
  625. package/src/p2p/signature_utils.ts +110 -25
  626. package/src/p2p/signed_txs.ts +46 -28
  627. package/src/parity/parity_base_private_inputs.ts +10 -4
  628. package/src/parity/parity_public_inputs.ts +9 -2
  629. package/src/proofs/chonk_proof.ts +49 -15
  630. package/src/rollup/block_rollup_public_inputs.ts +13 -0
  631. package/src/rollup/checkpoint_rollup_public_inputs.ts +10 -0
  632. package/src/schemas/schemas.ts +6 -1
  633. package/src/slashing/helpers.ts +13 -9
  634. package/src/slashing/types.ts +21 -14
  635. package/src/stats/stats.ts +4 -0
  636. package/src/tests/factories.ts +97 -68
  637. package/src/tests/mocks.ts +49 -57
  638. package/src/timetable/index.ts +63 -105
  639. package/src/trees/append_only_tree_snapshot.ts +8 -3
  640. package/src/trees/nullifier_membership_witness.ts +2 -12
  641. package/src/tx/block_header.ts +8 -3
  642. package/src/tx/global_variables.ts +10 -18
  643. package/src/tx/hashed_values.ts +8 -3
  644. package/src/tx/indexed_tx_effect.ts +17 -4
  645. package/src/tx/partial_state_reference.ts +8 -3
  646. package/src/tx/profiling.ts +4 -4
  647. package/src/tx/proven_tx.ts +6 -0
  648. package/src/tx/public_call_request_with_calldata.ts +8 -3
  649. package/src/tx/simulated_tx.ts +18 -21
  650. package/src/tx/state_reference.ts +9 -4
  651. package/src/tx/tree_snapshots.ts +9 -4
  652. package/src/tx/tx.ts +41 -22
  653. package/src/tx/tx_constant_data.ts +8 -3
  654. package/src/tx/tx_context.ts +8 -3
  655. package/src/tx/tx_hash.ts +20 -5
  656. package/src/tx/tx_receipt.ts +263 -80
  657. package/src/tx/validator/tx_validator.ts +1 -5
  658. package/src/types/shared.ts +8 -3
  659. package/src/update-checker/dev_version.ts +2 -0
  660. package/src/update-checker/index.ts +1 -0
  661. package/src/update-checker/package_version.ts +10 -23
  662. package/src/validators/schemas.ts +6 -4
  663. package/src/validators/types.ts +21 -2
  664. package/src/versioning/versioning.ts +1 -1
  665. package/src/world-state/genesis_data.ts +12 -0
  666. package/src/world-state/world_state_revision.ts +0 -33
  667. package/dest/block/checkpointed_l2_block.d.ts +0 -150
  668. package/dest/block/checkpointed_l2_block.d.ts.map +0 -1
  669. package/dest/block/checkpointed_l2_block.js +0 -46
  670. package/dest/config/pipelining-config.d.ts +0 -19
  671. package/dest/config/pipelining-config.d.ts.map +0 -1
  672. package/dest/config/pipelining-config.js +0 -18
  673. package/dest/interfaces/get_logs_response.d.ts +0 -97
  674. package/dest/interfaces/get_logs_response.d.ts.map +0 -1
  675. package/dest/interfaces/get_logs_response.js +0 -12
  676. package/dest/logs/extended_contract_class_log.d.ts +0 -51
  677. package/dest/logs/extended_contract_class_log.d.ts.map +0 -1
  678. package/dest/logs/extended_contract_class_log.js +0 -67
  679. package/dest/logs/extended_directional_app_tagging_secret.d.ts +0 -47
  680. package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +0 -1
  681. package/dest/logs/extended_public_log.d.ts +0 -106
  682. package/dest/logs/extended_public_log.d.ts.map +0 -1
  683. package/dest/logs/extended_public_log.js +0 -73
  684. package/dest/logs/log_filter.d.ts +0 -25
  685. package/dest/logs/log_filter.d.ts.map +0 -1
  686. package/dest/logs/log_filter.js +0 -12
  687. package/dest/logs/log_id.d.ts +0 -85
  688. package/dest/logs/log_id.d.ts.map +0 -1
  689. package/dest/logs/log_id.js +0 -93
  690. package/dest/logs/tx_scoped_l2_log.d.ts +0 -51
  691. package/dest/logs/tx_scoped_l2_log.d.ts.map +0 -1
  692. package/dest/logs/tx_scoped_l2_log.js +0 -77
  693. package/src/block/checkpointed_l2_block.ts +0 -70
  694. package/src/config/pipelining-config.ts +0 -31
  695. package/src/interfaces/get_logs_response.ts +0 -35
  696. package/src/logs/extended_contract_class_log.ts +0 -87
  697. package/src/logs/extended_public_log.ts +0 -94
  698. package/src/logs/log_filter.ts +0 -36
  699. package/src/logs/log_id.ts +0 -124
  700. package/src/logs/tx_scoped_l2_log.ts +0 -114
@@ -0,0 +1,110 @@
1
+ import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
2
+ import { BufferReader, numToUInt32BE } from '@aztec/foundation/serialize';
3
+
4
+ import { z } from 'zod';
5
+
6
+ import { schemas } from '../schemas/schemas.js';
7
+ import type { LogResultBase } from './log_result.js';
8
+
9
+ /**
10
+ * Cursor identifying a position in a tag's ordered log stream. Used as `afterLog` on `TagQuery` to resume
11
+ * pagination strictly after a previously-seen log.
12
+ *
13
+ * `(blockNumber, txIndexWithinBlock, logIndexWithinTx)` is sufficient to uniquely identify a position
14
+ * and matches the composite-key ordering of the archiver's log index, so the cursor maps directly to a
15
+ * key without a tx-hash lookup. All three fields are always present on {@link LogResult}, so a cursor is
16
+ * constructible from any returned log.
17
+ */
18
+ export class LogCursor {
19
+ constructor(
20
+ /** The block the cursor points to. */
21
+ public readonly blockNumber: BlockNumber,
22
+ /** The tx index within the block the cursor points to. */
23
+ public readonly txIndexWithinBlock: number,
24
+ /** The log index within the tx the cursor points to. */
25
+ public readonly logIndexWithinTx: number,
26
+ ) {}
27
+
28
+ static get schema() {
29
+ return z
30
+ .object({
31
+ blockNumber: BlockNumberSchema,
32
+ txIndexWithinBlock: schemas.Integer,
33
+ logIndexWithinTx: schemas.Integer,
34
+ })
35
+ .transform(
36
+ ({ blockNumber, txIndexWithinBlock, logIndexWithinTx }) =>
37
+ new LogCursor(blockNumber, txIndexWithinBlock, logIndexWithinTx),
38
+ );
39
+ }
40
+
41
+ /** Builds a cursor that points at the given log. Pagination resumes strictly after this position. */
42
+ static fromLog(log: Pick<LogResultBase, 'blockNumber' | 'txIndexWithinBlock' | 'logIndexWithinTx'>): LogCursor {
43
+ return new LogCursor(log.blockNumber, log.txIndexWithinBlock, log.logIndexWithinTx);
44
+ }
45
+
46
+ static random(): LogCursor {
47
+ return new LogCursor(
48
+ BlockNumber(Math.floor(Math.random() * 100000) + 1),
49
+ Math.floor(Math.random() * 100),
50
+ Math.floor(Math.random() * 100),
51
+ );
52
+ }
53
+
54
+ toBuffer(): Buffer {
55
+ return Buffer.concat([
56
+ numToUInt32BE(this.blockNumber),
57
+ numToUInt32BE(this.txIndexWithinBlock),
58
+ numToUInt32BE(this.logIndexWithinTx),
59
+ ]);
60
+ }
61
+
62
+ static fromBuffer(buffer: Buffer | BufferReader): LogCursor {
63
+ const reader = BufferReader.asReader(buffer);
64
+ const blockNumber = BlockNumber(reader.readNumber());
65
+ const txIndexWithinBlock = reader.readNumber();
66
+ const logIndexWithinTx = reader.readNumber();
67
+ return new LogCursor(blockNumber, txIndexWithinBlock, logIndexWithinTx);
68
+ }
69
+
70
+ equals(other: LogCursor): boolean {
71
+ return (
72
+ this.blockNumber === other.blockNumber &&
73
+ this.txIndexWithinBlock === other.txIndexWithinBlock &&
74
+ this.logIndexWithinTx === other.logIndexWithinTx
75
+ );
76
+ }
77
+
78
+ toString(): string {
79
+ return `${this.blockNumber}-${this.txIndexWithinBlock}-${this.logIndexWithinTx}`;
80
+ }
81
+
82
+ /**
83
+ * Parses a `<blockNumber>-<txIndexWithinBlock>-<logIndexWithinTx>` triple into a {@link LogCursor}.
84
+ * Throws on malformed input. Returns `undefined` for an empty / missing value so callers can use
85
+ * this directly as an optional CLI option parser.
86
+ */
87
+ static parseOptional(value: string): LogCursor | undefined {
88
+ if (!value) {
89
+ return undefined;
90
+ }
91
+ const parts = value.split('-');
92
+ if (parts.length !== 3) {
93
+ throw new Error(`Invalid log cursor "${value}". Expected <blockNumber>-<txIndexWithinBlock>-<logIndexWithinTx>.`);
94
+ }
95
+ const [blockNumberStr, txIndexStr, logIndexStr] = parts;
96
+ const blockNumber = Number(blockNumberStr);
97
+ const txIndexWithinBlock = Number(txIndexStr);
98
+ const logIndexWithinTx = Number(logIndexStr);
99
+ if (!Number.isInteger(blockNumber) || blockNumber < 1) {
100
+ throw new Error(`Invalid log cursor block number: ${blockNumberStr}`);
101
+ }
102
+ if (!Number.isInteger(txIndexWithinBlock) || txIndexWithinBlock < 0) {
103
+ throw new Error(`Invalid log cursor tx index: ${txIndexStr}`);
104
+ }
105
+ if (!Number.isInteger(logIndexWithinTx) || logIndexWithinTx < 0) {
106
+ throw new Error(`Invalid log cursor log index: ${logIndexStr}`);
107
+ }
108
+ return new LogCursor(BlockNumber(blockNumber), txIndexWithinBlock, logIndexWithinTx);
109
+ }
110
+ }
@@ -0,0 +1,104 @@
1
+ import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
2
+ import { times } from '@aztec/foundation/collection';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { schemas as foundationSchemas } from '@aztec/foundation/schemas';
5
+ import type { PickIfFlag, Prettify } from '@aztec/foundation/types';
6
+
7
+ import { z } from 'zod';
8
+
9
+ import { BlockHash } from '../block/block_hash.js';
10
+ import { schemas } from '../schemas/schemas.js';
11
+ import { TxHash } from '../tx/tx_hash.js';
12
+ import type { UInt64 } from '../types/shared.js';
13
+
14
+ /** Options for narrowing the shape of a {@link LogResult}. */
15
+ export type LogIncludeOptions = {
16
+ /** When set, the log carries `noteHashes` + all `nullifiers` from its tx effect. Off by default. */
17
+ includeEffects?: boolean;
18
+ };
19
+
20
+ export const LogIncludeOptionsSchema: z.ZodType<LogIncludeOptions> = z.object({
21
+ includeEffects: z.boolean().optional(),
22
+ });
23
+
24
+ /** Required metadata always present on a {@link LogResult}. */
25
+ export type LogResultBase = {
26
+ /** The data contents of the log, with the tag as the first field. */
27
+ logData: Fr[];
28
+ /** The block this log was emitted in. */
29
+ blockNumber: BlockNumber;
30
+ /** The hash of the block this log was emitted in. */
31
+ blockHash: BlockHash;
32
+ /** The timestamp of the block this log was emitted in. */
33
+ blockTimestamp: UInt64;
34
+ /** The hash of the tx this log was emitted in. */
35
+ txHash: TxHash;
36
+ /** The 0-based index of this log's tx within its block. */
37
+ txIndexWithinBlock: number;
38
+ /** The 0-based index of this log within its tx (across both private and public logs for the tx). */
39
+ logIndexWithinTx: number;
40
+ };
41
+
42
+ /**
43
+ * A single log returned from {@link L2LogsSource.getPrivateLogsByTags} or {@link L2LogsSource.getPublicLogsByTags}.
44
+ *
45
+ * Generic over the include-options so that flagged fields become required when the caller passes a
46
+ * literal `true`. The default type argument ({@link LogIncludeOptions}) yields the widest shape
47
+ * (all include-fields optional) — this is what the JSON-RPC wire layer validates against.
48
+ *
49
+ * `logData` is the raw field-element payload, with the tag in field 0 (consumers slice it off).
50
+ *
51
+ * @example
52
+ * const l: LogResult<{ includeEffects: true }> = (await node.getPrivateLogsByTags({ tags, includeEffects: true }))[0][0];
53
+ * l.nullifiers; // required, not optional
54
+ */
55
+ export type LogResult<Opts extends LogIncludeOptions = LogIncludeOptions> = Prettify<
56
+ LogResultBase & PickIfFlag<LogIncludeOptions, Opts, 'includeEffects', { noteHashes: Fr[]; nullifiers: Fr[] }>
57
+ >;
58
+
59
+ /** Zod schema for the widest {@link LogResult} shape (all include-gated fields optional). */
60
+ export const LogResultSchema: z.ZodType<LogResult> = z.object({
61
+ logData: z.array(foundationSchemas.Fr),
62
+ blockNumber: BlockNumberSchema,
63
+ blockHash: BlockHash.schema,
64
+ blockTimestamp: schemas.UInt64,
65
+ txHash: TxHash.schema,
66
+ txIndexWithinBlock: schemas.Integer,
67
+ logIndexWithinTx: schemas.Integer,
68
+ noteHashes: z.array(foundationSchemas.Fr).optional(),
69
+ nullifiers: z.array(foundationSchemas.Fr).optional(),
70
+ });
71
+
72
+ /** Builds a random {@link LogResult} for tests. `includeEffects` populates `noteHashes` + `nullifiers`. */
73
+ export function randomLogResult(includeEffects = false): LogResult {
74
+ const base: LogResultBase = {
75
+ logData: times(3, Fr.random),
76
+ blockNumber: BlockNumber(Math.floor(Math.random() * 100000) + 1),
77
+ blockHash: BlockHash.random(),
78
+ blockTimestamp: BigInt(Math.floor(Date.now() / 1000)),
79
+ txHash: TxHash.random(),
80
+ txIndexWithinBlock: Math.floor(Math.random() * 100),
81
+ logIndexWithinTx: Math.floor(Math.random() * 100),
82
+ };
83
+ if (includeEffects) {
84
+ return { ...base, noteHashes: times(3, Fr.random), nullifiers: times(3, Fr.random) };
85
+ }
86
+ return base;
87
+ }
88
+
89
+ /** Human-readable single-line representation, primarily for the CLI `get-logs` command. */
90
+ export function logResultToHumanReadable(log: LogResult): string {
91
+ const head =
92
+ `block ${log.blockNumber} (${log.blockHash.toString()}) ` +
93
+ `tx ${log.txHash.toString()} txIndex ${log.txIndexWithinBlock} logIndex ${log.logIndexWithinTx} ` +
94
+ `ts ${log.blockTimestamp}`;
95
+ const data = `data [${log.logData.map(f => f.toString()).join(', ')}]`;
96
+ const parts = [head, data];
97
+ if (log.noteHashes !== undefined) {
98
+ parts.push(`noteHashes [${log.noteHashes.map(f => f.toString()).join(', ')}]`);
99
+ }
100
+ if (log.nullifiers !== undefined) {
101
+ parts.push(`nullifiers [${log.nullifiers.map(f => f.toString()).join(', ')}]`);
102
+ }
103
+ return parts.join(' | ');
104
+ }
@@ -0,0 +1,138 @@
1
+ import { BlockNumberSchema } from '@aztec/foundation/branded-types';
2
+ import type { BlockNumber } from '@aztec/foundation/branded-types';
3
+
4
+ import { z } from 'zod';
5
+
6
+ import type { AztecAddress } from '../aztec-address/index.js';
7
+ import { BlockHash } from '../block/block_hash.js';
8
+ import { MAX_LOGS_PER_TAG, MAX_RPC_LEN } from '../interfaces/api_limit.js';
9
+ import { type ZodFor, schemas, zodFor } from '../schemas/index.js';
10
+ import { TxHash } from '../tx/tx_hash.js';
11
+ import { LogCursor } from './log_cursor.js';
12
+ import { SiloedTag } from './siloed_tag.js';
13
+ import { Tag } from './tag.js';
14
+
15
+ /**
16
+ * A tag to query in {@link PrivateLogsQuery} / {@link PublicLogsQuery}, optionally resuming strictly
17
+ * after a previously-seen log via `afterLog`. The bare `T` form means "from the beginning".
18
+ */
19
+ export type TagQuery<T extends Tag | SiloedTag> = T | { tag: T; afterLog?: LogCursor };
20
+
21
+ /**
22
+ * Shared fields for {@link PrivateLogsQuery} and {@link PublicLogsQuery}.
23
+ */
24
+ export type LogsQueryBase = {
25
+ /** Lower block bound, inclusive. */
26
+ fromBlock?: BlockNumber;
27
+ /** Upper block bound, exclusive. */
28
+ toBlock?: BlockNumber;
29
+ /**
30
+ * Restrict results to logs emitted in this transaction. Mutually exclusive with `fromBlock`/`toBlock`
31
+ * (a txHash already pins a block). `txHash` + `afterLog` is allowed and paginates within the tx's logs
32
+ * for that tag.
33
+ */
34
+ txHash?: TxHash;
35
+ /**
36
+ * Reorg-safety anchor: the latest block hash the caller has synced to. If set and the block is no
37
+ * longer present, the call throws. Distinct from `toBlock`, which is a filter, not a safety check.
38
+ */
39
+ referenceBlock?: BlockHash;
40
+ /** When set, each log also carries `noteHashes` and all `nullifiers` for note-nonce discovery. */
41
+ includeEffects?: boolean;
42
+ /**
43
+ * Maximum number of logs returned per tag. Capped at {@link MAX_LOGS_PER_TAG} (rejected if higher).
44
+ * Defaults to {@link MAX_LOGS_PER_TAG} when unset. Mainly useful for tests that need to force
45
+ * pagination at a small page size.
46
+ */
47
+ limitPerTag?: number;
48
+ };
49
+
50
+ /**
51
+ * Query for {@link L2LogsSource.getPrivateLogsByTags}. Returns one inner array per element of `tags`,
52
+ * in input order.
53
+ */
54
+ export type PrivateLogsQuery = LogsQueryBase & {
55
+ /** Tags to query. Between 1 and {@link MAX_RPC_LEN} entries (inclusive). */
56
+ tags: TagQuery<SiloedTag>[];
57
+ };
58
+
59
+ /**
60
+ * Query for {@link L2LogsSource.getPublicLogsByTags}. Returns one inner array per element of `tags`,
61
+ * in input order.
62
+ */
63
+ export type PublicLogsQuery = LogsQueryBase & {
64
+ /** Contract address that emitted the logs. Required for public queries. */
65
+ contractAddress: AztecAddress;
66
+ /** Tags to query. Between 1 and {@link MAX_RPC_LEN} entries (inclusive). */
67
+ tags: TagQuery<Tag>[];
68
+ };
69
+
70
+ function tagQuerySchema<T extends Tag | SiloedTag>(tagSchema: ZodFor<T>) {
71
+ return z.union([
72
+ tagSchema,
73
+ z.object({
74
+ tag: tagSchema,
75
+ afterLog: LogCursor.schema.optional(),
76
+ }),
77
+ ]) as ZodFor<TagQuery<T>>;
78
+ }
79
+
80
+ const logsQueryBaseShape = {
81
+ fromBlock: BlockNumberSchema.optional(),
82
+ toBlock: BlockNumberSchema.optional(),
83
+ txHash: TxHash.schema.optional(),
84
+ referenceBlock: BlockHash.schema.optional(),
85
+ includeEffects: z.boolean().optional(),
86
+ limitPerTag: z
87
+ .number()
88
+ .int()
89
+ .positive()
90
+ .max(MAX_LOGS_PER_TAG, { message: `limitPerTag must be <= ${MAX_LOGS_PER_TAG}` })
91
+ .optional(),
92
+ };
93
+
94
+ /** Minimal shape required by {@link refineTxHashAndRange}. */
95
+ type TxHashAndRangeFields = {
96
+ /** Tx hash filter. */
97
+ txHash?: TxHash;
98
+ /** Lower block bound. */
99
+ fromBlock?: BlockNumber;
100
+ /** Upper block bound (exclusive). */
101
+ toBlock?: BlockNumber;
102
+ };
103
+
104
+ /**
105
+ * Refinement: a `txHash` already pins a block, so combining it with a block range is contradictory.
106
+ * (`txHash` + `afterLog` is still allowed and is enforced per-tag inside `TagQuery`.) Exported so
107
+ * `aztec.js`'s wallet event-filter schemas can reuse the same rule.
108
+ */
109
+ export function refineTxHashAndRange<T extends TxHashAndRangeFields>(schema: z.ZodType<T>) {
110
+ return schema.refine(q => !(q.txHash !== undefined && (q.fromBlock !== undefined || q.toBlock !== undefined)), {
111
+ message: '`txHash` is mutually exclusive with `fromBlock`/`toBlock`',
112
+ });
113
+ }
114
+
115
+ export const PrivateLogsQuerySchema: ZodFor<PrivateLogsQuery> = refineTxHashAndRange(
116
+ zodFor<PrivateLogsQuery>()(
117
+ z.object({
118
+ ...logsQueryBaseShape,
119
+ tags: z
120
+ .array(tagQuerySchema(SiloedTag.schema))
121
+ .min(1)
122
+ .max(MAX_RPC_LEN, { message: `tags must have at most ${MAX_RPC_LEN} entries` }),
123
+ }),
124
+ ),
125
+ );
126
+
127
+ export const PublicLogsQuerySchema: ZodFor<PublicLogsQuery> = refineTxHashAndRange(
128
+ zodFor<PublicLogsQuery>()(
129
+ z.object({
130
+ ...logsQueryBaseShape,
131
+ contractAddress: schemas.AztecAddress,
132
+ tags: z
133
+ .array(tagQuerySchema(Tag.schema))
134
+ .min(1)
135
+ .max(MAX_RPC_LEN, { message: `tags must have at most ${MAX_RPC_LEN} entries` }),
136
+ }),
137
+ ),
138
+ );
@@ -2,7 +2,7 @@ import { MAX_NOTE_HASHES_PER_TX } from '@aztec/constants';
2
2
  import { range } from '@aztec/foundation/array';
3
3
  import { Fr } from '@aztec/foundation/curves/bn254';
4
4
 
5
- import type { TxHash } from '../tx/tx_hash.js';
5
+ import { TxHash } from '../tx/tx_hash.js';
6
6
 
7
7
  /**
8
8
  * Additional information needed to process a message.
@@ -38,6 +38,10 @@ export class MessageContext {
38
38
  /* eslint-enable camelcase */
39
39
  }
40
40
 
41
+ static empty(): MessageContext {
42
+ return new MessageContext(TxHash.zero(), [], Fr.ZERO);
43
+ }
44
+
41
45
  static toEmptyFields(): Fr[] {
42
46
  const serializationLen =
43
47
  1 /* txHash */ + MAX_NOTE_HASHES_PER_TX + 1 /* uniqueNoteHashesInTx BVec */ + 1; /* firstNullifierInTx */
@@ -2,10 +2,7 @@ import { schemas } from '@aztec/foundation/schemas';
2
2
 
3
3
  import { z } from 'zod';
4
4
 
5
- import {
6
- type ExtendedDirectionalAppTaggingSecret,
7
- ExtendedDirectionalAppTaggingSecretSchema,
8
- } from './extended_directional_app_tagging_secret.js';
5
+ import { type AppTaggingSecret, AppTaggingSecretSchema } from './app_tagging_secret.js';
9
6
 
10
7
  /**
11
8
  * Represents a preimage of a private log tag (see `Tag` in `pxe/src/tagging`).
@@ -15,11 +12,11 @@ import {
15
12
  * around this.
16
13
  */
17
14
  export type PreTag = {
18
- extendedSecret: ExtendedDirectionalAppTaggingSecret;
15
+ extendedSecret: AppTaggingSecret;
19
16
  index: number;
20
17
  };
21
18
 
22
19
  export const PreTagSchema = z.object({
23
- extendedSecret: ExtendedDirectionalAppTaggingSecretSchema,
20
+ extendedSecret: AppTaggingSecretSchema,
24
21
  index: schemas.Integer,
25
22
  });
@@ -5,10 +5,11 @@ import { Fr } from '@aztec/foundation/curves/bn254';
5
5
  import { schemas } from '@aztec/foundation/schemas';
6
6
  import {
7
7
  BufferReader,
8
+ BufferSink,
8
9
  FieldReader,
9
10
  type Tuple,
10
- serializeToBuffer,
11
11
  serializeToFields,
12
+ serializeToSink,
12
13
  } from '@aztec/foundation/serialize';
13
14
 
14
15
  import { inspect } from 'util';
@@ -67,8 +68,13 @@ export class PrivateLog {
67
68
  return new PrivateLog(makeTuple(PRIVATE_LOG_SIZE_IN_FIELDS, Fr.zero), 0);
68
69
  }
69
70
 
70
- toBuffer(): Buffer {
71
- return serializeToBuffer(this.fields, this.emittedLength);
71
+ toBuffer(): Buffer;
72
+ toBuffer(sink: BufferSink): void;
73
+ toBuffer(sink?: BufferSink): Buffer | void {
74
+ if (!sink) {
75
+ return BufferSink.serialize(this);
76
+ }
77
+ serializeToSink(sink, this.fields, this.emittedLength);
72
78
  }
73
79
 
74
80
  static fromBuffer(buffer: Buffer | BufferReader) {
@@ -0,0 +1,98 @@
1
+ import { MAX_LOGS_PER_TAG } from '../interfaces/api_limit.js';
2
+ import { LogCursor } from './log_cursor.js';
3
+ import type { LogResult } from './log_result.js';
4
+ import type { PrivateLogsQuery, PublicLogsQuery, TagQuery } from './logs_query.js';
5
+ import type { SiloedTag } from './siloed_tag.js';
6
+ import type { Tag } from './tag.js';
7
+
8
+ /** Minimal node surface needed by {@link queryAllPrivateLogsByTags}. */
9
+ export type PrivateLogsByTagsFetcher = {
10
+ getPrivateLogsByTags(query: PrivateLogsQuery): Promise<LogResult[][]>;
11
+ };
12
+
13
+ /** Minimal node surface needed by {@link queryAllPublicLogsByTags}. */
14
+ export type PublicLogsByTagsFetcher = {
15
+ getPublicLogsByTags(query: PublicLogsQuery): Promise<LogResult[][]>;
16
+ };
17
+
18
+ /**
19
+ * Drives the per-tag `afterLog` cursor loop for {@link PrivateLogsByTagsFetcher.getPrivateLogsByTags}.
20
+ *
21
+ * Each round re-queries only the tags whose previous page was full (`length === effective limit`), passing
22
+ * the cursor of the last seen log. Tags drop out as soon as they return a short page. Results are stitched
23
+ * back into one inner array per input tag, preserving the original input order.
24
+ *
25
+ * Honors {@link PrivateLogsQuery.limitPerTag} when set (caller is responsible for keeping it `<=`
26
+ * {@link MAX_LOGS_PER_TAG}; the query schema enforces this on the RPC boundary).
27
+ */
28
+ export function queryAllPrivateLogsByTags(
29
+ node: PrivateLogsByTagsFetcher,
30
+ query: PrivateLogsQuery,
31
+ ): Promise<LogResult[][]> {
32
+ return queryAllByTags(
33
+ query.tags,
34
+ tagQueries => node.getPrivateLogsByTags({ ...query, tags: tagQueries }),
35
+ query.limitPerTag,
36
+ );
37
+ }
38
+
39
+ /** {@inheritDoc queryAllPrivateLogsByTags} */
40
+ export function queryAllPublicLogsByTags(
41
+ node: PublicLogsByTagsFetcher,
42
+ query: PublicLogsQuery,
43
+ ): Promise<LogResult[][]> {
44
+ return queryAllByTags(
45
+ query.tags,
46
+ tagQueries => node.getPublicLogsByTags({ ...query, tags: tagQueries }),
47
+ query.limitPerTag,
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Generic per-tag pagination loop, abstracted over the query shape (private vs public). Caller supplies
53
+ * a `fetchPage` that runs one round against the node with the still-active subset of tag queries.
54
+ *
55
+ * @param tags - Input tag queries in original order. Returned outer array has the same length and order.
56
+ * @param fetchPage - Per-round fetch hook; receives the active subset and returns one page per active tag.
57
+ * @param limitPerTag - Effective page cap used to detect "full page" → keep paginating; defaults to
58
+ * {@link MAX_LOGS_PER_TAG} (the server-side cap when the query doesn't override).
59
+ */
60
+ async function queryAllByTags<T extends Tag | SiloedTag>(
61
+ tags: TagQuery<T>[],
62
+ fetchPage: (tagQueries: TagQuery<T>[]) => Promise<LogResult[][]>,
63
+ limitPerTag: number | undefined,
64
+ ): Promise<LogResult[][]> {
65
+ const effectiveLimit = limitPerTag ?? MAX_LOGS_PER_TAG;
66
+ const allResultsPerTag: LogResult[][] = tags.map(() => []);
67
+ let activeIndexes = tags.map((_, i) => i);
68
+ let nextQueries: TagQuery<T>[] = tags.slice();
69
+
70
+ while (activeIndexes.length > 0) {
71
+ const pageResults = await fetchPage(nextQueries);
72
+
73
+ const stillActive: number[] = [];
74
+ const followups: TagQuery<T>[] = [];
75
+ for (let i = 0; i < activeIndexes.length; i++) {
76
+ const originalIdx = activeIndexes[i];
77
+ const pageForTag = pageResults[i];
78
+ allResultsPerTag[originalIdx].push(...pageForTag);
79
+ if (pageForTag.length === effectiveLimit) {
80
+ const lastLog = pageForTag[pageForTag.length - 1];
81
+ stillActive.push(originalIdx);
82
+ followups.push({ tag: tagOf(tags[originalIdx]), afterLog: LogCursor.fromLog(lastLog) });
83
+ }
84
+ }
85
+ activeIndexes = stillActive;
86
+ nextQueries = followups;
87
+ }
88
+
89
+ return allResultsPerTag;
90
+ }
91
+
92
+ /** Unwraps a `TagQuery` to its underlying `Tag` / `SiloedTag` regardless of the bare-vs-object form. */
93
+ function tagOf<T extends Tag | SiloedTag>(entry: TagQuery<T>): T {
94
+ if (typeof entry === 'object' && entry !== null && 'tag' in entry) {
95
+ return entry.tag;
96
+ }
97
+ return entry as T;
98
+ }
@@ -5,6 +5,7 @@ import type { ZodFor } from '@aztec/foundation/schemas';
5
5
  import type { AztecAddress } from '../aztec-address/index.js';
6
6
  import { computeLogTag, computeSiloedPrivateLogFirstField } from '../hash/hash.js';
7
7
  import { schemas } from '../schemas/schemas.js';
8
+ import { AppTaggingSecretKind } from './app_tagging_secret_kind.js';
8
9
  import type { PreTag } from './pre_tag.js';
9
10
  import { Tag } from './tag.js';
10
11
 
@@ -20,7 +21,11 @@ export class SiloedTag {
20
21
 
21
22
  static async compute(preTag: PreTag): Promise<SiloedTag> {
22
23
  const tag = await Tag.compute(preTag);
23
- const logTag = await computeLogTag(tag.value, DomainSeparator.UNCONSTRAINED_MSG_LOG_TAG);
24
+ const domainSeparator =
25
+ preTag.extendedSecret.kind === AppTaggingSecretKind.CONSTRAINED
26
+ ? DomainSeparator.CONSTRAINED_MSG_LOG_TAG
27
+ : DomainSeparator.UNCONSTRAINED_MSG_LOG_TAG;
28
+ const logTag = await computeLogTag(tag.value, domainSeparator);
24
29
  return SiloedTag.computeFromTagAndApp(new Tag(logTag), preTag.extendedSecret.app);
25
30
  }
26
31
 
@@ -2,23 +2,17 @@ import { schemas } from '@aztec/foundation/schemas';
2
2
 
3
3
  import { z } from 'zod';
4
4
 
5
- import {
6
- type ExtendedDirectionalAppTaggingSecret,
7
- ExtendedDirectionalAppTaggingSecretSchema,
8
- } from './extended_directional_app_tagging_secret.js';
5
+ import { type AppTaggingSecret, AppTaggingSecretSchema } from './app_tagging_secret.js';
9
6
 
10
- /**
11
- * Represents a range of tagging indexes for a given extended directional app tagging secret. Used to track the lowest
12
- * and highest indexes used in a transaction for a given (sender, recipient, app/contract) tuple.
13
- */
7
+ /** Represents a range of tagging indexes for a given app tagging secret. */
14
8
  export type TaggingIndexRange = {
15
- extendedSecret: ExtendedDirectionalAppTaggingSecret;
9
+ extendedSecret: AppTaggingSecret;
16
10
  lowestIndex: number;
17
11
  highestIndex: number;
18
12
  };
19
13
 
20
14
  export const TaggingIndexRangeSchema = z.object({
21
- extendedSecret: ExtendedDirectionalAppTaggingSecretSchema,
15
+ extendedSecret: AppTaggingSecretSchema,
22
16
  lowestIndex: schemas.Integer,
23
17
  highestIndex: schemas.Integer,
24
18
  });
@@ -0,0 +1,21 @@
1
+ import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
2
+ import { padArrayEnd } from '@aztec/foundation/collection';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+
5
+ import type { MerkleTreeWriteOperations } from '../interfaces/merkle_tree_operations.js';
6
+ import { MerkleTreeId } from '../trees/merkle_tree_id.js';
7
+
8
+ /**
9
+ * Pads `l1ToL2Messages` to `NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP` and appends them to the
10
+ * L1→L2 message tree of `db`. Use whenever a fork at "state before the first block of a
11
+ * checkpoint" needs to mirror what the world-state synchronizer inserts at sync time.
12
+ */
13
+ export async function appendL1ToL2MessagesToTree(db: MerkleTreeWriteOperations, l1ToL2Messages: Fr[]): Promise<void> {
14
+ const padded = padArrayEnd<Fr, number>(
15
+ l1ToL2Messages,
16
+ Fr.ZERO,
17
+ NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
18
+ 'Too many L1 to L2 messages',
19
+ );
20
+ await db.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padded);
21
+ }
@@ -1,3 +1,4 @@
1
+ export * from './append_l1_to_l2_messages.js';
1
2
  export * from './in_hash.js';
2
3
  export * from './inbox_leaf.js';
3
4
  export * from './l1_to_l2_message.js';