@aztec/pxe 0.0.1-commit.2f68f620 → 0.0.1-commit.3100065

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 (350) hide show
  1. package/dest/bin/check_oracle_version.js +10 -20
  2. package/dest/bin/index.d.ts +2 -2
  3. package/dest/bin/index.d.ts.map +1 -1
  4. package/dest/bin/index.js +1 -1
  5. package/dest/bin/oracle_version_helpers.d.ts +26 -1
  6. package/dest/bin/oracle_version_helpers.d.ts.map +1 -1
  7. package/dest/bin/oracle_version_helpers.js +162 -1
  8. package/dest/block_synchronizer/block_stream_source.d.ts +5 -5
  9. package/dest/block_synchronizer/block_stream_source.d.ts.map +1 -1
  10. package/dest/block_synchronizer/block_stream_source.js +4 -29
  11. package/dest/block_synchronizer/block_synchronizer.d.ts +18 -14
  12. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  13. package/dest/block_synchronizer/block_synchronizer.js +54 -18
  14. package/dest/config/index.d.ts +2 -1
  15. package/dest/config/index.d.ts.map +1 -1
  16. package/dest/config/index.js +1 -0
  17. package/dest/config/package_info.js +1 -1
  18. package/dest/contract/contract_class_service.d.ts +31 -0
  19. package/dest/contract/contract_class_service.d.ts.map +1 -0
  20. package/dest/contract/contract_class_service.js +68 -0
  21. package/dest/contract/contract_sync_service.d.ts +48 -0
  22. package/dest/contract/contract_sync_service.d.ts.map +1 -0
  23. package/dest/{contract_sync → contract}/contract_sync_service.js +26 -45
  24. package/dest/contract/helpers.d.ts +7 -0
  25. package/dest/contract/helpers.d.ts.map +1 -0
  26. package/dest/contract/helpers.js +20 -0
  27. package/dest/contract_function_simulator/anchored_contract_data.d.ts +36 -0
  28. package/dest/contract_function_simulator/anchored_contract_data.d.ts.map +1 -0
  29. package/dest/contract_function_simulator/anchored_contract_data.js +54 -0
  30. package/dest/contract_function_simulator/aztec_node_read_cache.d.ts +39 -0
  31. package/dest/contract_function_simulator/aztec_node_read_cache.d.ts.map +1 -0
  32. package/dest/contract_function_simulator/aztec_node_read_cache.js +60 -0
  33. package/dest/contract_function_simulator/contract_function_simulator.d.ts +19 -18
  34. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/contract_function_simulator.js +64 -35
  36. package/dest/contract_function_simulator/execution_note_cache.d.ts +3 -9
  37. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  38. package/dest/contract_function_simulator/execution_note_cache.js +8 -28
  39. package/dest/contract_function_simulator/index.d.ts +19 -10
  40. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/index.js +7 -9
  42. package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts +8 -27
  43. package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts.map +1 -1
  44. package/dest/contract_function_simulator/noir-structs/bounded_vec.js +8 -23
  45. package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts +9 -0
  46. package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts.map +1 -0
  47. package/dest/contract_function_simulator/noir-structs/contract_class_log_data.js +1 -0
  48. package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts +7 -0
  49. package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts.map +1 -0
  50. package/dest/contract_function_simulator/noir-structs/embedded_curve_point.js +1 -0
  51. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
  52. package/dest/contract_function_simulator/noir-structs/fact.d.ts +16 -0
  53. package/dest/contract_function_simulator/noir-structs/fact.d.ts.map +1 -0
  54. package/dest/contract_function_simulator/noir-structs/fact.js +6 -0
  55. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts +27 -0
  56. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts.map +1 -0
  57. package/dest/contract_function_simulator/noir-structs/fact_collection.js +31 -0
  58. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +11 -12
  59. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  60. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +6 -49
  61. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +10 -8
  62. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  63. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -60
  64. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +2 -2
  65. package/dest/contract_function_simulator/noir-structs/option.d.ts +9 -11
  66. package/dest/contract_function_simulator/noir-structs/option.d.ts.map +1 -1
  67. package/dest/contract_function_simulator/noir-structs/option.js +18 -13
  68. package/dest/contract_function_simulator/noir-structs/origin_block.d.ts +11 -0
  69. package/dest/contract_function_simulator/noir-structs/origin_block.d.ts.map +1 -0
  70. package/dest/contract_function_simulator/noir-structs/origin_block.js +5 -0
  71. package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts +11 -0
  72. package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts.map +1 -0
  73. package/dest/contract_function_simulator/noir-structs/pending_tagged_log.js +4 -0
  74. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +6 -9
  75. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -1
  76. package/dest/contract_function_simulator/noir-structs/provided_secret.js +1 -24
  77. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts +28 -0
  78. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts.map +1 -0
  79. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.js +50 -0
  80. package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts +21 -0
  81. package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts.map +1 -0
  82. package/dest/contract_function_simulator/noir-structs/resolved_tx.js +50 -0
  83. package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts +14 -0
  84. package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts.map +1 -0
  85. package/dest/contract_function_simulator/noir-structs/tx_effect_data.js +5 -0
  86. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +6 -11
  87. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  88. package/dest/contract_function_simulator/noir-structs/utility_context.js +1 -20
  89. package/dest/contract_function_simulator/oracle/acir_callback.d.ts +21 -0
  90. package/dest/contract_function_simulator/oracle/acir_callback.d.ts.map +1 -0
  91. package/dest/contract_function_simulator/oracle/acir_callback.js +115 -0
  92. package/dest/contract_function_simulator/oracle/index.d.ts +2 -13
  93. package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
  94. package/dest/contract_function_simulator/oracle/index.js +1 -1
  95. package/dest/contract_function_simulator/oracle/interfaces.d.ts +2 -3
  96. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  97. package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts +39 -0
  98. package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts.map +1 -0
  99. package/dest/contract_function_simulator/oracle/legacy_oracle_registry.js +107 -0
  100. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -14
  101. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  102. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -24
  103. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +41 -30
  104. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
  105. package/dest/contract_function_simulator/oracle/oracle_registry.js +248 -27
  106. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +123 -40
  107. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
  108. package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +947 -264
  109. package/dest/contract_function_simulator/oracle/private_execution.d.ts +1 -1
  110. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  111. package/dest/contract_function_simulator/oracle/private_execution.js +2 -3
  112. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +21 -8
  113. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  114. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +128 -17
  115. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +73 -33
  116. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  117. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +220 -104
  118. package/dest/contract_function_simulator/transient_array_service.d.ts +31 -0
  119. package/dest/contract_function_simulator/transient_array_service.d.ts.map +1 -0
  120. package/dest/contract_function_simulator/transient_array_service.js +62 -0
  121. package/dest/debug/pxe_debug_utils.d.ts +2 -2
  122. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  123. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  124. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  125. package/dest/entrypoints/client/bundle/utils.js +8 -3
  126. package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
  127. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  128. package/dest/entrypoints/client/lazy/utils.js +8 -3
  129. package/dest/entrypoints/pxe_creation_options.d.ts +9 -3
  130. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  131. package/dest/entrypoints/server/index.d.ts +5 -3
  132. package/dest/entrypoints/server/index.d.ts.map +1 -1
  133. package/dest/entrypoints/server/index.js +3 -2
  134. package/dest/entrypoints/server/utils.d.ts +1 -1
  135. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  136. package/dest/entrypoints/server/utils.js +8 -2
  137. package/dest/error_enriching.d.ts +5 -3
  138. package/dest/error_enriching.d.ts.map +1 -1
  139. package/dest/error_enriching.js +13 -11
  140. package/dest/hooks/execution_hooks.d.ts +31 -11
  141. package/dest/hooks/execution_hooks.d.ts.map +1 -1
  142. package/dest/hooks/execution_hooks.js +3 -3
  143. package/dest/hooks/index.d.ts +4 -3
  144. package/dest/hooks/index.d.ts.map +1 -1
  145. package/dest/hooks/index.js +1 -0
  146. package/dest/hooks/resolve_custom_request.d.ts +23 -0
  147. package/dest/hooks/resolve_custom_request.d.ts.map +1 -0
  148. package/dest/hooks/resolve_custom_request.js +3 -0
  149. package/dest/hooks/resolve_tagging_secret_strategy.d.ts +50 -0
  150. package/dest/hooks/resolve_tagging_secret_strategy.d.ts.map +1 -0
  151. package/dest/hooks/resolve_tagging_secret_strategy.js +3 -0
  152. package/dest/logs/log_service.d.ts +7 -6
  153. package/dest/logs/log_service.d.ts.map +1 -1
  154. package/dest/logs/log_service.js +79 -28
  155. package/dest/messages/tx_resolver_service.d.ts +17 -0
  156. package/dest/messages/tx_resolver_service.d.ts.map +1 -0
  157. package/dest/messages/{message_context_service.js → tx_resolver_service.js} +8 -8
  158. package/dest/oracle_version.d.ts +3 -3
  159. package/dest/oracle_version.js +5 -5
  160. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +1 -1
  161. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  162. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +6 -2
  163. package/dest/private_kernel/hints/test_utils.js +1 -1
  164. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  165. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  166. package/dest/private_kernel/private_kernel_execution_prover.js +17 -36
  167. package/dest/private_kernel/private_kernel_oracle.d.ts +4 -2
  168. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  169. package/dest/private_kernel/private_kernel_oracle.js +17 -5
  170. package/dest/pxe.d.ts +114 -48
  171. package/dest/pxe.d.ts.map +1 -1
  172. package/dest/pxe.js +222 -139
  173. package/dest/storage/allowed_scopes.d.ts +6 -0
  174. package/dest/storage/allowed_scopes.d.ts.map +1 -0
  175. package/dest/storage/allowed_scopes.js +7 -0
  176. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -6
  177. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  178. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -6
  179. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +1 -1
  180. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -1
  181. package/dest/storage/backwards_compatibility_tests/schema_tests.js +129 -49
  182. package/dest/storage/capsule_store/capsule_service.d.ts +1 -1
  183. package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -1
  184. package/dest/storage/capsule_store/capsule_service.js +6 -9
  185. package/dest/storage/contract_store/contract_store.d.ts +27 -24
  186. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  187. package/dest/storage/contract_store/contract_store.js +64 -75
  188. package/dest/storage/fact_store/fact_service.d.ts +22 -0
  189. package/dest/storage/fact_store/fact_service.d.ts.map +1 -0
  190. package/dest/storage/fact_store/fact_service.js +45 -0
  191. package/dest/storage/fact_store/fact_store.d.ts +95 -0
  192. package/dest/storage/fact_store/fact_store.d.ts.map +1 -0
  193. package/dest/storage/fact_store/fact_store.js +408 -0
  194. package/dest/storage/fact_store/fact_store_keys.d.ts +34 -0
  195. package/dest/storage/fact_store/fact_store_keys.d.ts.map +1 -0
  196. package/dest/storage/fact_store/fact_store_keys.js +50 -0
  197. package/dest/storage/fact_store/index.d.ts +6 -0
  198. package/dest/storage/fact_store/index.d.ts.map +1 -0
  199. package/dest/storage/fact_store/index.js +4 -0
  200. package/dest/storage/fact_store/origin_state.d.ts +57 -0
  201. package/dest/storage/fact_store/origin_state.d.ts.map +1 -0
  202. package/dest/storage/fact_store/origin_state.js +53 -0
  203. package/dest/storage/fact_store/stored_fact.d.ts +32 -0
  204. package/dest/storage/fact_store/stored_fact.d.ts.map +1 -0
  205. package/dest/storage/fact_store/stored_fact.js +64 -0
  206. package/dest/storage/index.d.ts +3 -2
  207. package/dest/storage/index.d.ts.map +1 -1
  208. package/dest/storage/index.js +2 -1
  209. package/dest/storage/metadata.d.ts +2 -2
  210. package/dest/storage/metadata.d.ts.map +1 -1
  211. package/dest/storage/metadata.js +1 -1
  212. package/dest/storage/note_store/note_store.d.ts +42 -33
  213. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  214. package/dest/storage/note_store/note_store.js +197 -168
  215. package/dest/storage/note_store/stored_note.d.ts +3 -8
  216. package/dest/storage/note_store/stored_note.d.ts.map +1 -1
  217. package/dest/storage/note_store/stored_note.js +4 -20
  218. package/dest/storage/open_pxe_stores.d.ts +5 -3
  219. package/dest/storage/open_pxe_stores.d.ts.map +1 -1
  220. package/dest/storage/open_pxe_stores.js +5 -3
  221. package/dest/storage/private_event_store/private_event_store.d.ts +13 -16
  222. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  223. package/dest/storage/private_event_store/private_event_store.js +40 -43
  224. package/dest/storage/tagging_store/index.d.ts +2 -2
  225. package/dest/storage/tagging_store/index.d.ts.map +1 -1
  226. package/dest/storage/tagging_store/index.js +1 -1
  227. package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts +51 -0
  228. package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts.map +1 -0
  229. package/dest/storage/tagging_store/tagging_secret_sources_store.js +105 -0
  230. package/dest/tagging/constants.d.ts +2 -2
  231. package/dest/tagging/constants.d.ts.map +1 -1
  232. package/dest/tagging/constants.js +18 -9
  233. package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +21 -8
  234. package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -1
  235. package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +56 -16
  236. package/package.json +17 -17
  237. package/src/bin/check_oracle_version.ts +10 -19
  238. package/src/bin/index.ts +5 -1
  239. package/src/bin/oracle_version_helpers.ts +190 -0
  240. package/src/block_synchronizer/block_stream_source.ts +6 -45
  241. package/src/block_synchronizer/block_synchronizer.ts +70 -29
  242. package/src/config/index.ts +1 -0
  243. package/src/config/package_info.ts +1 -1
  244. package/src/contract/contract_class_service.ts +83 -0
  245. package/src/{contract_sync → contract}/contract_sync_service.ts +37 -50
  246. package/src/contract/helpers.ts +35 -0
  247. package/src/contract_function_simulator/anchored_contract_data.ts +74 -0
  248. package/src/contract_function_simulator/aztec_node_read_cache.ts +89 -0
  249. package/src/contract_function_simulator/contract_function_simulator.ts +97 -45
  250. package/src/contract_function_simulator/execution_note_cache.ts +7 -28
  251. package/src/contract_function_simulator/index.ts +26 -11
  252. package/src/contract_function_simulator/noir-structs/bounded_vec.ts +12 -24
  253. package/src/contract_function_simulator/noir-structs/contract_class_log_data.ts +9 -0
  254. package/src/contract_function_simulator/noir-structs/embedded_curve_point.ts +4 -0
  255. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  256. package/src/contract_function_simulator/noir-structs/fact.ts +13 -0
  257. package/src/contract_function_simulator/noir-structs/fact_collection.ts +64 -0
  258. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +20 -46
  259. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +13 -60
  260. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
  261. package/src/contract_function_simulator/noir-structs/option.ts +17 -11
  262. package/src/contract_function_simulator/noir-structs/origin_block.ts +8 -0
  263. package/src/contract_function_simulator/noir-structs/pending_tagged_log.ts +12 -0
  264. package/src/contract_function_simulator/noir-structs/provided_secret.ts +4 -26
  265. package/src/contract_function_simulator/noir-structs/resolved_tagging_strategy.ts +66 -0
  266. package/src/contract_function_simulator/noir-structs/resolved_tx.ts +53 -0
  267. package/src/contract_function_simulator/noir-structs/tx_effect_data.ts +15 -0
  268. package/src/contract_function_simulator/noir-structs/utility_context.ts +5 -17
  269. package/src/contract_function_simulator/oracle/acir_callback.ts +154 -0
  270. package/src/contract_function_simulator/oracle/index.ts +1 -15
  271. package/src/contract_function_simulator/oracle/interfaces.ts +1 -2
  272. package/src/contract_function_simulator/oracle/legacy_oracle_registry.ts +147 -0
  273. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +6 -21
  274. package/src/contract_function_simulator/oracle/oracle_registry.ts +162 -41
  275. package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +659 -248
  276. package/src/contract_function_simulator/oracle/private_execution.ts +2 -3
  277. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +156 -24
  278. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +357 -131
  279. package/src/contract_function_simulator/transient_array_service.ts +91 -0
  280. package/src/debug/pxe_debug_utils.ts +1 -1
  281. package/src/entrypoints/client/bundle/utils.ts +10 -3
  282. package/src/entrypoints/client/lazy/utils.ts +10 -3
  283. package/src/entrypoints/pxe_creation_options.ts +8 -2
  284. package/src/entrypoints/server/index.ts +5 -2
  285. package/src/entrypoints/server/utils.ts +10 -2
  286. package/src/error_enriching.ts +27 -11
  287. package/src/hooks/execution_hooks.ts +32 -12
  288. package/src/hooks/index.ts +8 -2
  289. package/src/hooks/resolve_custom_request.ts +24 -0
  290. package/src/hooks/resolve_tagging_secret_strategy.ts +60 -0
  291. package/src/logs/log_service.ts +91 -37
  292. package/src/messages/{message_context_service.ts → tx_resolver_service.ts} +16 -9
  293. package/src/oracle_version.ts +5 -5
  294. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +11 -1
  295. package/src/private_kernel/hints/test_utils.ts +1 -1
  296. package/src/private_kernel/private_kernel_execution_prover.ts +22 -52
  297. package/src/private_kernel/private_kernel_oracle.ts +23 -4
  298. package/src/pxe.ts +325 -159
  299. package/src/storage/allowed_scopes.ts +14 -0
  300. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -6
  301. package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +6 -6
  302. package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +1 -1
  303. package/src/storage/backwards_compatibility_tests/__snapshots__/FactStore.json +40 -0
  304. package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +12 -12
  305. package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +9 -15
  306. package/src/storage/backwards_compatibility_tests/__snapshots__/NoteStore.json +24 -4
  307. package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +11 -3
  308. package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +12 -4
  309. package/src/storage/backwards_compatibility_tests/__snapshots__/TaggingSecretSourcesStore.json +30 -0
  310. package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +29 -9
  311. package/src/storage/backwards_compatibility_tests/schema_tests.ts +141 -50
  312. package/src/storage/capsule_store/capsule_service.ts +8 -13
  313. package/src/storage/contract_store/contract_store.ts +86 -93
  314. package/src/storage/fact_store/fact_service.ts +69 -0
  315. package/src/storage/fact_store/fact_store.ts +487 -0
  316. package/src/storage/fact_store/fact_store_keys.ts +75 -0
  317. package/src/storage/fact_store/index.ts +14 -0
  318. package/src/storage/fact_store/origin_state.ts +75 -0
  319. package/src/storage/fact_store/stored_fact.ts +80 -0
  320. package/src/storage/index.ts +2 -1
  321. package/src/storage/metadata.ts +1 -1
  322. package/src/storage/note_store/note_store.ts +226 -187
  323. package/src/storage/note_store/stored_note.ts +5 -27
  324. package/src/storage/open_pxe_stores.ts +6 -3
  325. package/src/storage/private_event_store/private_event_store.ts +49 -55
  326. package/src/storage/tagging_store/index.ts +1 -1
  327. package/src/storage/tagging_store/tagging_secret_sources_store.ts +138 -0
  328. package/src/tagging/constants.ts +19 -9
  329. package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +77 -16
  330. package/dest/contract_function_simulator/oracle/oracle.d.ts +0 -89
  331. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +0 -1
  332. package/dest/contract_function_simulator/oracle/oracle.js +0 -552
  333. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +0 -6
  334. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +0 -1
  335. package/dest/contract_function_simulator/proxied_contract_data_source.js +0 -51
  336. package/dest/contract_sync/contract_sync_service.d.ts +0 -42
  337. package/dest/contract_sync/contract_sync_service.d.ts.map +0 -1
  338. package/dest/contract_sync/helpers.d.ts +0 -27
  339. package/dest/contract_sync/helpers.d.ts.map +0 -1
  340. package/dest/contract_sync/helpers.js +0 -53
  341. package/dest/messages/message_context_service.d.ts +0 -17
  342. package/dest/messages/message_context_service.d.ts.map +0 -1
  343. package/dest/storage/tagging_store/sender_address_book_store.d.ts +0 -14
  344. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +0 -1
  345. package/dest/storage/tagging_store/sender_address_book_store.js +0 -36
  346. package/src/contract_function_simulator/oracle/oracle.ts +0 -711
  347. package/src/contract_function_simulator/proxied_contract_data_source.ts +0 -60
  348. package/src/contract_sync/helpers.ts +0 -86
  349. package/src/storage/backwards_compatibility_tests/__snapshots__/SenderAddressBookStore.json +0 -16
  350. package/src/storage/tagging_store/sender_address_book_store.ts +0 -48
