@aztec/pxe 3.0.3 → 4.0.0-devnet.1-patch.1

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 (369) hide show
  1. package/dest/bin/check_oracle_version.js +1 -1
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +45 -0
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
  4. package/dest/block_synchronizer/block_synchronizer.js +153 -0
  5. package/dest/block_synchronizer/index.d.ts +2 -0
  6. package/dest/block_synchronizer/index.d.ts.map +1 -0
  7. package/dest/block_synchronizer/index.js +1 -0
  8. package/dest/config/index.d.ts +6 -4
  9. package/dest/config/index.d.ts.map +1 -1
  10. package/dest/config/index.js +17 -0
  11. package/dest/config/package_info.js +1 -1
  12. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  13. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  14. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  15. package/dest/contract_function_simulator/contract_function_simulator.d.ts +74 -23
  16. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/contract_function_simulator.js +215 -66
  18. package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
  19. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/execution_note_cache.js +45 -28
  21. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +1 -1
  22. package/dest/contract_function_simulator/execution_tagging_index_cache.js +1 -1
  23. package/dest/contract_function_simulator/index.d.ts +2 -2
  24. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  25. package/dest/contract_function_simulator/index.js +1 -1
  26. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
  27. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +6 -3
  29. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +4 -3
  30. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
  32. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
  33. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  34. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  35. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  36. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  37. package/dest/contract_function_simulator/oracle/interfaces.d.ts +19 -16
  38. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
  40. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
  42. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  43. package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
  44. package/dest/contract_function_simulator/oracle/oracle.d.ts +11 -9
  45. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  46. package/dest/contract_function_simulator/oracle/oracle.js +70 -47
  47. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -28
  48. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  49. package/dest/contract_function_simulator/oracle/private_execution.js +1 -37
  50. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +48 -41
  51. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  52. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +98 -57
  53. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +107 -35
  54. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  55. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +205 -80
  56. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  57. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  58. package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
  59. package/dest/contract_sync/contract_sync_service.d.ts +41 -0
  60. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  61. package/dest/contract_sync/contract_sync_service.js +82 -0
  62. package/dest/contract_sync/helpers.d.ts +28 -0
  63. package/dest/contract_sync/helpers.d.ts.map +1 -0
  64. package/dest/contract_sync/helpers.js +55 -0
  65. package/dest/debug/pxe_debug_utils.d.ts +44 -0
  66. package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
  67. package/dest/debug/pxe_debug_utils.js +48 -0
  68. package/dest/entrypoints/client/bundle/index.d.ts +1 -2
  69. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  70. package/dest/entrypoints/client/bundle/index.js +0 -1
  71. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  72. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  73. package/dest/entrypoints/client/bundle/utils.js +31 -8
  74. package/dest/entrypoints/client/lazy/index.d.ts +1 -2
  75. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  76. package/dest/entrypoints/client/lazy/index.js +0 -1
  77. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  78. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  79. package/dest/entrypoints/client/lazy/utils.js +32 -9
  80. package/dest/entrypoints/pxe_creation_options.d.ts +5 -3
  81. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  82. package/dest/entrypoints/server/index.d.ts +4 -2
  83. package/dest/entrypoints/server/index.d.ts.map +1 -1
  84. package/dest/entrypoints/server/index.js +3 -1
  85. package/dest/entrypoints/server/utils.d.ts +1 -1
  86. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  87. package/dest/entrypoints/server/utils.js +39 -16
  88. package/dest/error_enriching.d.ts +4 -4
  89. package/dest/error_enriching.d.ts.map +1 -1
  90. package/dest/error_enriching.js +6 -6
  91. package/dest/events/event_service.d.ts +15 -0
  92. package/dest/events/event_service.d.ts.map +1 -0
  93. package/dest/events/event_service.js +44 -0
  94. package/dest/events/private_event_filter_validator.d.ts +6 -5
  95. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  96. package/dest/events/private_event_filter_validator.js +5 -6
  97. package/dest/job_coordinator/job_coordinator.d.ts +75 -0
  98. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  99. package/dest/job_coordinator/job_coordinator.js +94 -0
  100. package/dest/logs/log_service.d.ts +28 -0
  101. package/dest/logs/log_service.d.ts.map +1 -0
  102. package/dest/logs/log_service.js +123 -0
  103. package/dest/notes/index.d.ts +2 -0
  104. package/dest/notes/index.d.ts.map +1 -0
  105. package/dest/notes/index.js +1 -0
  106. package/dest/notes/note_service.d.ts +48 -0
  107. package/dest/notes/note_service.d.ts.map +1 -0
  108. package/dest/notes/note_service.js +147 -0
  109. package/dest/oracle_version.d.ts +3 -3
  110. package/dest/oracle_version.d.ts.map +1 -1
  111. package/dest/oracle_version.js +4 -3
  112. package/dest/private_kernel/hints/index.d.ts +2 -2
  113. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  114. package/dest/private_kernel/hints/index.js +1 -1
  115. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
  116. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  117. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +13 -7
  118. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  119. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  120. package/dest/private_kernel/private_kernel_execution_prover.js +6 -7
  121. package/dest/private_kernel/private_kernel_oracle.d.ts +24 -28
  122. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  123. package/dest/private_kernel/private_kernel_oracle.js +90 -2
  124. package/dest/pxe.d.ts +95 -89
  125. package/dest/pxe.d.ts.map +1 -1
  126. package/dest/pxe.js +226 -233
  127. package/dest/storage/address_store/address_store.d.ts +11 -0
  128. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  129. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +13 -12
  130. package/dest/storage/address_store/index.d.ts +2 -0
  131. package/dest/storage/address_store/index.d.ts.map +1 -0
  132. package/dest/storage/address_store/index.js +1 -0
  133. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +17 -0
  134. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  135. package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +10 -10
  136. package/dest/storage/{sync_data_provider → anchor_block_store}/index.d.ts +2 -2
  137. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  138. package/dest/storage/anchor_block_store/index.js +1 -0
  139. package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
  140. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  141. package/dest/storage/capsule_store/capsule_store.js +253 -0
  142. package/dest/storage/capsule_store/index.d.ts +2 -0
  143. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  144. package/dest/storage/capsule_store/index.js +1 -0
  145. package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +6 -4
  146. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  147. package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +56 -16
  148. package/dest/storage/contract_store/index.d.ts +2 -0
  149. package/dest/storage/contract_store/index.d.ts.map +1 -0
  150. package/dest/storage/contract_store/index.js +1 -0
  151. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  152. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  153. package/dest/storage/index.d.ts +8 -8
  154. package/dest/storage/index.d.ts.map +1 -1
  155. package/dest/storage/index.js +7 -7
  156. package/dest/storage/metadata.d.ts +1 -1
  157. package/dest/storage/metadata.js +1 -1
  158. package/dest/storage/note_store/index.d.ts +3 -0
  159. package/dest/storage/note_store/index.d.ts.map +1 -0
  160. package/dest/storage/note_store/index.js +2 -0
  161. package/dest/storage/note_store/note_store.d.ts +83 -0
  162. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  163. package/dest/storage/note_store/note_store.js +344 -0
  164. package/dest/storage/note_store/stored_note.d.ts +16 -0
  165. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  166. package/dest/storage/note_store/stored_note.js +43 -0
  167. package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
  168. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  169. package/dest/storage/private_event_store/private_event_store.js +273 -0
  170. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  171. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  172. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  173. package/dest/storage/tagging_store/index.d.ts +4 -0
  174. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  175. package/dest/storage/tagging_store/index.js +3 -0
  176. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
  177. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  178. package/dest/storage/tagging_store/recipient_tagging_store.js +111 -0
  179. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  180. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  181. package/dest/storage/tagging_store/sender_address_book_store.js +36 -0
  182. package/dest/storage/tagging_store/sender_tagging_store.d.ts +77 -0
  183. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  184. package/dest/storage/tagging_store/sender_tagging_store.js +348 -0
  185. package/dest/tagging/constants.d.ts +2 -2
  186. package/dest/tagging/constants.d.ts.map +1 -1
  187. package/dest/tagging/constants.js +10 -2
  188. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  189. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  190. package/dest/tagging/get_all_logs_by_tags.js +46 -0
  191. package/dest/tagging/index.d.ts +16 -6
  192. package/dest/tagging/index.d.ts.map +1 -1
  193. package/dest/tagging/index.js +15 -5
  194. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +15 -0
  195. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
  196. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
  197. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
  198. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
  199. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
  200. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +15 -0
  201. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
  202. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +32 -0
  203. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +21 -0
  204. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  205. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
  206. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
  207. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  208. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +29 -0
  209. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +21 -0
  210. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  211. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +60 -0
  212. package/package.json +27 -18
  213. package/src/bin/check_oracle_version.ts +1 -0
  214. package/src/block_synchronizer/block_synchronizer.ts +178 -0
  215. package/src/block_synchronizer/index.ts +1 -0
  216. package/src/config/index.ts +17 -3
  217. package/src/config/package_info.ts +1 -1
  218. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  219. package/src/contract_function_simulator/contract_function_simulator.ts +379 -99
  220. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  221. package/src/contract_function_simulator/execution_tagging_index_cache.ts +1 -1
  222. package/src/contract_function_simulator/index.ts +1 -1
  223. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +5 -1
  224. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +5 -4
  225. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  226. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  227. package/src/contract_function_simulator/oracle/interfaces.ts +24 -15
  228. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  229. package/src/contract_function_simulator/oracle/oracle.ts +82 -50
  230. package/src/contract_function_simulator/oracle/private_execution.ts +1 -68
  231. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +144 -94
  232. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +335 -96
  233. package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
  234. package/src/contract_sync/contract_sync_service.ts +129 -0
  235. package/src/contract_sync/helpers.ts +93 -0
  236. package/src/debug/pxe_debug_utils.ts +91 -0
  237. package/src/entrypoints/client/bundle/index.ts +0 -1
  238. package/src/entrypoints/client/bundle/utils.ts +23 -16
  239. package/src/entrypoints/client/lazy/index.ts +0 -1
  240. package/src/entrypoints/client/lazy/utils.ts +24 -17
  241. package/src/entrypoints/pxe_creation_options.ts +4 -2
  242. package/src/entrypoints/server/index.ts +3 -1
  243. package/src/entrypoints/server/utils.ts +33 -41
  244. package/src/error_enriching.ts +7 -15
  245. package/src/events/event_service.ts +71 -0
  246. package/src/events/private_event_filter_validator.ts +4 -5
  247. package/src/job_coordinator/job_coordinator.ts +150 -0
  248. package/src/logs/log_service.ts +220 -0
  249. package/src/notes/index.ts +1 -0
  250. package/src/notes/note_service.ts +195 -0
  251. package/src/oracle_version.ts +4 -3
  252. package/src/private_kernel/hints/index.ts +1 -1
  253. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +33 -22
  254. package/src/private_kernel/private_kernel_execution_prover.ts +9 -8
  255. package/src/private_kernel/private_kernel_oracle.ts +116 -36
  256. package/src/pxe.ts +352 -305
  257. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +16 -16
  258. package/src/storage/address_store/index.ts +1 -0
  259. package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +10 -12
  260. package/src/storage/anchor_block_store/index.ts +1 -0
  261. package/src/storage/capsule_store/capsule_store.ts +315 -0
  262. package/src/storage/capsule_store/index.ts +1 -0
  263. package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +66 -13
  264. package/src/storage/contract_store/index.ts +1 -0
  265. package/src/storage/index.ts +7 -7
  266. package/src/storage/metadata.ts +1 -1
  267. package/src/storage/note_store/index.ts +2 -0
  268. package/src/storage/note_store/note_store.ts +415 -0
  269. package/src/storage/note_store/stored_note.ts +48 -0
  270. package/src/storage/private_event_store/private_event_store.ts +384 -0
  271. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  272. package/src/storage/tagging_store/index.ts +3 -0
  273. package/src/storage/tagging_store/recipient_tagging_store.ts +139 -0
  274. package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
  275. package/src/storage/tagging_store/sender_tagging_store.ts +429 -0
  276. package/src/tagging/constants.ts +10 -2
  277. package/src/tagging/get_all_logs_by_tags.ts +68 -0
  278. package/src/tagging/index.ts +18 -5
  279. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +143 -0
  280. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
  281. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +49 -0
  282. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +99 -0
  283. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +36 -0
  284. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +84 -0
  285. package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -268
  286. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
  287. package/dest/contract_function_simulator/execution_data_provider.js +0 -14
  288. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  289. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  290. package/dest/contract_function_simulator/proxied_node.js +0 -27
  291. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -124
  292. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
  293. package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -727
  294. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  295. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  296. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  297. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  298. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  299. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
  300. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  301. package/dest/storage/address_data_provider/index.d.ts +0 -2
  302. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  303. package/dest/storage/address_data_provider/index.js +0 -1
  304. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -25
  305. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  306. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -118
  307. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  308. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  309. package/dest/storage/capsule_data_provider/index.js +0 -1
  310. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  311. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  312. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  313. package/dest/storage/contract_data_provider/index.js +0 -1
  314. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  315. package/dest/storage/note_data_provider/index.d.ts +0 -3
  316. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  317. package/dest/storage/note_data_provider/index.js +0 -2
  318. package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -84
  319. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  320. package/dest/storage/note_data_provider/note_data_provider.js +0 -322
  321. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -51
  322. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  323. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -115
  324. package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
  325. package/dest/storage/sync_data_provider/index.js +0 -1
  326. package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -11
  327. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
  328. package/dest/storage/tagging_data_provider/index.d.ts +0 -2
  329. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  330. package/dest/storage/tagging_data_provider/index.js +0 -1
  331. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -40
  332. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
  333. package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -89
  334. package/dest/synchronizer/index.d.ts +0 -2
  335. package/dest/synchronizer/index.d.ts.map +0 -1
  336. package/dest/synchronizer/index.js +0 -1
  337. package/dest/synchronizer/synchronizer.d.ts +0 -36
  338. package/dest/synchronizer/synchronizer.d.ts.map +0 -1
  339. package/dest/synchronizer/synchronizer.js +0 -102
  340. package/dest/tagging/siloed_tag.d.ts +0 -14
  341. package/dest/tagging/siloed_tag.d.ts.map +0 -1
  342. package/dest/tagging/siloed_tag.js +0 -20
  343. package/dest/tagging/tag.d.ts +0 -12
  344. package/dest/tagging/tag.d.ts.map +0 -1
  345. package/dest/tagging/tag.js +0 -17
  346. package/dest/tagging/utils.d.ts +0 -18
  347. package/dest/tagging/utils.d.ts.map +0 -1
  348. package/dest/tagging/utils.js +0 -24
  349. package/src/contract_function_simulator/execution_data_provider.ts +0 -343
  350. package/src/contract_function_simulator/proxied_node.ts +0 -33
  351. package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1055
  352. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
  353. package/src/storage/address_data_provider/index.ts +0 -1
  354. package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -147
  355. package/src/storage/capsule_data_provider/index.ts +0 -1
  356. package/src/storage/contract_data_provider/index.ts +0 -1
  357. package/src/storage/note_data_provider/index.ts +0 -2
  358. package/src/storage/note_data_provider/note_data_provider.ts +0 -412
  359. package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -162
  360. package/src/storage/sync_data_provider/index.ts +0 -1
  361. package/src/storage/tagging_data_provider/index.ts +0 -1
  362. package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -120
  363. package/src/synchronizer/index.ts +0 -1
  364. package/src/synchronizer/synchronizer.ts +0 -121
  365. package/src/tagging/siloed_tag.ts +0 -22
  366. package/src/tagging/tag.ts +0 -16
  367. package/src/tagging/utils.ts +0 -31
  368. /package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +0 -0
  369. /package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +0 -0
