@aztec/pxe 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108

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 (379) hide show
  1. package/README.md +5 -5
  2. package/dest/bin/check_oracle_version.d.ts +1 -1
  3. package/dest/bin/check_oracle_version.js +110 -10
  4. package/dest/block_synchronizer/block_synchronizer.d.ts +39 -0
  5. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
  6. package/dest/{synchronizer/synchronizer.js → block_synchronizer/block_synchronizer.js} +23 -23
  7. package/dest/block_synchronizer/index.d.ts +2 -0
  8. package/dest/block_synchronizer/index.d.ts.map +1 -0
  9. package/dest/block_synchronizer/index.js +1 -0
  10. package/dest/config/index.d.ts +9 -17
  11. package/dest/config/index.d.ts.map +1 -1
  12. package/dest/config/index.js +10 -16
  13. package/dest/config/package_info.d.ts +1 -1
  14. package/dest/config/package_info.js +1 -1
  15. package/dest/contract_function_simulator/contract_function_simulator.d.ts +44 -15
  16. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/contract_function_simulator.js +142 -57
  18. package/dest/contract_function_simulator/execution_note_cache.d.ts +11 -9
  19. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/execution_note_cache.js +28 -17
  21. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
  22. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
  23. package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
  24. package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
  25. package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
  26. package/dest/contract_function_simulator/index.d.ts +4 -2
  27. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/index.js +2 -1
  29. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -2
  30. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
  32. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  33. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
  34. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +3 -3
  35. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  36. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +8 -4
  37. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +6 -3
  38. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +12 -3
  40. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +22 -0
  41. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
  42. package/dest/contract_function_simulator/noir-structs/utility_context.js +33 -0
  43. package/dest/contract_function_simulator/oracle/index.d.ts +2 -2
  44. package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/oracle/index.js +1 -1
  46. package/dest/contract_function_simulator/oracle/interfaces.d.ts +103 -0
  47. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
  48. package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
  49. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -4
  50. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  51. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
  52. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +10 -4
  53. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  54. package/dest/contract_function_simulator/oracle/note_packing_utils.js +10 -5
  55. package/dest/contract_function_simulator/oracle/oracle.d.ts +17 -15
  56. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  57. package/dest/contract_function_simulator/oracle/oracle.js +101 -81
  58. package/dest/contract_function_simulator/oracle/private_execution.d.ts +11 -12
  59. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  60. package/dest/contract_function_simulator/oracle/private_execution.js +15 -24
  61. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +51 -25
  62. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  63. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +103 -27
  64. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +65 -36
  65. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  66. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +171 -69
  67. package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
  68. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  69. package/dest/contract_function_simulator/pick_notes.js +1 -1
  70. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  71. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  72. package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
  73. package/dest/contract_function_simulator/proxied_node.d.ts +1 -1
  74. package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -1
  75. package/dest/debug/pxe_debug_utils.d.ts +31 -0
  76. package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
  77. package/dest/debug/pxe_debug_utils.js +37 -0
  78. package/dest/entrypoints/client/bundle/index.d.ts +4 -3
  79. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  80. package/dest/entrypoints/client/bundle/index.js +2 -2
  81. package/dest/entrypoints/client/bundle/utils.d.ts +9 -9
  82. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  83. package/dest/entrypoints/client/bundle/utils.js +21 -12
  84. package/dest/entrypoints/client/lazy/index.d.ts +4 -3
  85. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  86. package/dest/entrypoints/client/lazy/index.js +2 -2
  87. package/dest/entrypoints/client/lazy/utils.d.ts +8 -8
  88. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  89. package/dest/entrypoints/client/lazy/utils.js +20 -11
  90. package/dest/entrypoints/pxe_creation_options.d.ts +5 -2
  91. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  92. package/dest/entrypoints/server/index.d.ts +5 -3
  93. package/dest/entrypoints/server/index.d.ts.map +1 -1
  94. package/dest/entrypoints/server/index.js +3 -2
  95. package/dest/entrypoints/server/utils.d.ts +5 -24
  96. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  97. package/dest/entrypoints/server/utils.js +17 -45
  98. package/dest/error_enriching.d.ts +11 -0
  99. package/dest/error_enriching.d.ts.map +1 -0
  100. package/dest/{pxe_service/error_enriching.js → error_enriching.js} +9 -6
  101. package/dest/events/event_service.d.ts +15 -0
  102. package/dest/events/event_service.d.ts.map +1 -0
  103. package/dest/events/event_service.js +47 -0
  104. package/dest/events/index.d.ts +2 -0
  105. package/dest/events/index.d.ts.map +1 -0
  106. package/dest/events/index.js +1 -0
  107. package/dest/events/private_event_filter_validator.d.ts +9 -0
  108. package/dest/events/private_event_filter_validator.d.ts.map +1 -0
  109. package/dest/events/private_event_filter_validator.js +39 -0
  110. package/dest/logs/log_service.d.ts +26 -0
  111. package/dest/logs/log_service.d.ts.map +1 -0
  112. package/dest/logs/log_service.js +120 -0
  113. package/dest/notes/index.d.ts +2 -0
  114. package/dest/notes/index.d.ts.map +1 -0
  115. package/dest/notes/index.js +1 -0
  116. package/dest/notes/note_service.d.ts +48 -0
  117. package/dest/notes/note_service.d.ts.map +1 -0
  118. package/dest/notes/note_service.js +152 -0
  119. package/dest/oracle_version.d.ts +3 -3
  120. package/dest/oracle_version.js +2 -2
  121. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +3 -3
  122. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
  123. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +7 -7
  124. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +1 -1
  125. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +6 -6
  126. package/dest/private_kernel/hints/index.d.ts +1 -1
  127. package/dest/private_kernel/index.d.ts +1 -1
  128. package/dest/private_kernel/private_kernel_execution_prover.d.ts +9 -2
  129. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  130. package/dest/private_kernel/private_kernel_execution_prover.js +38 -32
  131. package/dest/private_kernel/private_kernel_oracle.d.ts +3 -2
  132. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  133. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +10 -9
  134. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
  135. package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
  136. package/dest/public_storage/public_storage_service.d.ts +24 -0
  137. package/dest/public_storage/public_storage_service.d.ts.map +1 -0
  138. package/dest/public_storage/public_storage_service.js +26 -0
  139. package/dest/pxe.d.ts +232 -0
  140. package/dest/pxe.d.ts.map +1 -0
  141. package/dest/{pxe_service/pxe_service.js → pxe.js} +299 -324
  142. package/dest/storage/address_store/address_store.d.ts +11 -0
  143. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  144. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -4
  145. package/dest/storage/address_store/index.d.ts +2 -0
  146. package/dest/storage/address_store/index.d.ts.map +1 -0
  147. package/dest/storage/address_store/index.js +1 -0
  148. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -0
  149. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  150. package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +2 -12
  151. package/dest/storage/anchor_block_store/index.d.ts +2 -0
  152. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  153. package/dest/storage/anchor_block_store/index.js +1 -0
  154. package/dest/storage/capsule_store/capsule_store.d.ts +57 -0
  155. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  156. package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +34 -10
  157. package/dest/storage/capsule_store/index.d.ts +2 -0
  158. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  159. package/dest/storage/capsule_store/index.js +1 -0
  160. package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +10 -18
  161. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  162. package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +46 -18
  163. package/dest/storage/contract_store/index.d.ts +2 -0
  164. package/dest/storage/contract_store/index.d.ts.map +1 -0
  165. package/dest/storage/contract_store/index.js +1 -0
  166. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  167. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  168. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
  169. package/dest/storage/index.d.ts +8 -9
  170. package/dest/storage/index.d.ts.map +1 -1
  171. package/dest/storage/index.js +7 -8
  172. package/dest/storage/metadata.d.ts +1 -1
  173. package/dest/storage/note_store/index.d.ts +3 -0
  174. package/dest/storage/note_store/index.d.ts.map +1 -0
  175. package/dest/storage/note_store/index.js +2 -0
  176. package/dest/storage/note_store/note_store.d.ts +84 -0
  177. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  178. package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +144 -82
  179. package/dest/storage/private_event_store/private_event_store.d.ts +56 -0
  180. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  181. package/dest/storage/private_event_store/private_event_store.js +157 -0
  182. package/dest/storage/tagging_store/index.d.ts +4 -0
  183. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  184. package/dest/storage/tagging_store/index.js +3 -0
  185. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +21 -0
  186. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  187. package/dest/storage/tagging_store/recipient_tagging_store.js +42 -0
  188. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  189. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  190. package/dest/storage/tagging_store/sender_address_book_store.js +30 -0
  191. package/dest/storage/tagging_store/sender_tagging_store.d.ts +67 -0
  192. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  193. package/dest/storage/tagging_store/sender_tagging_store.js +196 -0
  194. package/dest/tagging/index.d.ts +16 -0
  195. package/dest/tagging/index.d.ts.map +1 -0
  196. package/dest/tagging/index.js +23 -0
  197. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
  198. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
  199. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
  200. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
  201. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
  202. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
  203. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
  204. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
  205. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +29 -0
  206. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +20 -0
  207. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  208. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
  209. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
  210. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  211. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +32 -0
  212. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +18 -0
  213. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  214. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +55 -0
  215. package/dest/tree_membership/tree_membership_service.d.ts +52 -0
  216. package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
  217. package/dest/tree_membership/tree_membership_service.js +84 -0
  218. package/package.json +22 -24
  219. package/src/bin/check_oracle_version.ts +134 -10
  220. package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +22 -23
  221. package/src/block_synchronizer/index.ts +1 -0
  222. package/src/config/index.ts +18 -32
  223. package/src/config/package_info.ts +1 -1
  224. package/src/contract_function_simulator/contract_function_simulator.ts +233 -75
  225. package/src/contract_function_simulator/execution_note_cache.ts +33 -17
  226. package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
  227. package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
  228. package/src/contract_function_simulator/index.ts +3 -1
  229. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  230. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
  231. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +10 -5
  232. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +14 -2
  233. package/src/contract_function_simulator/noir-structs/utility_context.ts +42 -0
  234. package/src/contract_function_simulator/oracle/index.ts +1 -1
  235. package/src/contract_function_simulator/oracle/interfaces.ts +175 -0
  236. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
  237. package/src/contract_function_simulator/oracle/note_packing_utils.ts +21 -5
  238. package/src/contract_function_simulator/oracle/oracle.ts +135 -80
  239. package/src/contract_function_simulator/oracle/private_execution.ts +22 -28
  240. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +200 -56
  241. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +260 -109
  242. package/src/contract_function_simulator/pick_notes.ts +1 -1
  243. package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
  244. package/src/debug/pxe_debug_utils.ts +48 -0
  245. package/src/entrypoints/client/bundle/index.ts +3 -2
  246. package/src/entrypoints/client/bundle/utils.ts +21 -23
  247. package/src/entrypoints/client/lazy/index.ts +3 -2
  248. package/src/entrypoints/client/lazy/utils.ts +20 -23
  249. package/src/entrypoints/pxe_creation_options.ts +4 -1
  250. package/src/entrypoints/server/index.ts +4 -2
  251. package/src/entrypoints/server/utils.ts +20 -68
  252. package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +11 -15
  253. package/src/events/event_service.ts +77 -0
  254. package/src/events/index.ts +1 -0
  255. package/src/events/private_event_filter_validator.ts +48 -0
  256. package/src/logs/log_service.ts +202 -0
  257. package/src/notes/index.ts +1 -0
  258. package/src/notes/note_service.ts +200 -0
  259. package/src/oracle_version.ts +2 -2
  260. package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +5 -9
  261. package/src/private_kernel/hints/compute_tx_include_by_timestamp.ts +6 -6
  262. package/src/private_kernel/private_kernel_execution_prover.ts +51 -43
  263. package/src/private_kernel/private_kernel_oracle.ts +2 -1
  264. package/src/private_kernel/private_kernel_oracle_impl.ts +10 -9
  265. package/src/public_storage/public_storage_service.ts +33 -0
  266. package/src/{pxe_service/pxe_service.ts → pxe.ts} +349 -410
  267. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -7
  268. package/src/storage/address_store/index.ts +1 -0
  269. package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +2 -17
  270. package/src/storage/anchor_block_store/index.ts +1 -0
  271. package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +34 -12
  272. package/src/storage/capsule_store/index.ts +1 -0
  273. package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +67 -28
  274. package/src/storage/contract_store/index.ts +1 -0
  275. package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
  276. package/src/storage/index.ts +7 -8
  277. package/src/storage/note_store/index.ts +2 -0
  278. package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +173 -111
  279. package/src/storage/private_event_store/private_event_store.ts +213 -0
  280. package/src/storage/tagging_store/index.ts +3 -0
  281. package/src/storage/tagging_store/recipient_tagging_store.ts +53 -0
  282. package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
  283. package/src/storage/tagging_store/sender_tagging_store.ts +244 -0
  284. package/src/tagging/index.ts +28 -0
  285. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -0
  286. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
  287. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +43 -0
  288. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +96 -0
  289. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +44 -0
  290. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +72 -0
  291. package/src/tree_membership/tree_membership_service.ts +112 -0
  292. package/dest/bin/index.d.ts +0 -3
  293. package/dest/bin/index.d.ts.map +0 -1
  294. package/dest/bin/index.js +0 -48
  295. package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -285
  296. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
  297. package/dest/contract_function_simulator/execution_data_provider.js +0 -14
  298. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +0 -87
  299. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +0 -1
  300. package/dest/contract_function_simulator/oracle/typed_oracle.js +0 -146
  301. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -158
  302. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
  303. package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
  304. package/dest/contract_function_simulator/tagging_utils.d.ts +0 -17
  305. package/dest/contract_function_simulator/tagging_utils.d.ts.map +0 -1
  306. package/dest/contract_function_simulator/tagging_utils.js +0 -23
  307. package/dest/pxe_service/error_enriching.d.ts +0 -11
  308. package/dest/pxe_service/error_enriching.d.ts.map +0 -1
  309. package/dest/pxe_service/index.d.ts +0 -3
  310. package/dest/pxe_service/index.d.ts.map +0 -1
  311. package/dest/pxe_service/index.js +0 -2
  312. package/dest/pxe_service/pxe_service.d.ts +0 -100
  313. package/dest/pxe_service/pxe_service.d.ts.map +0 -1
  314. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -13
  315. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  316. package/dest/storage/address_data_provider/index.d.ts +0 -2
  317. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  318. package/dest/storage/address_data_provider/index.js +0 -1
  319. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -27
  320. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  321. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  322. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  323. package/dest/storage/capsule_data_provider/index.js +0 -1
  324. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  325. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  326. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  327. package/dest/storage/contract_data_provider/index.js +0 -1
  328. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  329. package/dest/storage/data_provider.d.ts +0 -4
  330. package/dest/storage/data_provider.d.ts.map +0 -1
  331. package/dest/storage/data_provider.js +0 -1
  332. package/dest/storage/note_data_provider/index.d.ts +0 -3
  333. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  334. package/dest/storage/note_data_provider/index.js +0 -2
  335. package/dest/storage/note_data_provider/note_dao.d.ts +0 -100
  336. package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
  337. package/dest/storage/note_data_provider/note_dao.js +0 -102
  338. package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -20
  339. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  340. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
  341. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  342. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -96
  343. package/dest/storage/sync_data_provider/index.d.ts +0 -2
  344. package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
  345. package/dest/storage/sync_data_provider/index.js +0 -1
  346. package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -12
  347. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
  348. package/dest/storage/tagging_data_provider/index.d.ts +0 -2
  349. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  350. package/dest/storage/tagging_data_provider/index.js +0 -1
  351. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -18
  352. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
  353. package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -82
  354. package/dest/synchronizer/index.d.ts +0 -2
  355. package/dest/synchronizer/index.d.ts.map +0 -1
  356. package/dest/synchronizer/index.js +0 -1
  357. package/dest/synchronizer/synchronizer.d.ts +0 -35
  358. package/dest/synchronizer/synchronizer.d.ts.map +0 -1
  359. package/dest/test/pxe_test_suite.d.ts +0 -3
  360. package/dest/test/pxe_test_suite.d.ts.map +0 -1
  361. package/dest/test/pxe_test_suite.js +0 -97
  362. package/src/bin/index.ts +0 -62
  363. package/src/contract_function_simulator/execution_data_provider.ts +0 -361
  364. package/src/contract_function_simulator/oracle/typed_oracle.ts +0 -289
  365. package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1020
  366. package/src/contract_function_simulator/tagging_utils.ts +0 -32
  367. package/src/pxe_service/index.ts +0 -2
  368. package/src/storage/address_data_provider/index.ts +0 -1
  369. package/src/storage/capsule_data_provider/index.ts +0 -1
  370. package/src/storage/contract_data_provider/index.ts +0 -1
  371. package/src/storage/data_provider.ts +0 -3
  372. package/src/storage/note_data_provider/index.ts +0 -2
  373. package/src/storage/note_data_provider/note_dao.ts +0 -154
  374. package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -134
  375. package/src/storage/sync_data_provider/index.ts +0 -1
  376. package/src/storage/tagging_data_provider/index.ts +0 -1
  377. package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -123
  378. package/src/synchronizer/index.ts +0 -1
  379. package/src/test/pxe_test_suite.ts +0 -113
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # PXE Service & PXE
1
+ # PXE & PXE
2
2
 
