@aztec/pxe 0.0.1-commit.b655e406 → 0.0.1-commit.c31f2472

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 (392) hide show
  1. package/dest/bin/check_oracle_version.d.ts +1 -1
  2. package/dest/bin/check_oracle_version.js +105 -15
  3. package/dest/block_synchronizer/block_synchronizer.d.ts +43 -0
  4. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
  5. package/dest/block_synchronizer/block_synchronizer.js +147 -0
  6. package/dest/block_synchronizer/index.d.ts +2 -0
  7. package/dest/block_synchronizer/index.d.ts.map +1 -0
  8. package/dest/block_synchronizer/index.js +1 -0
  9. package/dest/config/index.d.ts +6 -12
  10. package/dest/config/index.d.ts.map +1 -1
  11. package/dest/config/index.js +24 -13
  12. package/dest/config/package_info.d.ts +1 -1
  13. package/dest/config/package_info.js +1 -1
  14. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  15. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  16. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  17. package/dest/contract_function_simulator/contract_function_simulator.d.ts +44 -16
  18. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  19. package/dest/contract_function_simulator/contract_function_simulator.js +81 -41
  20. package/dest/contract_function_simulator/execution_note_cache.d.ts +25 -14
  21. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  22. package/dest/contract_function_simulator/execution_note_cache.js +59 -34
  23. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +2 -2
  24. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  25. package/dest/contract_function_simulator/execution_tagging_index_cache.js +1 -1
  26. package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
  27. package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/index.d.ts +2 -2
  29. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  30. package/dest/contract_function_simulator/index.js +1 -1
  31. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +5 -4
  32. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  33. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +6 -3
  34. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
  35. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  36. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
  37. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +3 -3
  38. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
  40. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +7 -5
  41. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  42. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +13 -4
  43. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  44. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  46. package/dest/contract_function_simulator/oracle/index.d.ts +1 -1
  47. package/dest/contract_function_simulator/oracle/interfaces.d.ts +28 -18
  48. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  49. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -2
  50. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  51. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
  52. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +14 -8
  53. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  54. package/dest/contract_function_simulator/oracle/note_packing_utils.js +16 -11
  55. package/dest/contract_function_simulator/oracle/oracle.d.ts +13 -10
  56. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  57. package/dest/contract_function_simulator/oracle/oracle.js +69 -41
  58. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -27
  59. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  60. package/dest/contract_function_simulator/oracle/private_execution.js +2 -38
  61. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +37 -33
  62. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  63. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +58 -49
  64. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +77 -26
  65. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  66. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +171 -64
  67. package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
  68. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  69. package/dest/contract_function_simulator/pick_notes.js +1 -1
  70. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  71. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  72. package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
  73. package/dest/contract_sync/index.d.ts +23 -0
  74. package/dest/contract_sync/index.d.ts.map +1 -0
  75. package/dest/contract_sync/index.js +54 -0
  76. package/dest/debug/pxe_debug_utils.d.ts +41 -0
  77. package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
  78. package/dest/debug/pxe_debug_utils.js +47 -0
  79. package/dest/entrypoints/client/bundle/index.d.ts +1 -2
  80. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  81. package/dest/entrypoints/client/bundle/index.js +0 -1
  82. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  83. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  84. package/dest/entrypoints/client/bundle/utils.js +22 -8
  85. package/dest/entrypoints/client/lazy/index.d.ts +1 -2
  86. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  87. package/dest/entrypoints/client/lazy/index.js +0 -1
  88. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  89. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  90. package/dest/entrypoints/client/lazy/utils.js +23 -9
  91. package/dest/entrypoints/pxe_creation_options.d.ts +7 -3
  92. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  93. package/dest/entrypoints/server/index.d.ts +4 -2
  94. package/dest/entrypoints/server/index.d.ts.map +1 -1
  95. package/dest/entrypoints/server/index.js +3 -1
  96. package/dest/entrypoints/server/utils.d.ts +1 -1
  97. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  98. package/dest/entrypoints/server/utils.js +31 -27
  99. package/dest/error_enriching.d.ts +4 -4
  100. package/dest/error_enriching.d.ts.map +1 -1
  101. package/dest/error_enriching.js +6 -6
  102. package/dest/events/event_service.d.ts +16 -0
  103. package/dest/events/event_service.d.ts.map +1 -0
  104. package/dest/events/event_service.js +45 -0
  105. package/dest/events/index.d.ts +2 -0
  106. package/dest/events/index.d.ts.map +1 -0
  107. package/dest/events/index.js +1 -0
  108. package/dest/events/private_event_filter_validator.d.ts +9 -0
  109. package/dest/events/private_event_filter_validator.d.ts.map +1 -0
  110. package/dest/events/private_event_filter_validator.js +38 -0
  111. package/dest/job_coordinator/job_coordinator.d.ts +75 -0
  112. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  113. package/dest/job_coordinator/job_coordinator.js +94 -0
  114. package/dest/logs/log_service.d.ts +28 -0
  115. package/dest/logs/log_service.d.ts.map +1 -0
  116. package/dest/logs/log_service.js +128 -0
  117. package/dest/notes/index.d.ts +2 -0
  118. package/dest/notes/index.d.ts.map +1 -0
  119. package/dest/notes/index.js +1 -0
  120. package/dest/notes/note_service.d.ts +49 -0
  121. package/dest/notes/note_service.d.ts.map +1 -0
  122. package/dest/notes/note_service.js +148 -0
  123. package/dest/oracle_version.d.ts +3 -3
  124. package/dest/oracle_version.d.ts.map +1 -1
  125. package/dest/oracle_version.js +4 -3
  126. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +1 -1
  127. package/dest/private_kernel/hints/index.d.ts +2 -2
  128. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  129. package/dest/private_kernel/hints/index.js +1 -1
  130. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
  131. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  132. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +19 -13
  133. package/dest/private_kernel/index.d.ts +1 -1
  134. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  135. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  136. package/dest/private_kernel/private_kernel_execution_prover.js +17 -17
  137. package/dest/private_kernel/private_kernel_oracle.d.ts +26 -29
  138. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  139. package/dest/private_kernel/private_kernel_oracle.js +90 -2
  140. package/dest/pxe.d.ts +54 -83
  141. package/dest/pxe.d.ts.map +1 -1
  142. package/dest/pxe.js +195 -242
  143. package/dest/storage/address_store/address_store.d.ts +11 -0
  144. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  145. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
  146. package/dest/storage/address_store/index.d.ts +2 -0
  147. package/dest/storage/address_store/index.d.ts.map +1 -0
  148. package/dest/storage/address_store/index.js +1 -0
  149. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -0
  150. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  151. package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +2 -9
  152. package/dest/storage/anchor_block_store/index.d.ts +2 -0
  153. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  154. package/dest/storage/anchor_block_store/index.js +1 -0
  155. package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
  156. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  157. package/dest/storage/capsule_store/capsule_store.js +255 -0
  158. package/dest/storage/capsule_store/index.d.ts +2 -0
  159. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  160. package/dest/storage/capsule_store/index.js +1 -0
  161. package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +7 -15
  162. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  163. package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +34 -15
  164. package/dest/storage/contract_store/index.d.ts +2 -0
  165. package/dest/storage/contract_store/index.d.ts.map +1 -0
  166. package/dest/storage/contract_store/index.js +1 -0
  167. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  168. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  169. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
  170. package/dest/storage/index.d.ts +8 -8
  171. package/dest/storage/index.d.ts.map +1 -1
  172. package/dest/storage/index.js +7 -7
  173. package/dest/storage/metadata.d.ts +1 -1
  174. package/dest/storage/note_store/index.d.ts +3 -0
  175. package/dest/storage/note_store/index.d.ts.map +1 -0
  176. package/dest/storage/note_store/index.js +2 -0
  177. package/dest/storage/note_store/note_store.d.ts +73 -0
  178. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  179. package/dest/storage/note_store/note_store.js +301 -0
  180. package/dest/storage/note_store/stored_note.d.ts +16 -0
  181. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  182. package/dest/storage/note_store/stored_note.js +43 -0
  183. package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
  184. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  185. package/dest/storage/private_event_store/private_event_store.js +248 -0
  186. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  187. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  188. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  189. package/dest/storage/tagging_store/index.d.ts +4 -0
  190. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  191. package/dest/storage/tagging_store/index.js +3 -0
  192. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
  193. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  194. package/dest/storage/tagging_store/recipient_tagging_store.js +99 -0
  195. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  196. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  197. package/dest/storage/tagging_store/sender_address_book_store.js +30 -0
  198. package/dest/storage/tagging_store/sender_tagging_store.d.ts +77 -0
  199. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  200. package/dest/storage/tagging_store/sender_tagging_store.js +278 -0
  201. package/dest/tagging/constants.d.ts +2 -2
  202. package/dest/tagging/constants.d.ts.map +1 -1
  203. package/dest/tagging/constants.js +10 -2
  204. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  205. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  206. package/dest/tagging/get_all_logs_by_tags.js +46 -0
  207. package/dest/tagging/index.d.ts +16 -6
  208. package/dest/tagging/index.d.ts.map +1 -1
  209. package/dest/tagging/index.js +15 -5
  210. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +15 -0
  211. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
  212. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
  213. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
  214. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
  215. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
  216. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +15 -0
  217. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
  218. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +32 -0
  219. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +21 -0
  220. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  221. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
  222. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
  223. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  224. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +29 -0
  225. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +21 -0
  226. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  227. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +60 -0
  228. package/package.json +20 -19
  229. package/src/bin/check_oracle_version.ts +131 -20
  230. package/src/block_synchronizer/block_synchronizer.ts +172 -0
  231. package/src/block_synchronizer/index.ts +1 -0
  232. package/src/config/index.ts +24 -25
  233. package/src/config/package_info.ts +1 -1
  234. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  235. package/src/contract_function_simulator/contract_function_simulator.ts +132 -43
  236. package/src/contract_function_simulator/execution_note_cache.ts +58 -28
  237. package/src/contract_function_simulator/execution_tagging_index_cache.ts +1 -1
  238. package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
  239. package/src/contract_function_simulator/index.ts +1 -1
  240. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +6 -2
  241. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
  242. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -2
  243. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +15 -3
  244. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  245. package/src/contract_function_simulator/oracle/interfaces.ts +41 -16
  246. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
  247. package/src/contract_function_simulator/oracle/note_packing_utils.ts +30 -14
  248. package/src/contract_function_simulator/oracle/oracle.ts +88 -43
  249. package/src/contract_function_simulator/oracle/private_execution.ts +2 -68
  250. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +138 -60
  251. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +263 -71
  252. package/src/contract_function_simulator/pick_notes.ts +1 -1
  253. package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
  254. package/src/contract_sync/index.ts +98 -0
  255. package/src/debug/pxe_debug_utils.ts +63 -0
  256. package/src/entrypoints/client/bundle/index.ts +0 -1
  257. package/src/entrypoints/client/bundle/utils.ts +13 -16
  258. package/src/entrypoints/client/lazy/index.ts +0 -1
  259. package/src/entrypoints/client/lazy/utils.ts +14 -17
  260. package/src/entrypoints/pxe_creation_options.ts +6 -2
  261. package/src/entrypoints/server/index.ts +3 -1
  262. package/src/entrypoints/server/utils.ts +27 -49
  263. package/src/error_enriching.ts +7 -15
  264. package/src/events/event_service.ts +73 -0
  265. package/src/events/index.ts +1 -0
  266. package/src/events/private_event_filter_validator.ts +46 -0
  267. package/src/job_coordinator/job_coordinator.ts +150 -0
  268. package/src/logs/log_service.ts +223 -0
  269. package/src/notes/index.ts +1 -0
  270. package/src/notes/note_service.ts +197 -0
  271. package/src/oracle_version.ts +4 -3
  272. package/src/private_kernel/hints/index.ts +1 -1
  273. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +38 -31
  274. package/src/private_kernel/private_kernel_execution_prover.ts +21 -24
  275. package/src/private_kernel/private_kernel_oracle.ts +118 -37
  276. package/src/pxe.ts +273 -315
  277. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
  278. package/src/storage/address_store/index.ts +1 -0
  279. package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +2 -11
  280. package/src/storage/anchor_block_store/index.ts +1 -0
  281. package/src/storage/capsule_store/capsule_store.ts +315 -0
  282. package/src/storage/capsule_store/index.ts +1 -0
  283. package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +45 -20
  284. package/src/storage/contract_store/index.ts +1 -0
  285. package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
  286. package/src/storage/index.ts +7 -7
  287. package/src/storage/note_store/index.ts +2 -0
  288. package/src/storage/note_store/note_store.ts +376 -0
  289. package/src/storage/note_store/stored_note.ts +48 -0
  290. package/src/storage/private_event_store/private_event_store.ts +361 -0
  291. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  292. package/src/storage/tagging_store/index.ts +3 -0
  293. package/src/storage/tagging_store/recipient_tagging_store.ts +129 -0
  294. package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
  295. package/src/storage/tagging_store/sender_tagging_store.ts +345 -0
  296. package/src/tagging/constants.ts +10 -2
  297. package/src/tagging/get_all_logs_by_tags.ts +68 -0
  298. package/src/tagging/index.ts +18 -5
  299. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +143 -0
  300. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
  301. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +49 -0
  302. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +99 -0
  303. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +36 -0
  304. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +84 -0
  305. package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -274
  306. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
  307. package/dest/contract_function_simulator/execution_data_provider.js +0 -14
  308. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  309. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  310. package/dest/contract_function_simulator/proxied_node.js +0 -27
  311. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -122
  312. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
  313. package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
  314. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  315. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  316. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -45
  317. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  318. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  319. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
  320. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  321. package/dest/storage/address_data_provider/index.d.ts +0 -2
  322. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  323. package/dest/storage/address_data_provider/index.js +0 -1
  324. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -25
  325. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  326. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -118
  327. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  328. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  329. package/dest/storage/capsule_data_provider/index.js +0 -1
  330. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  331. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  332. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  333. package/dest/storage/contract_data_provider/index.js +0 -1
  334. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  335. package/dest/storage/note_data_provider/index.d.ts +0 -3
  336. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  337. package/dest/storage/note_data_provider/index.js +0 -2
  338. package/dest/storage/note_data_provider/note_dao.d.ts +0 -100
  339. package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
  340. package/dest/storage/note_data_provider/note_dao.js +0 -102
  341. package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -83
  342. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  343. package/dest/storage/note_data_provider/note_data_provider.js +0 -308
  344. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -43
  345. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  346. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -104
  347. package/dest/storage/sync_data_provider/index.d.ts +0 -2
  348. package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
  349. package/dest/storage/sync_data_provider/index.js +0 -1
  350. package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -10
  351. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
  352. package/dest/storage/tagging_data_provider/index.d.ts +0 -2
  353. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  354. package/dest/storage/tagging_data_provider/index.js +0 -1
  355. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -40
  356. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
  357. package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -89
  358. package/dest/synchronizer/index.d.ts +0 -2
  359. package/dest/synchronizer/index.d.ts.map +0 -1
  360. package/dest/synchronizer/index.js +0 -1
  361. package/dest/synchronizer/synchronizer.d.ts +0 -35
  362. package/dest/synchronizer/synchronizer.d.ts.map +0 -1
  363. package/dest/synchronizer/synchronizer.js +0 -101
  364. package/dest/tagging/siloed_tag.d.ts +0 -14
  365. package/dest/tagging/siloed_tag.d.ts.map +0 -1
  366. package/dest/tagging/siloed_tag.js +0 -20
  367. package/dest/tagging/tag.d.ts +0 -12
  368. package/dest/tagging/tag.d.ts.map +0 -1
  369. package/dest/tagging/tag.js +0 -17
  370. package/dest/tagging/utils.d.ts +0 -18
  371. package/dest/tagging/utils.d.ts.map +0 -1
  372. package/dest/tagging/utils.js +0 -24
  373. package/src/contract_function_simulator/execution_data_provider.ts +0 -343
  374. package/src/contract_function_simulator/proxied_node.ts +0 -33
  375. package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1019
  376. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -132
  377. package/src/storage/address_data_provider/index.ts +0 -1
  378. package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -147
  379. package/src/storage/capsule_data_provider/index.ts +0 -1
  380. package/src/storage/contract_data_provider/index.ts +0 -1
  381. package/src/storage/note_data_provider/index.ts +0 -2
  382. package/src/storage/note_data_provider/note_dao.ts +0 -154
  383. package/src/storage/note_data_provider/note_data_provider.ts +0 -393
  384. package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -148
  385. package/src/storage/sync_data_provider/index.ts +0 -1
  386. package/src/storage/tagging_data_provider/index.ts +0 -1
  387. package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -120
  388. package/src/synchronizer/index.ts +0 -1
  389. package/src/synchronizer/synchronizer.ts +0 -120
  390. package/src/tagging/siloed_tag.ts +0 -22
  391. package/src/tagging/tag.ts +0 -16
  392. package/src/tagging/utils.ts +0 -31