@@ -6,35 +6,54 @@ import { type CircuitSimulator, toACVMWitness } from '@aztec/simulator/client';
6
6
  import {
7
7
  type FunctionAbi,
8
8
  type FunctionArtifact,
9
+ type FunctionCall,
9
10
  FunctionSelector,
10
11
  type NoteSelector,
11
12
  countArgumentsSize,
12
13
  } from '@aztec/stdlib/abi';
13
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
14
14
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
15
- import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
15
+ import { siloNullifier } from '@aztec/stdlib/hash';
16
16
  import { PrivateContextInputs } from '@aztec/stdlib/kernel';
17
- import type { ContractClassLog, DirectionalAppTaggingSecret, PreTag } from '@aztec/stdlib/logs';
17
+ import { type ContractClassLog, DirectionalAppTaggingSecret, type PreTag } from '@aztec/stdlib/logs';
18
+ import { Tag } from '@aztec/stdlib/logs';
18
19
  import { Note, type NoteStatus } from '@aztec/stdlib/note';
19
20
  import {
20
- type BlockHeader,
21
21
  CallContext,
22
- Capsule,
23
22
  CountedContractClassLog,
24
23
  NoteAndSlot,
25
24
  PrivateCallExecutionResult,
26
25
  type TxContext,
27
26
  } from '@aztec/stdlib/tx';
