@aztec/pxe 0.0.1-commit.03f7ef2 → 0.0.1-commit.08c5969dc

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 (337) hide show
  1. package/dest/bin/check_oracle_version.js +1 -1
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +17 -11
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  4. package/dest/block_synchronizer/block_synchronizer.js +80 -34
  5. package/dest/config/index.d.ts +3 -1
  6. package/dest/config/index.d.ts.map +1 -1
  7. package/dest/config/index.js +17 -0
  8. package/dest/config/package_info.js +1 -1
  9. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  10. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  11. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  12. package/dest/contract_function_simulator/contract_function_simulator.d.ts +64 -40
  13. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/contract_function_simulator.js +204 -84
  15. package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
  16. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/execution_note_cache.js +45 -28
  18. package/dest/contract_function_simulator/index.d.ts +2 -2
  19. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/index.js +1 -1
  21. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
  22. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +6 -3
  24. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
  25. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  26. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  27. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  29. package/dest/contract_function_simulator/oracle/interfaces.d.ts +17 -13
  30. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
  32. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  33. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
  34. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
  36. package/dest/contract_function_simulator/oracle/oracle.d.ts +12 -10
  37. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  38. package/dest/contract_function_simulator/oracle/oracle.js +67 -44
  39. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
  40. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/oracle/private_execution.js +1 -37
  42. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +45 -46
  43. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  44. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +96 -56
  45. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +81 -48
  46. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  47. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +142 -118
  48. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  49. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  50. package/dest/contract_function_simulator/proxied_contract_data_source.js +5 -5
  51. package/dest/contract_sync/contract_sync_service.d.ts +42 -0
  52. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  53. package/dest/contract_sync/contract_sync_service.js +97 -0
  54. package/dest/contract_sync/helpers.d.ts +28 -0
  55. package/dest/contract_sync/helpers.d.ts.map +1 -0
  56. package/dest/contract_sync/helpers.js +55 -0
  57. package/dest/debug/pxe_debug_utils.d.ts +24 -11
  58. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  59. package/dest/debug/pxe_debug_utils.js +30 -19
  60. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  61. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  62. package/dest/entrypoints/client/bundle/utils.js +31 -8
  63. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  64. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  65. package/dest/entrypoints/client/lazy/utils.js +32 -9
  66. package/dest/entrypoints/pxe_creation_options.d.ts +5 -3
  67. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  68. package/dest/entrypoints/server/index.d.ts +3 -1
  69. package/dest/entrypoints/server/index.d.ts.map +1 -1
  70. package/dest/entrypoints/server/index.js +2 -0
  71. package/dest/entrypoints/server/utils.d.ts +1 -1
  72. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  73. package/dest/entrypoints/server/utils.js +39 -16
  74. package/dest/error_enriching.d.ts +4 -4
  75. package/dest/error_enriching.d.ts.map +1 -1
  76. package/dest/error_enriching.js +6 -6
  77. package/dest/events/event_service.d.ts +8 -8
  78. package/dest/events/event_service.d.ts.map +1 -1
  79. package/dest/events/event_service.js +21 -24
  80. package/dest/events/private_event_filter_validator.d.ts +6 -6
  81. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  82. package/dest/events/private_event_filter_validator.js +5 -6
  83. package/dest/job_coordinator/job_coordinator.d.ts +75 -0
  84. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  85. package/dest/job_coordinator/job_coordinator.js +94 -0
  86. package/dest/logs/log_service.d.ts +17 -32
  87. package/dest/logs/log_service.d.ts.map +1 -1
  88. package/dest/logs/log_service.js +76 -197
  89. package/dest/notes/note_service.d.ts +10 -10
  90. package/dest/notes/note_service.d.ts.map +1 -1
  91. package/dest/notes/note_service.js +39 -44
  92. package/dest/oracle_version.d.ts +3 -3
  93. package/dest/oracle_version.d.ts.map +1 -1
  94. package/dest/oracle_version.js +4 -3
  95. package/dest/private_kernel/hints/index.d.ts +2 -2
  96. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  97. package/dest/private_kernel/hints/index.js +1 -1
  98. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
  99. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  100. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +13 -7
  101. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  102. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  103. package/dest/private_kernel/private_kernel_execution_prover.js +6 -7
  104. package/dest/private_kernel/private_kernel_oracle.d.ts +24 -28
  105. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  106. package/dest/private_kernel/private_kernel_oracle.js +90 -2
  107. package/dest/pxe.d.ts +84 -66
  108. package/dest/pxe.d.ts.map +1 -1
  109. package/dest/pxe.js +186 -174
  110. package/dest/storage/address_store/address_store.d.ts +11 -0
  111. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  112. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +13 -12
  113. package/dest/storage/address_store/index.d.ts +2 -0
  114. package/dest/storage/address_store/index.d.ts.map +1 -0
  115. package/dest/storage/address_store/index.js +1 -0
  116. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +17 -0
  117. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  118. package/dest/storage/{anchor_block_data_provider/anchor_block_data_provider.js → anchor_block_store/anchor_block_store.js} +9 -2
  119. package/dest/storage/anchor_block_store/index.d.ts +2 -0
  120. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  121. package/dest/storage/anchor_block_store/index.js +1 -0
  122. package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
  123. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  124. package/dest/storage/capsule_store/capsule_store.js +253 -0
  125. package/dest/storage/capsule_store/index.d.ts +2 -0
  126. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  127. package/dest/storage/capsule_store/index.js +1 -0
  128. package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +3 -3
  129. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  130. package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +29 -20
  131. package/dest/storage/contract_store/index.d.ts +2 -0
  132. package/dest/storage/contract_store/index.d.ts.map +1 -0
  133. package/dest/storage/contract_store/index.js +1 -0
  134. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  135. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  136. package/dest/storage/index.d.ts +8 -8
  137. package/dest/storage/index.d.ts.map +1 -1
  138. package/dest/storage/index.js +7 -7
  139. package/dest/storage/metadata.d.ts +1 -1
  140. package/dest/storage/metadata.js +1 -1
  141. package/dest/storage/note_store/index.d.ts +3 -0
  142. package/dest/storage/note_store/index.d.ts.map +1 -0
  143. package/dest/storage/note_store/index.js +2 -0
  144. package/dest/storage/note_store/note_store.d.ts +82 -0
  145. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  146. package/dest/storage/note_store/note_store.js +343 -0
  147. package/dest/storage/note_store/stored_note.d.ts +16 -0
  148. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  149. package/dest/storage/note_store/stored_note.js +43 -0
  150. package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
  151. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  152. package/dest/storage/private_event_store/private_event_store.js +273 -0
  153. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  154. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  155. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  156. package/dest/storage/tagging_store/index.d.ts +4 -0
  157. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  158. package/dest/storage/tagging_store/index.js +3 -0
  159. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
  160. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  161. package/dest/storage/tagging_store/recipient_tagging_store.js +111 -0
  162. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  163. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  164. package/dest/storage/tagging_store/sender_address_book_store.js +36 -0
  165. package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.d.ts → tagging_store/sender_tagging_store.d.ts} +19 -9
  166. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  167. package/dest/storage/tagging_store/sender_tagging_store.js +348 -0
  168. package/dest/tagging/constants.d.ts +2 -2
  169. package/dest/tagging/constants.d.ts.map +1 -1
  170. package/dest/tagging/constants.js +10 -3
  171. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  172. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  173. package/dest/tagging/get_all_logs_by_tags.js +46 -0
  174. package/dest/tagging/index.d.ts +15 -3
  175. package/dest/tagging/index.d.ts.map +1 -1
  176. package/dest/tagging/index.js +14 -2
  177. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -3
  178. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  179. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +8 -8
  180. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
  181. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  182. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
  183. package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.d.ts +4 -4
  184. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  185. package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.js +8 -23
  186. package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.d.ts +1 -1
  187. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  188. package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.js +5 -8
  189. package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.d.ts +7 -4
  190. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  191. package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.js +12 -7
  192. package/package.json +27 -18
  193. package/src/bin/check_oracle_version.ts +1 -0
  194. package/src/block_synchronizer/block_synchronizer.ts +99 -46
  195. package/src/config/index.ts +14 -0
  196. package/src/config/package_info.ts +1 -1
  197. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  198. package/src/contract_function_simulator/contract_function_simulator.ts +356 -145
  199. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  200. package/src/contract_function_simulator/index.ts +1 -1
  201. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +5 -1
  202. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  203. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  204. package/src/contract_function_simulator/oracle/interfaces.ts +22 -12
  205. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  206. package/src/contract_function_simulator/oracle/oracle.ts +79 -47
  207. package/src/contract_function_simulator/oracle/private_execution.ts +1 -69
  208. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +129 -135
  209. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +215 -132
  210. package/src/contract_function_simulator/proxied_contract_data_source.ts +7 -7
  211. package/src/contract_sync/contract_sync_service.ts +145 -0
  212. package/src/contract_sync/helpers.ts +93 -0
  213. package/src/debug/pxe_debug_utils.ts +63 -19
  214. package/src/entrypoints/client/bundle/utils.ts +23 -16
  215. package/src/entrypoints/client/lazy/utils.ts +24 -17
  216. package/src/entrypoints/pxe_creation_options.ts +4 -2
  217. package/src/entrypoints/server/index.ts +2 -0
  218. package/src/entrypoints/server/utils.ts +33 -41
  219. package/src/error_enriching.ts +7 -15
  220. package/src/events/event_service.ts +22 -28
  221. package/src/events/private_event_filter_validator.ts +4 -6
  222. package/src/job_coordinator/job_coordinator.ts +150 -0
  223. package/src/logs/log_service.ts +121 -274
  224. package/src/notes/note_service.ts +42 -47
  225. package/src/oracle_version.ts +4 -3
  226. package/src/private_kernel/hints/index.ts +1 -1
  227. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +33 -22
  228. package/src/private_kernel/private_kernel_execution_prover.ts +9 -8
  229. package/src/private_kernel/private_kernel_oracle.ts +116 -36
  230. package/src/pxe.ts +309 -239
  231. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +16 -16
  232. package/src/storage/address_store/index.ts +1 -0
  233. package/src/storage/{anchor_block_data_provider/anchor_block_data_provider.ts → anchor_block_store/anchor_block_store.ts} +9 -1
  234. package/src/storage/anchor_block_store/index.ts +1 -0
  235. package/src/storage/capsule_store/capsule_store.ts +315 -0
  236. package/src/storage/capsule_store/index.ts +1 -0
  237. package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +28 -17
  238. package/src/storage/contract_store/index.ts +1 -0
  239. package/src/storage/index.ts +7 -7
  240. package/src/storage/metadata.ts +1 -1
  241. package/src/storage/note_store/index.ts +2 -0
  242. package/src/storage/note_store/note_store.ts +414 -0
  243. package/src/storage/note_store/stored_note.ts +48 -0
  244. package/src/storage/private_event_store/private_event_store.ts +384 -0
  245. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  246. package/src/storage/tagging_store/index.ts +3 -0
  247. package/src/storage/tagging_store/recipient_tagging_store.ts +139 -0
  248. package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
  249. package/src/storage/tagging_store/sender_tagging_store.ts +429 -0
  250. package/src/tagging/constants.ts +10 -3
  251. package/src/tagging/get_all_logs_by_tags.ts +68 -0
  252. package/src/tagging/index.ts +17 -2
  253. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +23 -9
  254. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
  255. package/src/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.ts +12 -25
  256. package/src/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.ts +5 -13
  257. package/src/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.ts +19 -7
  258. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  259. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  260. package/dest/contract_function_simulator/proxied_node.js +0 -27
  261. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  262. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  263. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  264. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  265. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  266. package/dest/public_storage/public_storage_service.d.ts +0 -24
  267. package/dest/public_storage/public_storage_service.d.ts.map +0 -1
  268. package/dest/public_storage/public_storage_service.js +0 -26
  269. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
  270. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  271. package/dest/storage/address_data_provider/index.d.ts +0 -2
  272. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  273. package/dest/storage/address_data_provider/index.js +0 -1
  274. package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts +0 -9
  275. package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts.map +0 -1
  276. package/dest/storage/anchor_block_data_provider/index.d.ts +0 -2
  277. package/dest/storage/anchor_block_data_provider/index.d.ts.map +0 -1
  278. package/dest/storage/anchor_block_data_provider/index.js +0 -1
  279. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -57
  280. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  281. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -146
  282. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  283. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  284. package/dest/storage/capsule_data_provider/index.js +0 -1
  285. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  286. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  287. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  288. package/dest/storage/contract_data_provider/index.js +0 -1
  289. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  290. package/dest/storage/note_data_provider/index.d.ts +0 -3
  291. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  292. package/dest/storage/note_data_provider/index.js +0 -2
  293. package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -84
  294. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  295. package/dest/storage/note_data_provider/note_data_provider.js +0 -322
  296. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -51
  297. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  298. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -115
  299. package/dest/storage/tagging_data_provider/index.d.ts +0 -3
  300. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  301. package/dest/storage/tagging_data_provider/index.js +0 -2
  302. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts +0 -31
  303. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts.map +0 -1
  304. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.js +0 -65
  305. package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts.map +0 -1
  306. package/dest/storage/tagging_data_provider/sender_tagging_data_provider.js +0 -196
  307. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts +0 -21
  308. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts.map +0 -1
  309. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.js +0 -42
  310. package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +0 -1
  311. package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts.map +0 -1
  312. package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +0 -1
  313. package/dest/tagging/utils.d.ts +0 -18
  314. package/dest/tagging/utils.d.ts.map +0 -1
  315. package/dest/tagging/utils.js +0 -25
  316. package/dest/tree_membership/tree_membership_service.d.ts +0 -52
  317. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  318. package/dest/tree_membership/tree_membership_service.js +0 -84
  319. package/src/contract_function_simulator/proxied_node.ts +0 -33
  320. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
  321. package/src/public_storage/public_storage_service.ts +0 -33
  322. package/src/storage/address_data_provider/index.ts +0 -1
  323. package/src/storage/anchor_block_data_provider/index.ts +0 -1
  324. package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -179
  325. package/src/storage/capsule_data_provider/index.ts +0 -1
  326. package/src/storage/contract_data_provider/index.ts +0 -1
  327. package/src/storage/note_data_provider/index.ts +0 -2
  328. package/src/storage/note_data_provider/note_data_provider.ts +0 -412
  329. package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -162
  330. package/src/storage/tagging_data_provider/index.ts +0 -2
  331. package/src/storage/tagging_data_provider/recipient_tagging_data_provider.ts +0 -86
  332. package/src/storage/tagging_data_provider/sender_tagging_data_provider.ts +0 -244
  333. package/src/tagging/recipient_sync/new_recipient_tagging_data_provider.ts +0 -53
  334. package/src/tagging/utils.ts +0 -32
  335. package/src/tree_membership/tree_membership_service.ts +0 -112
  336. /package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +0 -0
  337. /package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +0 -0