@@ -1,13 +1,8 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
1
  import { type ACVMWitness, type CircuitSimulator } from '@aztec/simulator/client';
3
2
  import { type FunctionArtifact, type FunctionArtifactWithContractName, type FunctionSelector } from '@aztec/stdlib/abi';
4
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { ContractInstance } from '@aztec/stdlib/contract';
6
- import type { AztecNode } from '@aztec/stdlib/interfaces/client';
7
4
  import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
8
- import { BlockHeader, PrivateCallExecutionResult } from '@aztec/stdlib/tx';
9
- import type { UInt64 } from '@aztec/stdlib/types';
10
- import type { ExecutionDataProvider } from '../execution_data_provider.js';
5
+ import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
11
6
  import type { PrivateExecutionOracle } from './private_execution_oracle.js';
12
7
  /**
13
8
  * Execute a private function and return the execution result.
@@ -25,24 +20,4 @@ export declare function executePrivateFunction(simulator: CircuitSimulator, priv
25
20
  * @returns - The public inputs.
26
21
  */
27
22
  export declare function extractPrivateCircuitPublicInputs(artifact: FunctionArtifact, partialWitness: ACVMWitness): PrivateCircuitPublicInputs;
28
- /**
29
- * Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
30
- * from the instance is used.
31
- * @param contractAddress - The address of the contract to read the class id for.
32
- * @param instance - The instance of the contract.
33
- * @param executionDataProvider - The execution data provider.
34
- * @param blockNumber - The block number at which to load the DelayedPublicMutable storing the class id.
35
- * @param timestamp - The timestamp at which to obtain the class id from the DelayedPublicMutable.
36
- * @returns The current class id.
37
- */
38
- export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, executionDataProvider: ExecutionDataProvider | AztecNode, blockNumber: number, timestamp: UInt64): Promise<Fr>;
39
- /**
40
- * Verify that the current class id of a contract obtained from AztecNode is the same as the one in the execution data
41
- * provider (i.e. PXE).
42
- * @param contractAddress - The address of the contract to verify class id for.
43
- * @param executionDataProvider - The execution data provider.
44
- * @param header - The header of the block at which to verify the current class id. If not provided, the anchor block
45
- * header of the execution data provider is used.
46
- */
47
- export declare function verifyCurrentClassId(contractAddress: AztecAddress, executionDataProvider: ExecutionDataProvider, header?: BlockHeader): Promise<void>;
48
- //# sourceMappingURL=private_execution.d.ts.map
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9leGVjdXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb250cmFjdF9mdW5jdGlvbl9zaW11bGF0b3Ivb3JhY2xlL3ByaXZhdGVfZXhlY3V0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sRUFDTCxLQUFLLFdBQVcsRUFDaEIsS0FBSyxnQkFBZ0IsRUFLdEIsTUFBTSx5QkFBeUIsQ0FBQztBQUNqQyxPQUFPLEVBQ0wsS0FBSyxnQkFBZ0IsRUFDckIsS0FBSyxnQ0FBZ0MsRUFDckMsS0FBSyxnQkFBZ0IsRUFFdEIsTUFBTSxtQkFBbUIsQ0FBQztBQUMzQixPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUVsRSxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUc5RCxPQUFPLEtBQUssRUFBRSxzQkFBc0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRTVFOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0Isc0JBQXNCLENBQzFDLFNBQVMsRUFBRSxnQkFBZ0IsRUFDM0Isc0JBQXNCLEVBQUUsc0JBQXNCLEVBQzlDLFFBQVEsRUFBRSxnQ0FBZ0MsRUFDMUMsZUFBZSxFQUFFLFlBQVksRUFDN0IsZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQ2xDLEdBQUcseUNBQThDLEdBQ2hELE9BQU8sQ0FBQywwQkFBMEIsQ0FBQyxDQTJFckM7QUFFRDs7Ozs7R0FLRztBQUNILHdCQUFnQixpQ0FBaUMsQ0FDL0MsUUFBUSxFQUFFLGdCQUFnQixFQUMxQixjQUFjLEVBQUUsV0FBVyxHQUMxQiwwQkFBMEIsQ0FhNUIifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"private_execution.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/private_execution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAI9C,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAKtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,EACrC,KAAK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"","sources":["../../../src/contract_function_simulator/oracle/private_execution.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAKtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,EACrC,KAAK,gBAAgB,EAEtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAG9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,gBAAgB,EAC3B,sBAAsB,EAAE,sBAAsB,EAC9C,QAAQ,EAAE,gCAAgC,EAC1C,eAAe,EAAE,YAAY,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,yCAA8C,GAChD,OAAO,CAAC,0BAA0B,CAAC,CA2ErC;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,EAAE,WAAW,GAC1B,0BAA0B,CAa5B"}
@@ -1,11 +1,9 @@
1
1
  import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, PRIVATE_CONTEXT_INPUTS_LENGTH } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { createLogger } from '@aztec/foundation/log';