28
27
 
29
- import { Tag } from '../../tagging/tag.js';
30
- import type { ExecutionDataProvider } from '../execution_data_provider.js';
28
+ import type { ContractSyncService } from '../../contract_sync/contract_sync_service.js';
29
+ import { NoteService } from '../../notes/note_service.js';
30
+ import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagging_store.js';
31
+ import { syncSenderTaggingIndexes } from '../../tagging/index.js';
31
32
  import type { ExecutionNoteCache } from '../execution_note_cache.js';
32
33
  import { ExecutionTaggingIndexCache } from '../execution_tagging_index_cache.js';
33
34
  import type { HashedValuesCache } from '../hashed_values_cache.js';
34
35
  import { pickNotes } from '../pick_notes.js';
35
36
  import type { IPrivateExecutionOracle, NoteData } from './interfaces.js';
36
- import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
37
- import { UtilityExecutionOracle } from './utility_execution_oracle.js';
37
+ import { executePrivateFunction } from './private_execution.js';
38
+ import { UtilityExecutionOracle, type UtilityExecutionOracleArgs } from './utility_execution_oracle.js';
39
+
40
+ /** Args for PrivateExecutionOracle constructor. */
41
+ export type PrivateExecutionOracleArgs = Omit<UtilityExecutionOracleArgs, 'contractAddress'> & {
42
+ argsHash: Fr;
43
+ txContext: TxContext;
44
+ callContext: CallContext;
45
+ /** Needed to trigger contract synchronization before nested calls */
46
+ utilityExecutor: (call: FunctionCall) => Promise<void>;
47
+ executionCache: HashedValuesCache;
48
+ noteCache: ExecutionNoteCache;
49
+ taggingIndexCache: ExecutionTaggingIndexCache;
50
+ senderTaggingStore: SenderTaggingStore;
51
+ contractSyncService: ContractSyncService;
52
+ totalPublicCalldataCount?: number;
53
+ sideEffectCounter?: number;
54
+ senderForTags?: AztecAddress;
55
+ simulator?: CircuitSimulator;
56
+ };
38
57
 
