@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
@@ -0,0 +1,152 @@
1
+ import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/stdlib/hash';
2
+ import { MAX_RPC_LEN } from '@aztec/stdlib/interfaces/client';
3
+ import { Note, NoteDao } from '@aztec/stdlib/note';
4
+ import { MerkleTreeId } from '@aztec/stdlib/trees';
5
+ export class NoteService {
6
+ noteStore;
7
+ aztecNode;
8
+ anchorBlockStore;
9
+ constructor(noteStore, aztecNode, anchorBlockStore){
10
+ this.noteStore = noteStore;
11
+ this.aztecNode = aztecNode;
12
+ this.anchorBlockStore = anchorBlockStore;
13
+ }
14
+ /**
15
+ * Retrieves a set of notes stored in the database for a given contract address and storage slot.
16
+ * The query result is paginated using 'limit' and 'offset' values.
17
+ * Returns an object containing an array of note data.
18
+ *
19
+ * @param owner - The owner of the notes. If undefined, returns notes for all known owners.
20
+ * @param status - The status of notes to fetch.
21
+ * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
22
+ */ async getNotes(contractAddress, owner, storageSlot, status, scopes) {
23
+ const noteDaos = await this.noteStore.getNotes({
24
+ contractAddress,
25
+ owner,
26
+ storageSlot,
27
+ status,
28
+ scopes
29
+ });
30
+ return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier, index })=>({
31
+ contractAddress,
32
+ owner,
33
+ storageSlot,
34
+ randomness,
35
+ noteNonce,
36
+ note,
37
+ noteHash,
38
+ siloedNullifier,
39
+ // PXE can use this index to get full MembershipWitness
40
+ index
41
+ }));
42
+ }
43
+ /**
44
+ * Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
45
+ *
46
+ * Fetches notes from the NoteStore and checks which nullifiers are present in the
47
+ * onchain nullifier Merkle tree - up to the latest locally synced block. We use the
48
+ * locally synced block instead of querying the chain's 'latest' block to ensure correctness:
49
+ * notes are only marked nullified once their corresponding nullifier has been included in a
50
+ * block up to which the PXE has synced.
51
+ * This allows recent nullifications to be processed even if the node is not an archive node.
52
+ *
53
+ * @param contractAddress - The contract whose notes should be checked and nullified.
54
+ */ async syncNoteNullifiers(contractAddress) {
55
+ const syncedBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
56
+ const contractNotes = await this.noteStore.getNotes({
57
+ contractAddress
58
+ });
59
+ if (contractNotes.length === 0) {
60
+ return;
61
+ }
62
+ const nullifiersToCheck = contractNotes.map((note)=>note.siloedNullifier);
63
+ const nullifierBatches = nullifiersToCheck.reduce((acc, nullifier)=>{
64
+ if (acc[acc.length - 1].length < MAX_RPC_LEN) {
65
+ acc[acc.length - 1].push(nullifier);
66
+ } else {
67
+ acc.push([
68
+ nullifier
69
+ ]);
70
+ }
71
+ return acc;
72
+ }, [
73
+ []
74
+ ]);
75
+ const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
76
+ const foundNullifiers = nullifiersToCheck.map((nullifier, i)=>{
77
+ if (nullifierIndexes[i] !== undefined) {
78
+ return {
79
+ ...nullifierIndexes[i],
80
+ ...{
81
+ data: nullifier
82
+ }
83
+ };
84
+ }
85
+ }).filter((nullifier)=>nullifier !== undefined);
86
+ await this.noteStore.applyNullifiers(foundNullifiers);
87
+ }
88
+ async deliverNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
89
+ // We are going to store the new note in the NoteStore, which will let us later return it via `getNotes`.
90
+ // There's two things we need to check before we do this however:
91
+ // - we must make sure the note does actually exist in the note hash tree
92
+ // - we need to check if the note has already been nullified
93
+ //
94
+ // Failing to do either of the above would result in circuits getting either non-existent notes and failing to
95
+ // produce inclusion proofs for them, or getting nullified notes and producing duplicate nullifiers, both of which
96
+ // are catastrophic failure modes.
97
+ //
98
+ // Note that adding a note and removing it is *not* equivalent to never adding it in the first place. A nullifier
99
+ // emitted in a block that comes after note creation might result in the note being de-nullified by a chain reorg,
100
+ // so we must store both the note hash and nullifier block information.
101
+ // We avoid making node queries at 'latest' since we don't want to process notes or nullifiers that only exist ahead
102
+ // in time of the locally synced state.
103
+ // Note that while this technically results in historical queries, we perform it at the latest locally synced block
104
+ // number which *should* be recent enough to be available, even for non-archive nodes.
105
+ // Also note that the note should never be ahead of the synced block here since `fetchTaggedLogs` only processes
106
+ // logs up to the synced block making this only an additional safety check.
107
+ const syncedBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
108
+ // By computing siloed and unique note hashes ourselves we prevent contracts from interfering with the note storage
109
+ // of other contracts, which would constitute a security breach.
110
+ const uniqueNoteHash = await computeUniqueNoteHash(noteNonce, await siloNoteHash(contractAddress, noteHash));
111
+ const siloedNullifier = await siloNullifier(contractAddress, nullifier);
112
+ const txEffect = await this.aztecNode.getTxEffect(txHash);
113
+ if (!txEffect) {
114
+ throw new Error(`Could not find tx effect for tx hash ${txHash}`);
115
+ }
116
+ if (txEffect.l2BlockNumber > syncedBlockNumber) {
117
+ throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${syncedBlockNumber}`);
118
+ }
119
+ const noteInTx = txEffect.data.noteHashes.some((nh)=>nh.equals(uniqueNoteHash));
120
+ if (!noteInTx) {
121
+ throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present in tx ${txHash}`);
122
+ }
123
+ // We store notes by their index in the global note hash tree, which has the convenient side effect of validating
124
+ // note existence in said tree. We concurrently also check if the note's nullifier exists, performing all node
125
+ // queries in a single round-trip.
126
+ const [[uniqueNoteHashTreeIndexInBlock], [nullifierIndex]] = await Promise.all([
127
+ this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NOTE_HASH_TREE, [
128
+ uniqueNoteHash
129
+ ]),
130
+ this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, [
131
+ siloedNullifier
132
+ ])
133
+ ]);
134
+ if (uniqueNoteHashTreeIndexInBlock === undefined) {
135
+ throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present on the tree at block ${syncedBlockNumber} (from tx ${txHash})`);
136
+ }
137
+ const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, uniqueNoteHashTreeIndexInBlock.l2BlockNumber, uniqueNoteHashTreeIndexInBlock.l2BlockHash.toString(), uniqueNoteHashTreeIndexInBlock.data);
138
+ // The note was found by `recipient`, so we use that as the scope when storing the note.
139
+ await this.noteStore.addNotes([
140
+ noteDao
141
+ ], recipient);
142
+ if (nullifierIndex !== undefined) {
143
+ const { data: _, ...blockHashAndNum } = nullifierIndex;
144
+ await this.noteStore.applyNullifiers([
145
+ {
146
+ data: siloedNullifier,
147
+ ...blockHashAndNum
148
+ }
149
+ ]);
150
+ }
151
+ }
152
+ }
@@ -1,3 +1,3 @@
1
- export declare const ORACLE_VERSION = 3;
2
- export declare const ORACLE_INTERFACE_HASH = "f9168ceb5a2227c148c5021ebffd4e2ca0da99885b87c5be3ee5ac0d8dd3d67c";
3
- //# sourceMappingURL=oracle_version.d.ts.map
1
+ export declare const ORACLE_VERSION = 5;
2
+ export declare const ORACLE_INTERFACE_HASH = "d603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec";
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxJQUFJLENBQUM7QUFJaEMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
@@ -4,7 +4,7 @@
4
4
  ///
5
5
  /// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
6
6
  /// and if the oracle version is incompatible an error is thrown.
7
- export const ORACLE_VERSION = 3;
7
+ export const ORACLE_VERSION = 5;
8
8
  /// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
9
9
  /// which in turn implies that you need to update the ORACLE_VERSION constant.
10
- export const ORACLE_INTERFACE_HASH = 'f9168ceb5a2227c148c5021ebffd4e2ca0da99885b87c5be3ee5ac0d8dd3d67c';
10
+ export const ORACLE_INTERFACE_HASH = 'd603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec';
@@ -5,7 +5,7 @@ export declare class PrivateKernelResetPrivateInputsBuilder {
5
5
  private previousKernelOutput;
6
6
  private executionStack;
7
7
  private noteHashNullifierCounterMap;
8
- private validationRequestsSplitCounter;
8
+ private splitCounter;
9
9
  private previousKernel;
10
10
  private nextIteration?;
11
11
  private noteHashResetActions;
@@ -13,7 +13,7 @@ export declare class PrivateKernelResetPrivateInputsBuilder {
13
13
  private numTransientData?;
14
14
  private transientDataSquashingHints;
15
15
  private requestedDimensions;
16
- constructor(previousKernelOutput: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>, executionStack: PrivateCallExecutionResult[], noteHashNullifierCounterMap: Map<number, number>, validationRequestsSplitCounter: number);
16
+ constructor(previousKernelOutput: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>, executionStack: PrivateCallExecutionResult[], noteHashNullifierCounterMap: Map<number, number>, splitCounter: number);
17
17
  needsReset(): boolean;
18
18
  build(oracle: PrivateKernelOracle, noteHashLeafIndexMap: Map<bigint, bigint>): Promise<PrivateKernelResetCircuitPrivateInputs>;
19
19
  private reduceReadRequestActions;
@@ -25,4 +25,4 @@ export declare class PrivateKernelResetPrivateInputsBuilder {
25
25
  private needsSiloNullifiers;
26
26
  private needsSiloPrivateLogs;
27
27
  }
28
- //# sourceMappingURL=build_private_kernel_reset_private_inputs.d.ts.map
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGRfcHJpdmF0ZV9rZXJuZWxfcmVzZXRfcHJpdmF0ZV9pbnB1dHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9idWlsZF9wcml2YXRlX2tlcm5lbF9yZXNldF9wcml2YXRlX2lucHV0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFlQSxPQUFPLEVBS0wsS0FBSyxnQ0FBZ0MsRUFFckMsc0NBQXNDLEVBR3RDLEtBQUssMkJBQTJCLEVBZWpDLE1BQU0sc0JBQXNCLENBQUM7QUFDOUIsT0FBTyxFQUFFLEtBQUssMEJBQTBCLEVBQWlCLE1BQU0sa0JBQWtCLENBQUM7QUFHbEYsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQTRDdkUscUJBQWEsc0NBQXNDO0lBWS9DLE9BQU8sQ0FBQyxvQkFBb0I7SUFDNUIsT0FBTyxDQUFDLGNBQWM7SUFDdEIsT0FBTyxDQUFDLDJCQUEyQjtJQUNuQyxPQUFPLENBQUMsWUFBWTtJQWR0QixPQUFPLENBQUMsY0FBYyxDQUFtQztJQUV6RCxPQUFPLENBQUMsYUFBYSxDQUFDLENBQTZCO0lBRW5ELE9BQU8sQ0FBQyxvQkFBb0IsQ0FBcUU7SUFDakcsT0FBTyxDQUFDLHFCQUFxQixDQUFxRTtJQUNsRyxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FBUztJQUNsQyxPQUFPLENBQUMsMkJBQTJCLENBQWtFO0lBQ3JHLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBK0I7SUFFMUQsWUFDVSxvQkFBb0IsRUFBRSwyQkFBMkIsQ0FBQyxnQ0FBZ0MsQ0FBQyxFQUNuRixjQUFjLEVBQUUsMEJBQTBCLEVBQUUsRUFDNUMsMkJBQTJCLEVBQUUsR0FBRyxDQUFDLE1BQU0sRUFBRSxNQUFNLENBQUMsRUFDaEQsWUFBWSxFQUFFLE1BQU0sRUFXN0I7SUFFRCxVQUFVLElBQUksT0FBTyxDQXNCcEI7SUFFSyxLQUFLLENBQUMsTUFBTSxFQUFFLG1CQUFtQixFQUFFLG9CQUFvQixFQUFFLEdBQUcsQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLG1EQW9FakY7SUFFRCxPQUFPLENBQUMsd0JBQXdCO0lBMkJoQyxPQUFPLENBQUMsOEJBQThCO0lBdUR0QyxPQUFPLENBQUMsK0JBQStCO0lBdUR2QyxPQUFPLENBQUMsdUJBQXVCO0lBYS9CLE9BQU8sQ0FBQyx1QkFBdUI7SUFzRS9CLE9BQU8sQ0FBQyxtQkFBbUI7SUFjM0IsT0FBTyxDQUFDLG1CQUFtQjtJQWtCM0IsT0FBTyxDQUFDLG9CQUFvQjtDQXFCN0IifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"build_private_kernel_reset_private_inputs.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,EAgBjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA8CvE,qBAAa,sCAAsC;IAY/C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,2BAA2B;IACnC,OAAO,CAAC,8BAA8B;IAdxC,OAAO,CAAC,cAAc,CAAmC;IAEzD,OAAO,CAAC,aAAa,CAAC,CAA6B;IAEnD,OAAO,CAAC,oBAAoB,CAAqE;IACjG,OAAO,CAAC,qBAAqB,CAAqE;IAClG,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,2BAA2B,CAAkE;IACrG,OAAO,CAAC,mBAAmB,CAA+B;gBAGhD,oBAAoB,EAAE,2BAA2B,CAAC,gCAAgC,CAAC,EACnF,cAAc,EAAE,0BAA0B,EAAE,EAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,8BAA8B,EAAE,MAAM;IAahD,UAAU,IAAI,OAAO;IAwBf,KAAK,CAAC,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAuElF,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,8BAA8B;IAuDtC,OAAO,CAAC,+BAA+B;IAuDvC,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,uBAAuB;IAsE/B,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,oBAAoB;CAqB7B"}
1
+ {"version":3,"file":"build_private_kernel_reset_private_inputs.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/build_private_kernel_reset_private_inputs.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,gCAAgC,EAErC,sCAAsC,EAGtC,KAAK,2BAA2B,EAejC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA4CvE,qBAAa,sCAAsC;IAY/C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,2BAA2B;IACnC,OAAO,CAAC,YAAY;IAdtB,OAAO,CAAC,cAAc,CAAmC;IAEzD,OAAO,CAAC,aAAa,CAAC,CAA6B;IAEnD,OAAO,CAAC,oBAAoB,CAAqE;IACjG,OAAO,CAAC,qBAAqB,CAAqE;IAClG,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,2BAA2B,CAAkE;IACrG,OAAO,CAAC,mBAAmB,CAA+B;IAE1D,YACU,oBAAoB,EAAE,2BAA2B,CAAC,gCAAgC,CAAC,EACnF,cAAc,EAAE,0BAA0B,EAAE,EAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,YAAY,EAAE,MAAM,EAW7B;IAED,UAAU,IAAI,OAAO,CAsBpB;IAEK,KAAK,CAAC,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,mDAoEjF;IAED,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,8BAA8B;IAuDtC,OAAO,CAAC,+BAA+B;IAuDvC,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,uBAAuB;IAsE/B,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,oBAAoB;CAqB7B"}
@@ -4,12 +4,12 @@ import { padArrayEnd } from '@aztec/foundation/collection';
4
4
  import { assertLength } from '@aztec/foundation/serialize';
5
5
  import { MembershipWitness } from '@aztec/foundation/trees';
6
6
  import { privateKernelResetDimensionsConfig } from '@aztec/noir-protocol-circuits-types/client';
7
- import { KeyValidationHint, PaddedSideEffects, PrivateKernelData, PrivateKernelResetCircuitPrivateInputs, PrivateKernelResetDimensions, PrivateKernelResetHints, ReadRequestActionEnum, ReadRequestResetActions, ScopedNoteHash, ScopedNullifier, ScopedReadRequest, TransientDataSquashingHint, buildNoteHashReadRequestHintsFromResetActions, buildNullifierReadRequestHintsFromResetActions, buildTransientDataHints, findPrivateKernelResetDimensions, getNoteHashReadRequestResetActions, getNullifierReadRequestResetActions, privateKernelResetDimensionNames } from '@aztec/stdlib/kernel';
7
+ import { KeyValidationHint, PaddedSideEffects, PrivateKernelData, PrivateKernelResetCircuitPrivateInputs, PrivateKernelResetDimensions, PrivateKernelResetHints, ReadRequestActionEnum, ReadRequestResetActions, ScopedNoteHash, ScopedNullifier, TransientDataSquashingHint, buildNoteHashReadRequestHintsFromResetActions, buildNullifierReadRequestHintsFromResetActions, buildTransientDataHints, findPrivateKernelResetDimensions, getNoteHashReadRequestResetActions, getNullifierReadRequestResetActions, privateKernelResetDimensionNames } from '@aztec/stdlib/kernel';
8
8
  import { collectNested } from '@aztec/stdlib/tx';
9
9
  import { VkData } from '@aztec/stdlib/vks';
10
10
  function collectNestedReadRequests(executionStack, extractReadRequests) {
11
11
  return collectNested(executionStack, (executionResult)=>{
12
- return extractReadRequests(executionResult).getActiveItems().map((readRequest)=>new ScopedReadRequest(readRequest, executionResult.publicInputs.callContext.contractAddress));
12
+ return extractReadRequests(executionResult).getActiveItems();
13
13
  });
14
14
  }
15
15
  function getNullifierMembershipWitnessResolver(oracle) {
@@ -37,7 +37,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
37
37
  previousKernelOutput;
38
38
  executionStack;
39
39
  noteHashNullifierCounterMap;
40
- validationRequestsSplitCounter;
40
+ splitCounter;
41
41
  previousKernel;
42
42
  // If there's no next iteration, it's the final reset.
43
43
  nextIteration;
@@ -46,11 +46,11 @@ export class PrivateKernelResetPrivateInputsBuilder {
46
46
  numTransientData;
47
47
  transientDataSquashingHints;
48
48
  requestedDimensions;
49
- constructor(previousKernelOutput, executionStack, noteHashNullifierCounterMap, validationRequestsSplitCounter){
49
+ constructor(previousKernelOutput, executionStack, noteHashNullifierCounterMap, splitCounter){
50
50
  this.previousKernelOutput = previousKernelOutput;
51
51
  this.executionStack = executionStack;
52
52
  this.noteHashNullifierCounterMap = noteHashNullifierCounterMap;
53
- this.validationRequestsSplitCounter = validationRequestsSplitCounter;
53
+ this.splitCounter = splitCounter;
54
54
  this.previousKernel = previousKernelOutput.publicInputs;
55
55
  this.requestedDimensions = PrivateKernelResetDimensions.empty();
56
56
  this.noteHashResetActions = ReadRequestResetActions.empty(MAX_NOTE_HASH_READ_REQUESTS_PER_TX);
@@ -101,7 +101,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
101
101
  const paddedSideEffects = PaddedSideEffects.empty();
102
102
  return new PrivateKernelResetCircuitPrivateInputs(previousKernelData, paddedSideEffects, new PrivateKernelResetHints(await buildNoteHashReadRequestHintsFromResetActions(oracle, this.previousKernel.validationRequests.noteHashReadRequests, this.previousKernel.end.noteHashes, this.noteHashResetActions, noteHashLeafIndexMap), await buildNullifierReadRequestHintsFromResetActions({
103
103
  getNullifierMembershipWitness: getNullifierMembershipWitnessResolver(oracle)
104
- }, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions), await getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle), this.transientDataSquashingHints, this.validationRequestsSplitCounter), dimensions);
104
+ }, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions), await getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle), this.transientDataSquashingHints), dimensions);
105
105
  }
106
106
  reduceReadRequestActions(resetActions, maxPending, maxSettled) {
107
107
  let numPending = 0;
@@ -216,7 +216,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
216
216
  futureNoteHashReads.push(...this.previousKernel.validationRequests.noteHashReadRequests.getActiveItems());
217
217
  futureNullifierReads.push(...this.previousKernel.validationRequests.nullifierReadRequests.getActiveItems());
218
218
  }
219
- const { numTransientData, hints: transientDataSquashingHints } = buildTransientDataHints(this.previousKernel.end.noteHashes, this.previousKernel.end.nullifiers, futureNoteHashReads, futureNullifierReads, this.noteHashNullifierCounterMap, this.validationRequestsSplitCounter);
219
+ const { numTransientData, hints: transientDataSquashingHints } = buildTransientDataHints(this.previousKernel.end.noteHashes, this.previousKernel.end.nullifiers, futureNoteHashReads, futureNullifierReads, this.noteHashNullifierCounterMap, this.splitCounter);
220
220
  if (this.nextIteration && !numTransientData) {
221
221
  const forceResetAll = true;
222
222
  const canClearReadRequests = noteHashWillOverflow && this.needsResetNoteHashReadRequests(forceResetAll) || nullifierWillOverflow && this.needsResetNullifierReadRequests(forceResetAll) || logsWillOverflow && this.needsResetNoteHashReadRequests(forceResetAll);
@@ -1,4 +1,4 @@
1
1
  import type { PrivateKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
2
2
  import type { UInt64 } from '@aztec/stdlib/types';
3
3
  export declare function computeTxIncludeByTimestamp(previousKernel: PrivateKernelCircuitPublicInputs, maxDuration?: number): UInt64;
4
- //# sourceMappingURL=compute_tx_include_by_timestamp.d.ts.map
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZV90eF9pbmNsdWRlX2J5X3RpbWVzdGFtcC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL2hpbnRzL2NvbXB1dGVfdHhfaW5jbHVkZV9ieV90aW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsZ0NBQWdDLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM3RSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQXFCbEQsd0JBQWdCLDJCQUEyQixDQUN6QyxjQUFjLEVBQUUsZ0NBQWdDLEVBQ2hELFdBQVcsU0FBb0MsR0FDOUMsTUFBTSxDQStCUiJ9
@@ -1,3 +1,3 @@
1
1
  export * from './build_private_kernel_reset_private_inputs.js';
2
2
  export * from './compute_tx_include_by_timestamp.js';
3
- //# sourceMappingURL=index.d.ts.map
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGdEQUFnRCxDQUFDO0FBQy9ELGNBQWMsc0NBQXNDLENBQUMifQ==
@@ -1,3 +1,3 @@
1
1
  export * from './private_kernel_execution_prover.js';
2
2
  export * from './private_kernel_oracle.js';
3
- //# sourceMappingURL=index.d.ts.map
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsNEJBQTRCLENBQUMifQ==
@@ -41,4 +41,4 @@ export declare class PrivateKernelExecutionProver {
41
41
  private getVkData;
42
42
  private createPrivateCallData;
43
43
  }
44
- //# sourceMappingURL=private_kernel_execution_prover.d.ts.map
44
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfZXhlY3V0aW9uX3Byb3Zlci5kLnR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QUFFLGtCQUFrQixFQUFFLFdBQVcsRUFBRSxHQUFFLGtDQUk5QyxHQUNBLE9BQU8sQ0FBQyxpQ0FBaUMsQ0FBQyxvQ0FBb0MsQ0FBQyxDQUFDLENBcVJsRjtJQUVEOzs7OztPQUtHO0lBQ0gsT0FBTyxDQUFDLHVCQUF1QjtZQW9CakIsU0FBUztZQVNULHFCQUFxQjtDQStCcEMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;gBAGxD,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ;IAG5B;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC;IA4RnF;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA8BpC"}
1
+ {"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAuD;IAElE,YACU,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ,EACxB;IAEJ;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC,CAqRlF;IAED;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA+BpC"}
@@ -1,5 +1,5 @@
1
- import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto';
2
- import { Fr } from '@aztec/foundation/fields';
1
+ import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto/keys';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { createLogger } from '@aztec/foundation/log';
4
4
  import { pushTestData } from '@aztec/foundation/testing';
5
5
  import { Timer } from '@aztec/foundation/timer';
@@ -62,10 +62,11 @@ const NULL_SIMULATE_OUTPUT = {
62
62
  const executionSteps = [];
63
63
  const noteHashLeafIndexMap = collectNoteHashLeafIndexMap(executionResult);
64
64
  const noteHashNullifierCounterMap = collectNoteHashNullifierCounterMap(executionResult);
65
- const validationRequestsSplitCounter = isPrivateOnlyTx ? 0 : getFinalMinRevertibleSideEffectCounter(executionResult);
65
+ const minRevertibleSideEffectCounter = getFinalMinRevertibleSideEffectCounter(executionResult);
66
+ const splitCounter = isPrivateOnlyTx ? 0 : minRevertibleSideEffectCounter;
66
67
  while(executionStack.length){
67
68
  if (!firstIteration) {
68
- let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, validationRequestsSplitCounter);
69
+ let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, splitCounter);
69
70
  while(resetBuilder.needsReset()){
70
71
  const witgenTimer = new Timer();
71
72
  const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
@@ -79,7 +80,7 @@ const NULL_SIMULATE_OUTPUT = {
79
80
  witgen: witgenTimer.ms()
80
81
  }
81
82
  });
82
- resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, validationRequestsSplitCounter);
83
+ resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, splitCounter);
83
84
  }
84
85
  }
85
86
  const currentExecution = executionStack.pop();
@@ -100,7 +101,7 @@ const NULL_SIMULATE_OUTPUT = {
100
101
  const privateCallData = await this.createPrivateCallData(currentExecution);
101
102
  if (firstIteration) {
102
103
  const witgenTimer = new Timer();
103
- const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, getVKTreeRoot(), ProtocolContractsList, privateCallData, isPrivateOnlyTx, executionResult.firstNullifier);
104
+ const proofInput = new PrivateKernelInitCircuitPrivateInputs(txRequest, getVKTreeRoot(), ProtocolContractsList, privateCallData, isPrivateOnlyTx, executionResult.firstNullifier, minRevertibleSideEffectCounter);
104
105
  this.log.debug(`Calling private kernel init with isPrivateOnly ${isPrivateOnlyTx} and firstNullifierHint ${proofInput.firstNullifierHint}`);
105
106
  pushTestData('private-kernel-inputs-init', proofInput);
106
107
  output = generateWitnesses ? await this.proofCreator.generateInitOutput(proofInput) : await this.proofCreator.simulateInit(proofInput);
@@ -133,7 +134,7 @@ const NULL_SIMULATE_OUTPUT = {
133
134
  firstIteration = false;
134
135
  }
135
136
  // Reset.
136
- let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, validationRequestsSplitCounter);
137
+ let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
137
138
  while(resetBuilder.needsReset()){
138
139
  const witgenTimer = new Timer();
139
140
  const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
@@ -147,7 +148,7 @@ const NULL_SIMULATE_OUTPUT = {
147
148
  witgen: witgenTimer.ms()
148
149
  }
149
150
  });
150
- resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, validationRequestsSplitCounter);
151
+ resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
151
152
  }
152
153
  if (output.publicInputs.feePayer.isZero() && skipFeeEnforcement) {
153
154
  if (!skipProofGeneration) {
@@ -180,8 +181,8 @@ const NULL_SIMULATE_OUTPUT = {
180
181
  witgen: witgenTimer.ms()
181
182
  }
182
183
  });
183
- // Hiding circuit is only executed if we are generating witnesses.
184
- // For simulation, we can end with the tail, since the hiding circuit will simply return the same tail output.
184
+ // Hiding kernel is only executed if we are generating witnesses.
185
+ // For simulation, we can end with the tail, since the Hiding kernel will simply return the same tail output.
185
186
  if (generateWitnesses) {
186
187
  const previousKernelVkData = await this.getVkData(tailOutput.verificationKey);
187
188
  const witgenTimer = new Timer();
@@ -1,5 +1,6 @@
1
1
  import { FUNCTION_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT, VK_TREE_HEIGHT } from '@aztec/constants';
2
- import type { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
2
+ import type { Fr } from '@aztec/foundation/curves/bn254';
3
+ import type { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
3
4
  import { MembershipWitness } from '@aztec/foundation/trees';
4
5
  import type { FunctionSelector } from '@aztec/stdlib/abi';
5
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -59,4 +60,4 @@ export interface PrivateKernelOracle {
59
60
  * along with an associated DelayedPublicMutable containing the class ID to update. */
60
61
  getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
61
62
  }
62
- //# sourceMappingURL=private_kernel_oracle.d.ts.map
63
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJpdmF0ZV9rZXJuZWwvcHJpdmF0ZV9rZXJuZWxfb3JhY2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxxQkFBcUIsRUFBRSxjQUFjLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUMvRixPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsS0FBSyxFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDL0UsT0FBTyx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,SAAS,CAAC,CAAC;IAE7G;0FACsF;IACtF,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACrF"}
@@ -1,26 +1,27 @@
1
1
  import { NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
2
- import type { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
2
+ import type { Fr } from '@aztec/foundation/curves/bn254';
3
+ import type { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
3
4
  import { MembershipWitness } from '@aztec/foundation/trees';
4
5
  import type { KeyStore } from '@aztec/key-store';
5
6
  import type { FunctionSelector } from '@aztec/stdlib/abi';
6
7
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
- import type { L2BlockNumber } from '@aztec/stdlib/block';
8
+ import type { BlockParameter } from '@aztec/stdlib/block';
8
9
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
9
10
  import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
10
11
  import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
11
12
  import type { VerificationKeyAsFields } from '@aztec/stdlib/vks';
12
- import type { ContractDataProvider } from '../storage/index.js';
13
+ import type { ContractStore } from '../storage/contract_store/contract_store.js';
13
14
  import type { PrivateKernelOracle } from './private_kernel_oracle.js';
14
15
  /**
15
16
  * A data oracle that provides information needed for simulating a transaction.
16
17
  */
17
18
  export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
18
- private contractDataProvider;
19
+ private contractStore;
19
20
  private keyStore;
20
21
  private node;
21
22
  private blockNumber;
22
23
  private log;
23
- constructor(contractDataProvider: ContractDataProvider, keyStore: KeyStore, node: AztecNode, blockNumber?: L2BlockNumber, log?: import("@aztec/foundation/log").Logger);
24
+ constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode, blockNumber?: BlockParameter, log?: import("@aztec/foundation/log").Logger);
24
25
  getContractAddressPreimage(address: AztecAddress): Promise<{
25
26
  version: 1;
26
27
  salt: Fr;
@@ -28,7 +29,7 @@ export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
28
29
  currentContractClassId: Fr;
29
30
  originalContractClassId: Fr;
30
31
  initializationHash: Fr;
31
- publicKeys: import("@aztec/stdlib/keys").PublicKeys;
32
+ publicKeys: import("../../../stdlib/dest/keys/public_keys.js").PublicKeys;
32
33
  address: AztecAddress;
33
34
  saltedInitializationHash: Fr;
34
35
  }>;
@@ -42,4 +43,4 @@ export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
42
43
  getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
43
44
  getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
44
45
  }
45
- //# sourceMappingURL=private_kernel_oracle_impl.d.ts.map
46
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlX2ltcGwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9wcml2YXRlX2tlcm5lbF9vcmFjbGVfaW1wbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUscUJBQXFCLEVBQTJDLE1BQU0sa0JBQWtCLENBQUM7QUFDbEcsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsY0FBYyxFQUFFLEtBQUssRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBRy9FLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzVELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBR2pELE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7Q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AAC,GAAG;IALb,YACU,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,SAAS,EACf,WAAW,GAAE,cAAyB,EACtC,GAAG,yCAAoC,EAC7C;IAES,0BAA0B,CAAC,OAAO,EAAE,YAAY;;;;;;;;;;OAS5D;IAEY,0BAA0B,CAAC,eAAe,EAAE,EAAE,qEAM1D;IAEY,4BAA4B,CAAC,eAAe,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,iCAQxF;IAEM,sBAAsB,CAAC,EAAE,EAAE,uBAAuB,iCAGxD;IAEK,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAO9G;IAED,6BAA6B,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAE5F;IAEK,mBAAmB,IAAI,OAAO,CAAC,EAAE,CAAC,CAMvC;IAEM,kBAAkB,CAAC,eAAe,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,CAEzE;IAEM,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtG;IAEY,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA8B/F;CACF"}
@@ -12,20 +12,20 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
12
12
  /**
13
13
  * A data oracle that provides information needed for simulating a transaction.
14
14
  */ export class PrivateKernelOracleImpl {
15
- contractDataProvider;
15
+ contractStore;
16
16
  keyStore;
17
17
  node;
18
18
  blockNumber;
19
19
  log;
20
- constructor(contractDataProvider, keyStore, node, blockNumber = 'latest', log = createLogger('pxe:kernel_oracle')){
21
- this.contractDataProvider = contractDataProvider;
20
+ constructor(contractStore, keyStore, node, blockNumber = 'latest', log = createLogger('pxe:kernel_oracle')){
21
+ this.contractStore = contractStore;
22
22
  this.keyStore = keyStore;
23
23
  this.node = node;
24
24
  this.blockNumber = blockNumber;
25
25
  this.log = log;
26
26
  }
27
27
  async getContractAddressPreimage(address) {
28
- const instance = await this.contractDataProvider.getContractInstance(address);
28
+ const instance = await this.contractStore.getContractInstance(address);
29
29
  if (!instance) {
30
30
  throw new Error(`Contract instance not found when getting address preimage. Contract address: ${address}.`);
31
31
  }
@@ -35,14 +35,14 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
35
35
  };
36
36
  }
37
37
  async getContractClassIdPreimage(contractClassId) {
38
- const contractClass = await this.contractDataProvider.getContractClass(contractClassId);
38
+ const contractClass = await this.contractStore.getContractClass(contractClassId);
39
39
  if (!contractClass) {
40
40
  throw new Error(`Contract class not found when getting class id preimage. Class id: ${contractClassId}.`);
41
41
  }
42
42
  return computeContractClassIdPreimage(contractClass);
43
43
  }
44
44
  async getFunctionMembershipWitness(contractClassId, selector) {
45
- const membershipWitness = await this.contractDataProvider.getFunctionMembershipWitness(contractClassId, selector);
45
+ const membershipWitness = await this.contractStore.getFunctionMembershipWitness(contractClassId, selector);
46
46
  if (!membershipWitness) {
47
47
  throw new Error(`Membership witness not found for contract class id ${contractClassId} and selector ${selector}.`);
48
48
  }
@@ -70,7 +70,7 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
70
70
  return this.keyStore.getMasterSecretKey(masterPublicKey);
71
71
  }
72
72
  getDebugFunctionName(contractAddress, selector) {
73
- return this.contractDataProvider.getDebugFunctionName(contractAddress, selector);
73
+ return this.contractStore.getDebugFunctionName(contractAddress, selector);
74
74
  }
75
75
  async getUpdatedClassIdHints(contractAddress) {
76
76
  const { delayedPublicMutableSlot, delayedPublicMutableHashSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
@@ -0,0 +1,24 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
+ import type { BlockParameter } from '@aztec/stdlib/block';
4
+ import type { AztecNode } from '@aztec/stdlib/interfaces/server';
5
+ import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
6
+ export declare class PublicStorageService {
7
+ private readonly anchorBlockStore;
8
+ private readonly aztecNode;
9
+ constructor(anchorBlockStore: AnchorBlockStore, aztecNode: AztecNode);
10
+ /**
11
+ * Gets the storage value at the given contract storage slot.
12
+ *
13
+ * @remarks The storage slot here refers to the slot as it is defined in Noir not the index in the merkle tree.
14
+ * Aztec's version of `eth_getStorageAt`.
15
+ *
16
+ * @param blockNumber - The block number at which to get the data.
17
+ * @param contract - Address of the contract to query.
18
+ * @param slot - Slot to query.
19
+ * @returns Storage value at the given contract slot.
20
+ * @throws If the contract is not deployed.
21
+ */
22
+ getPublicStorageAt(blockNumber: BlockParameter, contract: AztecAddress, slot: Fr): Promise<Fr>;
23
+ }
24
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX3N0b3JhZ2Vfc2VydmljZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3B1YmxpY19zdG9yYWdlL3B1YmxpY19zdG9yYWdlX3NlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsY0FBYyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDMUQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFakUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxREFBcUQsQ0FBQztBQUU1RixxQkFBYSxvQkFBb0I7SUFFN0IsT0FBTyxDQUFDLFFBQVEsQ0FBQyxnQkFBZ0I7SUFDakMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxTQUFTO0lBRjVCLFlBQ21CLGdCQUFnQixFQUFFLGdCQUFnQixFQUNsQyxTQUFTLEVBQUUsU0FBUyxFQUNuQztJQUVKOzs7Ozs7Ozs7OztPQVdHO0lBQ1Usa0JBQWtCLENBQUMsV0FBVyxFQUFFLGNBQWMsRUFBRSxRQUFRLEVBQUUsWUFBWSxFQUFFLElBQUksRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQU0xRztDQUNGIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public_storage_service.d.ts","sourceRoot":"","sources":["../../src/public_storage/public_storage_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAE5F,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAF5B,YACmB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACnC;IAEJ;;;;;;;;;;;OAWG;IACU,kBAAkB,CAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAM1G;CACF"}
@@ -0,0 +1,26 @@
1
+ export class PublicStorageService {
2
+ anchorBlockStore;
3
+ aztecNode;
4
+ constructor(anchorBlockStore, aztecNode){
5
+ this.anchorBlockStore = anchorBlockStore;
6
+ this.aztecNode = aztecNode;
7
+ }
8
+ /**
9
+ * Gets the storage value at the given contract storage slot.
10
+ *
11
+ * @remarks The storage slot here refers to the slot as it is defined in Noir not the index in the merkle tree.
12
+ * Aztec's version of `eth_getStorageAt`.
13
+ *
14
+ * @param blockNumber - The block number at which to get the data.
15
+ * @param contract - Address of the contract to query.
16
+ * @param slot - Slot to query.
17
+ * @returns Storage value at the given contract slot.
18
+ * @throws If the contract is not deployed.
19
+ */ async getPublicStorageAt(blockNumber, contract, slot) {
20
+ const anchorBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
21
+ if (blockNumber !== 'latest' && blockNumber > anchorBlockNumber) {
22
+ throw new Error(`Block number ${blockNumber} is higher than current block ${anchorBlockNumber}`);
23
+ }
24
+ return await this.aztecNode.getPublicStorageAt(blockNumber, contract, slot);
25
+ }
26
+ }