4
4
  import { Timer } from '@aztec/foundation/timer';
5
- import { ProtocolContractAddress } from '@aztec/protocol-contracts';
6
5
  import { ExecutionError, extractCallStack, resolveAssertionMessageFromError, witnessMapToFields } from '@aztec/simulator/client';
7
6
  import { countArgumentsSize } from '@aztec/stdlib/abi';
8
- import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
9
7
  import { PrivateCircuitPublicInputs } from '@aztec/stdlib/kernel';
10
8
  import { PrivateCallExecutionResult } from '@aztec/stdlib/tx';
11
9
  import { Oracle } from './oracle.js';
@@ -48,7 +46,6 @@ import { Oracle } from './oracle.js';
48
46
  });
49
47
  const contractClassLogs = privateExecutionOracle.getContractClassLogs();
50
48
  const rawReturnValues = await privateExecutionOracle.privateLoadFromExecutionCache(publicInputs.returnsHash);
51
- const noteHashLeafIndexMap = privateExecutionOracle.getNoteHashLeafIndexMap();
52
49
  const newNotes = privateExecutionOracle.getNewNotes();
53
50
  const noteHashNullifierCounterMap = privateExecutionOracle.getNoteHashNullifierCounterMap();
54
51
  const offchainEffects = privateExecutionOracle.getOffchainEffects();