3
- `PXE Service` (pronounced "pixie service") is a server-side software that provides a set of apis for interacting with the Aztec network. It acts as a bridge between the network and client applications by exposing methods to manage accounts, deploy contracts, create transactions, and retrieve public and account-specific information. It provides a secure environment for the execution of sensitive operations, ensuring private information and decrypted data are not accessible to unauthorized applications. The PXE Service is a critical component of the Aztec network, and its security and reliability are essential to the overall trustworthiness of user's data.
3
+ `PXE` (pronounced "pixie service") is a server-side software that provides a set of apis for interacting with the Aztec network. It acts as a bridge between the network and client applications by exposing methods to manage accounts, deploy contracts, create transactions, and retrieve public and account-specific information. It provides a secure environment for the execution of sensitive operations, ensuring private information and decrypted data are not accessible to unauthorized applications. The PXE is a critical component of the Aztec network, and its security and reliability are essential to the overall trustworthiness of user's data.
4
4
 
5
- `PXE` is the interface the PXE Service and every client-side instance implement. Various implementations of the client-side can exist, including those for different platforms such as mobile apps and web browsers. It is a relay between the dApps and the actual PXE Service.
5
+ `PXE` is the interface the PXE and every client-side instance implement. Various implementations of the client-side can exist, including those for different platforms such as mobile apps and web browsers. It is a relay between the dApps and the actual PXE.
6
6
 
