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

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 (350) hide show
  1. package/dest/bin/check_oracle_version.d.ts +1 -1
  2. package/dest/bin/check_oracle_version.js +105 -15
  3. package/dest/block_synchronizer/block_synchronizer.d.ts +37 -0
  4. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
  5. package/dest/{synchronizer/synchronizer.js → block_synchronizer/block_synchronizer.js} +20 -22
  6. package/dest/block_synchronizer/index.d.ts +2 -0
  7. package/dest/block_synchronizer/index.d.ts.map +1 -0
  8. package/dest/block_synchronizer/index.js +1 -0
  9. package/dest/config/index.d.ts +4 -12
  10. package/dest/config/index.d.ts.map +1 -1
  11. package/dest/config/index.js +7 -13
  12. package/dest/config/package_info.d.ts +1 -1
  13. package/dest/contract_function_simulator/contract_function_simulator.d.ts +43 -14
  14. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  15. package/dest/contract_function_simulator/contract_function_simulator.js +55 -29
  16. package/dest/contract_function_simulator/execution_note_cache.d.ts +9 -7
  17. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  18. package/dest/contract_function_simulator/execution_note_cache.js +21 -13
  19. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +2 -2
  20. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  21. package/dest/contract_function_simulator/execution_tagging_index_cache.js +1 -1
  22. package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
  23. package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
  24. package/dest/contract_function_simulator/index.d.ts +1 -1
  25. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -2
  26. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  27. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
  28. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  29. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
  30. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +3 -3
  31. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
  33. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +6 -4
  34. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +12 -3
  36. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +2 -2
  37. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  38. package/dest/contract_function_simulator/noir-structs/utility_context.js +1 -1
  39. package/dest/contract_function_simulator/oracle/index.d.ts +1 -1
  40. package/dest/contract_function_simulator/oracle/interfaces.d.ts +19 -13
  41. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  42. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -4
  43. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  44. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
  45. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +10 -4
  46. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  47. package/dest/contract_function_simulator/oracle/note_packing_utils.js +10 -5
  48. package/dest/contract_function_simulator/oracle/oracle.d.ts +5 -4
  49. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  50. package/dest/contract_function_simulator/oracle/oracle.js +34 -17
  51. package/dest/contract_function_simulator/oracle/private_execution.d.ts +9 -10
  52. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  53. package/dest/contract_function_simulator/oracle/private_execution.js +12 -12
  54. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +24 -18
  55. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  56. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +41 -18
  57. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +58 -17
  58. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  59. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +147 -40
  60. package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
  61. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  62. package/dest/contract_function_simulator/pick_notes.js +1 -1
  63. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  64. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  65. package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
  66. package/dest/contract_function_simulator/proxied_node.d.ts +1 -1
  67. package/dest/contract_function_simulator/proxied_node.d.ts.map +1 -1
  68. package/dest/debug/pxe_debug_utils.d.ts +31 -0
  69. package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
  70. package/dest/debug/pxe_debug_utils.js +37 -0
  71. package/dest/entrypoints/client/bundle/index.d.ts +1 -2
  72. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  73. package/dest/entrypoints/client/bundle/index.js +0 -1
  74. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  75. package/dest/entrypoints/client/bundle/utils.js +4 -4
  76. package/dest/entrypoints/client/lazy/index.d.ts +1 -2
  77. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  78. package/dest/entrypoints/client/lazy/index.js +0 -1
  79. package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
  80. package/dest/entrypoints/client/lazy/utils.js +4 -4
  81. package/dest/entrypoints/pxe_creation_options.d.ts +3 -1
  82. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  83. package/dest/entrypoints/server/index.d.ts +2 -2
  84. package/dest/entrypoints/server/index.d.ts.map +1 -1
  85. package/dest/entrypoints/server/index.js +1 -1
  86. package/dest/entrypoints/server/utils.d.ts +1 -1
  87. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  88. package/dest/entrypoints/server/utils.js +5 -16
  89. package/dest/error_enriching.d.ts +4 -4
  90. package/dest/error_enriching.d.ts.map +1 -1
  91. package/dest/error_enriching.js +6 -6
  92. package/dest/events/event_service.d.ts +15 -0
  93. package/dest/events/event_service.d.ts.map +1 -0
  94. package/dest/events/event_service.js +47 -0
  95. package/dest/events/index.d.ts +2 -0
  96. package/dest/events/index.d.ts.map +1 -0
  97. package/dest/events/index.js +1 -0
  98. package/dest/events/private_event_filter_validator.d.ts +9 -0
  99. package/dest/events/private_event_filter_validator.d.ts.map +1 -0
  100. package/dest/events/private_event_filter_validator.js +39 -0
  101. package/dest/logs/log_service.d.ts +26 -0
  102. package/dest/logs/log_service.d.ts.map +1 -0
  103. package/dest/logs/log_service.js +120 -0
  104. package/dest/notes/index.d.ts +2 -0
  105. package/dest/notes/index.d.ts.map +1 -0
  106. package/dest/notes/index.js +1 -0
  107. package/dest/notes/note_service.d.ts +48 -0
  108. package/dest/notes/note_service.d.ts.map +1 -0
  109. package/dest/notes/note_service.js +152 -0
  110. package/dest/oracle_version.d.ts +3 -3
  111. package/dest/oracle_version.js +2 -2
  112. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +3 -3
  113. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -1
  114. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.js +7 -7
  115. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +1 -1
  116. package/dest/private_kernel/hints/index.d.ts +1 -1
  117. package/dest/private_kernel/index.d.ts +1 -1
  118. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  119. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  120. package/dest/private_kernel/private_kernel_execution_prover.js +11 -10
  121. package/dest/private_kernel/private_kernel_oracle.d.ts +3 -2
  122. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  123. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +8 -7
  124. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
  125. package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
  126. package/dest/public_storage/public_storage_service.d.ts +24 -0
  127. package/dest/public_storage/public_storage_service.d.ts.map +1 -0
  128. package/dest/public_storage/public_storage_service.js +26 -0
  129. package/dest/pxe.d.ts +47 -48
  130. package/dest/pxe.d.ts.map +1 -1
  131. package/dest/pxe.js +142 -171
  132. package/dest/storage/address_store/address_store.d.ts +11 -0
  133. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  134. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
  135. package/dest/storage/address_store/index.d.ts +2 -0
  136. package/dest/storage/address_store/index.d.ts.map +1 -0
  137. package/dest/storage/address_store/index.js +1 -0
  138. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -0
  139. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  140. package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +2 -9
  141. package/dest/storage/anchor_block_store/index.d.ts +2 -0
  142. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  143. package/dest/storage/anchor_block_store/index.js +1 -0
  144. package/dest/storage/capsule_store/capsule_store.d.ts +57 -0
  145. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  146. package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +34 -6
  147. package/dest/storage/capsule_store/index.d.ts +2 -0
  148. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  149. package/dest/storage/capsule_store/index.js +1 -0
  150. package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +7 -15
  151. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  152. package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +34 -15
  153. package/dest/storage/contract_store/index.d.ts +2 -0
  154. package/dest/storage/contract_store/index.d.ts.map +1 -0
  155. package/dest/storage/contract_store/index.js +1 -0
  156. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  157. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  158. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
  159. package/dest/storage/index.d.ts +8 -8
  160. package/dest/storage/index.d.ts.map +1 -1
  161. package/dest/storage/index.js +7 -7
  162. package/dest/storage/metadata.d.ts +1 -1
  163. package/dest/storage/note_store/index.d.ts +3 -0
  164. package/dest/storage/note_store/index.d.ts.map +1 -0
  165. package/dest/storage/note_store/index.js +2 -0
  166. package/dest/storage/{note_data_provider/note_data_provider.d.ts → note_store/note_store.d.ts} +14 -13
  167. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  168. package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +33 -19
  169. package/dest/storage/private_event_store/private_event_store.d.ts +51 -0
  170. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  171. package/dest/storage/{private_event_data_provider/private_event_data_provider.js → private_event_store/private_event_store.js} +39 -28
  172. package/dest/storage/tagging_store/index.d.ts +4 -0
  173. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  174. package/dest/storage/tagging_store/index.js +3 -0
  175. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +21 -0
  176. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  177. package/dest/storage/tagging_store/recipient_tagging_store.js +42 -0
  178. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  179. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  180. package/dest/storage/tagging_store/sender_address_book_store.js +30 -0
  181. package/dest/storage/tagging_store/sender_tagging_store.d.ts +67 -0
  182. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  183. package/dest/storage/tagging_store/sender_tagging_store.js +196 -0
  184. package/dest/tagging/index.d.ts +15 -6
  185. package/dest/tagging/index.d.ts.map +1 -1
  186. package/dest/tagging/index.js +23 -5
  187. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
  188. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
  189. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
  190. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
  191. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
  192. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
  193. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
  194. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
  195. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +29 -0
  196. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +20 -0
  197. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  198. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
  199. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
  200. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  201. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +32 -0
  202. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +18 -0
  203. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  204. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +55 -0
  205. package/dest/tree_membership/tree_membership_service.d.ts +52 -0
  206. package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
  207. package/dest/tree_membership/tree_membership_service.js +84 -0
  208. package/package.json +20 -19
  209. package/src/bin/check_oracle_version.ts +130 -20
  210. package/src/{synchronizer/synchronizer.ts → block_synchronizer/block_synchronizer.ts} +19 -22
  211. package/src/block_synchronizer/index.ts +1 -0
  212. package/src/config/index.ts +10 -25
  213. package/src/contract_function_simulator/contract_function_simulator.ts +95 -28
  214. package/src/contract_function_simulator/execution_note_cache.ts +22 -11
  215. package/src/contract_function_simulator/execution_tagging_index_cache.ts +1 -1
  216. package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
  217. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  218. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
  219. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -2
  220. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +14 -2
  221. package/src/contract_function_simulator/noir-structs/utility_context.ts +1 -1
  222. package/src/contract_function_simulator/oracle/interfaces.ts +26 -11
  223. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
  224. package/src/contract_function_simulator/oracle/note_packing_utils.ts +21 -5
  225. package/src/contract_function_simulator/oracle/oracle.ts +43 -13
  226. package/src/contract_function_simulator/oracle/private_execution.ts +17 -15
  227. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +100 -23
  228. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +223 -47
  229. package/src/contract_function_simulator/pick_notes.ts +1 -1
  230. package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
  231. package/src/debug/pxe_debug_utils.ts +48 -0
  232. package/src/entrypoints/client/bundle/index.ts +0 -1
  233. package/src/entrypoints/client/bundle/utils.ts +4 -4
  234. package/src/entrypoints/client/lazy/index.ts +0 -1
  235. package/src/entrypoints/client/lazy/utils.ts +4 -4
  236. package/src/entrypoints/pxe_creation_options.ts +2 -0
  237. package/src/entrypoints/server/index.ts +1 -1
  238. package/src/entrypoints/server/utils.ts +5 -19
  239. package/src/error_enriching.ts +7 -15
  240. package/src/events/event_service.ts +77 -0
  241. package/src/events/index.ts +1 -0
  242. package/src/events/private_event_filter_validator.ts +48 -0
  243. package/src/logs/log_service.ts +202 -0
  244. package/src/notes/index.ts +1 -0
  245. package/src/notes/note_service.ts +200 -0
  246. package/src/oracle_version.ts +2 -2
  247. package/src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts +5 -9
  248. package/src/private_kernel/private_kernel_execution_prover.ts +12 -16
  249. package/src/private_kernel/private_kernel_oracle.ts +2 -1
  250. package/src/private_kernel/private_kernel_oracle_impl.ts +10 -9
  251. package/src/public_storage/public_storage_service.ts +33 -0
  252. package/src/pxe.ts +167 -223
  253. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
  254. package/src/storage/address_store/index.ts +1 -0
  255. package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +2 -11
  256. package/src/storage/anchor_block_store/index.ts +1 -0
  257. package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +34 -2
  258. package/src/storage/capsule_store/index.ts +1 -0
  259. package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +45 -20
  260. package/src/storage/contract_store/index.ts +1 -0
  261. package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
  262. package/src/storage/index.ts +7 -7
  263. package/src/storage/note_store/index.ts +2 -0
  264. package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +41 -22
  265. package/src/storage/{private_event_data_provider/private_event_data_provider.ts → private_event_store/private_event_store.ts} +61 -47
  266. package/src/storage/tagging_store/index.ts +3 -0
  267. package/src/storage/tagging_store/recipient_tagging_store.ts +53 -0
  268. package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
  269. package/src/storage/tagging_store/sender_tagging_store.ts +244 -0
  270. package/src/tagging/index.ts +27 -5
  271. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -0
  272. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
  273. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +43 -0
  274. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +96 -0
  275. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +44 -0
  276. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +72 -0
  277. package/src/tree_membership/tree_membership_service.ts +112 -0
  278. package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -274
  279. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
  280. package/dest/contract_function_simulator/execution_data_provider.js +0 -14
  281. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -122
  282. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
  283. package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
  284. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
  285. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  286. package/dest/storage/address_data_provider/index.d.ts +0 -2
  287. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  288. package/dest/storage/address_data_provider/index.js +0 -1
  289. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -25
  290. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  291. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  292. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  293. package/dest/storage/capsule_data_provider/index.js +0 -1
  294. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  295. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  296. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  297. package/dest/storage/contract_data_provider/index.js +0 -1
  298. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  299. package/dest/storage/note_data_provider/index.d.ts +0 -3
  300. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  301. package/dest/storage/note_data_provider/index.js +0 -2
  302. package/dest/storage/note_data_provider/note_dao.d.ts +0 -100
  303. package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
  304. package/dest/storage/note_data_provider/note_dao.js +0 -102
  305. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  306. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -43
  307. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  308. package/dest/storage/sync_data_provider/index.d.ts +0 -2
  309. package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
  310. package/dest/storage/sync_data_provider/index.js +0 -1
  311. package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -10
  312. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
  313. package/dest/storage/tagging_data_provider/index.d.ts +0 -2
  314. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  315. package/dest/storage/tagging_data_provider/index.js +0 -1
  316. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -40
  317. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
  318. package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -89
  319. package/dest/synchronizer/index.d.ts +0 -2
  320. package/dest/synchronizer/index.d.ts.map +0 -1
  321. package/dest/synchronizer/index.js +0 -1
  322. package/dest/synchronizer/synchronizer.d.ts +0 -35
  323. package/dest/synchronizer/synchronizer.d.ts.map +0 -1
  324. package/dest/tagging/constants.d.ts +0 -2
  325. package/dest/tagging/constants.d.ts.map +0 -1
  326. package/dest/tagging/constants.js +0 -2
  327. package/dest/tagging/siloed_tag.d.ts +0 -14
  328. package/dest/tagging/siloed_tag.d.ts.map +0 -1
  329. package/dest/tagging/siloed_tag.js +0 -20
  330. package/dest/tagging/tag.d.ts +0 -12
  331. package/dest/tagging/tag.d.ts.map +0 -1
  332. package/dest/tagging/tag.js +0 -17
  333. package/dest/tagging/utils.d.ts +0 -18
  334. package/dest/tagging/utils.d.ts.map +0 -1
  335. package/dest/tagging/utils.js +0 -24
  336. package/src/contract_function_simulator/execution_data_provider.ts +0 -343
  337. package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1019
  338. package/src/storage/address_data_provider/index.ts +0 -1
  339. package/src/storage/capsule_data_provider/index.ts +0 -1
  340. package/src/storage/contract_data_provider/index.ts +0 -1
  341. package/src/storage/note_data_provider/index.ts +0 -2
  342. package/src/storage/note_data_provider/note_dao.ts +0 -154
  343. package/src/storage/sync_data_provider/index.ts +0 -1
  344. package/src/storage/tagging_data_provider/index.ts +0 -1
  345. package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -120
  346. package/src/synchronizer/index.ts +0 -1
  347. package/src/tagging/constants.ts +0 -2
  348. package/src/tagging/siloed_tag.ts +0 -22
  349. package/src/tagging/tag.ts +0 -16
  350. package/src/tagging/utils.ts +0 -31