@@ -62,7 +59,7 @@ import { Oracle } from './oracle.js';
62
59
  timerSubtractionList = timerSubtractionList.flatMap((nested)=>nested.nestedExecutionResults ?? []);
63
60
  }
64
61
  log.debug(`Returning from call to ${contractAddress.toString()}:${functionSelector}`);
65
- return new PrivateCallExecutionResult(artifact.bytecode, Buffer.from(artifact.verificationKey, 'base64'), partialWitness, publicInputs, noteHashLeafIndexMap, newNotes, noteHashNullifierCounterMap, rawReturnValues, offchainEffects, preTags, nestedExecutionResults, contractClassLogs, {
62
+ return new PrivateCallExecutionResult(artifact.bytecode, Buffer.from(artifact.verificationKey, 'base64'), partialWitness, publicInputs, newNotes, noteHashNullifierCounterMap, rawReturnValues, offchainEffects, preTags, nestedExecutionResults, contractClassLogs, {
66
63
  timings: {
67
64
  witgen: witgenTime,
68
65
  oracles: acirExecutionResult.oracles
@@ -88,36 +85,3 @@ import { Oracle } from './oracle.js';
88
85
  }
89
86
  return PrivateCircuitPublicInputs.fromFields(returnData);
90
87
  }
91
- /**
92
- * Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
93
- * from the instance is used.
94
- * @param contractAddress - The address of the contract to read the class id for.
95
- * @param instance - The instance of the contract.
96
- * @param executionDataProvider - The execution data provider.
97
- * @param blockNumber - The block number at which to load the DelayedPublicMutable storing the class id.
98
- * @param timestamp - The timestamp at which to obtain the class id from the DelayedPublicMutable.
99
- * @returns The current class id.
100
- */ export async function readCurrentClassId(contractAddress, instance, executionDataProvider, blockNumber, timestamp) {
101
- const { delayedPublicMutableSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
102
- const delayedPublicMutableValues = await DelayedPublicMutableValues.readFromTree(delayedPublicMutableSlot, (slot)=>executionDataProvider.getPublicStorageAt(blockNumber, ProtocolContractAddress.ContractInstanceRegistry, slot));
103
- let currentClassId = delayedPublicMutableValues.svc.getCurrentAt(timestamp)[0];
104
- if (currentClassId.isZero()) {
105
- currentClassId = instance.originalContractClassId;
106
- }
107
- return currentClassId;
108
- }
109
- /**
110
- * Verify that the current class id of a contract obtained from AztecNode is the same as the one in the execution data
111
- * provider (i.e. PXE).
112
- * @param contractAddress - The address of the contract to verify class id for.
113
- * @param executionDataProvider - The execution data provider.
114
- * @param header - The header of the block at which to verify the current class id. If not provided, the anchor block
115
- * header of the execution data provider is used.
116
- */ export async function verifyCurrentClassId(contractAddress, executionDataProvider, header) {
117
- header = header ?? await executionDataProvider.getAnchorBlockHeader();
118
- const instance = await executionDataProvider.getContractInstance(contractAddress);
119
- const currentClassId = await readCurrentClassId(contractAddress, instance, executionDataProvider, header.globalVariables.blockNumber, header.globalVariables.timestamp);
120
- if (!instance.currentContractClassId.equals(currentClassId)) {
121
- throw new Error(`Contract ${contractAddress} is outdated, current class id is ${currentClassId}, local class id is ${instance.currentContractClassId}`);
122
- }
123
- }
@@ -1,14 +1,24 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { KeyStore } from '@aztec/key-store';
2
3
  import { type CircuitSimulator } from '@aztec/simulator/client';
3
- import { type FunctionAbi, FunctionSelector, type NoteSelector } from '@aztec/stdlib/abi';
4
+ import { type FunctionAbi, type FunctionCall, FunctionSelector, type NoteSelector } from '@aztec/stdlib/abi';
4
5
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
5
6
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
7
+ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
6
8
  import { PrivateContextInputs } from '@aztec/stdlib/kernel';
7
- import type { ContractClassLog, PreTag } from '@aztec/stdlib/logs';
9
+ import { type ContractClassLog, type PreTag } from '@aztec/stdlib/logs';
10
+ import { Tag } from '@aztec/stdlib/logs';
8
11
  import { type NoteStatus } from '@aztec/stdlib/note';
9
12
  import { type BlockHeader, CallContext, Capsule, CountedContractClassLog, NoteAndSlot, PrivateCallExecutionResult, type TxContext } from '@aztec/stdlib/tx';
10
- import { Tag } from '../../tagging/tag.js';
11
- import type { ExecutionDataProvider } from '../execution_data_provider.js';
13
+ import type { AddressStore } from '../../storage/address_store/address_store.js';
14
+ import type { AnchorBlockStore } from '../../storage/anchor_block_store/anchor_block_store.js';
15
+ import type { CapsuleStore } from '../../storage/capsule_store/capsule_store.js';
16
+ import type { ContractStore } from '../../storage/contract_store/contract_store.js';
17
+ import type { NoteStore } from '../../storage/note_store/note_store.js';
18
+ import type { PrivateEventStore } from '../../storage/private_event_store/private_event_store.js';
19
+ import type { RecipientTaggingStore } from '../../storage/tagging_store/recipient_tagging_store.js';
20
+ import type { SenderAddressBookStore } from '../../storage/tagging_store/sender_address_book_store.js';
21
+ import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagging_store.js';
12
22
  import type { ExecutionNoteCache } from '../execution_note_cache.js';
13
23
  import { ExecutionTaggingIndexCache } from '../execution_tagging_index_cache.js';
14
24
  import type { HashedValuesCache } from '../hashed_values_cache.js';
@@ -24,9 +34,12 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
24
34
  private readonly callContext;
25
35
  /** Header of a block whose state is used during private execution (not the block the transaction is included in). */
26
36
  protected readonly anchorBlockHeader: BlockHeader;
37
+ /** Needed to trigger contract synchronization before nested calls */
38
+ private readonly utilityExecutor;
27
39
  private readonly executionCache;
28
40
  private readonly noteCache;
29
41
  private readonly taggingIndexCache;
42
+ private readonly senderTaggingStore;
30
43
  private totalPublicCalldataCount;
31
44
  protected sideEffectCounter: number;
32
45
  private senderForTags?;
@@ -41,16 +54,6 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
41
54
  * Users can also use this to get a clearer idea of what's happened during a simulation.
42
55
  */
43
56
  private newNotes;
44
- /**
45
- * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
46
- * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
47
- * It maps from siloed note hash to the index for notes created by public functions.
48
- *
49
- * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
50
- * because these notes are meant to be maintained on a per-call basis
51
- * They should act as references for the read requests output by an app circuit via public inputs.
52
- */
53
- private noteHashLeafIndexMap;
54
57
  private noteHashNullifierCounterMap;
55
58
  private contractClassLogs;
56
59
  private offchainEffects;
@@ -58,8 +61,10 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
58
61
  constructor(argsHash: Fr, txContext: TxContext, callContext: CallContext,
59
62
  /** Header of a block whose state is used during private execution (not the block the transaction is included in). */
60
63
  anchorBlockHeader: BlockHeader,
64
+ /** Needed to trigger contract synchronization before nested calls */
65
+ utilityExecutor: (call: FunctionCall) => Promise<void>,
61
66
  /** List of transient auth witnesses to be used during this simulation */
62
- authWitnesses: AuthWitness[], capsules: Capsule[], executionCache: HashedValuesCache, noteCache: ExecutionNoteCache, taggingIndexCache: ExecutionTaggingIndexCache, executionDataProvider: ExecutionDataProvider, totalPublicCalldataCount?: number, sideEffectCounter?: number, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[], senderForTags?: AztecAddress | undefined, simulator?: CircuitSimulator | undefined);
67
+ authWitnesses: AuthWitness[], capsules: Capsule[], executionCache: HashedValuesCache, noteCache: ExecutionNoteCache, taggingIndexCache: ExecutionTaggingIndexCache, contractStore: ContractStore, noteStore: NoteStore, keyStore: KeyStore, addressStore: AddressStore, aztecNode: AztecNode, anchorBlockStore: AnchorBlockStore, senderTaggingStore: SenderTaggingStore, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, capsuleStore: CapsuleStore, privateEventStore: PrivateEventStore, jobId: string, totalPublicCalldataCount?: number, sideEffectCounter?: number, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[], senderForTags?: AztecAddress | undefined, simulator?: CircuitSimulator | undefined);
63
68
  getPrivateContextInputs(): PrivateContextInputs;
64
69
  /**
65
70
  * Writes the function inputs to the initial witness.
@@ -67,11 +72,6 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
67
72
  * @returns The initial witness.
68
73
  */
69
74
  getInitialWitness(abi: FunctionAbi): Map<number, string>;
70
- /**
71
- * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
72
- * regarding which note hash each settled read request corresponds to.
73
- */
74
- getNoteHashLeafIndexMap(): Map<bigint, bigint>;
75
75
  /**
76
76
  * Get the data for the newly created notes.
77
77
  */
@@ -88,7 +88,7 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
88
88
  data: Fr[];
89
89
  }[];
90
90
  /**
91
- * Returns the pre tags that were used in this execution (and that need to be stored in the db).
91
+ * Returns the pre-tags that were used in this execution (and that need to be stored in the db).
92
92
  */
93
93
  getUsedPreTags(): PreTag[];
94
94
  /**
@@ -146,6 +146,7 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
146
146
  * Real notes coming from DB will have a leafIndex which
147
147
  * represents their index in the note hash tree.
148
148
  *
149
+ * @param owner - The owner of the notes. If undefined, returns notes for all owners.
149
150
  * @param storageSlot - The storage slot.
150
151
  * @param numSelects - The number of valid selects in selectBy and selectValues.
151
152
  * @param selectBy - An array of indices of the fields to selects.
@@ -158,18 +159,19 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
158
159
  * @param status - The status of notes to fetch.
159
160
  * @returns Array of note data.
160
161
  */
161
- utilityGetNotes(storageSlot: Fr, numSelects: number, selectByIndexes: number[], selectByOffsets: number[], selectByLengths: number[], selectValues: Fr[], selectComparators: number[], sortByIndexes: number[], sortByOffsets: number[], sortByLengths: number[], sortOrder: number[], limit: number, offset: number, status: NoteStatus): Promise<NoteData[]>;
162
+ utilityGetNotes(owner: AztecAddress | undefined, storageSlot: Fr, numSelects: number, selectByIndexes: number[], selectByOffsets: number[], selectByLengths: number[], selectValues: Fr[], selectComparators: number[], sortByIndexes: number[], sortByOffsets: number[], sortByLengths: number[], sortOrder: number[], limit: number, offset: number, status: NoteStatus): Promise<NoteData[]>;
162
163
  /**
163
164
  * Keep track of the new note created during execution.
164
165
  * It can be used in subsequent calls (or transactions when chaining txs is possible).
165
- * @param contractAddress - The contract address.
166
+ * @param owner - The owner of the note.
166
167
  * @param storageSlot - The storage slot.
168
+ * @param randomness - The randomness injected into the note.
167
169
  * @param noteTypeId - The type ID of the note.
168
170
  * @param noteItems - The items to be included in a Note.
169
171
  * @param noteHash - A hash of the new note.
170
172
  * @returns
171
173
  */
172
- privateNotifyCreatedNote(storageSlot: Fr, noteTypeId: NoteSelector, noteItems: Fr[], noteHash: Fr, counter: number): void;
174
+ privateNotifyCreatedNote(owner: AztecAddress, storageSlot: Fr, randomness: Fr, noteTypeId: NoteSelector, noteItems: Fr[], noteHash: Fr, counter: number): void;
173
175
  /**
174
176
  * Adding a siloed nullifier into the current set of all pending nullifiers created
175
177
  * within the current transaction/execution.
@@ -184,6 +186,14 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
184
186
  * @param noteHash - A hash of the new note.
185
187
  */
186
188
  privateNotifyCreatedNullifier(innerNullifier: Fr): Promise<void>;
189
+ /**
190
+ * Check if a nullifier has been emitted in the same transaction, i.e. if privateNotifyCreatedNullifier has been
191
+ * called for this inner nullifier from the contract with the specified address.
192
+ * @param innerNullifier - The inner nullifier to check.
193
+ * @param contractAddress - Address of the contract that emitted the nullifier.
194
+ * @returns A boolean indicating whether the nullifier is pending or not.
195
+ */
196
+ privateIsNullifierPending(innerNullifier: Fr, contractAddress: AztecAddress): Promise<boolean>;
187
197
  /**
188
198
  * Emit a contract class log.
189
199
  * This fn exists because we only carry a poseidon hash through the kernels, and need to
@@ -222,15 +232,9 @@ export declare class PrivateExecutionOracle extends UtilityExecutionOracle imple
222
232
  */
223
233
  privateNotifySetPublicTeardownFunctionCall(_targetContractAddress: AztecAddress, calldataHash: Fr, _sideEffectCounter: number, _isStaticCall: boolean): Promise<void>;
224
234
  privateNotifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
225
- /**
226
- * Derives the call context for a nested execution.
227
- * @param targetContractAddress - The address of the contract being called.
228
- * @param targetArtifact - The artifact of the function being called.
229
- * @param isStaticCall - Whether the call is a static call.
230
- * @returns The derived call context.
231
- */
235
+ privateIsSideEffectCounterRevertible(sideEffectCounter: number): Promise<boolean>;
232
236
  private deriveCallContext;
233
237
  getDebugFunctionName(): Promise<string>;
234
238
  utilityEmitOffchainEffect(data: Fr[]): Promise<void>;
235
239
  }
236
- //# sourceMappingURL=private_execution_oracle.d.ts.map
240
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9leGVjdXRpb25fb3JhY2xlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29udHJhY3RfZnVuY3Rpb25fc2ltdWxhdG9yL29yYWNsZS9wcml2YXRlX2V4ZWN1dGlvbl9vcmFjbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBR3BELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2pELE9BQU8sRUFBRSxLQUFLLGdCQUFnQixFQUFpQixNQUFNLHlCQUF5Qix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FFLEVBQUUsRUFDaEIsa0JBQWtCLEVBQUUsTUFBTSxFQUMxQixhQUFhLEVBQUUsT0FBTyxpQkFJdkI7SUFFTSw4Q0FBOEMsQ0FBQyw4QkFBOEIsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUUzRztJQUVNLG9DQUFvQyxDQUFDLGlCQUFpQixFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLENBRXZGO1lBU2EsaUJBQWlCO0lBYXhCLG9CQUFvQixvQkFFMUI7SUFFTSx5QkFBeUIsQ0FBQyxJQUFJLEVBQUUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUcxRDtDQUNGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"private_execution_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/private_execution_oracle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,KAAK,WAAW,EAEhB,gBAAgB,EAChB,KAAK,YAAY,EAElB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAA+B,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,WAAW,EACX,0BAA0B,EAC1B,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE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;;;;;OAMG;IACI,0CAA0C,CAC/C,sBAAsB,EAAE,YAAY,EACpC,YAAY,EAAE,EAAE,EAChB,kBAAkB,EAAE,MAAM,EAC1B,aAAa,EAAE,OAAO;IAMjB,8CAA8C,CAAC,8BAA8B,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5G;;;;;;OAMG;YACW,iBAAiB;IAaxB,oBAAoB;IAIpB,yBAAyB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAI5D"}
1
+ {"version":3,"file":"private_execution_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/private_execution_oracle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,YAAY,EACjB,gBAAgB,EAChB,KAAK,YAAY,EAElB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,gBAAgB,EAA+B,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,KAAK,WAAW,EAChB,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,WAAW,EACX,0BAA0B,EAC1B,KAAK,SAAS,EAC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A8C,CAAC,8BAA8B,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3G;IAEM,oCAAoC,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEvF;YASa,iBAAiB;IAaxB,oBAAoB,oBAE1B;IAEM,yBAAyB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1D;CACF"}
@@ -1,16 +1,20 @@
1
1
  import { MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS, PRIVATE_CONTEXT_INPUTS_LENGTH } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { createLogger } from '@aztec/foundation/log';