@@ -1,16 +1,2 @@
1
- import type { Oracle } from './oracle.js';
2
-
3
- export * from './oracle.js';
1
+ export * from './acir_callback.js';
4
2
  export * from './interfaces.js';
5
-
6
- /**
7
- * A conditional type that takes a type `T` and returns a union of its method names.
8
- */
9
- type MethodNames<T> = {
10
- [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
11
- }[keyof T];
12
-
13
- /**
14
- * Available oracle function names.
15
- */
16
- export type ORACLE_NAMES = MethodNames<Oracle>;
@@ -1,5 +1,4 @@
1
- import type { HandlersForPrefix } from './oracle_registry.js';
2
- import type { ORACLE_REGISTRY } from './oracle_registry.js';
1
+ import type { HandlersForPrefix, ORACLE_REGISTRY } from './oracle_registry.js';
3
2
 
4
3
  /**
5
4
  * Miscellaneous oracle methods, not very Aztec-specific and expected to be available in all scenarios in which aztec-nr
@@ -0,0 +1,147 @@
1
+ /* eslint-disable camelcase */
2
+ import { MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_CIPHERTEXT_LEN, PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants';
3
+ import { computeFeeJuiceMessageNullifier } from '@aztec/stdlib/messaging';
4
+
5
+ import type { EphemeralArray } from '../noir-structs/ephemeral_array.js';
6
+ import type { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
7
+ import { Option } from '../noir-structs/option.js';
8
+ import type { PendingTaggedLog } from '../noir-structs/pending_tagged_log.js';
9
+ import type { ResolvedTx } from '../noir-structs/resolved_tx.js';
10
+ import {
11
+ type InferDeserializedParams,
12
+ ORACLE_REGISTRY,
13
+ type OracleRegistryEntry,
14
+ type ParamTypes,
15
+ type RegistryParam,
16
+ } from './oracle_registry.js';
17
+ import {
18
+ AZTEC_ADDRESS,
19
+ EPHEMERAL_ARRAY,
20
+ FIELD,
21
+ FIXED_BOUNDED_VEC,
22
+ STRUCT,
23
+ TX_HASH,
24
+ type TypeMapping,
25
+ } from './oracle_type_mappings.js';
26
+
27
+ const LEGACY_LOG_RETRIEVAL_RESPONSE: TypeMapping<LegacyLogRetrievalResponse> = STRUCT([
28
+ { name: 'logPayload', type: FIXED_BOUNDED_VEC(FIELD, PRIVATE_LOG_CIPHERTEXT_LEN) },
29
+ { name: 'txHash', type: TX_HASH },
30
+ { name: 'uniqueNoteHashesInTx', type: FIXED_BOUNDED_VEC(FIELD, MAX_NOTE_HASHES_PER_TX) },
31
+ { name: 'firstNullifierInTx', type: FIELD },
32
+ ]);
33
+
34
+ // Block-less transaction context: the prefix of `ResolvedTx`'s wire carried by the original `getPendingTaggedLogs`
35
+ // oracle. Known as `MessageContext` in the Aztec.nr versions that call that oracle.
36
+ const LEGACY_MESSAGE_CONTEXT: TypeMapping<LegacyMessageContext> = STRUCT<LegacyMessageContext>([
37
+ { name: 'txHash', type: TX_HASH },
38
+ { name: 'uniqueNoteHashesInTx', type: FIXED_BOUNDED_VEC(FIELD, MAX_NOTE_HASHES_PER_TX) },
39
+ { name: 'firstNullifierInTx', type: FIELD },
40
+ ]);
41
+
42
+ const LEGACY_PENDING_TAGGED_LOG: TypeMapping<LegacyPendingTaggedLog> = STRUCT<LegacyPendingTaggedLog>([
43
+ { name: 'log', type: FIXED_BOUNDED_VEC(FIELD, PRIVATE_LOG_SIZE_IN_FIELDS) },
44
+ { name: 'context', type: LEGACY_MESSAGE_CONTEXT },
45
+ ]);
46
+
47
+ /**
48
+ * Wire shapes that already-deployed contracts still call by their original oracle name, keyed by that retired name.
49
+ * New Aztec.nr calls the current name in `ORACLE_REGISTRY`; old bytecode keeps calling the name compiled into it and
50
+ * is served from here, so versioning an oracle's wire (e.g. adding return fields) stops being a breaking change.
51
+ *
52
+ * Append-only. Drop an entry only once the `ORACLE_VERSION_MAJOR` that introduced its successor is retired, since
53
+ * older contracts can no longer run against this environment.
54
+ */
55
+ export const LEGACY_ORACLE_REGISTRY: Record<string, LegacyOracleEntry> = {
56
+ aztec_utl_getL1ToL2MembershipWitness: legacyOracle({
57
+ modernOracle: 'aztec_utl_getL1ToL2MembershipWitnessV2',
58
+ // The old wire passed the contract address and secret, the modern oracle takes the unsiloed nullifier (plus the
59
+ // address to silo it with) instead. We derive it here so already-deployed contracts that still emit the old call
60
+ // keep working.
61
+ //
62
+ // This is the fee juice message nullifier derivation: only contracts using that scheme call this retired oracle.
63
+ params: {
64
+ legacyType: [
65
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
66
+ { name: 'messageHash', type: FIELD },
67
+ { name: 'secret', type: FIELD },
68
+ ],
69
+ mapping: async ([contractAddress, messageHash, secret]) => [
70
+ messageHash,
71
+ Option.some({ contractAddress, nullifier: await computeFeeJuiceMessageNullifier(messageHash, secret) }),
72
+ ],
73
+ },
74
+ }),
75
+ aztec_utl_getLogsByTag: legacyOracle({
76
+ modernOracle: 'aztec_utl_getLogsByTagV2',
77
+ returnType: {
78
+ legacyType: EPHEMERAL_ARRAY(EPHEMERAL_ARRAY(LEGACY_LOG_RETRIEVAL_RESPONSE)),
79
+ // We can map this directly, since the new type is a superset of the old type
80
+ mapping: result => result as unknown as EphemeralArray<EphemeralArray<LegacyLogRetrievalResponse>>,
81
+ },
82
+ }),
83
+ aztec_utl_getPendingTaggedLogs: legacyOracle({
84
+ modernOracle: 'aztec_utl_getPendingTaggedLogsV2',
85
+ returnType: {
86
+ legacyType: EPHEMERAL_ARRAY(LEGACY_PENDING_TAGGED_LOG),
87
+ // We can map this directly, since `ResolvedTx` carries the legacy context's fields under the same names
88
+ mapping: result => result as unknown as EphemeralArray<LegacyPendingTaggedLog>,
89
+ },
90
+ }),
91
+ };
92
+
93
+ type LegacyLogRetrievalResponse = Pick<
94
+ LogRetrievalResponse,
95
+ 'logPayload' | 'txHash' | 'uniqueNoteHashesInTx' | 'firstNullifierInTx'
96
+ >;
97
+
98
+ type LegacyMessageContext = Pick<ResolvedTx, 'txHash' | 'uniqueNoteHashesInTx' | 'firstNullifierInTx'>;
99
+
100
+ type LegacyPendingTaggedLog = {
101
+ log: PendingTaggedLog['log'];
102
+ context: LegacyMessageContext;
103
+ };
104
+
105
+ type Registry = typeof ORACLE_REGISTRY;
106
+
107
+ /** The handler return value type of a modern oracle entry. */
108
+ type ReturnValueOf<K extends keyof Registry> = Registry[K] extends OracleRegistryEntry<any, infer R> ? R : never;
109
+
110
+ /** The modern handler's positional argument tuple, derived from the oracle's declared params. */
111
+ type HandlerArgsOf<K extends keyof Registry> = ParamTypes<ReturnType<Registry[K]['deserializeParams']>>;
112
+
113
+ /**
114
+ * A legacy oracle adapter, stored under the retired oracle name that already-deployed contracts still call. It reuses
115
+ * the handler of `modernOracle` and overrides only the wire side(s) that changed; an omitted side falls back to that
116
+ * modern entry.
117
+ */
118
+ export interface LegacyOracleEntry {
119
+ /** The current oracle whose handler this reuses and whose param/return wire it inherits by default. */
120
+ modernOracle: keyof Registry;
121
+ /**
122
+ * Old param wire. `legacyType` deserializes the old wire; `mapping` bridges the deserialized legacy args to the
123
+ * modern handler's args. The mapping may be async. Omit when the param wire is unchanged.
124
+ */
125
+ params?: {
126
+ legacyType: readonly RegistryParam[];
127
+ mapping: (legacyArgs: any) => readonly unknown[] | Promise<readonly unknown[]>;
128
+ };
129
+ /**
130
+ * Old return wire. `legacyType` serializes the subset the old contract reads; `mapping` bridges the handler's
131
+ * current result to that subset's value type. Omit when the return wire is unchanged.
132
+ */
133
+ returnType?: { legacyType: TypeMapping; mapping: (result: any) => unknown };
134
+ }
135
+
136
+ function legacyOracle<K extends keyof Registry, W = never, const TLegacyParams extends RegistryParam[] = []>(entry: {
137
+ modernOracle: K;
138
+ params?: {
139
+ legacyType: [...TLegacyParams];
140
+ mapping: (
141
+ legacyArgs: ParamTypes<InferDeserializedParams<TLegacyParams>>,
142
+ ) => HandlerArgsOf<K> | Promise<HandlerArgsOf<K>>;
143
+ };
144
+ returnType?: { legacyType: TypeMapping<W>; mapping: (result: ReturnValueOf<K>) => W };
145
+ }): LegacyOracleEntry {
146
+ return entry;
147
+ }
@@ -1,23 +1,8 @@
1
- import { Fr } from '@aztec/foundation/curves/bn254';
2
1
  import type { SiblingPath } from '@aztec/foundation/trees';
3
2
 
4
- export class MessageLoadOracleInputs<N extends number> {
5
- constructor(
6
- /** The index of the message commitment in the merkle tree. */
7
- public index: bigint,
8
- /** The path in the merkle tree to the message. */
9
- public siblingPath: SiblingPath<N>,
10
- ) {}
11
-
12
- toFields(): Fr[] {
13
- return [new Fr(this.index), ...this.siblingPath.toFields()];
14
- }
15
-
16
- /**
17
- * Returns a representation of the public data witness as expected by intrinsic Noir deserialization.
18
- */
19
- public toNoirRepresentation(): (string | string[])[] {
20
- // TODO(#12874): remove the stupid as string conversion by modifying ForeignCallOutput type in acvm.js
21
- return [new Fr(this.index).toString() as string, this.siblingPath.toFields().map(fr => fr.toString()) as string[]];
22
- }
23
- }
3
+ export type MessageLoadOracleInputs<N extends number> = {
4
+ /** The index of the message commitment in the merkle tree. */
5
+ index: bigint;
6
+ /** The path in the merkle tree to the message. */
7
+ siblingPath: SiblingPath<N>;
8
+ };
@@ -3,6 +3,7 @@ import { ARCHIVE_HEIGHT, NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
3
3
  import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import { FieldReader } from '@aztec/foundation/serialize';
5
5
  import { toACVMField } from '@aztec/simulator/client';
6
+ import type { UnsiloedMessageNullifier } from '@aztec/stdlib/messaging';
6
7
 
7
8
  import {
8
9
  ARRAY,
@@ -15,11 +16,12 @@ import {
15
16
  BUFFER,
16
17
  BYTE,
17
18
  CALL_PRIVATE_RESULT,
18
- CONTRACT_CLASS_LOG_INPUT,
19
+ CONTRACT_CLASS_LOG,
19
20
  CONTRACT_INSTANCE,
20
21
  DELIVERY_MODE,
21
22
  EPHEMERAL_ARRAY,
22
23
  EVENT_VALIDATION_REQUEST,
24
+ FACT_COLLECTION,
23
25
  FIELD,
24
26
  FUNCTION_SELECTOR,
25
27
  type InputSlot,
@@ -27,7 +29,6 @@ import {
27
29
  LOG_RETRIEVAL_REQUEST,
28
30
  LOG_RETRIEVAL_RESPONSE,
29
31
  MEMBERSHIP_WITNESS,
30
- MESSAGE_CONTEXT,
31
32
  MESSAGE_LOAD_ORACLE_INPUTS,
32
33
  type MaybePromise,
33
34
  NOTE,
@@ -35,19 +36,24 @@ import {
35
36
  NOTE_VALIDATION_REQUEST,
36
37
  NULLIFIER_MEMBERSHIP_WITNESS,
37
38
  OPTION,
39
+ ORIGIN_BLOCK,
38
40
  type OutputSlot,
39
41
  PENDING_TAGGED_LOG,
40
42
  POINT,
41
43
  PROVIDED_SECRET,
42
44
  PUBLIC_DATA_WITNESS,
43
45
  PUBLIC_KEYS_AND_PARTIAL_ADDRESS,
46
+ RESOLVED_TAGGING_STRATEGY,
47
+ RESOLVED_TX,
44
48
  STR,
49
+ STRUCT,
45
50
  TX_EFFECT,
46
51
  TX_HASH,
47
52
  type TypeMapping,
48
53
  U32,
49
54
  UTILITY_CONTEXT,
50
55
  assertReadersConsumed,
56
+ slotsOf,
51
57
  } from './oracle_type_mappings.js';
52
58
 
53
59
  export {
@@ -59,7 +65,9 @@ export {
59
65
  BOUNDED_VEC,
60
66
  BUFFER,
61
67
  BYTE,
68
+ CONTRACT_CLASS_LOG,
62
69
  DELIVERY_MODE,
70
+ RESOLVED_TAGGING_STRATEGY,
63
71
  EPHEMERAL_ARRAY,
64
72
  EVENT_VALIDATION_REQUEST,
65
73
  FIELD,
@@ -67,17 +75,19 @@ export {
67
75
  LOG_RETRIEVAL_REQUEST,
68
76
  LOG_RETRIEVAL_RESPONSE,
69
77
  MEMBERSHIP_WITNESS,
70
- MESSAGE_CONTEXT,
71
78
  NOTE_VALIDATION_REQUEST,
72
79
  OPTION,
73
80
  PENDING_TAGGED_LOG,
74
81
  POINT,
75
82
  PROVIDED_SECRET,
83
+ RESOLVED_TX,
76
84
  STR,
77
85
  U32,
86
+ slotsOf,
78
87
  type InputSlot,
79
88
  type MaybePromise,
80
89
  type OutputSlot,
90
+ type SlotShape,
81
91
  type TypeMapping,
82
92
  } from './oracle_type_mappings.js';
83
93
 
@@ -103,7 +113,10 @@ export const ORACLE_REGISTRY = {
103
113
  aztec_utl_getUtilityContext: makeEntry({ returnType: UTILITY_CONTEXT }),
104
114
 
105
115
  aztec_utl_getKeyValidationRequest: makeEntry({
106
- params: [{ name: 'pkMHash', type: FIELD }],
116
+ params: [
117
+ { name: 'pkMHash', type: FIELD },
118
+ { name: 'keyIndex', type: FIELD },
119
+ ],
107
120
  returnType: KEY_VALIDATION_REQUEST,
108
121
  }),
109
122
 
@@ -128,6 +141,14 @@ export const ORACLE_REGISTRY = {
128
141
  returnType: OPTION(MEMBERSHIP_WITNESS(ARCHIVE_HEIGHT)),
129
142
  }),
130
143
 
144
+ aztec_utl_areBlockHashesInArchive: makeEntry({
145
+ params: [
146
+ { name: 'anchorBlockHash', type: BLOCK_HASH },
147
+ { name: 'blockHashes', type: EPHEMERAL_ARRAY(BLOCK_HASH) },
148
+ ],
149
+ returnType: EPHEMERAL_ARRAY(BOOL),
150
+ }),
151
+
131
152
  aztec_utl_getNullifierMembershipWitness: makeEntry({
132
153
  params: [
133
154
  { name: 'blockHash', type: BLOCK_HASH },
@@ -172,11 +193,18 @@ export const ORACLE_REGISTRY = {
172
193
  returnType: BOOL,
173
194
  }),
174
195
 
175
- aztec_utl_getL1ToL2MembershipWitness: makeEntry({
196
+ aztec_utl_getL1ToL2MembershipWitnessV2: makeEntry({
176
197
  params: [
177
- { name: 'contractAddress', type: AZTEC_ADDRESS },
178
198
  { name: 'messageHash', type: FIELD },
179
- { name: 'secret', type: FIELD },
199
+ {
200
+ name: 'nullifier',
201
+ type: OPTION(
202
+ STRUCT<UnsiloedMessageNullifier>([
203
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
204
+ { name: 'nullifier', type: FIELD },
205
+ ]),
206
+ ),
207
+ },
180
208
  ],
181
209
  returnType: MESSAGE_LOAD_ORACLE_INPUTS,
182
210
  }),
@@ -214,7 +242,7 @@ export const ORACLE_REGISTRY = {
214
242
  returnType: BOUNDED_VEC(NOTE),
215
243
  }),
216
244
 
217
- aztec_utl_getPendingTaggedLogs: makeEntry({
245
+ aztec_utl_getPendingTaggedLogsV2: makeEntry({
218
246
  params: [
219
247
  { name: 'scope', type: AZTEC_ADDRESS },
220
248
  { name: 'providedSecrets', type: EPHEMERAL_ARRAY(PROVIDED_SECRET) },
@@ -230,14 +258,14 @@ export const ORACLE_REGISTRY = {
230
258
  ],
231
259
  }),
232
260
 
233
- aztec_utl_getLogsByTag: makeEntry({
261
+ aztec_utl_getLogsByTagV2: makeEntry({
234
262
  params: [{ name: 'requests', type: EPHEMERAL_ARRAY(LOG_RETRIEVAL_REQUEST) }],
235
263
  returnType: EPHEMERAL_ARRAY(EPHEMERAL_ARRAY(LOG_RETRIEVAL_RESPONSE)),
236
264
  }),
237
265
 
238
- aztec_utl_getMessageContextsByTxHash: makeEntry({
266
+ aztec_utl_getResolvedTxs: makeEntry({
239
267
  params: [{ name: 'requests', type: EPHEMERAL_ARRAY(FIELD) }],
240
- returnType: EPHEMERAL_ARRAY(OPTION(MESSAGE_CONTEXT)),
268
+ returnType: EPHEMERAL_ARRAY(OPTION(RESOLVED_TX)),
241
269
  }),
242
270
 
243
271
  aztec_utl_getTxEffect: makeEntry({
@@ -285,8 +313,8 @@ export const ORACLE_REGISTRY = {
285
313
  aztec_utl_decryptAes128: makeEntry({
286
314
  params: [
287
315
  { name: 'ciphertext', type: BOUNDED_VEC(BYTE) },
288
- { name: 'iv', type: BUFFER(8) },
289
- { name: 'symKey', type: BUFFER(8) },
316
+ { name: 'iv', type: BUFFER(8, 16) },
317
+ { name: 'symKey', type: BUFFER(8, 16) },
290
318
  ],
291
319
  returnType: OPTION(BOUNDED_VEC(BYTE)),
292
320
  }),
@@ -311,6 +339,46 @@ export const ORACLE_REGISTRY = {
311
339
  params: [{ name: 'data', type: ARRAY(FIELD) }],
312
340
  }),
313
341
 
342
+ aztec_utl_recordFact: makeEntry({
343
+ params: [
344
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
345
+ { name: 'scope', type: AZTEC_ADDRESS },
346
+ { name: 'factCollectionTypeId', type: FIELD },
347
+ { name: 'factCollectionId', type: FIELD },
348
+ { name: 'factTypeId', type: FIELD },
349
+ { name: 'payload', type: EPHEMERAL_ARRAY(FIELD) },
350
+ { name: 'originBlock', type: OPTION(ORIGIN_BLOCK) },
351
+ ],
352
+ }),
353
+
354
+ aztec_utl_deleteFactCollection: makeEntry({
355
+ params: [
356
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
357
+ { name: 'scope', type: AZTEC_ADDRESS },
358
+ { name: 'factCollectionTypeId', type: FIELD },
359
+ { name: 'factCollectionId', type: FIELD },
360
+ ],
361
+ }),
362
+
363
+ aztec_utl_getFactCollection: makeEntry({
364
+ params: [
365
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
366
+ { name: 'scope', type: AZTEC_ADDRESS },
367
+ { name: 'factCollectionTypeId', type: FIELD },
368
+ { name: 'factCollectionId', type: FIELD },
369
+ ],
370
+ returnType: OPTION(FACT_COLLECTION),
371
+ }),
372
+
373
+ aztec_utl_getFactCollectionsByType: makeEntry({
374
+ params: [
375
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
376
+ { name: 'scope', type: AZTEC_ADDRESS },
377
+ { name: 'factCollectionTypeId', type: FIELD },
378
+ ],
379
+ returnType: EPHEMERAL_ARRAY(FACT_COLLECTION),
380
+ }),
381
+
314
382
  aztec_utl_callUtilityFunction: makeEntry({
315
383
  params: [
316
384
  { name: 'contractAddress', type: AZTEC_ADDRESS },
@@ -365,6 +433,51 @@ export const ORACLE_REGISTRY = {
365
433
  params: [{ name: 'slot', type: FIELD }],
366
434
  }),
367
435
 
436
+ aztec_utl_pushTransient: makeEntry({
437
+ params: [
438
+ { name: 'slot', type: FIELD },
439
+ { name: 'elements', type: ARRAY(FIELD) },
440
+ ],
441
+ returnType: U32,
442
+ }),
443
+
444
+ aztec_utl_popTransient: makeEntry({
445
+ params: [{ name: 'slot', type: FIELD }],
446
+ returnType: ARRAY(FIELD),
447
+ }),
448
+
449
+ aztec_utl_getTransient: makeEntry({
450
+ params: [
451
+ { name: 'slot', type: FIELD },
452
+ { name: 'index', type: U32 },
453
+ ],
454
+ returnType: ARRAY(FIELD),
455
+ }),
456
+
457
+ aztec_utl_setTransient: makeEntry({
458
+ params: [
459
+ { name: 'slot', type: FIELD },
460
+ { name: 'index', type: U32 },
461
+ { name: 'elements', type: ARRAY(FIELD) },
462
+ ],
463
+ }),
464
+
465
+ aztec_utl_getTransientLen: makeEntry({
466
+ params: [{ name: 'slot', type: FIELD }],
467
+ returnType: U32,
468
+ }),
469
+
470
+ aztec_utl_removeTransient: makeEntry({
471
+ params: [
472
+ { name: 'slot', type: FIELD },
473
+ { name: 'index', type: U32 },
474
+ ],
475
+ }),
476
+
477
+ aztec_utl_clearTransient: makeEntry({
478
+ params: [{ name: 'slot', type: FIELD }],
479
+ }),
480
+
368
481
  aztec_prv_setHashPreimage: makeEntry({
369
482
  params: [
370
483
  { name: 'values', type: ARRAY(FIELD) },
@@ -411,7 +524,7 @@ export const ORACLE_REGISTRY = {
411
524
 
412
525
  aztec_prv_notifyCreatedContractClassLog: makeEntry({
413
526
  params: [
414
- { name: 'log', type: CONTRACT_CLASS_LOG_INPUT },
527
+ { name: 'log', type: CONTRACT_CLASS_LOG },
415
528
  { name: 'counter', type: U32 },
416
529
  ],
417
530
  }),
@@ -457,28 +570,24 @@ export const ORACLE_REGISTRY = {
457
570
  }),
458
571
 
459
572
  aztec_prv_getSenderForTags: makeEntry({ returnType: OPTION(AZTEC_ADDRESS) }),
460
- } satisfies Record<string, OracleRegistryEntry>;
461
573
 
462
- /**
463
- * Deserializes oracle inputs, calls the handler with typed params, and serializes the result.
464
- */
465
- export async function callHandler<K extends keyof typeof ORACLE_REGISTRY>({
466
- oracle,
467
- inputs,
468
- handler,
469
- }: {
470
- oracle: K;
471
- inputs: InputSlot[];
472
- handler: (
473
- params: ParamTypes<ReturnType<(typeof ORACLE_REGISTRY)[K]['deserializeParams']>>,
474
- ) => MaybePromise<Parameters<(typeof ORACLE_REGISTRY)[K]['serializeReturn']>[0]>;
475
- }): Promise<OutputSlot[]> {
476
- const entry = ORACLE_REGISTRY[oracle] as OracleRegistryEntry;
477
- const named = entry.deserializeParams(inputs);
478
- const positional = named.map(p => p.value);
479
- const result = await handler(positional as any);
480
- return entry.serializeReturn(result);
481
- }
574
+ aztec_prv_resolveTaggingStrategy: makeEntry({
575
+ params: [
576
+ { name: 'sender', type: AZTEC_ADDRESS },
577
+ { name: 'recipient', type: AZTEC_ADDRESS },
578
+ { name: 'deliveryMode', type: DELIVERY_MODE },
579
+ ],
580
+ returnType: RESOLVED_TAGGING_STRATEGY,
581
+ }),
582
+
583
+ aztec_prv_resolveCustomRequest: makeEntry({
584
+ params: [
585
+ { name: 'kind', type: FIELD },
586
+ { name: 'payload', type: ARRAY(FIELD) },
587
+ ],
588
+ returnType: ARRAY(FIELD),
589
+ }),
590
+ } satisfies Record<string, OracleRegistryEntry>;
482
591
 
483
592
  // ─── Registry Infrastructure ─────────────────────────────────────────────────
484
593
 
@@ -496,6 +605,10 @@ export interface OracleRegistryEntry<
496
605
  deserializeParams(inputs: InputSlot[]): TDeserializedParams;
497
606
  /** Serialize a handler return value into ACVM output slots. */
498
607
  serializeReturn(result: TReturnValue): OutputSlot[];
608
+ /** The ordered named parameters with their {@link TypeMapping}s. Lets callers introspect the oracle's wire ABI. */
609
+ readonly params: readonly RegistryParam[];
610
+ /** The return {@link TypeMapping}, or `undefined` for oracles that return nothing. */
611
+ readonly returnType?: TypeMapping<TReturnValue>;
499
612
  }
500
613
 
501
614
  export function makeEntry<const TParams extends RegistryParam[] = [], TReturnValue = void>({
@@ -506,16 +619,18 @@ export function makeEntry<const TParams extends RegistryParam[] = [], TReturnVal
506
619
  returnType?: TypeMapping<TReturnValue>;
507
620
  } = {}): OracleRegistryEntry<InferDeserializedParams<TParams>, TReturnValue> {
508
621
  return {
622
+ params: params ?? [],
623
+ returnType,
509
624
  deserializeParams(inputs: InputSlot[]): InferDeserializedParams<TParams> {
510
625
  const resolvedParams: RegistryParam[] = params ?? [];
511
626
  // Walk the input slots left-to-right, advancing by each param's slot count.
512
627
  let offset = 0;
513
- return resolvedParams.map(param => {
628
+ const named = resolvedParams.map(param => {
514
629
  if (!param.type.deserialization) {
515
630
  throw new Error(`Param '${param.name}' has no deserialization defined`);
516
631
  }
517
632
  // Collect the slots for this param and wrap each in a FieldReader.
518
- const slotCount = param.type.deserialization.slots;
633
+ const slotCount = slotsOf(param.type);
519
634
  const readers = inputs
520
635
  .slice(offset, offset + slotCount)
521
636
  .map(slot => new FieldReader(slot.map(hex => Fr.fromString(hex))));
@@ -525,7 +640,13 @@ export function makeEntry<const TParams extends RegistryParam[] = [], TReturnVal
525
640
  const value = param.type.deserialization.fn(readers);
526
641
  assertReadersConsumed(readers);
527
642
  return { name: param.name, value };
528
- }) as unknown as InferDeserializedParams<TParams>;
643
+ });
644
+ // Every input slot must be specified by a param: oracles whose Noir decl passes an extra field must declare it
645
+ // (the handler can ignore it). Otherwise an under-declared shape would silently drop a field into nothing.
646
+ if (offset !== inputs.length) {
647
+ throw new Error(`Oracle received ${inputs.length} input slot(s) but the registry specifies ${offset}`);
648
+ }
649
+ return named as unknown as InferDeserializedParams<TParams>;
529
650
  },
530
651
  serializeReturn(result: TReturnValue): OutputSlot[] {
531
652
  if (returnType?.serialization === undefined) {
@@ -539,7 +660,7 @@ export function makeEntry<const TParams extends RegistryParam[] = [], TReturnVal
539
660
  }
540
661
 
541
662
  /** A named oracle parameter with its TypeMapping. */
542
- interface RegistryParam<TName extends string = string, T = any> {
663
+ export interface RegistryParam<TName extends string = string, T = any> {
543
664
  name: TName;
544
665
  type: TypeMapping<T>;
545
666
  }
@@ -565,14 +686,14 @@ export type ParamTypes<T extends readonly NamedValue[]> = {
565
686
  * @example `InferDeserializedParams<[RegistryParam<'addr', AztecAddress>, RegistryParam<'slot', Fr>]>`
566
687
  * → `[NamedValue<'addr', AztecAddress>, NamedValue<'slot', Fr>]`
567
688
  */
568
- type InferDeserializedParams<T extends RegistryParam[]> = {
689
+ export type InferDeserializedParams<T extends RegistryParam[]> = {
569
690
  [K in keyof T]: T[K] extends RegistryParam<infer N, infer V> ? NamedValue<N, V> : never;
570
691
  };
571
692
 
572
693
  // ─── Derived Handler Interfaces ─────────────────────────────────────────────
573
694
 
574
695
  /** Strips the `aztec_{scope}_` prefix from an oracle key to get the handler method name. */
575
- export type StripOraclePrefix<K extends string> = K extends `aztec_${string}_${infer M}` ? M : never;
696
+ type StripOraclePrefix<K extends string> = K extends `aztec_${string}_${infer M}` ? M : never;
576
697
 
577
698
  /** Derives the handler function signature from a registry entry's deserialization/serialization types. */
578
699
  type HandlerFn<E extends OracleRegistryEntry> = (