@aztec/pxe 0.0.1-commit.d3ec352c → 0.0.1-commit.fcb71a6

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 (322) hide show
  1. package/dest/bin/check_oracle_version.js +105 -15
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +37 -0
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
  4. package/dest/{synchronizer/synchronizer.js → block_synchronizer/block_synchronizer.js} +19 -22
  5. package/dest/block_synchronizer/index.d.ts +2 -0
  6. package/dest/block_synchronizer/index.d.ts.map +1 -0
  7. package/dest/block_synchronizer/index.js +1 -0
  8. package/dest/config/index.d.ts +4 -4
  9. package/dest/config/index.d.ts.map +1 -1
  10. package/dest/contract_function_simulator/contract_function_simulator.d.ts +41 -12
  11. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  12. package/dest/contract_function_simulator/contract_function_simulator.js +49 -19
  13. package/dest/contract_function_simulator/execution_note_cache.d.ts +4 -4
  14. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  15. package/dest/contract_function_simulator/execution_note_cache.js +3 -3
  16. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +1 -1
  17. package/dest/contract_function_simulator/execution_tagging_index_cache.js +1 -1
  18. package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
  19. package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -2
  21. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  22. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
  23. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  24. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
  25. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
  26. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  27. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
  28. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -2
  29. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  30. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +2 -2
  31. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/noir-structs/utility_context.js +1 -1
  33. package/dest/contract_function_simulator/oracle/interfaces.d.ts +6 -6
  34. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -2
  36. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  37. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
  38. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +7 -3
  39. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  40. package/dest/contract_function_simulator/oracle/note_packing_utils.js +7 -3
  41. package/dest/contract_function_simulator/oracle/oracle.d.ts +2 -2
  42. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  43. package/dest/contract_function_simulator/oracle/oracle.js +18 -7
  44. package/dest/contract_function_simulator/oracle/private_execution.d.ts +8 -10
  45. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  46. package/dest/contract_function_simulator/oracle/private_execution.js +12 -12
  47. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +25 -11
  48. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  49. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +26 -14
  50. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +51 -11
  51. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  52. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +146 -40
  53. package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
  54. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  55. package/dest/contract_function_simulator/pick_notes.js +1 -1
  56. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  57. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  58. package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
  59. package/dest/debug/pxe_debug_utils.d.ts +31 -0
  60. package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
  61. package/dest/debug/pxe_debug_utils.js +37 -0
  62. package/dest/entrypoints/client/bundle/index.d.ts +1 -2
  63. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  64. package/dest/entrypoints/client/bundle/index.js +0 -1
  65. package/dest/entrypoints/client/bundle/utils.js +2 -2
  66. package/dest/entrypoints/client/lazy/index.d.ts +1 -2
  67. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  68. package/dest/entrypoints/client/lazy/index.js +0 -1
  69. package/dest/entrypoints/client/lazy/utils.js +2 -2
  70. package/dest/entrypoints/pxe_creation_options.d.ts +3 -1
  71. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  72. package/dest/entrypoints/server/index.d.ts +2 -2
  73. package/dest/entrypoints/server/index.d.ts.map +1 -1
  74. package/dest/entrypoints/server/index.js +1 -1
  75. package/dest/entrypoints/server/utils.js +1 -1
  76. package/dest/error_enriching.d.ts +4 -4
  77. package/dest/error_enriching.d.ts.map +1 -1
  78. package/dest/error_enriching.js +6 -6
  79. package/dest/events/event_service.d.ts +15 -0
  80. package/dest/events/event_service.d.ts.map +1 -0
  81. package/dest/events/event_service.js +47 -0
  82. package/dest/events/index.d.ts +2 -0
  83. package/dest/events/index.d.ts.map +1 -0
  84. package/dest/events/index.js +1 -0
  85. package/dest/events/private_event_filter_validator.d.ts +9 -0
  86. package/dest/events/private_event_filter_validator.d.ts.map +1 -0
  87. package/dest/events/private_event_filter_validator.js +39 -0
  88. package/dest/logs/log_service.d.ts +26 -0
  89. package/dest/logs/log_service.d.ts.map +1 -0
  90. package/dest/logs/log_service.js +120 -0
  91. package/dest/notes/index.d.ts +2 -0
  92. package/dest/notes/index.d.ts.map +1 -0
  93. package/dest/notes/index.js +1 -0
  94. package/dest/notes/note_service.d.ts +48 -0
  95. package/dest/notes/note_service.d.ts.map +1 -0
  96. package/dest/notes/note_service.js +152 -0
  97. package/dest/oracle_version.d.ts +2 -2
  98. package/dest/oracle_version.js +2 -2
  99. package/dest/private_kernel/private_kernel_execution_prover.js +4 -4
  100. package/dest/private_kernel/private_kernel_oracle.d.ts +3 -2
  101. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  102. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +6 -5
  103. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
  104. package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
  105. package/dest/public_storage/public_storage_service.d.ts +24 -0
  106. package/dest/public_storage/public_storage_service.d.ts.map +1 -0
  107. package/dest/public_storage/public_storage_service.js +26 -0
  108. package/dest/pxe.d.ts +38 -46
  109. package/dest/pxe.d.ts.map +1 -1
  110. package/dest/pxe.js +135 -143
  111. package/dest/storage/address_store/address_store.d.ts +11 -0
  112. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  113. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
  114. package/dest/storage/address_store/index.d.ts +2 -0
  115. package/dest/storage/address_store/index.d.ts.map +1 -0
  116. package/dest/storage/address_store/index.js +1 -0
  117. package/dest/storage/{sync_data_provider/sync_data_provider.d.ts → anchor_block_store/anchor_block_store.d.ts} +2 -4
  118. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  119. package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +2 -9
  120. package/dest/storage/{sync_data_provider → anchor_block_store}/index.d.ts +2 -2
  121. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  122. package/dest/storage/anchor_block_store/index.js +1 -0
  123. package/dest/storage/capsule_store/capsule_store.d.ts +57 -0
  124. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  125. package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +34 -6
  126. package/dest/storage/capsule_store/index.d.ts +2 -0
  127. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  128. package/dest/storage/capsule_store/index.js +1 -0
  129. package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +8 -5
  130. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  131. package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +46 -3
  132. package/dest/storage/contract_store/index.d.ts +2 -0
  133. package/dest/storage/contract_store/index.d.ts.map +1 -0
  134. package/dest/storage/contract_store/index.js +1 -0
  135. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  136. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  137. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
  138. package/dest/storage/index.d.ts +8 -8
  139. package/dest/storage/index.d.ts.map +1 -1
  140. package/dest/storage/index.js +7 -7
  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_data_provider/note_data_provider.d.ts → note_store/note_store.d.ts} +10 -9
  145. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  146. package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +16 -8
  147. package/dest/storage/private_event_store/private_event_store.d.ts +51 -0
  148. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  149. package/dest/storage/{private_event_data_provider/private_event_data_provider.js → private_event_store/private_event_store.js} +37 -27
  150. package/dest/storage/tagging_store/index.d.ts +4 -0
  151. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  152. package/dest/storage/tagging_store/index.js +3 -0
  153. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +21 -0
  154. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  155. package/dest/storage/tagging_store/recipient_tagging_store.js +42 -0
  156. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  157. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  158. package/dest/storage/tagging_store/sender_address_book_store.js +30 -0
  159. package/dest/storage/tagging_store/sender_tagging_store.d.ts +67 -0
  160. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  161. package/dest/storage/tagging_store/sender_tagging_store.js +196 -0
  162. package/dest/tagging/index.d.ts +15 -6
  163. package/dest/tagging/index.d.ts.map +1 -1
  164. package/dest/tagging/index.js +23 -5
  165. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
  166. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
  167. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
  168. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
  169. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
  170. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
  171. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
  172. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
  173. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +29 -0
  174. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +20 -0
  175. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  176. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
  177. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
  178. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  179. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +32 -0
  180. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +18 -0
  181. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  182. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +55 -0
  183. package/dest/tree_membership/tree_membership_service.d.ts +52 -0
  184. package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
  185. package/dest/tree_membership/tree_membership_service.js +84 -0
  186. package/package.json +16 -16
  187. package/src/bin/check_oracle_version.ts +130 -20
  188. package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +18 -22
  189. package/src/block_synchronizer/index.ts +1 -0
  190. package/src/config/index.ts +3 -3
  191. package/src/contract_function_simulator/contract_function_simulator.ts +86 -17
  192. package/src/contract_function_simulator/execution_note_cache.ts +7 -4
  193. package/src/contract_function_simulator/execution_tagging_index_cache.ts +1 -1
  194. package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
  195. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  196. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
  197. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -1
  198. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  199. package/src/contract_function_simulator/noir-structs/utility_context.ts +1 -1
  200. package/src/contract_function_simulator/oracle/interfaces.ts +5 -5
  201. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
  202. package/src/contract_function_simulator/oracle/note_packing_utils.ts +17 -3
  203. package/src/contract_function_simulator/oracle/oracle.ts +21 -7
  204. package/src/contract_function_simulator/oracle/private_execution.ts +15 -14
  205. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +92 -22
  206. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +213 -49
  207. package/src/contract_function_simulator/pick_notes.ts +1 -1
  208. package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
  209. package/src/debug/pxe_debug_utils.ts +48 -0
  210. package/src/entrypoints/client/bundle/index.ts +0 -1
  211. package/src/entrypoints/client/bundle/utils.ts +2 -2
  212. package/src/entrypoints/client/lazy/index.ts +0 -1
  213. package/src/entrypoints/client/lazy/utils.ts +2 -2
  214. package/src/entrypoints/pxe_creation_options.ts +2 -0
  215. package/src/entrypoints/server/index.ts +1 -1
  216. package/src/entrypoints/server/utils.ts +1 -1
  217. package/src/error_enriching.ts +7 -15
  218. package/src/events/event_service.ts +77 -0
  219. package/src/events/index.ts +1 -0
  220. package/src/events/private_event_filter_validator.ts +48 -0
  221. package/src/logs/log_service.ts +202 -0
  222. package/src/notes/index.ts +1 -0
  223. package/src/notes/note_service.ts +200 -0
  224. package/src/oracle_version.ts +2 -2
  225. package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +1 -1
  226. package/src/private_kernel/private_kernel_execution_prover.ts +4 -4
  227. package/src/private_kernel/private_kernel_oracle.ts +2 -1
  228. package/src/private_kernel/private_kernel_oracle_impl.ts +8 -7
  229. package/src/public_storage/public_storage_service.ts +33 -0
  230. package/src/pxe.ts +162 -181
  231. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
  232. package/src/storage/address_store/index.ts +1 -0
  233. package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +2 -12
  234. package/src/storage/anchor_block_store/index.ts +1 -0
  235. package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +34 -2
  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} +65 -3
  238. package/src/storage/contract_store/index.ts +1 -0
  239. package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
  240. package/src/storage/index.ts +7 -7
  241. package/src/storage/note_store/index.ts +2 -0
  242. package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +19 -10
  243. package/src/storage/{private_event_data_provider/private_event_data_provider.ts → private_event_store/private_event_store.ts} +60 -41
  244. package/src/storage/tagging_store/index.ts +3 -0
  245. package/src/storage/tagging_store/recipient_tagging_store.ts +53 -0
  246. package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
  247. package/src/storage/tagging_store/sender_tagging_store.ts +244 -0
  248. package/src/tagging/index.ts +27 -5
  249. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -0
  250. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
  251. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +43 -0
  252. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +96 -0
  253. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +44 -0
  254. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +72 -0
  255. package/src/tree_membership/tree_membership_service.ts +112 -0
  256. package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -267
  257. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
  258. package/dest/contract_function_simulator/execution_data_provider.js +0 -14
  259. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -123
  260. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
  261. package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -696
  262. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
  263. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  264. package/dest/storage/address_data_provider/index.d.ts +0 -2
  265. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  266. package/dest/storage/address_data_provider/index.js +0 -1
  267. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -25
  268. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  269. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  270. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  271. package/dest/storage/capsule_data_provider/index.js +0 -1
  272. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  273. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  274. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  275. package/dest/storage/contract_data_provider/index.js +0 -1
  276. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  277. package/dest/storage/note_data_provider/index.d.ts +0 -3
  278. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  279. package/dest/storage/note_data_provider/index.js +0 -2
  280. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  281. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
  282. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  283. package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
  284. package/dest/storage/sync_data_provider/index.js +0 -1
  285. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
  286. package/dest/storage/tagging_data_provider/index.d.ts +0 -2
  287. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  288. package/dest/storage/tagging_data_provider/index.js +0 -1
  289. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -40
  290. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
  291. package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -89
  292. package/dest/synchronizer/index.d.ts +0 -2
  293. package/dest/synchronizer/index.d.ts.map +0 -1
  294. package/dest/synchronizer/index.js +0 -1
  295. package/dest/synchronizer/synchronizer.d.ts +0 -36
  296. package/dest/synchronizer/synchronizer.d.ts.map +0 -1
  297. package/dest/tagging/constants.d.ts +0 -2
  298. package/dest/tagging/constants.d.ts.map +0 -1
  299. package/dest/tagging/constants.js +0 -2
  300. package/dest/tagging/siloed_tag.d.ts +0 -14
  301. package/dest/tagging/siloed_tag.d.ts.map +0 -1
  302. package/dest/tagging/siloed_tag.js +0 -20
  303. package/dest/tagging/tag.d.ts +0 -12
  304. package/dest/tagging/tag.d.ts.map +0 -1
  305. package/dest/tagging/tag.js +0 -17
  306. package/dest/tagging/utils.d.ts +0 -18
  307. package/dest/tagging/utils.d.ts.map +0 -1
  308. package/dest/tagging/utils.js +0 -24
  309. package/src/contract_function_simulator/execution_data_provider.ts +0 -342
  310. package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1023
  311. package/src/storage/address_data_provider/index.ts +0 -1
  312. package/src/storage/capsule_data_provider/index.ts +0 -1
  313. package/src/storage/contract_data_provider/index.ts +0 -1
  314. package/src/storage/note_data_provider/index.ts +0 -2
  315. package/src/storage/sync_data_provider/index.ts +0 -1
  316. package/src/storage/tagging_data_provider/index.ts +0 -1
  317. package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -120
  318. package/src/synchronizer/index.ts +0 -1
  319. package/src/tagging/constants.ts +0 -2
  320. package/src/tagging/siloed_tag.ts +0 -22
  321. package/src/tagging/tag.ts +0 -16
  322. package/src/tagging/utils.ts +0 -31