4
4
  import { Timer } from '@aztec/foundation/timer';
5
5
  import { toACVMWitness } from '@aztec/simulator/client';
6
6
  import { FunctionSelector, countArgumentsSize } from '@aztec/stdlib/abi';
7
- import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
7
+ import { siloNullifier } from '@aztec/stdlib/hash';
8
8
  import { PrivateContextInputs } from '@aztec/stdlib/kernel';
9
+ import { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
10
+ import { Tag } from '@aztec/stdlib/logs';
9
11
  import { Note } from '@aztec/stdlib/note';
10
12
  import { CallContext, CountedContractClassLog, NoteAndSlot } from '@aztec/stdlib/tx';
11
- import { Tag } from '../../tagging/tag.js';
13
+ import { ensureContractSynced } from '../../contract_sync/index.js';
14
+ import { NoteService } from '../../notes/note_service.js';
15
+ import { syncSenderTaggingIndexes } from '../../tagging/index.js';
12
16
  import { pickNotes } from '../pick_notes.js';
13
- import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
17
+ import { executePrivateFunction } from './private_execution.js';
14
18
  import { UtilityExecutionOracle } from './utility_execution_oracle.js';
15
19
  /**
16
20
  * The execution oracle for the private part of a transaction.
@@ -19,9 +23,11 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
19
23
  txContext;
20
24
  callContext;
21
25
  anchorBlockHeader;
26
+ utilityExecutor;
22
27
  executionCache;
23
28
  noteCache;
24
29
  taggingIndexCache;
30
+ senderTaggingStore;
25
31
  totalPublicCalldataCount;
26
32
  sideEffectCounter;
27
33
  senderForTags;
@@ -35,21 +41,12 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
35
41
  * This information is only for references (currently used for tests), and is not used for any sort of constrains.
36
42
  * Users can also use this to get a clearer idea of what's happened during a simulation.
37
43
  */ newNotes;
38
- /**
39
- * Notes from previous transactions that are returned to the oracle call `getNotes` during this execution.
40
- * The mapping maps from the unique siloed note hash to the index for notes created in private executions.
41
- * It maps from siloed note hash to the index for notes created by public functions.
42
- *
43
- * They are not part of the ExecutionNoteCache and being forwarded to nested contexts via `extend()`
44
- * because these notes are meant to be maintained on a per-call basis
45
- * They should act as references for the read requests output by an app circuit via public inputs.
46
- */ noteHashLeafIndexMap;
47
44
  noteHashNullifierCounterMap;
48
45
  contractClassLogs;
49
46
  offchainEffects;
50
47
  nestedExecutionResults;
51
- constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ anchorBlockHeader, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionCache, noteCache, taggingIndexCache, executionDataProvider, totalPublicCalldataCount = 0, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes, senderForTags, simulator){
52
- super(callContext.contractAddress, authWitnesses, capsules, executionDataProvider, log, scopes), this.argsHash = argsHash, this.txContext = txContext, this.callContext = callContext, this.anchorBlockHeader = anchorBlockHeader, this.executionCache = executionCache, this.noteCache = noteCache, this.taggingIndexCache = taggingIndexCache, this.totalPublicCalldataCount = totalPublicCalldataCount, this.sideEffectCounter = sideEffectCounter, this.senderForTags = senderForTags, this.simulator = simulator, this.isPrivate = true, this.newNotes = [], this.noteHashLeafIndexMap = new Map(), this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.offchainEffects = [], this.nestedExecutionResults = [];
48
+ constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ anchorBlockHeader, /** Needed to trigger contract synchronization before nested calls */ utilityExecutor, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionCache, noteCache, taggingIndexCache, contractStore, noteStore, keyStore, addressStore, aztecNode, anchorBlockStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobId, totalPublicCalldataCount = 0, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes, senderForTags, simulator){
49
+ super(callContext.contractAddress, authWitnesses, capsules, anchorBlockHeader, contractStore, noteStore, keyStore, addressStore, aztecNode, anchorBlockStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobId, log, scopes), this.argsHash = argsHash, this.txContext = txContext, this.callContext = callContext, this.anchorBlockHeader = anchorBlockHeader, this.utilityExecutor = utilityExecutor, this.executionCache = executionCache, this.noteCache = noteCache, this.taggingIndexCache = taggingIndexCache, this.senderTaggingStore = senderTaggingStore, this.totalPublicCalldataCount = totalPublicCalldataCount, this.sideEffectCounter = sideEffectCounter, this.senderForTags = senderForTags, this.simulator = simulator, this.isPrivate = true, this.newNotes = [], this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.offchainEffects = [], this.nestedExecutionResults = [];
53
50
  }