7
- ### Main Components in an PXE Service
7
+ ### Main Components in an PXE
8
8
 
9
9
  - [Simulator](../simulator/)
10
10
  - [Key Store](../key-store/)
11
11
  - [Account State](./src/account_state/account_state.ts): It coordinates other components to synchronize and decrypt data, simulate transactions, and generate kernel proofs, for a specific account.
12
12
 
13
- ![Pixie](./pixie.png)
13
+ ![Pixie](./pixie.png)
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=check_oracle_version.d.ts.map
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tfb3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iaW4vY2hlY2tfb3JhY2xlX3ZlcnNpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -1,11 +1,9 @@
1
- import { keccak256String } from '@aztec/foundation/crypto';
2
- import deterministicStringify from 'json-stringify-deterministic';
3
- import { Oracle } from '../contract_function_simulator/oracle/oracle.js';
4
- import { TypedOracle } from '../contract_function_simulator/oracle/typed_oracle.js';
1
+ import { keccak256String } from '@aztec/foundation/crypto/keccak';
2
+ import { readFileSync } from 'fs';
3
+ import { dirname, join } from 'path';
4
+ import ts from 'typescript';
5
+ import { fileURLToPath } from 'url';
5
6
  import { ORACLE_INTERFACE_HASH } from '../oracle_version.js';