@@ -17,10 +17,11 @@ import {
17
17
  MAX_PRIVATE_LOGS_PER_TX,
18
18
  } from '@aztec/constants';
19
19
  import { arrayNonEmptyLength, padArrayEnd } from '@aztec/foundation/collection';
20
- import { poseidon2Hash } from '@aztec/foundation/crypto';
21
- import { Fr } from '@aztec/foundation/fields';
20
+ import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
21
+ import { Fr } from '@aztec/foundation/curves/bn254';
22
22
  import { type Logger, createLogger } from '@aztec/foundation/log';
23
23
  import { Timer } from '@aztec/foundation/timer';
24
+ import type { KeyStore } from '@aztec/key-store';
24
25
  import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
25
26
  import { protocolContractsHash } from '@aztec/protocol-contracts';
26
27
  import {
@@ -32,12 +33,19 @@ import {
32
33
  toACVMWitness,
33
34
  witnessMapToFields,
34
35
  } from '@aztec/simulator/client';
35
- import type { AbiDecoded, FunctionCall } from '@aztec/stdlib/abi';
36
- import { FunctionSelector, FunctionType, decodeFromAbi } from '@aztec/stdlib/abi';
36
+ import type { FunctionCall } from '@aztec/stdlib/abi';
37
+ import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
37
38
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
38
39
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
39
40
  import { Gas } from '@aztec/stdlib/gas';
40
- import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
41
+ import {
42
+ computeNoteHashNonce,
43
+ computeProtocolNullifier,
44
+ computeUniqueNoteHash,
45
+ siloNoteHash,
46
+ siloNullifier,
47
+ } from '@aztec/stdlib/hash';
48
+ import type { AztecNode } from '@aztec/stdlib/interfaces/server';
41
49
  import {
42
50
  PartialPrivateTailPublicInputsForPublic,
43
51
  PartialPrivateTailPublicInputsForRollup,
@@ -53,6 +61,7 @@ import { PrivateLog } from '@aztec/stdlib/logs';
53
61
  import { ScopedL2ToL1Message } from '@aztec/stdlib/messaging';
54
62
  import { ChonkProof } from '@aztec/stdlib/proofs';
55
63
  import {
64
+ BlockHeader,
56
65
  CallContext,
57
66
  HashedValues,
58
67
  PrivateExecutionResult,
@@ -62,8 +71,15 @@ import {
62
71
  getFinalMinRevertibleSideEffectCounter,
63
72
  } from '@aztec/stdlib/tx';
64
73
 
65
- import type { ContractDataProvider } from '../storage/index.js';
66
- import type { ExecutionDataProvider } from './execution_data_provider.js';
74
+ import type { AddressStore } from '../storage/address_store/address_store.js';
75
+ import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
76
+ import type { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
77
+ import type { ContractStore } from '../storage/contract_store/contract_store.js';
78
+ import type { NoteStore } from '../storage/note_store/note_store.js';
79
+ import type { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
80
+ import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
81
+ import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
82
+ import type { SenderTaggingStore } from '../storage/tagging_store/sender_tagging_store.js';
67
83
  import { ExecutionNoteCache } from './execution_note_cache.js';
68
84
  import { ExecutionTaggingIndexCache } from './execution_tagging_index_cache.js';
69
85
  import { HashedValuesCache } from './hashed_values_cache.js';
@@ -71,6 +87,7 @@ import { Oracle } from './oracle/oracle.js';
71
87
  import { executePrivateFunction, verifyCurrentClassId } from './oracle/private_execution.js';
72
88
  import { PrivateExecutionOracle } from './oracle/private_execution_oracle.js';
73
89
  import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
90
+ import type { ProxiedNode } from './proxied_node.js';
74
91
 
75
92
  /**
76
93
  * The contract function simulator.
@@ -79,7 +96,17 @@ export class ContractFunctionSimulator {
79
96
  private log: Logger;
80
97
 
81
98
  constructor(
82
- private executionDataProvider: ExecutionDataProvider,
99
+ private contractStore: ContractStore,
100
+ private noteStore: NoteStore,
101
+ private keyStore: KeyStore,
102
+ private addressStore: AddressStore,
103
+ private aztecNode: AztecNode,
104
+ private anchorBlockStore: AnchorBlockStore,
105
+ private senderTaggingStore: SenderTaggingStore,
106
+ private recipientTaggingStore: RecipientTaggingStore,
107
+ private senderAddressBookStore: SenderAddressBookStore,
108
+ private capsuleStore: CapsuleStore,
109
+ private privateEventStore: PrivateEventStore,
83
110
  private simulator: CircuitSimulator,
84
111
  ) {
85
112
  this.log = createLogger('simulator');
@@ -92,6 +119,7 @@ export class ContractFunctionSimulator {
92
119
  * @param contractAddress - The address of the contract (should match request.origin)
93
120
  * @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract
94
121
  * or a specific account.
122
+ * @param anchorBlockHeader - The block header to use as base state for this run.
95
123
  * @param senderForTags - The address that is used as a tagging sender when emitting private logs. Returned from
96
124
  * the `privateGetSenderForTags` oracle.
97
125
  * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
@@ -102,15 +130,15 @@ export class ContractFunctionSimulator {
102
130
  contractAddress: AztecAddress,
103
131
  selector: FunctionSelector,
104
132
  msgSender = AztecAddress.fromField(Fr.MAX_FIELD_VALUE),
133
+ anchorBlockHeader: BlockHeader,
105
134
  senderForTags?: AztecAddress,
106
135
  scopes?: AztecAddress[],
107
136
  ): Promise<PrivateExecutionResult> {
108
137
  const simulatorSetupTimer = new Timer();
109
- const anchorBlockHeader = await this.executionDataProvider.getAnchorBlockHeader();
110
138
 
111
- await verifyCurrentClassId(contractAddress, this.executionDataProvider);
139
+ await verifyCurrentClassId(contractAddress, this.aztecNode, this.contractStore, anchorBlockHeader);
112
140
 
113
- const entryPointArtifact = await this.executionDataProvider.getFunctionArtifact(contractAddress, selector);
141
+ const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(contractAddress, selector);
114
142
 
115
143
  if (entryPointArtifact.functionType !== FunctionType.PRIVATE) {
116
144
  throw new Error(`Cannot run ${entryPointArtifact.functionType} function as private`);
@@ -123,7 +151,7 @@ export class ContractFunctionSimulator {
123
151
  }
124
152
 
125
153
  // reserve the first side effect for the tx hash (inserted by the private kernel)
126
- const startSideEffectCounter = 1;
154
+ const startSideEffectCounter = 2;
127
155
 
128
156
  const callContext = new CallContext(
129
157
  msgSender,
@@ -132,8 +160,8 @@ export class ContractFunctionSimulator {
132
160
  entryPointArtifact.isStatic,
133
161
  );
134
162
 
135
- const txRequestHash = await request.toTxRequest().hash();
136
- const noteCache = new ExecutionNoteCache(txRequestHash);
163
+ const protocolNullifier = await computeProtocolNullifier(await request.toTxRequest().hash());
164
+ const noteCache = new ExecutionNoteCache(protocolNullifier);
137
165
  const taggingIndexCache = new ExecutionTaggingIndexCache();
138
166
 
139
167
  const privateExecutionOracle = new PrivateExecutionOracle(
@@ -146,7 +174,17 @@ export class ContractFunctionSimulator {
146
174
  HashedValuesCache.create(request.argsOfCalls),
147
175
  noteCache,
148
176
  taggingIndexCache,
149
- this.executionDataProvider,
177
+ this.contractStore,
178
+ this.noteStore,
179
+ this.keyStore,
180
+ this.addressStore,
181
+ this.aztecNode,
182
+ this.anchorBlockStore,
183
+ this.senderTaggingStore,
184
+ this.recipientTaggingStore,
185
+ this.senderAddressBookStore,
186
+ this.capsuleStore,
187
+ this.privateEventStore,
150
188
  0, // totalPublicArgsCount
151
189
  startSideEffectCounter,
152
190
  undefined, // log
@@ -170,8 +208,8 @@ export class ContractFunctionSimulator {
170
208
  request.functionSelector,
171
209
  );
172
210
  const simulatorTeardownTimer = new Timer();
173
- const { usedTxRequestHashForNonces } = noteCache.finish();
174
- const firstNullifierHint = usedTxRequestHashForNonces ? Fr.ZERO : noteCache.getAllNullifiers()[0];
211
+ const { usedProtocolNullifierForNonces } = noteCache.finish();
212
+ const firstNullifierHint = usedProtocolNullifierForNonces ? Fr.ZERO : noteCache.getAllNullifiers()[0];
175
213
 
176
214
  const publicCallRequests = collectNested([executionResult], r =>
177
215
  r.publicInputs.publicCallRequests
@@ -207,20 +245,43 @@ export class ContractFunctionSimulator {
207
245
  * Runs a utility function.
208
246
  * @param call - The function call to execute.
209
247
  * @param authwits - Authentication witnesses required for the function call.
248
+ * @param anchorBlockHeader - The block header to use as base state for this run.
210
249
  * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
211
250
  * accounts if not specified.
212
- * @returns A decoded ABI value containing the function's return data.
251
+ * @returns A return value of the utility function in a form as returned by the simulator (Noir fields)
213
252
  */
214
- public async runUtility(call: FunctionCall, authwits: AuthWitness[], scopes?: AztecAddress[]): Promise<AbiDecoded> {
215
- await verifyCurrentClassId(call.to, this.executionDataProvider);
253
+ public async runUtility(
254
+ call: FunctionCall,
255
+ authwits: AuthWitness[],
256
+ anchorBlockHeader: BlockHeader,
257
+ scopes?: AztecAddress[],
258
+ ): Promise<Fr[]> {
259
+ await verifyCurrentClassId(call.to, this.aztecNode, this.contractStore, anchorBlockHeader);
216
260
 
217
- const entryPointArtifact = await this.executionDataProvider.getFunctionArtifact(call.to, call.selector);
261
+ const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
218
262
 
219
263
  if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
220
264
  throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
221
265
  }
222
266
 
223
- const oracle = new UtilityExecutionOracle(call.to, authwits, [], this.executionDataProvider, undefined, scopes);
267
+ const oracle = new UtilityExecutionOracle(
268
+ call.to,
269
+ authwits,
270
+ [],
271
+ anchorBlockHeader,
272
+ this.contractStore,
273
+ this.noteStore,
274
+ this.keyStore,
275
+ this.addressStore,
276
+ this.aztecNode,
277
+ this.anchorBlockStore,
278
+ this.recipientTaggingStore,
279
+ this.senderAddressBookStore,
280
+ this.capsuleStore,
281
+ this.privateEventStore,
282
+ undefined,
283
+ scopes,
284
+ );
224
285
 
225
286
  try {
226
287
  this.log.verbose(`Executing utility function ${entryPointArtifact.name}`, {
@@ -244,17 +305,23 @@ export class ContractFunctionSimulator {
244
305
  );
245
306
  });
246
307
 
247
- const returnWitness = witnessMapToFields(acirExecutionResult.returnWitness);
248
308
  this.log.verbose(`Utility simulation for ${call.to}.${call.selector} completed`);
249
- return decodeFromAbi(entryPointArtifact.returnTypes, returnWitness);
309
+ return witnessMapToFields(acirExecutionResult.returnWitness);
250
310
  } catch (err) {
251
311
  throw createSimulationError(err instanceof Error ? err : new Error('Unknown error during private execution'));
252
312
  }
253
313
  }
254
314
  // docs:end:execute_utility_function
255
315
 
316
+ /**
317
+ * Returns the execution statistics collected during the simulator run.
318
+ * @returns The execution statistics.
319
+ */
256
320
  getStats() {
257
- return this.executionDataProvider.getStats();
321
+ const nodeRPCCalls =
322
+ typeof (this.aztecNode as ProxiedNode).getStats === 'function' ? (this.aztecNode as ProxiedNode).getStats() : {};
323
+
324
+ return { nodeRPCCalls };
258
325
  }
259
326
  }
260
327
 
@@ -277,13 +344,13 @@ class OrderedSideEffect<T> {
277
344
  * @param privateExecutionResult - The result of the private execution.
278
345
  * @param nonceGenerator - A nonce generator for note hashes. According to the protocol rules,
279
346
  * it can either be the first nullifier in the tx or the hash of the initial tx request if there are none.
280
- * @param contractDataProvider - A provider for contract data in order to get function names and debug info.
347
+ * @param contractStore - A provider for contract data in order to get function names and debug info.
281
348
  * @returns The simulated proving result.
282
349
  */
283
350
  export async function generateSimulatedProvingResult(
284
351
  privateExecutionResult: PrivateExecutionResult,
285
352
  nonceGenerator: Fr,
286
- contractDataProvider: ContractDataProvider,
353
+ contractStore: ContractStore,
287
354
  ): Promise<PrivateKernelExecutionProofOutput<PrivateKernelTailCircuitPublicInputs>> {
288
355
  const siloedNoteHashes: OrderedSideEffect<Fr>[] = [];
289
356
  const nullifiers: OrderedSideEffect<Fr>[] = [];
@@ -360,7 +427,7 @@ export async function generateSimulatedProvingResult(
360
427
  : execution.publicInputs.publicTeardownCallRequest;
361
428
 
362
429
  executionSteps.push({
363
- functionName: await contractDataProvider.getDebugFunctionName(
430
+ functionName: await contractStore.getDebugFunctionName(
364
431
  execution.publicInputs.callContext.contractAddress,
365
432
  execution.publicInputs.callContext.functionSelector,
366
433
  ),
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
3
  import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
4
4
 
@@ -44,9 +44,9 @@ export class ExecutionNoteCache {
44
44
  * We don't need to use the tx request hash for nonces if another non revertible nullifier is emitted.
45
45
  * In that case we disable injecting the tx request hash as a nullifier.
46
46
  */
47
- private usedTxRequestHashForNonces = true;
47
+ private usedProtocolNullifierForNonces = true;
48
48
 
49
- constructor(private readonly txRequestHash: Fr) {}
49
+ constructor(private readonly protocolNullifier: Fr) {}
50
50
 
51
51
  /**
52
52
  * Enters the revertible phase of the transaction.
@@ -60,12 +60,11 @@ export class ExecutionNoteCache {
60
60
  }
61
61
  this.inRevertiblePhase = true;
62
62
  this.minRevertibleSideEffectCounter = minRevertibleSideEffectCounter;
63
-
64
- let nonceGenerator = this.txRequestHash;
63
+ let nonceGenerator = this.protocolNullifier;
65
64
  const nullifiers = this.getAllNullifiers();
66
65
  if (nullifiers.length > 0) {
67
66
  nonceGenerator = new Fr(nullifiers[0]);
68
- this.usedTxRequestHashForNonces = false;
67
+ this.usedProtocolNullifierForNonces = false;
69
68
  }
70
69
 
71
70
  // The existing pending notes are all non-revertible.
@@ -92,14 +91,22 @@ export class ExecutionNoteCache {
92
91
  updatedNotes.forEach(n => this.#addNote(n));
93
92
  }
94
93
 
94
+ public isSideEffectCounterRevertible(sideEffectCounter: number): boolean {
95
+ if (!this.inRevertiblePhase) {
96
+ return false;
97
+ }
98
+ return sideEffectCounter >= this.minRevertibleSideEffectCounter;
99
+ }
100
+
95
101
  public finish() {
96
- // If we never entered the revertible phase, we need to use the tx request hash as a nonce for the notes if no nullifiers have been emitted.
102
+ // If we never entered the revertible phase, we need to use the protocol nullifier to compute the nonces for the
103
+ // notes if no nullifiers have been emitted.
97
104
  if (!this.inRevertiblePhase) {
98
- this.usedTxRequestHashForNonces = this.getAllNullifiers().length === 0;
105
+ this.usedProtocolNullifierForNonces = this.getAllNullifiers().length === 0;
99
106
  }
100
107
  // If we entered the revertible phase, the nonce generator was decided based on wether or not a nullifier was emitted before entering.
101
108
  return {
102
- usedTxRequestHashForNonces: this.usedTxRequestHashForNonces,
109
+ usedProtocolNullifierForNonces: this.usedProtocolNullifierForNonces,
103
110
  };
104
111
  }
105
112
 
@@ -166,11 +173,15 @@ export class ExecutionNoteCache {
166
173
  * Return notes created up to current point in execution.
167
174
  * If a nullifier for a note in this list is emitted, the note will be deleted.
168
175
  * @param contractAddress - Contract address of the notes.
176
+ * @param owner - Owner of the notes. If undefined, returns all notes regardless of owner.
169
177
  * @param storageSlot - Storage slot of the notes.
170
178
  **/
171
- public getNotes(contractAddress: AztecAddress, storageSlot: Fr) {
179
+ public getNotes(contractAddress: AztecAddress, owner: AztecAddress | undefined, storageSlot: Fr) {
172
180
  const notes = this.noteMap.get(contractAddress.toBigInt()) ?? [];
173
- return notes.filter(n => n.note.storageSlot.equals(storageSlot)).map(n => n.note);
181
+ return notes
182
+ .filter(n => owner === undefined || n.note.owner.equals(owner))
183
+ .filter(n => n.note.storageSlot.equals(storageSlot))
184
+ .map(n => n.note);
174
185
  }
175
186
 
176
187
  /**
@@ -21,7 +21,7 @@ export class ExecutionTaggingIndexCache {
21
21
  }
22
22
 
23
23
  /**
24
- * Returns the pre tags that were used in this execution (and that need to be stored in the db).
24
+ * Returns the pre-tags that were used in this execution (and that need to be stored in the db).
25
25
  */
26
26
  public getUsedPreTags(): PreTag[] {
27
27
  return Array.from(this.taggingIndexMap.entries()).map(([secret, index]) => ({
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { HashedValues } from '@aztec/stdlib/tx';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { FieldReader } from '@aztec/foundation/serialize';
3
3
  import { EventSelector } from '@aztec/stdlib/abi';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -1,6 +1,7 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { FieldReader } from '@aztec/foundation/serialize';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
+ import { Tag } from '@aztec/stdlib/logs';
4
5
 
5
6
  /**
6
7
  * Intermediate struct used to perform batch log retrieval by PXE. The `utilityBulkRetrieveLogs` oracle expects values of this
@@ -9,19 +10,19 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
9
10
  export class LogRetrievalRequest {
10
11
  constructor(
11
12
  public contractAddress: AztecAddress,
12
- public unsiloedTag: Fr,
13
+ public tag: Tag,
13
14
  ) {}
14
15
 
15
16
  toFields(): Fr[] {
16
- return [this.contractAddress.toField(), this.unsiloedTag];
17
+ return [this.contractAddress.toField(), this.tag.value];
17
18
  }
18
19
 
19
20
  static fromFields(fields: Fr[] | FieldReader): LogRetrievalRequest {
20
21
  const reader = FieldReader.asReader(fields);
21
22
 
22
23
  const contractAddress = AztecAddress.fromField(reader.readField());
23
- const unsiloedTag = reader.readField();
24
+ const tag = new Tag(reader.readField());
24
25
 
25
- return new LogRetrievalRequest(contractAddress, unsiloedTag);
26
+ return new LogRetrievalRequest(contractAddress, tag);
26
27
  }
27
28
  }
@@ -1,6 +1,6 @@
1
1
  import { MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_CIPHERTEXT_LEN } from '@aztec/constants';
2
2
  import { range } from '@aztec/foundation/array';
3
- import { Fr } from '@aztec/foundation/fields';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import type { TxHash } from '@aztec/stdlib/tx';
5
5
 
6
6
  import { MAX_NOTE_PACKED_LEN } from './note_validation_request.js';
@@ -42,7 +42,7 @@ export class LogRetrievalResponse {
42
42
  return range(serializationLen).map(_ => Fr.zero());
43
43
  }
44
44
 
45
- static toSerializedOption(response?: LogRetrievalResponse): Fr[] {
45
+ static toSerializedOption(response: LogRetrievalResponse | null): Fr[] {
46
46
  if (response) {
47
47
  return [new Fr(1), ...response.toFields()];
48
48
  } else {
@@ -1,10 +1,10 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { FieldReader } from '@aztec/foundation/serialize';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import { TxHash } from '@aztec/stdlib/tx';
5
5
 
6
6
  // TODO(#14617): should we compute this from constants? This value is aztec-nr specific.
7
- export const MAX_NOTE_PACKED_LEN = 12;
7
+ export const MAX_NOTE_PACKED_LEN = 10;
8
8
 
9
9
  /**
10
10
  * Intermediate struct used to perform batch note validation by PXE. The `utilityValidateEnqueuedNotesAndEvents` oracle
@@ -13,7 +13,9 @@ export const MAX_NOTE_PACKED_LEN = 12;
13
13
  export class NoteValidationRequest {
14
14
  constructor(
15
15
  public contractAddress: AztecAddress,
16
+ public owner: AztecAddress,
16
17
  public storageSlot: Fr,
18
+ public randomness: Fr,
17
19
  public noteNonce: Fr,
18
20
  public content: Fr[],
19
21
  public noteHash: Fr,
@@ -26,7 +28,9 @@ export class NoteValidationRequest {
26
28
  const reader = FieldReader.asReader(fields);
27
29
 
28
30
  const contractAddress = AztecAddress.fromField(reader.readField());
31
+ const owner = AztecAddress.fromField(reader.readField());
29
32
  const storageSlot = reader.readField();
33
+ const randomness = reader.readField();
30
34
  const noteNonce = reader.readField();
31
35
 
32
36
  const contentStorage = reader.readFieldArray(MAX_NOTE_PACKED_LEN);
@@ -38,9 +42,17 @@ export class NoteValidationRequest {
38
42
  const txHash = TxHash.fromField(reader.readField());
39
43
  const recipient = AztecAddress.fromField(reader.readField());
40
44
 
45
+ if (reader.remainingFields() !== 0) {
46
+ throw new Error(
47
+ `Error converting array of fields to NoteValidationRequest. Hint: check that MAX_NOTE_PACKED_LEN is consistent with private_notes::MAX_NOTE_PACKED_LEN in Aztec-nr.`,
48
+ );
49
+ }
50
+
41
51
  return new NoteValidationRequest(
42
52
  contractAddress,
53
+ owner,
43
54
  storageSlot,
55
+ randomness,
44
56
  noteNonce,
45
57
  content,
46
58
  noteHash,
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { FieldsOf } from '@aztec/foundation/types';
3
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { UInt64 } from '@aztec/stdlib/types';
@@ -1,15 +1,16 @@
1
1
  import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
2
- import { Fr, Point } from '@aztec/foundation/fields';
2
+ import type { BlockNumber } from '@aztec/foundation/branded-types';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { Point } from '@aztec/foundation/curves/grumpkin';
3
5
  import type { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
4
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
7
  import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
6
8
  import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
7
- import type { ContractClassLog } from '@aztec/stdlib/logs';
9
+ import type { ContractClassLog, Tag } from '@aztec/stdlib/logs';
8
10
  import type { Note, NoteStatus } from '@aztec/stdlib/note';
9
11
  import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
10
12
  import type { BlockHeader } from '@aztec/stdlib/tx';
11
13
 
12
- import type { Tag } from '../../tagging/tag.js';
13
14
  import type { UtilityContext } from '../noir-structs/utility_context.js';
14
15
  import type { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
15
16
 
@@ -21,8 +22,12 @@ export interface NoteData {
21
22
  note: Note;
22
23
  /** The address of the contract that owns the note. */
23
24
  contractAddress: AztecAddress;
25
+ /** The owner of the note. */
26
+ owner: AztecAddress;
24
27
  /** The storage slot of the note. */
25
28
  storageSlot: Fr;
29
+ /** The randomness injected to the note */
30
+ randomness: Fr;
26
31
  /** The nonce injected into the note hash preimage by kernels. */
27
32
  noteNonce: Fr;
28
33
  /** A hash of the note as it gets stored in the note hash tree. */
@@ -57,23 +62,24 @@ export interface IMiscOracle {
57
62
  export interface IUtilityExecutionOracle {
58
63
  isUtility: true;
59
64
 
60
- utilityGetUtilityContext(): Promise<UtilityContext>;
65
+ utilityGetUtilityContext(): UtilityContext;
61
66
  utilityGetKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest>;
62
67
  utilityGetContractInstance(address: AztecAddress): Promise<ContractInstance>;
63
- utilityGetMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[] | undefined>;
68
+ utilityGetMembershipWitness(blockNumber: BlockNumber, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[] | undefined>;
64
69
  utilityGetNullifierMembershipWitness(
65
- blockNumber: number,
70
+ blockNumber: BlockNumber,
66
71
  nullifier: Fr,
67
72
  ): Promise<NullifierMembershipWitness | undefined>;
68
- utilityGetPublicDataWitness(blockNumber: number, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
73
+ utilityGetPublicDataWitness(blockNumber: BlockNumber, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
69
74
  utilityGetLowNullifierMembershipWitness(
70
- blockNumber: number,
75
+ blockNumber: BlockNumber,
71
76
  nullifier: Fr,
72
77
  ): Promise<NullifierMembershipWitness | undefined>;
73
- utilityGetBlockHeader(blockNumber: number): Promise<BlockHeader | undefined>;
78
+ utilityGetBlockHeader(blockNumber: BlockNumber): Promise<BlockHeader | undefined>;
74
79
  utilityGetPublicKeysAndPartialAddress(account: AztecAddress): Promise<CompleteAddress>;
75
80
  utilityGetAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
76
81
  utilityGetNotes(
82
+ owner: AztecAddress | undefined,
77
83
  storageSlot: Fr,
78
84
  numSelects: number,
79
85
  selectByIndexes: number[],
@@ -98,7 +104,7 @@ export interface IUtilityExecutionOracle {
98
104
  utilityStorageRead(
99
105
  contractAddress: AztecAddress,
100
106
  startStorageSlot: Fr,
101
- blockNumber: number,
107
+ blockNumber: BlockNumber,
102
108
  numberOfElements: number,
103
109
  ): Promise<Fr[]>;
104
110
  utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
@@ -129,7 +135,15 @@ export interface IPrivateExecutionOracle {
129
135
 
130
136
  privateStoreInExecutionCache(values: Fr[], hash: Fr): void;
131
137
  privateLoadFromExecutionCache(hash: Fr): Promise<Fr[]>;
132
- privateNotifyCreatedNote(storageSlot: Fr, noteTypeId: NoteSelector, note: Fr[], noteHash: Fr, counter: number): void;
138
+ privateNotifyCreatedNote(
139
+ owner: AztecAddress,
140
+ storageSlot: Fr,
141
+ randomness: Fr,
142
+ noteTypeId: NoteSelector,
143
+ note: Fr[],
144
+ noteHash: Fr,
145
+ counter: number,
146
+ ): void;
133
147
  privateNotifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number): Promise<void>;
134
148
  privateNotifyCreatedNullifier(innerNullifier: Fr): Promise<void>;
135
149
  privateNotifyCreatedContractClassLog(log: ContractClassLog, counter: number): void;
@@ -153,6 +167,7 @@ export interface IPrivateExecutionOracle {
153
167
  isStaticCall: boolean,
154
168
  ): Promise<void>;
155
169
  privateNotifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
170
+ privateIsSideEffectCounterRevertible(sideEffectCounter: number): Promise<boolean>;
156
171
  privateGetSenderForTags(): Promise<AztecAddress | undefined>;
157
172
  privateSetSenderForTags(senderForTags: AztecAddress): Promise<void>;
158
173
  privateGetNextAppTagAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<Tag>;
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { SiblingPath } from '@aztec/foundation/trees';
3
3
 
4
4
  export class MessageLoadOracleInputs<N extends number> {
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
3
  import type { Note } from '@aztec/stdlib/note';
4
4
 
@@ -24,6 +24,9 @@ function fromRawData(nonzeroNoteHashCounter: boolean, maybeNoteNonce: Fr): { sta
24
24
  * and only after that it packs the retrieved note. Hence it doesn't map one to one with `RetrievedNote::pack()`.
25
25
  *
26
26
  * @param contractAddress - The address of the contract that owns the note
27
+ * @param owner - The owner of the note
28
+ * @param randomness - The randomness injected into the note to get the hiding property of commitments
29
+ * @param storageSlot - The storage slot of the note
27
30
  * @param noteNonce - The nonce injected into the note hash preimage by kernels.
28
31
  * @param index - Optional index in the note hash tree. If undefined, indicates a transient note
29
32
  * @param note - The note content containing the actual note data
@@ -31,22 +34,35 @@ function fromRawData(nonzeroNoteHashCounter: boolean, maybeNoteNonce: Fr): { sta
31
34
  */
32
35
  export function packAsRetrievedNote({
33
36
  contractAddress,
37
+ owner,
38
+ randomness,
39
+ storageSlot,
34
40
  noteNonce,
35
41
  index,
36
42
  note,
37
43
  }: {
38
44
  contractAddress: AztecAddress;
45
+ owner: AztecAddress;
46
+ randomness: Fr;
47
+ storageSlot: Fr;
39
48
  noteNonce: Fr;
40
49
  index?: bigint;
41
50
  note: Note;
42
51
  }) {
43
52
  // If index is undefined, the note is transient which implies that the nonzero_note_hash_counter has to be true
44
- const noteIsTransient = index === undefined;
45
- const nonzeroNoteHashCounter = noteIsTransient ? true : false;
53
+ const nonzeroNoteHashCounter = index === undefined;
46
54
 
47
55
  // To pack the note as retrieved note we first need to reconstruct the note metadata.
48
56
  const noteMetadata = fromRawData(nonzeroNoteHashCounter, noteNonce);
49
57
 
50
- // Pack metadata first (stage and maybe_note_nonce), followed by the rest
51
- return [...note.items, contractAddress, new Fr(noteMetadata.stage), noteMetadata.maybeNoteNonce];
58
+ // Pack in order: note, contract_address, owner, randomness, storage_slot, metadata (stage, maybe_note_nonce)
59
+ return [
60
+ ...note.items,
61
+ contractAddress,
62
+ owner,
63
+ randomness,
64
+ storageSlot,
65
+ new Fr(noteMetadata.stage),
66
+ noteMetadata.maybeNoteNonce,
67
+ ];
52
68
  }