39
58
  /**
40
59
  * The execution oracle for the private part of a transaction.
@@ -51,42 +70,44 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
51
70
  * Users can also use this to get a clearer idea of what's happened during a simulation.
52
71
  */
53
72
  private newNotes: NoteAndSlot[] = [];
54
- /**
55
- * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
56
- * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
57
- * It maps from siloed note hash to the index for notes created by public functions.
58
- *
59
- * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
60
- * because these notes are meant to be maintained on a per-call basis
61
- * They should act as references for the read requests output by an app circuit via public inputs.
62
- */
63
- private noteHashLeafIndexMap: Map<bigint, bigint> = new Map();
64
73
  private noteHashNullifierCounterMap: Map<number, number> = new Map();
65
74
  private contractClassLogs: CountedContractClassLog[] = [];
66
75
  private offchainEffects: { data: Fr[] }[] = [];
67
76
  private nestedExecutionResults: PrivateCallExecutionResult[] = [];
68
77
 
69
- constructor(
70
- private readonly argsHash: Fr,
71
- private readonly txContext: TxContext,
72
- private readonly callContext: CallContext,
73
- /** Header of a block whose state is used during private execution (not the block the transaction is included in). */
74
- protected readonly anchorBlockHeader: BlockHeader,
75
- /** List of transient auth witnesses to be used during this simulation */
76
- authWitnesses: AuthWitness[],
77
- capsules: Capsule[],
78
- private readonly executionCache: HashedValuesCache,
79
- private readonly noteCache: ExecutionNoteCache,
80
- private readonly taggingIndexCache: ExecutionTaggingIndexCache,
81
- executionDataProvider: ExecutionDataProvider,
82
- private totalPublicCalldataCount: number = 0,
83
- protected sideEffectCounter: number = 0,
84
- log = createLogger('simulator:client_execution_context'),
85
- scopes?: AztecAddress[],
86
- private senderForTags?: AztecAddress,
87
- private simulator?: CircuitSimulator,
88
- ) {
89
- super(callContext.contractAddress, authWitnesses, capsules, executionDataProvider, log, scopes);
78
+ private readonly argsHash: Fr;
79
+ private readonly txContext: TxContext;
80
+ private readonly callContext: CallContext;
81
+ private readonly utilityExecutor: (call: FunctionCall) => Promise<void>;
82
+ private readonly executionCache: HashedValuesCache;
83
+ private readonly noteCache: ExecutionNoteCache;
84
+ private readonly taggingIndexCache: ExecutionTaggingIndexCache;
85
+ private readonly senderTaggingStore: SenderTaggingStore;
86
+ private readonly contractSyncService: ContractSyncService;
87
+ private totalPublicCalldataCount: number;
88
+ protected sideEffectCounter: number;
89
+ private senderForTags?: AztecAddress;
90
+ private readonly simulator?: CircuitSimulator;
91
+
92
+ constructor(args: PrivateExecutionOracleArgs) {
93
+ super({
94
+ ...args,
95
+ contractAddress: args.callContext.contractAddress,
96
+ log: args.log ?? createLogger('simulator:client_execution_context'),
97
+ });
98
+ this.argsHash = args.argsHash;
99
+ this.txContext = args.txContext;
100
+ this.callContext = args.callContext;
101
+ this.utilityExecutor = args.utilityExecutor;
102
+ this.executionCache = args.executionCache;
103
+ this.noteCache = args.noteCache;
104
+ this.taggingIndexCache = args.taggingIndexCache;
105
+ this.senderTaggingStore = args.senderTaggingStore;
106
+ this.contractSyncService = args.contractSyncService;
107
+ this.totalPublicCalldataCount = args.totalPublicCalldataCount ?? 0;
108
+ this.sideEffectCounter = args.sideEffectCounter ?? 0;
109
+ this.senderForTags = args.senderForTags;
110
+ this.simulator = args.simulator;
90
111
  }
91
112
 
92
113
  public getPrivateContextInputs(): PrivateContextInputs {
@@ -118,14 +139,6 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
118
139
  return toACVMWitness(0, fields);
119
140
  }
120
141
 
121
- /**
122
- * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
123
- * regarding which note hash each settled read request corresponds to.
124
- */
125
- public getNoteHashLeafIndexMap() {
126
- return this.noteHashLeafIndexMap;
127
- }
128
-
129
142
  /**
130
143
  * Get the data for the newly created notes.
131
144
  */
@@ -152,7 +165,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
152
165
  }