6
- // Create a minimal mock implementation of TypedOracle to instantiate the Oracle class for interface verification.
7
- class OracleMock extends TypedOracle {
8
- }
9
7
  /**
10
8
  * Verifies that the Oracle interface matches the expected interface hash.
11
9
  *
@@ -18,12 +16,114 @@ class OracleMock extends TypedOracle {
18
16
  * oracles. Ensure this checks TXE oracles as well. This hasn't been implemented yet since we don't have a clean TXE
19
17
  * oracle interface like we do in PXE (i.e., there is no single Oracle class that contains only the oracles).
20
18
  */ function assertOracleInterfaceMatches() {
21
- const oracle = new Oracle(new OracleMock());
19
+ const oracleInterfaceSignature = getOracleInterfaceSignature();
22
20
  // We use keccak256 here just because we already have it in the dependencies.
23
- const oracleInterfaceHash = keccak256String(deterministicStringify(oracle.toACIRCallback()));
21
+ const oracleInterfaceHash = keccak256String(oracleInterfaceSignature);
24
22
  if (oracleInterfaceHash !== ORACLE_INTERFACE_HASH) {
25
23
  // This check exists only to notify you when you need to update the ORACLE_VERSION constant.
26
- throw new Error(`The TypedOracle interface has changed, which implies a breaking change in the aztec.nr/PXE oracle interface. Update ORACLE_INTERFACE_HASH to ${oracleInterfaceHash} and bump ORACLE_VERSION in pxe/src/oracle_version.ts.`);
24
+ throw new Error(`The Oracle interface has changed, which implies a breaking change in the aztec.nr/PXE oracle interface. Update ORACLE_INTERFACE_HASH to ${oracleInterfaceHash} and bump ORACLE_VERSION in pxe/src/oracle_version.ts.`);
25
+ }
26
+ }
27
+ /**
28
+ * Constructs a signature of the Oracle interface while ignoring methods that are not foreign call handlers.
29
+ */ function getOracleInterfaceSignature() {
30
+ const excludedProps = [
31
+ 'handler',
32
+ 'constructor',
33
+ 'toACIRCallback',
34
+ 'handlerAsMisc',
35
+ 'handlerAsUtility',
36
+ 'handlerAsPrivate'
37
+ ];
38
+ // Get the path to Oracle.ts source file
39
+ // The script runs from dest/bin/ after compilation, so we need to go up to the package root
40
+ // then into src/ to find the source file
41
+ const currentDir = dirname(fileURLToPath(import.meta.url));
42
+ // Go up from dest/bin/ or src/bin/ to the package root (pxe/), then into src/
43
+ const packageRoot = dirname(dirname(currentDir)); // Go up from bin/ to pxe/
44
+ const oracleSourcePath = join(packageRoot, 'src/contract_function_simulator/oracle/oracle.ts');
45
+ // Read and parse the TypeScript source file
46
+ const sourceCode = readFileSync(oracleSourcePath, 'utf-8');
47
+ const sourceFile = ts.createSourceFile('oracle.ts', sourceCode, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
48
+ // Extract method signatures from the Oracle class
49
+ const methodSignatures = [];
50
+ function visit(node) {
51
+ // Look for class declaration named "Oracle"
52
+ if (ts.isClassDeclaration(node) && node.name?.text === 'Oracle') {
53
+ // Visit all members of the class
54
+ node.members.forEach((member)=>{
55
+ if (ts.isMethodDeclaration(member) && member.name && ts.isIdentifier(member.name)) {
56
+ const methodName = member.name.text;
57
+ // Skip excluded methods
58
+ if (excludedProps.includes(methodName)) {
59
+ return;
60
+ }
61
+ // Extract parameter signatures
62
+ const paramSignatures = [];
63
+ member.parameters.forEach((param)=>{
64
+ const paramName = extractParameterName(param, sourceFile);
65
+ const paramType = extractTypeString(param.type, sourceFile);
66
+ paramSignatures.push(`${paramName}: ${paramType}`);
67
+ });
68
+ // Extract return type
69
+ const returnType = extractTypeString(member.type, sourceFile);
70
+ // Build full signature: methodName(param1: Type1, param2: Type2): ReturnType
71
+ const signature = `${methodName}(${paramSignatures.join(', ')}): ${returnType}`;
72
+ methodSignatures.push(signature);
73
+ }
74
+ });
75
+ }
76
+ ts.forEachChild(node, visit);
77
+ }
78
+ visit(sourceFile);
79
+ // Sort signatures alphabetically for consistent hashing
80
+ methodSignatures.sort();
81
+ // Create a hashable representation by concatenating all signatures
82
+ return methodSignatures.join('');
83
+ }
84
+ /**
85
+ * Extracts the parameter name from a parameter node, handling destructured parameters.
86
+ */ function extractParameterName(param, sourceFile) {
87
+ const name = param.name;
88
+ if (ts.isIdentifier(name)) {
89
+ return name.text;
90
+ }
91
+ if (ts.isArrayBindingPattern(name)) {
92
+ // Handle destructured parameters like [blockNumber]: ACVMField[]
93
+ // Extract the first element name
94
+ if (name.elements.length > 0) {
95
+ const element = name.elements[0];
96
+ if (ts.isBindingElement(element)) {
97
+ const elementName = element.name;
98
+ if (ts.isIdentifier(elementName)) {
99
+ return elementName.text;
100
+ }
101
+ // Nested destructuring - use text representation
102
+ if (ts.isArrayBindingPattern(elementName) || ts.isObjectBindingPattern(elementName)) {
103
+ return elementName.getText(sourceFile);
104
+ }
105
+ }
106
+ }
107
+ // Fallback: return the text representation
108
+ return name.getText(sourceFile);
109
+ }
110
+ if (ts.isObjectBindingPattern(name)) {
111
+ // Handle object destructuring
112
+ return name.getText(sourceFile);
113
+ }
114
+ // Fallback for any other case - this should never happen but TypeScript needs it
115
+ return name.getText(sourceFile);
116
+ }
117
+ /**
118
+ * Extracts the type string from a type node, normalizing whitespace.
119
+ */ function extractTypeString(typeNode, sourceFile) {
120
+ if (!typeNode) {
121
+ return 'void';
27
122
  }
123
+ // Get the type text and normalize whitespace
124
+ let typeText = typeNode.getText(sourceFile);
125
+ // Normalize whitespace: remove extra spaces, newlines, and tabs
126
+ typeText = typeText.replace(/\s+/g, ' ').trim();
127
+ return typeText;
28
128
  }
29
129
  assertOracleInterfaceMatches();
@@ -0,0 +1,39 @@
1
+ import { type Logger } from '@aztec/foundation/log';
2
+ import type { L2TipsKVStore } from '@aztec/kv-store/stores';
3
+ import { L2BlockStream, type L2BlockStreamEvent, type L2BlockStreamEventHandler } from '@aztec/stdlib/block';
4
+ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
5
+ import type { PXEConfig } from '../config/index.js';
6
+ import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
7
+ import type { NoteStore } from '../storage/note_store/note_store.js';
8
+ import type { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
9
+ /**
10
+ * The BlockSynchronizer class orchestrates synchronization between PXE and Aztec node, maintaining an up-to-date
11
+ * view of the L2 chain state. It handles block header retrieval, chain reorganizations, and provides an interface
12
+ * for querying sync status.
13
+ */
14
+ export declare class BlockSynchronizer implements L2BlockStreamEventHandler {
15
+ private node;
16
+ private anchorBlockStore;
17
+ private noteStore;
18
+ private privateEventStore;
19
+ private l2TipsStore;
20
+ private log;
21
+ private isSyncing;
22
+ protected readonly blockStream: L2BlockStream;
23
+ constructor(node: AztecNode, anchorBlockStore: AnchorBlockStore, noteStore: NoteStore, privateEventStore: PrivateEventStore, l2TipsStore: L2TipsKVStore, config?: Partial<Pick<PXEConfig, 'l2BlockBatchSize'>>, loggerOrSuffix?: string | Logger);
24
+ protected createBlockStream(config: Partial<Pick<PXEConfig, 'l2BlockBatchSize'>>): L2BlockStream;
25
+ /** Handle events emitted by the block stream. */
26
+ handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void>;
27
+ /**
28
+ * Syncs PXE and the node by downloading the metadata of the latest blocks, allowing simulations to use
29
+ * recent data (e.g. notes), and handling any reorgs that might have occurred.
30
+ *
31
+ * Note this BlockSynchronizer is designed to let its users control when a synchronization is run,
32
+ * so this component doesn't proactively stay up to date with the blockchain.
33
+ *
34
+ * We do this so PXE can ensure data consistency.
35
+ */
36
+ sync(): Promise<void>;
37
+ private doSync;
38
+ }
39
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfc3luY2hyb25pemVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYmxvY2tfc3luY2hyb25pemVyL2Jsb2NrX3N5bmNocm9uaXplci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFDbEUsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDNUQsT0FBTyxFQUFFLGFBQWEsRUFBRSxLQUFLLGtCQUFrQixFQUFFLEtBQUsseUJBQXlCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM3RyxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVqRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBQzVGLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBQ3JFLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sdURBQXVELENBQUM7QUFFL0Y7Ozs7R0FJRztBQUNILHFCQUFhLGlCQUFrQixZQUFXLHlCQUF5QjtJQU0vRCxPQ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1
+ import { BlockNumber } from '@aztec/foundation/branded-types';
1
2
  import { createLogger } from '@aztec/foundation/log';
2
3
  import { L2BlockStream } from '@aztec/stdlib/block';
3
4
  /**
4
- * The Synchronizer class orchestrates synchronization between the PXE and Aztec node, maintaining an up-to-date
5
+ * The BlockSynchronizer class orchestrates synchronization between PXE and Aztec node, maintaining an up-to-date
5
6
  * view of the L2 chain state. It handles block header retrieval, chain reorganizations, and provides an interface
6
7
  * for querying sync status.
7
- */ export class Synchronizer {
8
+ */ export class BlockSynchronizer {
8
9
  node;
9
- syncDataProvider;
10
- noteDataProvider;
11
- taggingDataProvider;
10
+ anchorBlockStore;
11
+ noteStore;
12
+ privateEventStore;
12
13
  l2TipsStore;
13
14
  log;
14
15
  isSyncing;
15
16
  blockStream;
16
- constructor(node, syncDataProvider, noteDataProvider, taggingDataProvider, l2TipsStore, config = {}, loggerOrSuffix){
17
+ constructor(node, anchorBlockStore, noteStore, privateEventStore, l2TipsStore, config = {}, loggerOrSuffix){
17
18
  this.node = node;
18
- this.syncDataProvider = syncDataProvider;
19
- this.noteDataProvider = noteDataProvider;
20
- this.taggingDataProvider = taggingDataProvider;
19
+ this.anchorBlockStore = anchorBlockStore;
20
+ this.noteStore = noteStore;
21
+ this.privateEventStore = privateEventStore;
21
22
  this.l2TipsStore = l2TipsStore;
22
- this.log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:synchronizer:${loggerOrSuffix}` : `pxe:synchronizer`) : loggerOrSuffix;
23
+ this.log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:block_synchronizer:${loggerOrSuffix}` : `pxe:block_synchronizer`) : loggerOrSuffix;
23
24
  this.blockStream = this.createBlockStream(config);
24
25
  }
25
26
  createBlockStream(config) {
@@ -41,25 +42,22 @@ import { L2BlockStream } from '@aztec/stdlib/block';
41
42
  archive: lastBlock.archive.root.toString(),
42
43
  header: lastBlock.header.toInspect()
43
44
  });
44
- await this.syncDataProvider.setHeader(lastBlock.header);
45
+ await this.anchorBlockStore.setHeader(lastBlock.getBlockHeader());
45
46
  break;
46
47
  }
47
48
  case 'chain-pruned':
48
49
  {
49
50
  this.log.warn(`Pruning data after block ${event.block.number} due to reorg`);
50
51
  // We first unnullify and then remove so that unnullified notes that were created after the block number end up deleted.
51
- const lastSynchedBlockNumber = await this.syncDataProvider.getBlockNumber();
52
- await this.noteDataProvider.unnullifyNotesAfter(event.block.number, lastSynchedBlockNumber);
53
- await this.noteDataProvider.removeNotesAfter(event.block.number);
54
- // Remove all note tagging indexes to force a full resync. This is suboptimal, but unless we track the
55
- // block number in which each index is used it's all we can do.
56
- await this.taggingDataProvider.resetNoteSyncData();
52
+ const lastSynchedBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
53
+ await this.noteStore.rollbackNotesAndNullifiers(event.block.number, lastSynchedBlockNumber);
54
+ await this.privateEventStore.rollbackEventsAfterBlock(event.block.number, lastSynchedBlockNumber);
57
55
  // Update the header to the last block.
58
56
  const newHeader = await this.node.getBlockHeader(event.block.number);
59
57
  if (!newHeader) {
60
58
  this.log.error(`Block header not found for block number ${event.block.number} during chain prune`);
61
59
  } else {
62
- await this.syncDataProvider.setHeader(newHeader);
60
+ await this.anchorBlockStore.setHeader(newHeader);
63
61
  }
64
62
  break;
65
63
  }
@@ -68,6 +66,11 @@ import { L2BlockStream } from '@aztec/stdlib/block';
68
66
  /**
69
67
  * Syncs PXE and the node by downloading the metadata of the latest blocks, allowing simulations to use
70
68
  * recent data (e.g. notes), and handling any reorgs that might have occurred.
69
+ *
70
+ * Note this BlockSynchronizer is designed to let its users control when a synchronization is run,
71
+ * so this component doesn't proactively stay up to date with the blockchain.
72
+ *
73
+ * We do this so PXE can ensure data consistency.
71
74
  */ async sync() {
72
75
  if (this.isSyncing !== undefined) {
73
76
  this.log.debug(`Waiting for the ongoing sync to finish`);
@@ -86,17 +89,14 @@ import { L2BlockStream } from '@aztec/stdlib/block';
86
89
  async doSync() {
87
90
  let currentHeader;
88
91
  try {
89
- currentHeader = await this.syncDataProvider.getBlockHeader();
92
+ currentHeader = await this.anchorBlockStore.getBlockHeader();
90
93
  } catch {
91
94
  this.log.debug('Header is not set, requesting from the node');
92
95
  }
93
96
  if (!currentHeader) {
94
97
  // REFACTOR: We should know the header of the genesis block without having to request it from the node.
95
- await this.syncDataProvider.setHeader(await this.node.getBlockHeader(0));
98
+ await this.anchorBlockStore.setHeader(await this.node.getBlockHeader(BlockNumber.ZERO));
96
99
  }
97
100
  await this.blockStream.sync();
98
101
  }
99
- getSynchedBlockNumber() {
100
- return this.syncDataProvider.getBlockNumber();
101
- }
102
102
  }
@@ -0,0 +1,2 @@
1
+ export * from './block_synchronizer.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ibG9ja19zeW5jaHJvbml6ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx5QkFBeUIsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block_synchronizer/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './block_synchronizer.js';
@@ -2,14 +2,6 @@ import { type ConfigMappingsType } from '@aztec/foundation/config';
2
2
  import { type DataStoreConfig } from '@aztec/kv-store/config';
3
3
  import { type ChainConfig } from '@aztec/stdlib/config';
4
4
  export { getPackageInfo } from './package_info.js';
5
- /**
6
- * Temporary configuration until WASM can be used instead of native
7
- */
8
- export interface BBProverConfig {
9
- bbWorkingDirectory?: string;
10
- bbBinaryPath?: string;
11
- bbSkipCleanup?: boolean;
12
- }
13
5
  /**
14
6
  * Configuration settings for the prover factory
15
7
  */
@@ -18,26 +10,26 @@ export interface KernelProverConfig {
18
10
  proverEnabled?: boolean;
19
11
  }
20
12
  /**
21
- * Configuration settings for the PXE.
13
+ * Configuration settings for the block synchronizer.
22
14
  */
23
- export interface PXEConfig {
15
+ export interface BlockSynchronizerConfig {
24
16
  /** Maximum amount of blocks to pull from the stream in one request when synchronizing */
25
17
  l2BlockBatchSize: number;
26
18
  }
27
- export type PXEServiceConfig = PXEConfig & KernelProverConfig & BBProverConfig & DataStoreConfig & ChainConfig;
19
+ export type PXEConfig = KernelProverConfig & DataStoreConfig & ChainConfig & BlockSynchronizerConfig;
28
20
  export type CliPXEOptions = {
29
21
  /** Custom Aztec Node URL to connect to */
30
22
  nodeUrl?: string;
31
23
  };
32
- export declare const pxeConfigMappings: ConfigMappingsType<PXEServiceConfig>;
24
+ export declare const pxeConfigMappings: ConfigMappingsType<PXEConfig>;
33
25
  /**
34
- * Creates an instance of PXEServiceConfig out of environment variables using sensible defaults for integration testing if not set.
26
+ * Creates an instance of PXEConfig out of environment variables using sensible defaults for integration testing if not set.
35
27
  */
36
- export declare function getPXEServiceConfig(): PXEServiceConfig;
28
+ export declare function getPXEConfig(): PXEConfig;
37
29
  export declare const pxeCliConfigMappings: ConfigMappingsType<CliPXEOptions>;
38
- export declare const allPxeConfigMappings: ConfigMappingsType<CliPXEOptions & PXEServiceConfig>;
30
+ export declare const allPxeConfigMappings: ConfigMappingsType<CliPXEOptions & PXEConfig>;
39
31
  /**
40
32
  * Creates an instance of CliPxeOptions out of environment variables
41
33
  */
42
- export declare function getCliPXEOptions(): CliPXEOptions & PXEServiceConfig;
43
- //# sourceMappingURL=index.d.ts.map
34
+ export declare function getCliPXEOptions(): CliPXEOptions & PXEConfig;
35
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb25maWcvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtY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ot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,yFAAyF;IACzF,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,SAAS,GAAG,kBAAkB,GAAG,eAAe,GAAG,WAAW,GAAG,uBAAuB,CAAC;AAErG,MAAM,MAAM,aAAa,GAAG;IAC1B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,SAAS,CAoB3D,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,aAAa,CAKlE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,aAAa,GAAG,SAAS,CAW9E,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAQ5D"}
@@ -10,19 +10,13 @@ export const pxeConfigMappings = {
10
10
  ...numberConfigHelper(50),
11
11
  description: 'Maximum amount of blocks to pull from the stream in one request when synchronizing'
12
12
  },
13
- bbBinaryPath: {
14
- env: 'BB_BINARY_PATH',
15
- description: 'Path to the BB binary'
16
- },
17
- bbWorkingDirectory: {
18
- env: 'BB_WORKING_DIRECTORY',
19
- description: 'Working directory for the BB binary'
20
- },
21
- bbSkipCleanup: {
22
- env: 'BB_SKIP_CLEANUP',
23
- description: 'True to skip cleanup of temporary files for debugging purposes',
24
- ...booleanConfigHelper()
25
- },
13
+ // TODO: We're losing this feature in moving to bb.js api.
14
+ // Reimplement it as a setting that dumps the msgpack data on the bb.js backend if needed.
15
+ // bbSkipCleanup: {
16
+ // env: 'BB_SKIP_CLEANUP',
17
+ // description: 'True to skip cleanup of temporary files for debugging purposes',
18
+ // ...booleanConfigHelper(),
19
+ // },
26
20
  proverEnabled: {
27
21
  env: 'PXE_PROVER_ENABLED',
28
22
  description: 'Enable real proofs',
@@ -30,8 +24,8 @@ export const pxeConfigMappings = {
30
24
  }
31
25
  };
32
26
  /**
33
- * Creates an instance of PXEServiceConfig out of environment variables using sensible defaults for integration testing if not set.
34
- */ export function getPXEServiceConfig() {
27
+ * Creates an instance of PXEConfig out of environment variables using sensible defaults for integration testing if not set.
28
+ */ export function getPXEConfig() {
35
29
  return getConfigFromMappings(pxeConfigMappings);
36
30
  }
37
31
  export const pxeCliConfigMappings = {
@@ -55,7 +49,7 @@ export const allPxeConfigMappings = {
55
49
  /**
56
50
  * Creates an instance of CliPxeOptions out of environment variables
57
51
  */ export function getCliPXEOptions() {
58
- const pxeConfig = getPXEServiceConfig();
52
+ const pxeConfig = getPXEConfig();
59
53
  const cliOptions = getConfigFromMappings(pxeCliConfigMappings);
60
54
  return {
61
55
  ...pxeConfig,
@@ -2,4 +2,4 @@ export declare function getPackageInfo(): {
2
2
  version: string;
3
3
  name: string;
4
4
  };
5
- //# sourceMappingURL=package_info.d.ts.map
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZV9pbmZvLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlnL3BhY2thZ2VfaW5mby50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx3QkFBZ0IsY0FBYzs7O0VBRTdCIn0=
@@ -1,6 +1,6 @@
1
1
  export function getPackageInfo() {
2
2
  return {
3
- version: '2.0.0',
3
+ version: '4.0.0',
4
4
  name: '@aztec/pxe'
5
5
  };
6
6
  }
@@ -1,21 +1,40 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { KeyStore } from '@aztec/key-store';
2
3
  import { type CircuitSimulator } from '@aztec/simulator/client';
3
- import type { AbiDecoded, FunctionCall } from '@aztec/stdlib/abi';
4
+ import type { FunctionCall } from '@aztec/stdlib/abi';
4
5
  import { FunctionSelector } from '@aztec/stdlib/abi';
5
6
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
6
7
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
8
+ import type { AztecNode } from '@aztec/stdlib/interfaces/server';
7
9
  import { type PrivateKernelExecutionProofOutput, PrivateKernelTailCircuitPublicInputs } from '@aztec/stdlib/kernel';
8
- import { PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
9
- import type { ContractDataProvider } from '../storage/index.js';
10
- import type { ExecutionDataProvider } from './execution_data_provider.js';
10
+ import { BlockHeader, PrivateExecutionResult, TxExecutionRequest } from '@aztec/stdlib/tx';
11
+ import type { AddressStore } from '../storage/address_store/address_store.js';
12
+ import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
13
+ import type { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
14
+ import type { ContractStore } from '../storage/contract_store/contract_store.js';
15
+ import type { NoteStore } from '../storage/note_store/note_store.js';
16
+ import type { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
17
+ import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
18
+ import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
19
+ import type { SenderTaggingStore } from '../storage/tagging_store/sender_tagging_store.js';
11
20
  /**
12
21
  * The contract function simulator.
13
22
  */
14
23
  export declare class ContractFunctionSimulator {
15
- private executionDataProvider;
24
+ private contractStore;
25
+ private noteStore;
26
+ private keyStore;
27
+ private addressStore;
28
+ private aztecNode;
29
+ private anchorBlockStore;
30
+ private senderTaggingStore;
31
+ private recipientTaggingStore;
32
+ private senderAddressBookStore;
33
+ private capsuleStore;
34
+ private privateEventStore;
16
35
  private simulator;
17
36
  private log;
18
- constructor(executionDataProvider: ExecutionDataProvider, simulator: CircuitSimulator);
37
+ constructor(contractStore: ContractStore, noteStore: NoteStore, keyStore: KeyStore, addressStore: AddressStore, aztecNode: AztecNode, anchorBlockStore: AnchorBlockStore, senderTaggingStore: SenderTaggingStore, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, capsuleStore: CapsuleStore, privateEventStore: PrivateEventStore, simulator: CircuitSimulator);
19
38
  /**
20
39
  * Runs a private function.
21
40
  * @param request - The transaction request.
@@ -23,25 +42,35 @@ export declare class ContractFunctionSimulator {
23
42
  * @param contractAddress - The address of the contract (should match request.origin)
24
43
  * @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract
25
44
  * or a specific account.
45
+ * @param anchorBlockHeader - The block header to use as base state for this run.
26
46
  * @param senderForTags - The address that is used as a tagging sender when emitting private logs. Returned from
27
47
  * the `privateGetSenderForTags` oracle.
28
48
  * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
29
49
  * @returns The result of the execution.
30
50
  */
31
- run(request: TxExecutionRequest, contractAddress: AztecAddress, selector: FunctionSelector, msgSender?: AztecAddress, senderForTags?: AztecAddress, scopes?: AztecAddress[]): Promise<PrivateExecutionResult>;
51
+ run(request: TxExecutionRequest, contractAddress: AztecAddress, selector: FunctionSelector, msgSender: AztecAddress | undefined, anchorBlockHeader: BlockHeader, senderForTags?: AztecAddress, scopes?: AztecAddress[]): Promise<PrivateExecutionResult>;
32
52
  /**
33
53
  * Runs a utility function.
34
54
  * @param call - The function call to execute.
35
55
  * @param authwits - Authentication witnesses required for the function call.
56
+ * @param anchorBlockHeader - The block header to use as base state for this run.
36
57
  * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
37
58
  * accounts if not specified.
38
- * @returns A decoded ABI value containing the function's return data.
59
+ * @returns A return value of the utility function in a form as returned by the simulator (Noir fields)
39
60
  */
40
- runUtility(call: FunctionCall, authwits: AuthWitness[], scopes?: AztecAddress[]): Promise<AbiDecoded>;
41
- getStats(): import("./execution_data_provider.js").ExecutionStats;
61
+ runUtility(call: FunctionCall, authwits: AuthWitness[], anchorBlockHeader: BlockHeader, scopes?: AztecAddress[]): Promise<Fr[]>;
62
+ /**
63
+ * Returns the execution statistics collected during the simulator run.
64
+ * @returns The execution statistics.
65
+ */
66
+ getStats(): {
67
+ nodeRPCCalls: Partial<Record<keyof AztecNode, {
68
+ times: number[];
69
+ }>>;
70
+ };
42
71
  }
43
72
  /**
44
- * Generates the final public inputs of the tail kernel circuit, an empty ClientIVC proof
73
+ * Generates the final public inputs of the tail kernel circuit, an empty Chonk proof
45
74
  * and the execution steps for a `PrivateExecutionResult` as if it had been
46
75
  * processed by the private kernel prover. This skips many of the checks performed by the kernels
47
76
  * (allowing state overrides) and is much faster, while still generating a valid
@@ -49,8 +78,8 @@ export declare class ContractFunctionSimulator {
49
78
  * @param privateExecutionResult - The result of the private execution.
50
79
  * @param nonceGenerator - A nonce generator for note hashes. According to the protocol rules,
51
80
  * it can either be the first nullifier in the tx or the hash of the initial tx request if there are none.
52
- * @param contractDataProvider - A provider for contract data in order to get function names and debug info.
81
+ * @param contractStore - A provider for contract data in order to get function names and debug info.
53
82
  * @returns The simulated proving result.
54
83
  */
55
- export declare function generateSimulatedProvingResult(privateExecutionResult: PrivateExecutionResult, nonceGenerator: Fr, contractDataProvider: ContractDataProvider): Promise<PrivateKernelExecutionProofOutput<PrivateKernelTailCircuitPublicInputs>>;
56
- //# sourceMappingURL=contract_function_simulator.d.ts.map
84
+ export declare function generateSimulatedProvingResult(privateExecutionResult: PrivateExecutionResult, nonceGenerator: Fr, contractStore: ContractStore): Promise<PrivateKernelExecutionProofO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BZ05sRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"contract_function_simulator.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/contract_function_simulator.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAK9C,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,EAIL,KAAK,iCAAiC,EACtC,oCAAoC,EAKrC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAGL,sBAAsB,EAEtB,kBAAkB,EAEnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAQ1E;;GAEG;AACH,qBAAa,yBAAyB;IAIlC,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,SAAS;IAJnB,OAAO,CAAC,GAAG,CAAS;gBAGV,qBAAqB,EAAE,qBAAqB,EAC5C,SAAS,EAAE,gBAAgB;IAKrC;;;;;;;;;;;OAWG;IACU,GAAG,CACd,OAAO,EAAE,kBAAkB,EAC3B,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,eAA6C,EACtD,aAAa,CAAC,EAAE,YAAY,EAC5B,MAAM,CAAC,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,sBAAsB,CAAC;IAiGlC;;;;;;;OAOG;IACU,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IA0ClH,QAAQ;CAGT;AAYD;;;;;;;;;;;GAWG;AACH,wBAAsB,8BAA8B,CAClD,sBAAsB,EAAE,sBAAsB,EAC9C,cAAc,EAAE,EAAE,EAClB,oBAAoB,EAAE,oBAAoB,GACzC,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC,CA+LlF"}
1
+ {"version":3,"file":"contract_function_simulator.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/contract_function_simulator.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAS3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAIL,KAAK,iCAAiC,EACtC,oCAAoC,EAKrC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,WAAW,EAGX,sBAAsB,EAEtB,kBAAkB,EAGnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE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