@@ -1,2 +1,2 @@
1
- export { SyncDataProvider } from './sync_data_provider.js';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3N5bmNfZGF0YV9wcm92aWRlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQyJ9
1
+ export { AnchorBlockStore } from './anchor_block_store.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2FuY2hvcl9ibG9ja19zdG9yZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/anchor_block_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ export { AnchorBlockStore } from './anchor_block_store.js';
@@ -0,0 +1,57 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { type Logger } from '@aztec/foundation/log';
3
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ export declare class CapsuleStore {
6
+ #private;
7
+ logger: Logger;
8
+ constructor(store: AztecAsyncKVStore);
9
+ /**
10
+ * Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `loadCapsule`.
11
+ * * If data was already stored at this slot, it is overwritten.
12
+ * @param contractAddress - The contract address to scope the data under.
13
+ * @param slot - The slot in the database in which to store the value. Slots need not be contiguous.
14
+ * @param capsule - An array of field elements representing the capsule.
15
+ * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. It works similarly
16
+ * to public contract storage in that it's indexed by the contract address and storage slot but instead of the global
17
+ * network state it's backed by local PXE db.
18
+ */
19
+ storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void>;
20
+ /**
21
+ * Returns data previously stored via `storeCapsule` in the per-contract non-volatile database.
22
+ * @param contractAddress - The contract address under which the data is scoped.
23
+ * @param slot - The slot in the database to read.
24
+ * @returns The stored data or `null` if no data is stored under the slot.
25
+ */
26
+ loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
27
+ /**
28
+ * Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
29
+ * @param contractAddress - The contract address under which the data is scoped.
30
+ * @param slot - The slot in the database to delete.
31
+ */
32
+ deleteCapsule(contractAddress: AztecAddress, slot: Fr): Promise<void>;
33
+ /**
34
+ * Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data
35
+ * structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`.
36
+ * Supports overlapping source and destination regions (which will result in the overlapped source values being
37
+ * overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)
38
+ *
39
+ * @param contractAddress - The contract address under which the data is scoped.
40
+ * @param srcSlot - The first slot to copy from.
41
+ * @param dstSlot - The first slot to copy to.
42
+ * @param numEntries - The number of entries to copy.
43
+ */
44
+ copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
45
+ /**
46
+ * Appends multiple capsules to a capsule array stored at the base slot.
47
+ * The array length is stored at the base slot, and elements are stored in consecutive slots after it.
48
+ * All operations are performed in a single transaction.
49
+ * @param contractAddress - The contract address that owns the capsule array
50
+ * @param baseSlot - The slot where the array length is stored
51
+ * @param content - Array of capsule data to append
52
+ */
53
+ appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
54
+ readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr): Promise<Fr[][]>;
55
+ setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
56
+ }
57
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvY2Fwc3VsZV9zdG9yZS9jYXBzdWxlX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQ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AAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBtG;IAED;;;;;;;OAOG;IACH,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhG;IAED,gBAAgB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAsB7E;IAED,eAAe,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,iBAmB3E;CACF"}
@@ -1,6 +1,6 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { createLogger } from '@aztec/foundation/log';
3
- export class CapsuleDataProvider {
3
+ export class CapsuleStore {
4
4
  #store;
5
5
  // Arbitrary data stored by contracts. Key is computed as `${contractAddress}:${key}`
6
6
  #capsules;
@@ -10,10 +10,24 @@ export class CapsuleDataProvider {
10
10
  this.#capsules = this.#store.openMap('capsules');
11
11
  this.logger = createLogger('pxe:capsule-data-provider');
12
12
  }
13
- async storeCapsule(contractAddress, slot, capsule) {
13
+ /**
14
+ * Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `loadCapsule`.
15
+ * * If data was already stored at this slot, it is overwritten.
16
+ * @param contractAddress - The contract address to scope the data under.
17
+ * @param slot - The slot in the database in which to store the value. Slots need not be contiguous.
18
+ * @param capsule - An array of field elements representing the capsule.
19
+ * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. It works similarly
20
+ * to public contract storage in that it's indexed by the contract address and storage slot but instead of the global
21
+ * network state it's backed by local PXE db.
22
+ */ async storeCapsule(contractAddress, slot, capsule) {
14
23
  await this.#capsules.set(dbSlotToKey(contractAddress, slot), Buffer.concat(capsule.map((value)=>value.toBuffer())));
15
24
  }
16
- async loadCapsule(contractAddress, slot) {
25
+ /**
26
+ * Returns data previously stored via `storeCapsule` in the per-contract non-volatile database.
27
+ * @param contractAddress - The contract address under which the data is scoped.
28
+ * @param slot - The slot in the database to read.
29
+ * @returns The stored data or `null` if no data is stored under the slot.
30
+ */ async loadCapsule(contractAddress, slot) {
17
31
  const dataBuffer = await this.#capsules.getAsync(dbSlotToKey(contractAddress, slot));
18
32
  if (!dataBuffer) {
19
33
  this.logger.trace(`Data not found for contract ${contractAddress.toString()} and slot ${slot.toString()}`);
@@ -25,10 +39,24 @@ export class CapsuleDataProvider {
25
39
  }
26
40
  return capsule;
27
41
  }
28
- async deleteCapsule(contractAddress, slot) {
42
+ /**
43
+ * Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
44
+ * @param contractAddress - The contract address under which the data is scoped.
45
+ * @param slot - The slot in the database to delete.
46
+ */ async deleteCapsule(contractAddress, slot) {
29
47
  await this.#capsules.delete(dbSlotToKey(contractAddress, slot));
30
48
  }
31
- copyCapsule(contractAddress, srcSlot, dstSlot, numEntries) {
49
+ /**
50
+ * Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data
51
+ * structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`.
52
+ * Supports overlapping source and destination regions (which will result in the overlapped source values being
53
+ * overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)
54
+ *
55
+ * @param contractAddress - The contract address under which the data is scoped.
56
+ * @param srcSlot - The first slot to copy from.
57
+ * @param dstSlot - The first slot to copy to.
58
+ * @param numEntries - The number of entries to copy.
59
+ */ copyCapsule(contractAddress, srcSlot, dstSlot, numEntries) {
32
60
  return this.#store.transactionAsync(async ()=>{
33
61
  // In order to support overlapping source and destination regions, we need to check the relative positions of source
34
62
  // and destination. If destination is ahead of source, then by the time we overwrite source elements using forward
@@ -0,0 +1,2 @@
1
+ export { CapsuleStore } from './capsule_store.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2NhcHN1bGVfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLG9CQUFvQixDQUFDIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/capsule_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export { CapsuleStore } from './capsule_store.js';
@@ -1,18 +1,18 @@
1
1
  import type { FUNCTION_TREE_HEIGHT } from '@aztec/constants';
2
- import type { Fr } from '@aztec/foundation/fields';
2
+ import type { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import type { MembershipWitness } from '@aztec/foundation/trees';
4
4
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
5
- import { type ContractArtifact, type FunctionAbi, type FunctionArtifactWithContractName, type FunctionDebugMetadata, FunctionSelector } from '@aztec/stdlib/abi';
5
+ import { type ContractArtifact, type FunctionAbi, type FunctionArtifactWithContractName, FunctionCall, type FunctionDebugMetadata, FunctionSelector } from '@aztec/stdlib/abi';
6
6
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
7
7
  import { type ContractClass, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
8
8
  /**
9
- * ContractDataProvider serves as a data manager and retriever for Aztec.nr contracts.
9
+ * ContractStore serves as a data manager and retriever for Aztec.nr contracts.
10
10
  * It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
11
11
  * from a given contract address and function selector. The class maintains a cache of ContractTree instances
12
12
  * to efficiently serve the requested data. It interacts with the ContractDatabase and AztecNode to fetch
13
13
  * the required information and facilitate cryptographic proof generation.
14
14
  */
15
- export declare class ContractDataProvider {
15
+ export declare class ContractStore {
16
16
  #private;
17
17
  constructor(store: AztecAsyncKVStore);
18
18
  addContractArtifact(id: Fr, contract: ContractArtifact): Promise<void>;
@@ -34,6 +34,7 @@ export declare class ContractDataProvider {
34
34
  * @returns The corresponding function's artifact as an object.
35
35
  */
36
36
  getFunctionArtifact(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionArtifactWithContractName | undefined>;
37
+ getFunctionArtifactWithDebugMetadata(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionArtifactWithContractName>;
37
38
  getPublicFunctionArtifact(contractAddress: AztecAddress): Promise<FunctionArtifactWithContractName | undefined>;
38
39
  getFunctionAbi(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionAbi | undefined>;
39
40
  /**
@@ -60,5 +61,7 @@ export declare class ContractDataProvider {
60
61
  getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<typeof FUNCTION_TREE_HEIGHT> | undefined>;
61
62
  getDebugContractName(contractAddress: AztecAddress): Promise<string | undefined>;
62
63
  getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
64
+ getFunctionCall(functionName: string, args: any[], to: AztecAddress): Promise<FunctionCall>;
65
+ syncPrivateState(contractAddress: AztecAddress, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (privateSyncCall: FunctionCall) => Promise<any>): Promise<any>;
63
66
  }
64
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfZGF0YV9wcm92aWRlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvY29udHJhY3RfZGF0YV9wcm92aWRlci9jb250cmFjdF9kYXRhX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sa0JBQWtCLEN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AEY,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,mBAI1F;IA8BY,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAuBvG;IAGY,gBAAgB,CAC3B,eAAe,EAAE,YAAY,EAC7B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,eAAe,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,CAAC,gBAajE;CACF"}
@@ -1,15 +1,16 @@
1
1
  import { toArray } from '@aztec/foundation/iterable';
2
- import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
2
+ import { isProtocolContract } from '@aztec/protocol-contracts';
3
+ import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
3
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
5
  import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
5
6
  import { PrivateFunctionsTree } from './private_functions_tree.js';
6
7
  /**
7
- * ContractDataProvider serves as a data manager and retriever for Aztec.nr contracts.
8
+ * ContractStore serves as a data manager and retriever for Aztec.nr contracts.
8
9
  * It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
9
10
  * from a given contract address and function selector. The class maintains a cache of ContractTree instances
10
11
  * to efficiently serve the requested data. It interacts with the ContractDatabase and AztecNode to fetch
11
12
  * the required information and facilitate cryptographic proof generation.
12
- */ export class ContractDataProvider {
13
+ */ export class ContractStore {
13
14
  /** Map from contract class id to private function tree. */ // TODO: Update it to be LRU cache so that it doesn't keep all the data all the time.
14
15
  #privateFunctionTrees = new Map();
15
16
  /** Map from contract address to contract class id */ #contractClassIdMap = new Map();
@@ -115,6 +116,17 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
115
116
  contractName: artifact.name
116
117
  };
117
118
  }
119
+ async getFunctionArtifactWithDebugMetadata(contractAddress, selector) {
120
+ const artifact = await this.getFunctionArtifact(contractAddress, selector);
121
+ if (!artifact) {
122
+ throw new Error(`Function artifact not found for contract ${contractAddress} and selector ${selector}.`);
123
+ }
124
+ const debug = await this.getFunctionDebugMetadata(contractAddress, selector);
125
+ return {
126
+ ...artifact,
127
+ debug
128
+ };
129
+ }
118
130
  async getPublicFunctionArtifact(contractAddress) {
119
131
  const artifact = await this.#getContractArtifactByAddress(contractAddress);
120
132
  const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
@@ -190,4 +202,35 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
190
202
  }
191
203
  }
192
204
  }
205
+ async getFunctionCall(functionName, args, to) {
206
+ const contract = await this.getContract(to);
207
+ if (!contract) {
208
+ throw new Error(`Unknown contract ${to}: add it to PXE by calling server.addContracts(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#unknown-contract-0x0-add-it-to-pxe-by-calling-serveraddcontracts`);
209
+ }
210
+ const functionDao = contract.functions.find((f)=>f.name === functionName);
211
+ if (!functionDao) {
212
+ throw new Error(`Unknown function ${functionName} in contract ${contract.name}.`);
213
+ }
214
+ return {
215
+ name: functionDao.name,
216
+ args: encodeArguments(functionDao, args),
217
+ selector: await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters),
218
+ type: functionDao.functionType,
219
+ to,
220
+ hideMsgSender: false,
221
+ isStatic: functionDao.isStatic,
222
+ returnTypes: functionDao.returnTypes
223
+ };
224
+ }
225
+ // Synchronize target contract data
226
+ async syncPrivateState(contractAddress, functionToInvokeAfterSync, utilityExecutor) {
227
+ // Protocol contracts don't have private state to sync
228
+ if (!isProtocolContract(contractAddress)) {
229
+ const syncPrivateStateFunctionCall = await this.getFunctionCall('sync_private_state', [], contractAddress);
230
+ if (functionToInvokeAfterSync && functionToInvokeAfterSync.equals(syncPrivateStateFunctionCall.selector)) {
231
+ throw new Error('Forbidden `sync_private_state` invocation. `sync_private_state` can only be invoked by PXE, manual execution can lead to inconsistencies.');
232
+ }
233
+ return utilityExecutor(syncPrivateStateFunctionCall);
234
+ }
235
+ }
193
236
  }
@@ -0,0 +1,2 @@
1
+ export { ContractStore } from './contract_store.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2NvbnRyYWN0X3N0b3JlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ export { ContractStore } from './contract_store.js';
@@ -24,4 +24,4 @@ export declare class PrivateFunctionsTree {
24
24
  getFunctionMembershipWitness(selector: FunctionSelector): Promise<MembershipWitness<typeof FUNCTION_TREE_HEIGHT>>;
25
25
  private getTree;
26
26
  }
27
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9mdW5jdGlvbnNfdHJlZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvY29udHJhY3RfZGF0YV9wcm92aWRlci9wcml2YXRlX2Z1bmN0aW9uc190cmVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLGtCQUF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CxPQUFPLENBQUMsUUFBUSxDQUFDLGdCQUFnQjtJQUZyRCxPQUFPLENBQUMsSUFBSSxDQUFDLENBQWE7SUFFMUIsT0FBTyxlQUFxRTtJQUU1RSxPQUFhLE1BQU0sQ0FBQyxRQUFRLEVBQUUsZ0JBQWdCLGlDQU83QztJQUVEOzs7Ozs7OztPQVFHO0lBQ1UsNEJBQTRCLENBQ3ZDLFFBQVEsRUFBRSxnQkFBZ0IsR0FDekIsT0FBTyxDQUFDLGlCQUFpQixDQUFDLE9BQU8sb0JBQW9CLENBQUMsQ0FBQyxDQWV6RDtZQUVhLE9BQU87Q0FNdEIifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private_functions_tree.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_store/private_functions_tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AAQ1F;;;;;GAKG;AACH,qBAAa,oBAAoB;IAGX,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAFrD,OAAO,CAAC,IAAI,CAAC,CAAa;IAE1B,OAAO,eAAqE;IAE5E,OAAa,MAAM,CAAC,QAAQ,EAAE,gBAAgB,iCAO7C;IAED;;;;;;;;OAQG;IACU,4BAA4B,CACvC,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAezD;YAEa,OAAO;CAMtB"}
@@ -1,5 +1,5 @@
1
1
  import { FUNCTION_TREE_HEIGHT } from '@aztec/constants';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { assertLength } from '@aztec/foundation/serialize';
4
4
  import { MembershipWitness } from '@aztec/foundation/trees';
5
5
  import { FunctionType } from '@aztec/stdlib/abi';
@@ -1,9 +1,9 @@
1
- export * from './address_data_provider/index.js';
2
- export * from './capsule_data_provider/index.js';
3
- export * from './contract_data_provider/index.js';
4
- export * from './note_data_provider/index.js';
5
- export * from './sync_data_provider/index.js';
6
- export * from './tagging_data_provider/index.js';
1
+ export * from './address_store/index.js';
2
+ export * from './capsule_store/index.js';
3
+ export * from './contract_store/index.js';
4
+ export * from './note_store/index.js';
5
+ export * from './anchor_block_store/index.js';
6
+ export * from './tagging_store/index.js';
7
7
  export * from './metadata.js';
8
- export * from './private_event_data_provider/private_event_data_provider.js';
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0NBQWtDLENBQUM7QUFDakQsY0FBYyxrQ0FBa0MsQ0FBQztBQUNqRCxjQUFjLG1DQUFtQyxDQUFDO0FBQ2xELGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLGtDQUFrQyxDQUFDO0FBQ2pELGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsOERBQThELENBQUMifQ==
8
+ export * from './private_event_store/private_event_store.js';
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsOENBQThDLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,eAAe,CAAC;AAC9B,cAAc,8DAA8D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,8CAA8C,CAAC"}
@@ -1,8 +1,8 @@
1
- export * from './address_data_provider/index.js';
2
- export * from './capsule_data_provider/index.js';
3
- export * from './contract_data_provider/index.js';
4
- export * from './note_data_provider/index.js';
5
- export * from './sync_data_provider/index.js';
6
- export * from './tagging_data_provider/index.js';
1
+ export * from './address_store/index.js';
2
+ export * from './capsule_store/index.js';
3
+ export * from './contract_store/index.js';
4
+ export * from './note_store/index.js';
5
+ export * from './anchor_block_store/index.js';
6
+ export * from './tagging_store/index.js';
7
7
  export * from './metadata.js';
8
- export * from './private_event_data_provider/private_event_data_provider.js';
8
+ export * from './private_event_store/private_event_store.js';
@@ -0,0 +1,3 @@
1
+ export { NoteDao } from '@aztec/stdlib/note';
2
+ export { NoteStore } from './note_store.js';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL25vdGVfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { NoteDao } from '@aztec/stdlib/note';
2
+ export { NoteStore } from './note_store.js';
@@ -1,28 +1,28 @@
1
- import type { Fr } from '@aztec/foundation/fields';
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { DataInBlock } from '@aztec/stdlib/block';
5
5
  import { type NotesFilter } from '@aztec/stdlib/note';
6
6
  import { NoteDao } from '@aztec/stdlib/note';
7
7
  /**
8
- * NoteDataProvider manages the storage and retrieval of notes.
8
+ * NoteStore manages the storage and retrieval of notes.
9
9
  *
10
10
  * Notes can be active or nullified. This class processes new notes, nullifications,
11
11
  * and performs rollback handling in the case of a reorg.
12
12
  **/
13
- export declare class NoteDataProvider {
13
+ export declare class NoteStore {
14
14
  #private;
15
15
  private constructor();
16
16
  /**
17
- * Creates and initializes a new NoteDataProvider instance.
17
+ * Creates and initializes a new NoteStore instance.
18
18
  *
19
- * This factory method creates a NoteDataProvider and restores any existing
19
+ * This factory method creates a NoteStore and restores any existing
20
20
  * scope-specific indexes from the database.
21
21
  *
22
22
  * @param store - The key-value store to use for persistence
23
- * @returns Promise resolving to a fully initialized NoteDataProvider instance
23
+ * @returns Promise resolving to a fully initialized NoteStore instance
24
24
  */
25
- static create(store: AztecAsyncKVStore): Promise<NoteDataProvider>;
25
+ static create(store: AztecAsyncKVStore): Promise<NoteStore>;
26
26
  /**
27
27
  * Adds a new scope to the note data provider.
28
28
  *
@@ -63,7 +63,8 @@ export declare class NoteDataProvider {
63
63
  *
64
64
  * @param filter - Filter criteria including contractAddress (required), and optional
65
65
  * owner, storageSlot, status, scopes, and siloedNullifier.
66
- * @returns Promise resolving to array of NoteDao objects matching the filter
66
+ * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
67
+ * returned once if this is the case)
67
68
  * @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
68
69
  */
69
70
  getNotes(filter: NotesFilter): Promise<NoteDao[]>;
@@ -80,4 +81,4 @@ export declare class NoteDataProvider {
80
81
  */
81
82
  applyNullifiers(nullifiers: DataInBlock<Fr>[]): Promise<NoteDao[]>;
82
83
  }
83
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9kYXRhX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9ub3RlX2RhdGFfcHJvdmlkZXIvbm90ZV9kYXRhX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBRW5ELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFxQyxNQUFNLGlCQUFpQixDQUFDO0FBQzVGLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUMzRCxPQUFPLEtBQUssRUFBRSxXQUFXLE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AgB7D;IAED;;;;;;;;;OASG;IACU,0BAA0B,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGtG;IAuFD;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAwGtD;IAED;;;;;;;;;;OAUG;IACH,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CA8DjE;CACF"}
@@ -4,11 +4,11 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import { NoteStatus } from '@aztec/stdlib/note';
5
5
  import { NoteDao } from '@aztec/stdlib/note';
6
6
  /**
7
- * NoteDataProvider manages the storage and retrieval of notes.
7
+ * NoteStore manages the storage and retrieval of notes.
8
8
  *
9
9
  * Notes can be active or nullified. This class processes new notes, nullifications,
10
10
  * and performs rollback handling in the case of a reorg.
11
- **/ export class NoteDataProvider {
11
+ **/ export class NoteStore {
12
12
  #store;
13
13
  #notes;
14
14
  #nullifiedNotes;
@@ -38,15 +38,15 @@ import { NoteDao } from '@aztec/stdlib/note';
38
38
  this.#notesByStorageSlotAndScope = new Map();
39
39
  }
40
40
  /**
41
- * Creates and initializes a new NoteDataProvider instance.
41
+ * Creates and initializes a new NoteStore instance.
42
42
  *
43
- * This factory method creates a NoteDataProvider and restores any existing
43
+ * This factory method creates a NoteStore and restores any existing
44
44
  * scope-specific indexes from the database.
45
45
  *
46
46
  * @param store - The key-value store to use for persistence
47
- * @returns Promise resolving to a fully initialized NoteDataProvider instance
47
+ * @returns Promise resolving to a fully initialized NoteStore instance
48
48
  */ static async create(store) {
49
- const pxeDB = new NoteDataProvider(store);
49
+ const pxeDB = new NoteStore(store);
50
50
  for await (const scope of pxeDB.#scopes.keysAsync()){
51
51
  pxeDB.#notesByContractAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_contract`));
52
52
  pxeDB.#notesByStorageSlotAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_storage_slot`));
@@ -186,7 +186,8 @@ import { NoteDao } from '@aztec/stdlib/note';
186
186
  *
187
187
  * @param filter - Filter criteria including contractAddress (required), and optional
188
188
  * owner, storageSlot, status, scopes, and siloedNullifier.
189
- * @returns Promise resolving to array of NoteDao objects matching the filter
189
+ * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
190
+ * returned once if this is the case)
190
191
  * @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
191
192
  */ async getNotes(filter) {
192
193
  filter.status = filter.status ?? NoteStatus.ACTIVE;
@@ -249,7 +250,14 @@ import { NoteDao } from '@aztec/stdlib/note';
249
250
  result.push(note);
250
251
  }
251
252
  }
252
- return result;
253
+ // A note might be present in multiple scopes - we ensure it is only returned once
254
+ const deduplicated = [];
255
+ for (const note of result){
256
+ if (!deduplicated.some((existing)=>existing.equals(note))) {
257
+ deduplicated.push(note);
258
+ }
259
+ }
260
+ return deduplicated;
253
261
  }
254
262
  /**
255
263
  * Transitions notes from "active" to "nullified" state.
@@ -0,0 +1,51 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
+ import type { EventSelector } from '@aztec/stdlib/abi';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import { type InTx, TxHash } from '@aztec/stdlib/tx';
6
+ import type { PackedPrivateEvent } from '../../pxe.js';
7
+ export type PrivateEventStoreFilter = {
8
+ contractAddress: AztecAddress;
9
+ fromBlock: number;
10
+ toBlock: number;
11
+ scopes: AztecAddress[];
12
+ txHash?: TxHash;
13
+ };
14
+ type PrivateEventMetadata = InTx & {
15
+ contractAddress: AztecAddress;
16
+ scope: AztecAddress;
17
+ };
18
+ /**
19
+ * Stores decrypted private event logs.
20
+ */
21
+ export declare class PrivateEventStore {
22
+ #private;
23
+ logger: import("@aztec/foundation/log").Logger;
24
+ constructor(store: AztecAsyncKVStore);
25
+ /**
26
+ * Store a private event log.
27
+ * @param eventSelector - The event selector of the event.
28
+ * @param msgContent - The content of the event.
29
+ * @param eventCommitmentIndex - The index of the event commitment in the nullifier tree.
30
+ * @param metadata
31
+ * contractAddress - The address of the contract that emitted the event.
32
+ * scope - The address to which the event is scoped.
33
+ * txHash - The transaction hash of the event log.
34
+ * blockNumber - The block number in which the event was emitted.
35
+ */
36
+ storePrivateEventLog(eventSelector: EventSelector, msgContent: Fr[], eventCommitmentIndex: number, metadata: PrivateEventMetadata): Promise<void>;
37
+ /**
38
+ * Returns the private events given search parameters.
39
+ * @param eventSelector - The event selector to filter by.
40
+ * @param filter - Filtering criteria:
41
+ * contractAddress: The address of the contract to get events from.
42
+ * fromBlock: The block number to search from (inclusive).
43
+ * toBlock: The block number to search upto (exclusive).
44
+ * scope: - The addresses that decrypted the logs.
45
+ * @returns - The event log contents, augmented with metadata about
46
+ * the transaction and block it the event was included in .
47
+ */
48
+ getPrivateEvents(eventSelector: EventSelector, filter: PrivateEventStoreFilter): Promise<PackedPrivateEvent[]>;
49
+ }
50
+ export {};
51
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9ldmVudF9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvcHJpdmF0ZV9ldmVudF9zdG9yZS9wcml2YXRlX2V2ZW50X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUdwRCxPQUFPLEtBQUssRUFBbUIsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFDekYsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDd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YifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private_event_store.d.ts","sourceRoot":"","sources":["../../../src/storage/private_event_store/private_event_store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,YAAY,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAUF,KAAK,oBAAoB,GAAG,IAAI,GAAG;IACjC,eAAe,EAAE,YAAY,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,iBAAiB;;IAS5B,MAAM,yCAAuC;IAE7C,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAMD;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,EAAE,EAAE,EAChB,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA8Bf;IAED;;;;;;;;;;OAUG;IACU,gBAAgB,CAC3B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAwC/B;CACF"}