@@ -1,239 +1,118 @@
1
- import { DirectionalAppTaggingSecret, PendingTaggedLog, PrivateLogWithTxData, PublicLogWithTxData, SiloedTag, Tag } from '@aztec/stdlib/logs';
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
3
+ import { DirectionalAppTaggingSecret, PendingTaggedLog, SiloedTag } from '@aztec/stdlib/logs';
2
4
  import { LogRetrievalResponse } from '../contract_function_simulator/noir-structs/log_retrieval_response.js';
3
- import { WINDOW_HALF_SIZE } from '../tagging/constants.js';
4
- import { getInitialIndexesMap, getPreTagsForTheWindow } from '../tagging/utils.js';
5
+ import { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract, loadPrivateLogsForSenderRecipientPair } from '../tagging/index.js';
5
6
  export class LogService {
6
7
  aztecNode;
7
- anchorBlockDataProvider;
8
+ anchorBlockHeader;
8
9
  keyStore;
9
- capsuleDataProvider;
10
- recipientTaggingDataProvider;
11
- addressDataProvider;
12
- constructor(aztecNode, anchorBlockDataProvider, keyStore, capsuleDataProvider, recipientTaggingDataProvider, addressDataProvider){
10
+ capsuleStore;
11
+ recipientTaggingStore;
12
+ senderAddressBookStore;
13
+ addressStore;
14
+ jobId;
15
+ log;
16
+ constructor(aztecNode, anchorBlockHeader, keyStore, capsuleStore, recipientTaggingStore, senderAddressBookStore, addressStore, jobId, bindings){
13
17
  this.aztecNode = aztecNode;
14
- this.anchorBlockDataProvider = anchorBlockDataProvider;
18
+ this.anchorBlockHeader = anchorBlockHeader;
15
19
  this.keyStore = keyStore;
16
- this.capsuleDataProvider = capsuleDataProvider;
17
- this.recipientTaggingDataProvider = recipientTaggingDataProvider;
18
- this.addressDataProvider = addressDataProvider;
20
+ this.capsuleStore = capsuleStore;
21
+ this.recipientTaggingStore = recipientTaggingStore;
22
+ this.senderAddressBookStore = senderAddressBookStore;
23
+ this.addressStore = addressStore;
24
+ this.jobId = jobId;
25
+ this.log = createLogger('pxe:log_service', bindings);
19
26
  }
20
27
  async bulkRetrieveLogs(logRetrievalRequests) {
21
28
  return await Promise.all(logRetrievalRequests.map(async (request)=>{
22
- // TODO(F-231): remove these internal functions and have node endpoints that do this instead
23
29
  const [publicLog, privateLog] = await Promise.all([
24
- this.getPublicLogByTag(request.tag, request.contractAddress),
25
- this.getPrivateLogByTag(await SiloedTag.compute(request.tag, request.contractAddress))
30
+ this.#getPublicLogByTag(request.tag, request.contractAddress),
31
+ this.#getPrivateLogByTag(await SiloedTag.compute(request.tag, request.contractAddress))
26
32
  ]);
27
- if (publicLog !== null) {
28
- if (privateLog !== null) {
29
- throw new Error(`Found both a public and private log when searching for tag ${request.tag} from contract ${request.contractAddress}`);
30
- }
31
- return new LogRetrievalResponse(publicLog.logPayload, publicLog.txHash, publicLog.uniqueNoteHashesInTx, publicLog.firstNullifierInTx);
32
- } else if (privateLog !== null) {
33
- return new LogRetrievalResponse(privateLog.logPayload, privateLog.txHash, privateLog.uniqueNoteHashesInTx, privateLog.firstNullifierInTx);
34
- } else {
35
- return null;
33
+ if (publicLog !== null && privateLog !== null) {
34
+ throw new Error(`Found both a public and private log when searching for tag ${request.tag} from contract ${request.contractAddress}`);
36
35
  }
36
+ return publicLog ?? privateLog;
37
37
  }));
38
38
  }
39
- // TODO(F-231): delete this function and implement this behavior in the node instead
40
- async getPublicLogByTag(tag, contractAddress) {
41
- const logs = await this.aztecNode.getPublicLogsByTagsFromContract(contractAddress, [
39
+ async #getPublicLogByTag(tag, contractAddress) {
40
+ const anchorBlockHash = await this.anchorBlockHeader.hash();
41
+ const allLogsPerTag = await getAllPublicLogsByTagsFromContract(this.aztecNode, contractAddress, [
42
42
  tag
43
- ]);
44
- const logsForTag = logs[0];
45
- if (logsForTag.length == 0) {
43
+ ], anchorBlockHash);
44
+ const logsForTag = allLogsPerTag[0];
45
+ if (logsForTag.length === 0) {
46
46
  return null;
47
47
  } else if (logsForTag.length > 1) {
48
48
  // TODO(#11627): handle this case
49
49
  throw new Error(`Got ${logsForTag.length} logs for tag ${tag} and contract ${contractAddress.toString()}. getPublicLogByTag currently only supports a single log per tag`);
50
50
  }
51
51
  const scopedLog = logsForTag[0];
52
- // getLogsByTag doesn't have all of the information that we need (notably note hashes and the first nullifier), so
53
- // we need to make a second call to the node for `getTxEffect`.
54
- // TODO(#9789): bundle this information in the `getLogsByTag` call.
55
- const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
56
- if (txEffect == undefined) {
57
- throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
58
- }
59
- return new PublicLogWithTxData(scopedLog.log.getEmittedFieldsWithoutTag(), scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
52
+ return new LogRetrievalResponse(scopedLog.logData.slice(1), scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier);
60
53
  }
61
- // TODO(F-231): delete this function and implement this behavior in the node instead
62
- async getPrivateLogByTag(siloedTag) {
63
- const logs = await this.aztecNode.getPrivateLogsByTags([
54
+ async #getPrivateLogByTag(siloedTag) {
55
+ const anchorBlockHash = await this.anchorBlockHeader.hash();
56
+ const allLogsPerTag = await getAllPrivateLogsByTags(this.aztecNode, [
64
57
  siloedTag
65
- ]);
66
- const logsForTag = logs[0];
67
- if (logsForTag.length == 0) {
58
+ ], anchorBlockHash);
59
+ const logsForTag = allLogsPerTag[0];
60
+ if (logsForTag.length === 0) {
68
61
  return null;
69
62
  } else if (logsForTag.length > 1) {
70
63
  // TODO(#11627): handle this case
71
64
  throw new Error(`Got ${logsForTag.length} logs for tag ${siloedTag}. getPrivateLogByTag currently only supports a single log per tag`);
72
65
  }
73
66
  const scopedLog = logsForTag[0];
74
- // getLogsByTag doesn't have all of the information that we need (notably note hashes and the first nullifier), so
75
- // we need to make a second call to the node for `getTxEffect`.
76
- // TODO(#9789): bundle this information in the `getLogsByTag` call.
77
- const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
78
- if (txEffect == undefined) {
79
- throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
80
- }
81
- return new PrivateLogWithTxData(scopedLog.log.getEmittedFieldsWithoutTag(), scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
67
+ return new LogRetrievalResponse(scopedLog.logData.slice(1), scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier);
82
68
  }
83
- // TODO(#17775): Replace this implementation of this function with one implementing an approach similar
84
- // to syncSenderTaggingIndexes. Not done yet due to re-prioritization to devex and this doesn't directly affect
85
- // devex.
86
- async syncTaggedLogs(contractAddress, pendingTaggedLogArrayBaseSlot, scopes) {
87
- const maxBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
88
- // Ideally this algorithm would be implemented in noir, exposing its building blocks as oracles.
89
- // However it is impossible at the moment due to the language not supporting nested slices.
90
- // This nesting is necessary because for a given set of tags we don't
91
- // know how many logs we will get back. Furthermore, these logs are of undetermined
92
- // length, since we don't really know the note they correspond to until we decrypt them.
93
- const recipients = scopes ? scopes : await this.keyStore.getAccounts();
94
- for (const recipient of recipients){
95
- // Get all the secrets for the recipient and sender pairs (#9365)
96
- const indexedSecrets = await this.getLastUsedTaggingIndexesForSenders(contractAddress, recipient);
97
- // We fetch logs for a window of indexes in a range:
98
- // <latest_log_index - WINDOW_HALF_SIZE, latest_log_index + WINDOW_HALF_SIZE>.
99
- //
100
- // We use this window approach because it could happen that a sender might have messed up and inadvertently
101
- // incremented their index without us getting any logs (for example, in case of a revert). If we stopped looking
102
- // for logs the first time we don't receive any logs for a tag, we might never receive anything from that sender again.
103
- // Also there's a possibility that we have advanced our index, but the sender has reused it, so we might have missed
104
- // some logs. For these reasons, we have to look both back and ahead of the stored index.
105
- let secretsAndWindows = indexedSecrets.map((indexedSecret)=>{
106
- if (indexedSecret.index === undefined) {
107
- return {
108
- secret: indexedSecret.secret,
109
- leftMostIndex: 0,
110
- rightMostIndex: WINDOW_HALF_SIZE
111
- };
112
- } else {
113
- return {
114
- secret: indexedSecret.secret,
115
- leftMostIndex: Math.max(0, indexedSecret.index - WINDOW_HALF_SIZE),
116
- rightMostIndex: indexedSecret.index + WINDOW_HALF_SIZE
117
- };
118
- }
119
- });
120
- // As we iterate we store the largest index we have seen for a given secret to later on store it in the db.
121
- const newLargestIndexMapToStore = {};
122
- // The initial/unmodified indexes of the secrets stored in a key-value map where key is the directional app
123
- // tagging secret.
124
- const initialIndexesMap = getInitialIndexesMap(indexedSecrets);
125
- while(secretsAndWindows.length > 0){
126
- const preTagsForTheWholeWindow = getPreTagsForTheWindow(secretsAndWindows);
127
- const tagsForTheWholeWindow = await Promise.all(preTagsForTheWholeWindow.map(async (preTag)=>{
128
- return SiloedTag.compute(await Tag.compute(preTag), contractAddress);
129
- }));
130
- // We store the new largest indexes we find in the iteration in the following map to later on construct
131
- // a new set of secrets and windows to fetch logs for.
132
- const newLargestIndexMapForIteration = {};
133
- // Fetch the private logs for the tags and iterate over them
134
- const logsByTags = await this.aztecNode.getPrivateLogsByTags(tagsForTheWholeWindow);
135
- for(let logIndex = 0; logIndex < logsByTags.length; logIndex++){
136
- const logsByTag = logsByTags[logIndex];
137
- if (logsByTag.length > 0) {
138
- // We filter out the logs that are newer than the anchor block number of the tx currently being constructed
139
- const filteredLogsByBlockNumber = logsByTag.filter((l)=>l.blockNumber <= maxBlockNumber);
140
- // We store the logs in capsules (to later be obtained in Noir)
141
- await this.#storePendingTaggedLogs(contractAddress, pendingTaggedLogArrayBaseSlot, recipient, filteredLogsByBlockNumber);
142
- // We retrieve the pre-tag corresponding to the log as I need that to evaluate whether
143
- // a new largest index have been found.
144
- const preTagCorrespondingToLog = preTagsForTheWholeWindow[logIndex];
145
- const initialIndex = initialIndexesMap[preTagCorrespondingToLog.secret.toString()];
146
- if (preTagCorrespondingToLog.index >= initialIndex && (newLargestIndexMapForIteration[preTagCorrespondingToLog.secret.toString()] === undefined || preTagCorrespondingToLog.index >= newLargestIndexMapForIteration[preTagCorrespondingToLog.secret.toString()])) {
147
- // We have found a new largest index so we store it for later processing (storing it in the db + fetching
148
- // the difference of the window sets of current and the next iteration)
149
- newLargestIndexMapForIteration[preTagCorrespondingToLog.secret.toString()] = preTagCorrespondingToLog.index + 1;
150
- }
151
- }
152
- }
153
- // Now based on the new largest indexes we found, we will construct a new secrets and windows set to fetch logs
154
- // for. Note that it's very unlikely that a new log from the current window would appear between the iterations
155
- // so we fetch the logs only for the difference of the window sets.
156
- const newSecretsAndWindows = [];
157
- for (const [directionalAppTaggingSecret, newIndex] of Object.entries(newLargestIndexMapForIteration)){
158
- const maybeIndexedSecret = indexedSecrets.find((indexedSecret)=>indexedSecret.secret.toString() === directionalAppTaggingSecret);
159
- if (maybeIndexedSecret) {
160
- newSecretsAndWindows.push({
161
- secret: maybeIndexedSecret.secret,
162
- // We set the left most index to the new index to avoid fetching the same logs again
163
- leftMostIndex: newIndex,
164
- rightMostIndex: newIndex + WINDOW_HALF_SIZE
165
- });
166
- // We store the new largest index in the map to later store it in the db.
167
- newLargestIndexMapToStore[directionalAppTaggingSecret] = newIndex;
168
- } else {
169
- throw new Error(`Secret not found for directionalAppTaggingSecret ${directionalAppTaggingSecret}. This is a bug as it should never happen!`);
170
- }
171
- }
172
- // Now we set the new secrets and windows and proceed to the next iteration.
173
- secretsAndWindows = newSecretsAndWindows;
69
+ async fetchTaggedLogs(contractAddress, pendingTaggedLogArrayBaseSlot, scopes) {
70
+ this.log.verbose(`Fetching tagged logs for ${contractAddress.toString()}`);
71
+ // We only load logs from block up to and including the anchor block number
72
+ const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
73
+ const anchorBlockHash = await this.anchorBlockHeader.hash();
74
+ // Determine recipients: use scopes if provided, otherwise get all accounts
75
+ const recipients = scopes && scopes.length > 0 ? scopes : await this.keyStore.getAccounts();
76
+ // For each recipient, fetch secrets, load logs, and store them.
77
+ // We run these per-recipient tasks in parallel so that logs are loaded for all recipients concurrently.
78
+ await Promise.all(recipients.map(async (recipient)=>{
79
+ // Get all secrets for this recipient (one per sender)
80
+ const secrets = await this.#getSecretsForSenders(contractAddress, recipient);
81
+ // Load logs for all sender-recipient pairs in parallel
82
+ const logArrays = await Promise.all(secrets.map((secret)=>loadPrivateLogsForSenderRecipientPair(secret, contractAddress, this.aztecNode, this.recipientTaggingStore, anchorBlockNumber, anchorBlockHash, this.jobId)));
83
+ // Flatten all logs from all secrets
84
+ const allLogs = logArrays.flat();
85
+ // Store the logs for this recipient
86
+ if (allLogs.length > 0) {
87
+ await this.#storePendingTaggedLogs(contractAddress, pendingTaggedLogArrayBaseSlot, recipient, allLogs);
174
88
  }
175
- // At this point we have processed all the logs for the recipient so we store the last used indexes in the db.
176
- // newLargestIndexMapToStore contains "next" indexes to look for (one past the last found), so subtract 1 to get
177
- // last used.
178
- await this.recipientTaggingDataProvider.setLastUsedIndexes(Object.entries(newLargestIndexMapToStore).map(([directionalAppTaggingSecret, index])=>({
179
- secret: DirectionalAppTaggingSecret.fromString(directionalAppTaggingSecret),
180
- index: index - 1
181
- })));
182
- }
89
+ }));
183
90
  }
184
- /**
185
- * Returns the last used tagging indexes along with the directional app tagging secrets for a given recipient and all
186
- * the senders in the address book.
187
- * This method should be exposed as an oracle call to allow aztec.nr to perform the orchestration
188
- * of the syncTaggedLogs and processTaggedLogs methods. However, it is not possible to do so at the moment,
189
- * so we're keeping it private for now.
190
- * @param contractAddress - The contract address to silo the secret for
191
- * @param recipient - The address receiving the notes
192
- * @returns A list of directional app tagging secrets along with the last used tagging indexes. If the corresponding
193
- * secret was never used, the index is undefined.
194
- * TODO(#17775): The naming here is broken as the function name does not reflect the return type. Make sure this gets
195
- * fixed when implementing the linked issue.
196
- */ async getLastUsedTaggingIndexesForSenders(contractAddress, recipient) {
197
- const recipientCompleteAddress = await this.#getCompleteAddress(recipient);
91
+ async #getSecretsForSenders(contractAddress, recipient) {
92
+ const recipientCompleteAddress = await this.addressStore.getCompleteAddress(recipient);
93
+ if (!recipientCompleteAddress) {
94
+ return [];
95
+ }
198
96
  const recipientIvsk = await this.keyStore.getMasterIncomingViewingSecretKey(recipient);
199
97
  // We implicitly add all PXE accounts as senders, this helps us decrypt tags on notes that we send to ourselves
200
98
  // (recipient = us, sender = us)
201
- const senders = [
202
- ...await this.recipientTaggingDataProvider.getSenderAddresses(),
99
+ const allSenders = [
100
+ ...await this.senderAddressBookStore.getSenders(),
203
101
  ...await this.keyStore.getAccounts()
204
- ].filter((address, index, self)=>index === self.findIndex((otherAddress)=>otherAddress.equals(address)));
205
- const secrets = await Promise.all(senders.map((contact)=>{
206
- return DirectionalAppTaggingSecret.compute(recipientCompleteAddress, recipientIvsk, contact, contractAddress, recipient);
102
+ ];
103
+ // We deduplicate the senders by adding them to a set and then converting the set back to an array
104
+ const deduplicatedSenders = Array.from(new Set(allSenders.map((sender)=>sender.toString()))).map((sender)=>AztecAddress.fromString(sender));
105
+ return Promise.all(deduplicatedSenders.map((sender)=>{
106
+ return DirectionalAppTaggingSecret.compute(recipientCompleteAddress, recipientIvsk, sender, contractAddress, recipient);
207
107
  }));
208
- const indexes = await this.recipientTaggingDataProvider.getLastUsedIndexes(secrets);
209
- if (indexes.length !== secrets.length) {
210
- throw new Error('Indexes and directional app tagging secrets have different lengths');
211
- }
212
- return secrets.map((secret, i)=>({
213
- secret,
214
- index: indexes[i]
215
- }));
216
108
  }
217
- async #storePendingTaggedLogs(contractAddress, capsuleArrayBaseSlot, recipient, privateLogs) {
218
- // Build all pending tagged logs upfront with their tx effects
219
- const pendingTaggedLogs = await Promise.all(privateLogs.map(async (scopedLog)=>{
220
- // TODO(#9789): get these effects along with the log
221
- const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
222
- if (!txEffect) {
223
- throw new Error(`Could not find tx effect for tx hash ${scopedLog.txHash}`);
224
- }
225
- const pendingTaggedLog = new PendingTaggedLog(scopedLog.log.fields, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0], recipient);
109
+ #storePendingTaggedLogs(contractAddress, capsuleArrayBaseSlot, recipient, privateLogs) {
110
+ // Build all pending tagged logs from the scoped logs
111
+ const pendingTaggedLogs = privateLogs.map((scopedLog)=>{
112
+ const pendingTaggedLog = new PendingTaggedLog(scopedLog.logData, scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier, recipient);
226
113
  return pendingTaggedLog.toFields();
227
- }));
114
+ });
228
115
  // TODO: This looks like it could belong more at the oracle interface level
229
- return this.capsuleDataProvider.appendToCapsuleArray(contractAddress, capsuleArrayBaseSlot, pendingTaggedLogs);
230
- }
231
- async #getCompleteAddress(account) {
232
- const completeAddress = await this.addressDataProvider.getCompleteAddress(account);
233
- if (!completeAddress) {
234
- throw new Error(`No public key registered for address ${account}.
235
- Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#simulation-error-no-public-key-registered-for-address-0x0-register-it-by-calling-pxeregisterrecipient-or-pxeregisteraccount`);
236
- }
237
- return completeAddress;
116
+ return this.capsuleStore.appendToCapsuleArray(contractAddress, capsuleArrayBaseSlot, pendingTaggedLogs, this.jobId);
238
117
  }
239
118
  }
@@ -2,14 +2,14 @@ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
3
  import { type AztecNode } from '@aztec/stdlib/interfaces/client';
4
4
  import { Note, NoteStatus } from '@aztec/stdlib/note';
5
- import type { TxHash } from '@aztec/stdlib/tx';
6
- import type { AnchorBlockDataProvider } from '../storage/anchor_block_data_provider/anchor_block_data_provider.js';
7
- import type { NoteDataProvider } from '../storage/note_data_provider/note_data_provider.js';
5
+ import type { BlockHeader, TxHash } from '@aztec/stdlib/tx';
6
+ import type { NoteStore } from '../storage/note_store/note_store.js';
8
7
  export declare class NoteService {
9
- private readonly noteDataProvider;
8
+ private readonly noteStore;
10
9
  private readonly aztecNode;
11
- private readonly anchorBlockDataProvider;
12
- constructor(noteDataProvider: NoteDataProvider, aztecNode: AztecNode, anchorBlockDataProvider: AnchorBlockDataProvider);
10
+ private readonly anchorBlockHeader;
11
+ private readonly jobId;
12
+ constructor(noteStore: NoteStore, aztecNode: AztecNode, anchorBlockHeader: BlockHeader, jobId: string);
13
13
  /**
14
14
  * Retrieves a set of notes stored in the database for a given contract address and storage slot.
15
15
  * The query result is paginated using 'limit' and 'offset' values.
@@ -27,13 +27,13 @@ export declare class NoteService {
27
27
  noteNonce: Fr;
28
28
  note: Note;
29
29
  noteHash: Fr;
30
+ isPending: boolean;
30
31
  siloedNullifier: Fr;
31
- index: bigint;
32
32
  }[]>;
33
33
  /**
34
34
  * Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
35
35
  *
36
- * Fetches notes from the NoteDataProvider and checks which nullifiers are present in the
36
+ * Fetches notes from the NoteStore and checks which nullifiers are present in the
37
37
  * onchain nullifier Merkle tree - up to the latest locally synced block. We use the
38
38
  * locally synced block instead of querying the chain's 'latest' block to ensure correctness:
39
39
  * notes are only marked nullified once their corresponding nullifier has been included in a
@@ -43,6 +43,6 @@ export declare class NoteService {
43
43
  * @param contractAddress - The contract whose notes should be checked and nullified.
44
44
  */
45
45
  syncNoteNullifiers(contractAddress: AztecAddress): Promise<void>;
46
- deliverNote(contractAddress: AztecAddress, owner: AztecAddress, storageSlot: Fr, randomness: Fr, noteNonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: TxHash, recipient: AztecAddress): Promise<void>;
46
+ validateAndStoreNote(contractAddress: AztecAddress, owner: AztecAddress, storageSlot: Fr, randomness: Fr, noteNonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: TxHash, recipient: AztecAddress): Promise<void>;
47
47
  }
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbm90ZXMvbm90ZV9zZXJ2aWNlL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AAE,EAAE,EACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC,CAsEf;CACF"}
@@ -3,13 +3,15 @@ import { MAX_RPC_LEN } from '@aztec/stdlib/interfaces/client';
3
3
  import { Note, NoteDao } from '@aztec/stdlib/note';
4
4
  import { MerkleTreeId } from '@aztec/stdlib/trees';
5
5
  export class NoteService {
6
- noteDataProvider;
6
+ noteStore;
7
7
  aztecNode;
8
- anchorBlockDataProvider;
9
- constructor(noteDataProvider, aztecNode, anchorBlockDataProvider){
10
- this.noteDataProvider = noteDataProvider;
8
+ anchorBlockHeader;
9
+ jobId;
10
+ constructor(noteStore, aztecNode, anchorBlockHeader, jobId){
11
+ this.noteStore = noteStore;
11
12
  this.aztecNode = aztecNode;
12
- this.anchorBlockDataProvider = anchorBlockDataProvider;
13
+ this.anchorBlockHeader = anchorBlockHeader;
14
+ this.jobId = jobId;
13
15
  }
14
16
  /**
15
17
  * Retrieves a set of notes stored in the database for a given contract address and storage slot.
@@ -20,14 +22,14 @@ export class NoteService {
20
22
  * @param status - The status of notes to fetch.
21
23
  * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
22
24
  */ async getNotes(contractAddress, owner, storageSlot, status, scopes) {
23
- const noteDaos = await this.noteDataProvider.getNotes({
25
+ const noteDaos = await this.noteStore.getNotes({
24
26
  contractAddress,
25
27
  owner,
26
28
  storageSlot,
27
29
  status,
28
30
  scopes
29
- });
30
- return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier, index })=>({
31
+ }, this.jobId);
32
+ return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier })=>({
31
33
  contractAddress,
32
34
  owner,
33
35
  storageSlot,
@@ -35,15 +37,14 @@ export class NoteService {
35
37
  noteNonce,
36
38
  note,
37
39
  noteHash,
38
- siloedNullifier,
39
- // PXE can use this index to get full MembershipWitness
40
- index
40
+ isPending: false,
41
+ siloedNullifier
41
42
  }));
42
43
  }
43
44
  /**
44
45
  * Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
45
46
  *
46
- * Fetches notes from the NoteDataProvider and checks which nullifiers are present in the
47
+ * Fetches notes from the NoteStore and checks which nullifiers are present in the
47
48
  * onchain nullifier Merkle tree - up to the latest locally synced block. We use the
48
49
  * locally synced block instead of querying the chain's 'latest' block to ensure correctness:
49
50
  * notes are only marked nullified once their corresponding nullifier has been included in a
@@ -52,10 +53,10 @@ export class NoteService {
52
53
  *
53
54
  * @param contractAddress - The contract whose notes should be checked and nullified.
54
55
  */ async syncNoteNullifiers(contractAddress) {
55
- const syncedBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
56
- const contractNotes = await this.noteDataProvider.getNotes({
56
+ const anchorBlockHash = await this.anchorBlockHeader.hash();
57
+ const contractNotes = await this.noteStore.getNotes({
57
58
  contractAddress
58
- });
59
+ }, this.jobId);
59
60
  if (contractNotes.length === 0) {
60
61
  return;
61
62
  }
@@ -72,7 +73,7 @@ export class NoteService {
72
73
  }, [
73
74
  []
74
75
  ]);
75
- const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
76
+ const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
76
77
  const foundNullifiers = nullifiersToCheck.map((nullifier, i)=>{
77
78
  if (nullifierIndexes[i] !== undefined) {
78
79
  return {
@@ -83,10 +84,10 @@ export class NoteService {
83
84
  };
84
85
  }
85
86
  }).filter((nullifier)=>nullifier !== undefined);
86
- await this.noteDataProvider.applyNullifiers(foundNullifiers);
87
+ await this.noteStore.applyNullifiers(foundNullifiers, this.jobId);
87
88
  }
88
- async deliverNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
89
- // We are going to store the new note in the NoteDataProvider, which will let us later return it via `getNotes`.
89
+ async validateAndStoreNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
90
+ // We are going to store the new note in the NoteStore, which will let us later return it via `getNotes`.
90
91
  // There's two things we need to check before we do this however:
91
92
  // - we must make sure the note does actually exist in the note hash tree
92
93
  // - we need to check if the note has already been nullified
@@ -104,49 +105,43 @@ export class NoteService {
104
105
  // number which *should* be recent enough to be available, even for non-archive nodes.
105
106
  // Also note that the note should never be ahead of the synced block here since `fetchTaggedLogs` only processes
106
107
  // logs up to the synced block making this only an additional safety check.
107
- const syncedBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
108
+ const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
109
+ const anchorBlockHash = await this.anchorBlockHeader.hash();
108
110
  // By computing siloed and unique note hashes ourselves we prevent contracts from interfering with the note storage
109
111
  // of other contracts, which would constitute a security breach.
110
112
  const uniqueNoteHash = await computeUniqueNoteHash(noteNonce, await siloNoteHash(contractAddress, noteHash));
111
113
  const siloedNullifier = await siloNullifier(contractAddress, nullifier);
112
- const txEffect = await this.aztecNode.getTxEffect(txHash);
114
+ const [txEffect, [nullifierIndex]] = await Promise.all([
115
+ this.aztecNode.getTxEffect(txHash),
116
+ this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, [
117
+ siloedNullifier
118
+ ])
119
+ ]);
113
120
  if (!txEffect) {
114
121
  throw new Error(`Could not find tx effect for tx hash ${txHash}`);
115
122
  }
116
- if (txEffect.l2BlockNumber > syncedBlockNumber) {
117
- throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${syncedBlockNumber}`);
123
+ if (txEffect.l2BlockNumber > anchorBlockNumber) {
124
+ throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${anchorBlockNumber}`);
118
125
  }
119
- const noteInTx = txEffect.data.noteHashes.some((nh)=>nh.equals(uniqueNoteHash));
120
- if (!noteInTx) {
126
+ // Find the index of the note hash in the noteHashes array to determine note ordering within the tx
127
+ const noteIndexInTx = txEffect.data.noteHashes.findIndex((nh)=>nh.equals(uniqueNoteHash));
128
+ if (noteIndexInTx === -1) {
121
129
  throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present in tx ${txHash}`);
122
130
  }
123
- // We store notes by their index in the global note hash tree, which has the convenient side effect of validating
124
- // note existence in said tree. We concurrently also check if the note's nullifier exists, performing all node
125
- // queries in a single round-trip.
126
- const [[uniqueNoteHashTreeIndexInBlock], [nullifierIndex]] = await Promise.all([
127
- this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NOTE_HASH_TREE, [
128
- uniqueNoteHash
129
- ]),
130
- this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, [
131
- siloedNullifier
132
- ])
133
- ]);
134
- if (uniqueNoteHashTreeIndexInBlock === undefined) {
135
- throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present on the tree at block ${syncedBlockNumber} (from tx ${txHash})`);
136
- }
137
- const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, uniqueNoteHashTreeIndexInBlock.l2BlockNumber, uniqueNoteHashTreeIndexInBlock.l2BlockHash.toString(), uniqueNoteHashTreeIndexInBlock.data);
131
+ const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, txEffect.l2BlockNumber, txEffect.l2BlockHash.toString(), txEffect.txIndexInBlock, noteIndexInTx);
138
132
  // The note was found by `recipient`, so we use that as the scope when storing the note.
139
- await this.noteDataProvider.addNotes([
133
+ await this.noteStore.addNotes([
140
134
  noteDao
141
- ], recipient);
135
+ ], recipient, this.jobId);
142
136
  if (nullifierIndex !== undefined) {
137
+ // We found nullifier index which implies that the note has already been nullified.
143
138
  const { data: _, ...blockHashAndNum } = nullifierIndex;
144
- await this.noteDataProvider.applyNullifiers([
139
+ await this.noteStore.applyNullifiers([
145
140
  {
146
141
  data: siloedNullifier,
147
142
  ...blockHashAndNum
148
143
  }
149
- ]);
144
+ ], this.jobId);
150
145
  }
151
146
  }
152
147
  }
@@ -1,3 +1,3 @@
1
- export declare const ORACLE_VERSION = 5;
2
- export declare const ORACLE_INTERFACE_HASH = "d603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec";
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxJQUFJLENBQUM7QUFJaEMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
1
+ export declare const ORACLE_VERSION = 12;
2
+ export declare const ORACLE_INTERFACE_HASH = "666a8a7fc697f72b29dbf0ae7464db269cf5afa019acac8861f814543147dbb4";
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxLQUFLLENBQUM7QUFLakMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,IAAI,CAAC;AAIhC,eAAO,MAAM,qBAAqB,qEAAqE,CAAC"}
1
+ {"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,KAAK,CAAC;AAKjC,eAAO,MAAM,qBAAqB,qEAAqE,CAAC"}
@@ -4,7 +4,8 @@
4
4
  ///
5
5
  /// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
6
6
  /// and if the oracle version is incompatible an error is thrown.
7
- export const ORACLE_VERSION = 5;
7
+ export const ORACLE_VERSION = 12;
8
8
  /// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
9
- /// which in turn implies that you need to update the ORACLE_VERSION constant.
10
- export const ORACLE_INTERFACE_HASH = 'd603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec';
9
+ /// which in turn implies that you need to update the ORACLE_VERSION constant in this file and in
10
+ /// `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
11
+ export const ORACLE_INTERFACE_HASH = '666a8a7fc697f72b29dbf0ae7464db269cf5afa019acac8861f814543147dbb4';
@@ -1,3 +1,3 @@
1
- export * from './build_private_kernel_reset_private_inputs.js';
1
+ export * from './private_kernel_reset_private_inputs_builder.js';
2
2
  export * from './compute_tx_include_by_timestamp.js';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGdEQUFnRCxDQUFDO0FBQy9ELGNBQWMsc0NBQXNDLENBQUMifQ==
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGtEQUFrRCxDQUFDO0FBQ2pFLGNBQWMsc0NBQXNDLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/index.ts"],"names":[],"mappings":"AAAA,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC"}
@@ -1,2 +1,2 @@
1
- export * from './build_private_kernel_reset_private_inputs.js';
1
+ export * from './private_kernel_reset_private_inputs_builder.js';
2
2
  export * from './compute_tx_include_by_timestamp.js';