153
166
 
154
167
  /**
155
- * Returns the pre tags that were used in this execution (and that need to be stored in the db).
168
+ * Returns the pre-tags that were used in this execution (and that need to be stored in the db).
156
169
  */
157
170
  public getUsedPreTags(): PreTag[] {
158
171
  return this.taggingIndexCache.getUsedPreTags();
@@ -202,11 +215,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
202
215
  * @returns An app tag to be used in a log.
203
216
  */
204
217
  public async privateGetNextAppTagAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<Tag> {
205
- const secret = await this.executionDataProvider.calculateDirectionalAppTaggingSecret(
206
- this.contractAddress,
207
- sender,
208
- recipient,
209
- );
218
+ const secret = await this.#calculateDirectionalAppTaggingSecret(this.contractAddress, sender, recipient);
210
219
 
211
220
  const index = await this.#getIndexToUseForSecret(secret);
212
221
  this.log.debug(
@@ -217,6 +226,22 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
217
226
  return Tag.compute({ secret, index });
218
227
  }
219
228
 
229
+ async #calculateDirectionalAppTaggingSecret(
230
+ contractAddress: AztecAddress,
231
+ sender: AztecAddress,
232
+ recipient: AztecAddress,
233
+ ) {
234
+ const senderCompleteAddress = await this.getCompleteAddressOrFail(sender);
235
+ const senderIvsk = await this.keyStore.getMasterIncomingViewingSecretKey(sender);
236
+ return DirectionalAppTaggingSecret.compute(
237
+ senderCompleteAddress,
238
+ senderIvsk,
239
+ recipient,
240
+ contractAddress,
241
+ recipient,
242
+ );
243
+ }
244
+
220
245
  async #getIndexToUseForSecret(secret: DirectionalAppTaggingSecret): Promise<number> {
221
246
  // If we have the tagging index in the cache, we use it. If not we obtain it from the execution data provider.
222
247
  const lastUsedIndexInTx = this.taggingIndexCache.getLastUsedIndex(secret);
@@ -227,8 +252,16 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
227
252
  // This is a tagging secret we've not yet used in this tx, so first sync our store to make sure its indices
228
253
  // are up to date. We do this here because this store is not synced as part of the global sync because
229
254
  // that'd be wasteful as most tagging secrets are not used in each tx.
230
- await this.executionDataProvider.syncTaggedLogsAsSender(secret, this.contractAddress);
231
- const lastUsedIndex = await this.executionDataProvider.getLastUsedIndexAsSender(secret);
255
+ await syncSenderTaggingIndexes(
256
+ secret,
257
+ this.contractAddress,
258
+ this.aztecNode,
259
+ this.senderTaggingStore,
260
+ await this.anchorBlockHeader.hash(),
261
+ this.jobId,
262
+ );
263
+
264
+ const lastUsedIndex = await this.senderTaggingStore.getLastUsedIndex(secret, this.jobId);
232
265
  // If lastUsedIndex is undefined, we've never used this secret, so start from 0
233
266
  // Otherwise, the next index to use is one past the last used index
234
267
  return lastUsedIndex === undefined ? 0 : lastUsedIndex + 1;
@@ -316,7 +349,9 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
316
349
  const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, owner, storageSlot);