54
51
  getPrivateContextInputs() {
55
52
  return new PrivateContextInputs(this.callContext, this.anchorBlockHeader, this.txContext, this.sideEffectCounter);
@@ -77,12 +74,6 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
77
74
  return toACVMWitness(0, fields);
78
75
  }
79
76
  /**
80
- * The KernelProver will use this to fully populate witnesses and provide hints to the kernel circuit
81
- * regarding which note hash each settled read request corresponds to.
82
- */ getNoteHashLeafIndexMap() {
83
- return this.noteHashLeafIndexMap;
84
- }
85
- /**
86
77
  * Get the data for the newly created notes.
87
78
  */ getNewNotes() {
88
79
  return this.newNotes;
@@ -101,7 +92,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
101
92
  return this.offchainEffects;
102
93
  }
103
94
  /**
104
- * Returns the pre tags that were used in this execution (and that need to be stored in the db).
95
+ * Returns the pre-tags that were used in this execution (and that need to be stored in the db).
105
96
  */ getUsedPreTags() {
106
97
  return this.taggingIndexCache.getUsedPreTags();
107
98
  }
@@ -142,7 +133,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
142
133
  * @param recipient - The address receiving the log
143
134
  * @returns An app tag to be used in a log.
144
135
  */ async privateGetNextAppTagAsSender(sender, recipient) {
145
- const secret = await this.executionDataProvider.calculateDirectionalAppTaggingSecret(this.contractAddress, sender, recipient);
136
+ const secret = await this.#calculateDirectionalAppTaggingSecret(this.contractAddress, sender, recipient);
146
137
  const index = await this.#getIndexToUseForSecret(secret);
147
138
  this.log.debug(`Incrementing tagging index for sender: ${sender}, recipient: ${recipient}, contract: ${this.contractAddress} to ${index}`);
148
139
  this.taggingIndexCache.setLastUsedIndex(secret, index);
@@ -151,6 +142,11 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
151
142
  index
152
143
  });