317
350
 
318
351
  const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
319
- const dbNotes = await this.executionDataProvider.getNotes(
352
+
353
+ const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockHeader, this.jobId);
354
+ const dbNotes = await noteService.getNotes(
320
355
  this.callContext.contractAddress,
321
356
  owner,
322
357
  storageSlot,
@@ -345,23 +380,6 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
345
380
  .join(', ')}`,
346
381
  );
347
382
 
348
- const noteHashesAndIndexes = await Promise.all(
349
- notes.map(async n => {
350
- if (n.index !== undefined) {
351
- const siloedNoteHash = await siloNoteHash(n.contractAddress, n.noteHash);
352
- const uniqueNoteHash = await computeUniqueNoteHash(n.noteNonce, siloedNoteHash);
353
-
354
- return { hash: uniqueNoteHash, index: n.index };
355
- }
356
- }),
357
- );
358
-
359
- noteHashesAndIndexes
360
- .filter(n => n !== undefined)
361
- .forEach(n => {
362
- this.noteHashLeafIndexMap.set(n!.hash.toBigInt(), n!.index);
363
- });
364
-
365
383
  return notes;
366
384
  }
367
385
 
@@ -404,6 +422,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
404
422
  note,
405
423
  siloedNullifier: undefined, // Siloed nullifier cannot be known for newly created note.
406
424
  noteHash,
425
+ isPending: true, // This note has just been created and hence is not settled yet.
407
426
  },
408
427
  counter,
409
428
  );
@@ -438,6 +457,19 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
438
457
  return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
439
458
  }
440
459
 
460
+ /**
461
+ * Check if a nullifier has been emitted in the same transaction, i.e. if privateNotifyCreatedNullifier has been
462
+ * called for this inner nullifier from the contract with the specified address.
463
+ * @param innerNullifier - The inner nullifier to check.
464
+ * @param contractAddress - Address of the contract that emitted the nullifier.
465
+ * @returns A boolean indicating whether the nullifier is pending or not.
466
+ */
467
+ public async privateIsNullifierPending(innerNullifier: Fr, contractAddress: AztecAddress): Promise<boolean> {
468
+ const siloedNullifier = await siloNullifier(contractAddress, innerNullifier);
469
+ const isNullifierPending = this.noteCache.getNullifiers(contractAddress).has(siloedNullifier.toBigInt());
470
+ return Promise.resolve(isNullifierPending);
471
+ }
472
+
441
473
  /**
442
474
  * Emit a contract class log.
443
475
  * This fn exists because we only carry a poseidon hash through the kernels, and need to
@@ -494,9 +526,15 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
494
526
 
495
527
  isStaticCall = isStaticCall || this.callContext.isStaticCall;
496
528
 
497
- await verifyCurrentClassId(targetContractAddress, this.executionDataProvider, this.anchorBlockHeader);
529
+ await this.contractSyncService.ensureContractSynced(
530
+ targetContractAddress,
531
+ functionSelector,
532
+ this.utilityExecutor,
533
+ this.anchorBlockHeader,
534
+ this.jobId,
535
+ );
498
536
 
499
- const targetArtifact = await this.executionDataProvider.getFunctionArtifact(
537
+ const targetArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(
500
538
  targetContractAddress,
501
539
  functionSelector,
502
540
  );
@@ -505,29 +543,41 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
505
543
 
506
544
  const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
507
545
 
508
- const privateExecutionOracle = new PrivateExecutionOracle(
546
+ const privateExecutionOracle = new PrivateExecutionOracle({
509
547
  argsHash,
510
- derivedTxContext,
511
- derivedCallContext,
512
- this.anchorBlockHeader,
513
- this.authWitnesses,
514
- this.capsules,
515
- this.executionCache,
516
- this.noteCache,
517
- this.taggingIndexCache,
518
- this.executionDataProvider,
519
- this.totalPublicCalldataCount,
548
+ txContext: derivedTxContext,
549
+ callContext: derivedCallContext,
550
+ anchorBlockHeader: this.anchorBlockHeader,
551
+ utilityExecutor: this.utilityExecutor,
552
+ authWitnesses: this.authWitnesses,
553
+ capsules: this.capsules,
554
+ executionCache: this.executionCache,
555
+ noteCache: this.noteCache,
556
+ taggingIndexCache: this.taggingIndexCache,
557
+ contractStore: this.contractStore,
558
+ noteStore: this.noteStore,
559
+ keyStore: this.keyStore,
560
+ addressStore: this.addressStore,
561
+ aztecNode: this.aztecNode,
562
+ senderTaggingStore: this.senderTaggingStore,
563
+ recipientTaggingStore: this.recipientTaggingStore,
564
+ senderAddressBookStore: this.senderAddressBookStore,
565
+ capsuleStore: this.capsuleStore,
566
+ privateEventStore: this.privateEventStore,
567
+ contractSyncService: this.contractSyncService,
568
+ jobId: this.jobId,
569
+ totalPublicCalldataCount: this.totalPublicCalldataCount,
520
570
  sideEffectCounter,
521
- this.log,
522
- this.scopes,
523
- this.senderForTags,
524
- this.simulator,
525
- );
571
+ log: this.log,
572
+ scopes: this.scopes,
573
+ senderForTags: this.senderForTags,
574
+ simulator: this.simulator!,
575
+ });
526
576
 
527
577
  const setupTime = simulatorSetupTimer.ms();
528
578
 
529
579
  const childExecutionResult = await executePrivateFunction(
530
- this.simulator,
580
+ this.simulator!,
531
581
  privateExecutionOracle,
532
582
  targetArtifact,
533
583
  targetContractAddress,
@@ -628,7 +678,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
628
678
  }
629
679
 
630
680
  public getDebugFunctionName() {
631
- return this.executionDataProvider.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
681
+ return this.contractStore.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
632
682
  }
633
683
 
634
684
  public utilityEmitOffchainEffect(data: Fr[]): Promise<void> {