153
144
  }
145
+ async #calculateDirectionalAppTaggingSecret(contractAddress, sender, recipient) {
146
+ const senderCompleteAddress = await this.getCompleteAddress(sender);
147
+ const senderIvsk = await this.keyStore.getMasterIncomingViewingSecretKey(sender);
148
+ return DirectionalAppTaggingSecret.compute(senderCompleteAddress, senderIvsk, recipient, contractAddress, recipient);
149
+ }
154
150
  async #getIndexToUseForSecret(secret) {
155
151
  // If we have the tagging index in the cache, we use it. If not we obtain it from the execution data provider.
156
152
  const lastUsedIndexInTx = this.taggingIndexCache.getLastUsedIndex(secret);
@@ -160,8 +156,8 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
160
156
  // This is a tagging secret we've not yet used in this tx, so first sync our store to make sure its indices
161
157
  // are up to date. We do this here because this store is not synced as part of the global sync because
162
158
  // that'd be wasteful as most tagging secrets are not used in each tx.
163
- await this.executionDataProvider.syncTaggedLogsAsSender(secret, this.contractAddress);
164
- const lastUsedIndex = await this.executionDataProvider.getLastUsedIndexAsSender(secret);
159
+ await syncSenderTaggingIndexes(secret, this.contractAddress, this.aztecNode, this.senderTaggingStore, await this.anchorBlockHeader.hash(), this.jobId);
160
+ const lastUsedIndex = await this.senderTaggingStore.getLastUsedIndex(secret, this.jobId);
165
161
  // If lastUsedIndex is undefined, we've never used this secret, so start from 0
166
162
  // Otherwise, the next index to use is one past the last used index
167
163
  return lastUsedIndex === undefined ? 0 : lastUsedIndex + 1;
@@ -203,6 +199,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
203
199
  * Real notes coming from DB will have a leafIndex which
204
200
  * represents their index in the note hash tree.
205
201
  *
202
+ * @param owner - The owner of the notes. If undefined, returns notes for all owners.
206
203
  * @param storageSlot - The storage slot.
207
204
  * @param numSelects - The number of valid selects in selectBy and selectValues.
208
205
  * @param selectBy - An array of indices of the fields to selects.
@@ -214,11 +211,12 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
214
211
  * @param offset - The starting index for pagination.
215
212
  * @param status - The status of notes to fetch.
216
213
  * @returns Array of note data.
217
- */ async utilityGetNotes(storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
214
+ */ async utilityGetNotes(owner, storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
218
215
  // Nullified pending notes are already removed from the list.
219
- const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, storageSlot);
216
+ const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, owner, storageSlot);
220
217
  const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
221
- const dbNotes = await this.executionDataProvider.getNotes(this.callContext.contractAddress, storageSlot, status, this.scopes);
218
+ const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore, this.jobId);
219
+ const dbNotes = await noteService.getNotes(this.callContext.contractAddress, owner, storageSlot, status, this.scopes);
222
220
  const dbNotesFiltered = dbNotes.filter((n)=>!pendingNullifiers.has(n.siloedNullifier.value));
223
221
  const notes = pickNotes([
224
222
  ...dbNotesFiltered,
@@ -245,47 +243,44 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
245
243
  offset
246
244
  });
247
245
  this.log.debug(`Returning ${notes.length} notes for ${this.callContext.contractAddress} at ${storageSlot}: ${notes.map((n)=>`${n.noteNonce.toString()}:[${n.note.items.map((i)=>i.toString()).join(',')}]`).join(', ')}`);
248
- const noteHashesAndIndexes = await Promise.all(notes.map(async (n)=>{
249
- if (n.index !== undefined) {
250
- const siloedNoteHash = await siloNoteHash(n.contractAddress, n.noteHash);
251
- const uniqueNoteHash = await computeUniqueNoteHash(n.noteNonce, siloedNoteHash);
252
- return {
253
- hash: uniqueNoteHash,
254
- index: n.index
255
- };
256
- }
257
- }));
258
- noteHashesAndIndexes.filter((n)=>n !== undefined).forEach((n)=>{
259
- this.noteHashLeafIndexMap.set(n.hash.toBigInt(), n.index);
260
- });
261
246
  return notes;
262
247
  }
263
248
  /**
264
249
  * Keep track of the new note created during execution.
265
250
  * It can be used in subsequent calls (or transactions when chaining txs is possible).
266
- * @param contractAddress - The contract address.
251
+ * @param owner - The owner of the note.
267
252
  * @param storageSlot - The storage slot.
253
+ * @param randomness - The randomness injected into the note.
268
254
  * @param noteTypeId - The type ID of the note.
269
255
  * @param noteItems - The items to be included in a Note.
270
256
  * @param noteHash - A hash of the new note.
271
257
  * @returns
272
- */ privateNotifyCreatedNote(storageSlot, noteTypeId, noteItems, noteHash, counter) {
258
+ */ privateNotifyCreatedNote(owner, storageSlot, randomness, noteTypeId, noteItems, noteHash, counter) {
273
259
  this.log.debug(`Notified of new note with inner hash ${noteHash}`, {
274
260
  contractAddress: this.callContext.contractAddress,
275
261
  storageSlot,
262
+ randomness,
276
263
  noteTypeId,
277
264
  counter
278
265
  });
279
266
  const note = new Note(noteItems);
280
267
  this.noteCache.addNewNote({
281
268
  contractAddress: this.callContext.contractAddress,
269
+ owner,
282
270
  storageSlot,
271
+ randomness,
283
272
  noteNonce: Fr.ZERO,
284
273
  note,
285
274
  siloedNullifier: undefined,
286
- noteHash
275
+ noteHash,
276
+ isPending: true
287
277
  }, counter);
288
- this.newNotes.push(new NoteAndSlot(note, storageSlot, noteTypeId));
278
+ this.newNotes.push(NoteAndSlot.from({
279
+ note,
280
+ storageSlot,
281
+ randomness,
282
+ noteTypeId
283
+ }));
289
284
  }
290
285
  /**
291
286
  * Adding a siloed nullifier into the current set of all pending nullifiers created
@@ -310,6 +305,17 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
310
305
  return this.noteCache.nullifierCreated(this.callContext.contractAddress, innerNullifier);
311
306
  }
312
307
  /**
308
+ * Check if a nullifier has been emitted in the same transaction, i.e. if privateNotifyCreatedNullifier has been
309
+ * called for this inner nullifier from the contract with the specified address.
310
+ * @param innerNullifier - The inner nullifier to check.
311
+ * @param contractAddress - Address of the contract that emitted the nullifier.
312
+ * @returns A boolean indicating whether the nullifier is pending or not.
313
+ */ async privateIsNullifierPending(innerNullifier, contractAddress) {
314
+ const siloedNullifier = await siloNullifier(contractAddress, innerNullifier);
315
+ const isNullifierPending = this.noteCache.getNullifiers(contractAddress).has(siloedNullifier.toBigInt());
316
+ return Promise.resolve(isNullifierPending);
317
+ }
318
+ /**
313
319
  * Emit a contract class log.
314
320
  * This fn exists because we only carry a poseidon hash through the kernels, and need to
315
321
  * keep the preimage in ts for later.
@@ -342,11 +348,11 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
342
348
  const simulatorSetupTimer = new Timer();
343
349
  this.log.debug(`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`);
344
350
  isStaticCall = isStaticCall || this.callContext.isStaticCall;
345
- await verifyCurrentClassId(targetContractAddress, this.executionDataProvider, this.anchorBlockHeader);
346
- const targetArtifact = await this.executionDataProvider.getFunctionArtifact(targetContractAddress, functionSelector);
351
+ await ensureContractSynced(targetContractAddress, functionSelector, this.utilityExecutor, this.aztecNode, this.contractStore, this.anchorBlockHeader);
352
+ const targetArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(targetContractAddress, functionSelector);
347
353
  const derivedTxContext = this.txContext.clone();
348
354
  const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
349
- const privateExecutionOracle = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.anchorBlockHeader, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.taggingIndexCache, this.executionDataProvider, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes, this.senderForTags, this.simulator);
355
+ const privateExecutionOracle = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.anchorBlockHeader, this.utilityExecutor, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.taggingIndexCache, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.aztecNode, this.anchorBlockStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.jobId, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes, this.senderForTags, this.simulator);
350
356
  const setupTime = simulatorSetupTimer.ms();
351
357
  const childExecutionResult = await executePrivateFunction(this.simulator, privateExecutionOracle, targetArtifact, targetContractAddress, functionSelector);
352
358
  if (isStaticCall) {
@@ -396,6 +402,9 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
396
402
  privateNotifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter) {
397
403
  return this.noteCache.setMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter);
398
404
  }
405
+ privateIsSideEffectCounterRevertible(sideEffectCounter) {
406
+ return Promise.resolve(this.noteCache.isSideEffectCounterRevertible(sideEffectCounter));
407
+ }
399
408
  /**
400
409
  * Derives the call context for a nested execution.
401
410
  * @param targetContractAddress - The address of the contract being called.
@@ -406,7 +415,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
406
415
  return new CallContext(this.contractAddress, targetContractAddress, await FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters), isStaticCall);
407
416
  }
408
417
  getDebugFunctionName() {
409
- return this.executionDataProvider.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
418
+ return this.contractStore.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
410
419
  }
411
420
  utilityEmitOffchainEffect(data) {
412
421
  this.offchainEffects.push({