@aztec/pxe 0.0.1-commit.03f7ef2 → 0.0.1-commit.0b941701

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 (328) hide show
  1. package/dest/bin/check_oracle_version.js +1 -1
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +14 -10
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  4. package/dest/block_synchronizer/block_synchronizer.js +72 -32
  5. package/dest/config/index.d.ts +3 -1
  6. package/dest/config/index.d.ts.map +1 -1
  7. package/dest/config/index.js +17 -0
  8. package/dest/config/package_info.js +1 -1
  9. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  10. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  11. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  12. package/dest/contract_function_simulator/contract_function_simulator.d.ts +28 -27
  13. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/contract_function_simulator.js +56 -40
  15. package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
  16. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/execution_note_cache.js +45 -28
  18. package/dest/contract_function_simulator/index.d.ts +2 -2
  19. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/index.js +1 -1
  21. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
  22. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +6 -3
  24. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
  25. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  26. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  27. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  29. package/dest/contract_function_simulator/oracle/interfaces.d.ts +15 -11
  30. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
  32. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  33. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
  34. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
  36. package/dest/contract_function_simulator/oracle/oracle.d.ts +10 -8
  37. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  38. package/dest/contract_function_simulator/oracle/oracle.js +43 -32
  39. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
  40. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/oracle/private_execution.js +1 -37
  42. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +26 -26
  43. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  44. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +28 -41
  45. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +44 -34
  46. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  47. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +92 -92
  48. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  49. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  50. package/dest/contract_function_simulator/proxied_contract_data_source.js +5 -5
  51. package/dest/contract_sync/index.d.ts +23 -0
  52. package/dest/contract_sync/index.d.ts.map +1 -0
  53. package/dest/contract_sync/index.js +54 -0
  54. package/dest/debug/pxe_debug_utils.d.ts +6 -6
  55. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  56. package/dest/debug/pxe_debug_utils.js +8 -7
  57. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  58. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  59. package/dest/entrypoints/client/bundle/utils.js +10 -1
  60. package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
  61. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  62. package/dest/entrypoints/client/lazy/utils.js +10 -1
  63. package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
  64. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  65. package/dest/entrypoints/server/index.d.ts +3 -1
  66. package/dest/entrypoints/server/index.d.ts.map +1 -1
  67. package/dest/entrypoints/server/index.js +2 -0
  68. package/dest/entrypoints/server/utils.d.ts +1 -1
  69. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  70. package/dest/entrypoints/server/utils.js +11 -7
  71. package/dest/error_enriching.d.ts +4 -4
  72. package/dest/error_enriching.d.ts.map +1 -1
  73. package/dest/error_enriching.js +6 -6
  74. package/dest/events/event_service.d.ts +8 -7
  75. package/dest/events/event_service.d.ts.map +1 -1
  76. package/dest/events/event_service.js +22 -24
  77. package/dest/events/private_event_filter_validator.d.ts +6 -6
  78. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  79. package/dest/events/private_event_filter_validator.js +5 -6
  80. package/dest/job_coordinator/job_coordinator.d.ts +74 -0
  81. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  82. package/dest/job_coordinator/job_coordinator.js +93 -0
  83. package/dest/logs/log_service.d.ts +15 -31
  84. package/dest/logs/log_service.d.ts.map +1 -1
  85. package/dest/logs/log_service.js +77 -188
  86. package/dest/notes/note_service.d.ts +10 -9
  87. package/dest/notes/note_service.d.ts.map +1 -1
  88. package/dest/notes/note_service.js +40 -44
  89. package/dest/oracle_version.d.ts +3 -3
  90. package/dest/oracle_version.d.ts.map +1 -1
  91. package/dest/oracle_version.js +4 -3
  92. package/dest/private_kernel/hints/index.d.ts +2 -2
  93. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  94. package/dest/private_kernel/hints/index.js +1 -1
  95. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
  96. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  97. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +13 -7
  98. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  99. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  100. package/dest/private_kernel/private_kernel_execution_prover.js +4 -5
  101. package/dest/private_kernel/private_kernel_oracle.d.ts +24 -28
  102. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  103. package/dest/private_kernel/private_kernel_oracle.js +90 -2
  104. package/dest/pxe.d.ts +17 -44
  105. package/dest/pxe.d.ts.map +1 -1
  106. package/dest/pxe.js +131 -147
  107. package/dest/storage/address_store/address_store.d.ts +11 -0
  108. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  109. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
  110. package/dest/storage/address_store/index.d.ts +2 -0
  111. package/dest/storage/address_store/index.d.ts.map +1 -0
  112. package/dest/storage/address_store/index.js +1 -0
  113. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -0
  114. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  115. package/dest/storage/{anchor_block_data_provider/anchor_block_data_provider.js → anchor_block_store/anchor_block_store.js} +1 -1
  116. package/dest/storage/anchor_block_store/index.d.ts +2 -0
  117. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  118. package/dest/storage/anchor_block_store/index.js +1 -0
  119. package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
  120. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  121. package/dest/storage/capsule_store/capsule_store.js +255 -0
  122. package/dest/storage/capsule_store/index.d.ts +2 -0
  123. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  124. package/dest/storage/capsule_store/index.js +1 -0
  125. package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +3 -3
  126. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  127. package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +2 -2
  128. package/dest/storage/contract_store/index.d.ts +2 -0
  129. package/dest/storage/contract_store/index.d.ts.map +1 -0
  130. package/dest/storage/contract_store/index.js +1 -0
  131. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  132. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  133. package/dest/storage/index.d.ts +8 -8
  134. package/dest/storage/index.d.ts.map +1 -1
  135. package/dest/storage/index.js +7 -7
  136. package/dest/storage/note_store/index.d.ts +3 -0
  137. package/dest/storage/note_store/index.d.ts.map +1 -0
  138. package/dest/storage/note_store/index.js +2 -0
  139. package/dest/storage/note_store/note_store.d.ts +73 -0
  140. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  141. package/dest/storage/note_store/note_store.js +303 -0
  142. package/dest/storage/note_store/stored_note.d.ts +16 -0
  143. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  144. package/dest/storage/note_store/stored_note.js +43 -0
  145. package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
  146. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  147. package/dest/storage/private_event_store/private_event_store.js +250 -0
  148. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  149. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  150. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  151. package/dest/storage/tagging_store/index.d.ts +4 -0
  152. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  153. package/dest/storage/tagging_store/index.js +3 -0
  154. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
  155. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  156. package/dest/storage/tagging_store/recipient_tagging_store.js +99 -0
  157. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  158. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  159. package/dest/storage/tagging_store/sender_address_book_store.js +30 -0
  160. package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.d.ts → tagging_store/sender_tagging_store.d.ts} +19 -9
  161. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  162. package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.js → tagging_store/sender_tagging_store.js} +111 -29
  163. package/dest/tagging/constants.d.ts +2 -2
  164. package/dest/tagging/constants.d.ts.map +1 -1
  165. package/dest/tagging/constants.js +10 -3
  166. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  167. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  168. package/dest/tagging/get_all_logs_by_tags.js +46 -0
  169. package/dest/tagging/index.d.ts +15 -3
  170. package/dest/tagging/index.d.ts.map +1 -1
  171. package/dest/tagging/index.js +14 -2
  172. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -3
  173. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  174. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +8 -8
  175. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
  176. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  177. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
  178. package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.d.ts +4 -4
  179. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  180. package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.js +8 -23
  181. package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.d.ts +1 -1
  182. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  183. package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.js +5 -8
  184. package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.d.ts +7 -4
  185. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  186. package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.js +12 -7
  187. package/package.json +18 -18
  188. package/src/bin/check_oracle_version.ts +1 -0
  189. package/src/block_synchronizer/block_synchronizer.ts +83 -34
  190. package/src/config/index.ts +14 -0
  191. package/src/config/package_info.ts +1 -1
  192. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  193. package/src/contract_function_simulator/contract_function_simulator.ts +79 -64
  194. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  195. package/src/contract_function_simulator/index.ts +1 -1
  196. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +5 -1
  197. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  198. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  199. package/src/contract_function_simulator/oracle/interfaces.ts +20 -10
  200. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  201. package/src/contract_function_simulator/oracle/oracle.ts +56 -41
  202. package/src/contract_function_simulator/oracle/private_execution.ts +1 -69
  203. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +77 -78
  204. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +121 -105
  205. package/src/contract_function_simulator/proxied_contract_data_source.ts +7 -7
  206. package/src/contract_sync/index.ts +98 -0
  207. package/src/debug/pxe_debug_utils.ts +7 -6
  208. package/src/entrypoints/client/bundle/utils.ts +7 -1
  209. package/src/entrypoints/client/lazy/utils.ts +7 -2
  210. package/src/entrypoints/pxe_creation_options.ts +2 -1
  211. package/src/entrypoints/server/index.ts +2 -0
  212. package/src/entrypoints/server/utils.ts +11 -15
  213. package/src/error_enriching.ts +7 -15
  214. package/src/events/event_service.ts +23 -27
  215. package/src/events/private_event_filter_validator.ts +4 -6
  216. package/src/job_coordinator/job_coordinator.ts +149 -0
  217. package/src/logs/log_service.ts +116 -260
  218. package/src/notes/note_service.ts +43 -46
  219. package/src/oracle_version.ts +4 -3
  220. package/src/private_kernel/hints/index.ts +1 -1
  221. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +33 -22
  222. package/src/private_kernel/private_kernel_execution_prover.ts +3 -5
  223. package/src/private_kernel/private_kernel_oracle.ts +116 -36
  224. package/src/pxe.ts +189 -190
  225. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
  226. package/src/storage/address_store/index.ts +1 -0
  227. package/src/storage/{anchor_block_data_provider/anchor_block_data_provider.ts → anchor_block_store/anchor_block_store.ts} +1 -1
  228. package/src/storage/anchor_block_store/index.ts +1 -0
  229. package/src/storage/capsule_store/capsule_store.ts +315 -0
  230. package/src/storage/capsule_store/index.ts +1 -0
  231. package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +2 -2
  232. package/src/storage/contract_store/index.ts +1 -0
  233. package/src/storage/index.ts +7 -7
  234. package/src/storage/note_store/index.ts +2 -0
  235. package/src/storage/note_store/note_store.ts +381 -0
  236. package/src/storage/note_store/stored_note.ts +48 -0
  237. package/src/storage/private_event_store/private_event_store.ts +363 -0
  238. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  239. package/src/storage/tagging_store/index.ts +3 -0
  240. package/src/storage/tagging_store/recipient_tagging_store.ts +129 -0
  241. package/src/storage/tagging_store/sender_address_book_store.ts +42 -0
  242. package/src/storage/{tagging_data_provider/sender_tagging_data_provider.ts → tagging_store/sender_tagging_store.ts} +129 -28
  243. package/src/tagging/constants.ts +10 -3
  244. package/src/tagging/get_all_logs_by_tags.ts +68 -0
  245. package/src/tagging/index.ts +17 -2
  246. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +23 -9
  247. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
  248. package/src/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.ts +12 -25
  249. package/src/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.ts +5 -13
  250. package/src/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.ts +19 -7
  251. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  252. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  253. package/dest/contract_function_simulator/proxied_node.js +0 -27
  254. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  255. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  256. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  257. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  258. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  259. package/dest/public_storage/public_storage_service.d.ts +0 -24
  260. package/dest/public_storage/public_storage_service.d.ts.map +0 -1
  261. package/dest/public_storage/public_storage_service.js +0 -26
  262. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
  263. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  264. package/dest/storage/address_data_provider/index.d.ts +0 -2
  265. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  266. package/dest/storage/address_data_provider/index.js +0 -1
  267. package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts +0 -9
  268. package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts.map +0 -1
  269. package/dest/storage/anchor_block_data_provider/index.d.ts +0 -2
  270. package/dest/storage/anchor_block_data_provider/index.d.ts.map +0 -1
  271. package/dest/storage/anchor_block_data_provider/index.js +0 -1
  272. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -57
  273. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  274. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -146
  275. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  276. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  277. package/dest/storage/capsule_data_provider/index.js +0 -1
  278. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  279. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  280. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  281. package/dest/storage/contract_data_provider/index.js +0 -1
  282. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  283. package/dest/storage/note_data_provider/index.d.ts +0 -3
  284. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  285. package/dest/storage/note_data_provider/index.js +0 -2
  286. package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -84
  287. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  288. package/dest/storage/note_data_provider/note_data_provider.js +0 -322
  289. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -51
  290. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  291. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -115
  292. package/dest/storage/tagging_data_provider/index.d.ts +0 -3
  293. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  294. package/dest/storage/tagging_data_provider/index.js +0 -2
  295. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts +0 -31
  296. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts.map +0 -1
  297. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.js +0 -65
  298. package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts.map +0 -1
  299. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts +0 -21
  300. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts.map +0 -1
  301. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.js +0 -42
  302. package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +0 -1
  303. package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts.map +0 -1
  304. package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +0 -1
  305. package/dest/tagging/utils.d.ts +0 -18
  306. package/dest/tagging/utils.d.ts.map +0 -1
  307. package/dest/tagging/utils.js +0 -25
  308. package/dest/tree_membership/tree_membership_service.d.ts +0 -52
  309. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  310. package/dest/tree_membership/tree_membership_service.js +0 -84
  311. package/src/contract_function_simulator/proxied_node.ts +0 -33
  312. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
  313. package/src/public_storage/public_storage_service.ts +0 -33
  314. package/src/storage/address_data_provider/index.ts +0 -1
  315. package/src/storage/anchor_block_data_provider/index.ts +0 -1
  316. package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -179
  317. package/src/storage/capsule_data_provider/index.ts +0 -1
  318. package/src/storage/contract_data_provider/index.ts +0 -1
  319. package/src/storage/note_data_provider/index.ts +0 -2
  320. package/src/storage/note_data_provider/note_data_provider.ts +0 -412
  321. package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -162
  322. package/src/storage/tagging_data_provider/index.ts +0 -2
  323. package/src/storage/tagging_data_provider/recipient_tagging_data_provider.ts +0 -86
  324. package/src/tagging/recipient_sync/new_recipient_tagging_data_provider.ts +0 -53
  325. package/src/tagging/utils.ts +0 -32
  326. package/src/tree_membership/tree_membership_service.ts +0 -112
  327. /package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +0 -0
  328. /package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +0 -0
@@ -3,13 +3,15 @@ import { MAX_RPC_LEN } from '@aztec/stdlib/interfaces/client';
3
3
  import { Note, NoteDao } from '@aztec/stdlib/note';
4
4
  import { MerkleTreeId } from '@aztec/stdlib/trees';
5
5
  export class NoteService {
6
- noteDataProvider;
6
+ noteStore;
7
7
  aztecNode;
8
- anchorBlockDataProvider;
9
- constructor(noteDataProvider, aztecNode, anchorBlockDataProvider){
10
- this.noteDataProvider = noteDataProvider;
8
+ anchorBlockStore;
9
+ jobId;
10
+ constructor(noteStore, aztecNode, anchorBlockStore, jobId){
11
+ this.noteStore = noteStore;
11
12
  this.aztecNode = aztecNode;
12
- this.anchorBlockDataProvider = anchorBlockDataProvider;
13
+ this.anchorBlockStore = anchorBlockStore;
14
+ this.jobId = jobId;
13
15
  }
14
16
  /**
15
17
  * Retrieves a set of notes stored in the database for a given contract address and storage slot.
@@ -20,14 +22,14 @@ export class NoteService {
20
22
  * @param status - The status of notes to fetch.
21
23
  * @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
22
24
  */ async getNotes(contractAddress, owner, storageSlot, status, scopes) {
23
- const noteDaos = await this.noteDataProvider.getNotes({
25
+ const noteDaos = await this.noteStore.getNotes({
24
26
  contractAddress,
25
27
  owner,
26
28
  storageSlot,
27
29
  status,
28
30
  scopes
29
- });
30
- return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier, index })=>({
31
+ }, this.jobId);
32
+ return noteDaos.map(({ contractAddress, owner, storageSlot, randomness, noteNonce, note, noteHash, siloedNullifier })=>({
31
33
  contractAddress,
32
34
  owner,
33
35
  storageSlot,
@@ -35,15 +37,14 @@ export class NoteService {
35
37
  noteNonce,
36
38
  note,
37
39
  noteHash,
38
- siloedNullifier,
39
- // PXE can use this index to get full MembershipWitness
40
- index
40
+ isPending: false,
41
+ siloedNullifier
41
42
  }));
42
43
  }
43
44
  /**
44
45
  * Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
45
46
  *
46
- * Fetches notes from the NoteDataProvider and checks which nullifiers are present in the
47
+ * Fetches notes from the NoteStore and checks which nullifiers are present in the
47
48
  * onchain nullifier Merkle tree - up to the latest locally synced block. We use the
48
49
  * locally synced block instead of querying the chain's 'latest' block to ensure correctness:
49
50
  * notes are only marked nullified once their corresponding nullifier has been included in a
@@ -52,10 +53,10 @@ export class NoteService {
52
53
  *
53
54
  * @param contractAddress - The contract whose notes should be checked and nullified.
54
55
  */ async syncNoteNullifiers(contractAddress) {
55
- const syncedBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
56
- const contractNotes = await this.noteDataProvider.getNotes({
56
+ const anchorBlockHash = await (await this.anchorBlockStore.getBlockHeader()).hash();
57
+ const contractNotes = await this.noteStore.getNotes({
57
58
  contractAddress
58
- });
59
+ }, this.jobId);
59
60
  if (contractNotes.length === 0) {
60
61
  return;
61
62
  }
@@ -72,7 +73,7 @@ export class NoteService {
72
73
  }, [
73
74
  []
74
75
  ]);
75
- const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
76
+ const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
76
77
  const foundNullifiers = nullifiersToCheck.map((nullifier, i)=>{
77
78
  if (nullifierIndexes[i] !== undefined) {
78
79
  return {
@@ -83,10 +84,10 @@ export class NoteService {
83
84
  };
84
85
  }
85
86
  }).filter((nullifier)=>nullifier !== undefined);
86
- await this.noteDataProvider.applyNullifiers(foundNullifiers);
87
+ await this.noteStore.applyNullifiers(foundNullifiers, this.jobId);
87
88
  }
88
- async deliverNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
89
- // We are going to store the new note in the NoteDataProvider, which will let us later return it via `getNotes`.
89
+ async validateAndStoreNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
90
+ // We are going to store the new note in the NoteStore, which will let us later return it via `getNotes`.
90
91
  // There's two things we need to check before we do this however:
91
92
  // - we must make sure the note does actually exist in the note hash tree
92
93
  // - we need to check if the note has already been nullified
@@ -104,49 +105,44 @@ export class NoteService {
104
105
  // number which *should* be recent enough to be available, even for non-archive nodes.
105
106
  // Also note that the note should never be ahead of the synced block here since `fetchTaggedLogs` only processes
106
107
  // logs up to the synced block making this only an additional safety check.
107
- const syncedBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
108
+ const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
109
+ const anchorBlockNumber = anchorBlockHeader.getBlockNumber();
110
+ const anchorBlockHash = await anchorBlockHeader.hash();
108
111
  // By computing siloed and unique note hashes ourselves we prevent contracts from interfering with the note storage
109
112
  // of other contracts, which would constitute a security breach.
110
113
  const uniqueNoteHash = await computeUniqueNoteHash(noteNonce, await siloNoteHash(contractAddress, noteHash));
111
114
  const siloedNullifier = await siloNullifier(contractAddress, nullifier);
112
- const txEffect = await this.aztecNode.getTxEffect(txHash);
115
+ const [txEffect, [nullifierIndex]] = await Promise.all([
116
+ this.aztecNode.getTxEffect(txHash),
117
+ this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, [
118
+ siloedNullifier
119
+ ])
120
+ ]);
113
121
  if (!txEffect) {
114
122
  throw new Error(`Could not find tx effect for tx hash ${txHash}`);
115
123
  }
116
- if (txEffect.l2BlockNumber > syncedBlockNumber) {
117
- throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${syncedBlockNumber}`);
124
+ if (txEffect.l2BlockNumber > anchorBlockNumber) {
125
+ throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${anchorBlockNumber}`);
118
126
  }
119
- const noteInTx = txEffect.data.noteHashes.some((nh)=>nh.equals(uniqueNoteHash));
120
- if (!noteInTx) {
127
+ // Find the index of the note hash in the noteHashes array to determine note ordering within the tx
128
+ const noteIndexInTx = txEffect.data.noteHashes.findIndex((nh)=>nh.equals(uniqueNoteHash));
129
+ if (noteIndexInTx === -1) {
121
130
  throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present in tx ${txHash}`);
122
131
  }
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);
132
+ const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, txEffect.l2BlockNumber, txEffect.l2BlockHash.toString(), txEffect.txIndexInBlock, noteIndexInTx);
138
133
  // The note was found by `recipient`, so we use that as the scope when storing the note.
139
- await this.noteDataProvider.addNotes([
134
+ await this.noteStore.addNotes([
140
135
  noteDao
141
- ], recipient);
136
+ ], recipient, this.jobId);
142
137
  if (nullifierIndex !== undefined) {
138
+ // We found nullifier index which implies that the note has already been nullified.
143
139
  const { data: _, ...blockHashAndNum } = nullifierIndex;
144
- await this.noteDataProvider.applyNullifiers([
140
+ await this.noteStore.applyNullifiers([
145
141
  {
146
142
  data: siloedNullifier,
147
143
  ...blockHashAndNum
148
144
  }
149
- ]);
145
+ ], this.jobId);
150
146
  }
151
147
  }
152
148
  }
@@ -1,3 +1,3 @@
1
- export declare const ORACLE_VERSION = 5;
2
- export declare const ORACLE_INTERFACE_HASH = "d603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec";
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxJQUFJLENBQUM7QUFJaEMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
1
+ export declare const ORACLE_VERSION = 9;
2
+ export declare const ORACLE_INTERFACE_HASH = "9866cc52510acaef75a3d47a0ed501fd9ff92b9d53b2c8a88c8a3ffd04ced81f";
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxJQUFJLENBQUM7QUFLaEMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,IAAI,CAAC;AAIhC,eAAO,MAAM,qBAAqB,qEAAqE,CAAC"}
1
+ {"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,IAAI,CAAC;AAKhC,eAAO,MAAM,qBAAqB,qEAAqE,CAAC"}
@@ -4,7 +4,8 @@
4
4
  ///
5
5
  /// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
6
6
  /// and if the oracle version is incompatible an error is thrown.
7
- export const ORACLE_VERSION = 5;
7
+ export const ORACLE_VERSION = 9;
8
8
  /// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
9
- /// which in turn implies that you need to update the ORACLE_VERSION constant.
10
- export const ORACLE_INTERFACE_HASH = 'd603c17a97034d978ca453d2bce3aacae139539dee28bbc46e8f8c7177a348ec';
9
+ /// which in turn implies that you need to update the ORACLE_VERSION constant in this file and in
10
+ /// `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
11
+ export const ORACLE_INTERFACE_HASH = '9866cc52510acaef75a3d47a0ed501fd9ff92b9d53b2c8a88c8a3ffd04ced81f';
@@ -1,3 +1,3 @@
1
- export * from './build_private_kernel_reset_private_inputs.js';
1
+ export * from './private_kernel_reset_private_inputs_builder.js';
2
2
  export * from './compute_tx_include_by_timestamp.js';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGdEQUFnRCxDQUFDO0FBQy9ELGNBQWMsc0NBQXNDLENBQUMifQ==
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGtEQUFrRCxDQUFDO0FBQ2pFLGNBQWMsc0NBQXNDLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/index.ts"],"names":[],"mappings":"AAAA,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC"}
@@ -1,2 +1,2 @@
1
- export * from './build_private_kernel_reset_private_inputs.js';
1
+ export * from './private_kernel_reset_private_inputs_builder.js';
2
2
  export * from './compute_tx_include_by_timestamp.js';
@@ -0,0 +1,28 @@
1
+ import { type PrivateKernelCircuitPublicInputs, PrivateKernelResetCircuitPrivateInputs, type PrivateKernelSimulateOutput } from '@aztec/stdlib/kernel';
2
+ import { type PrivateCallExecutionResult } from '@aztec/stdlib/tx';
3
+ import type { PrivateKernelOracle } from '../private_kernel_oracle.js';
4
+ export declare class PrivateKernelResetPrivateInputsBuilder {
5
+ private previousKernelOutput;
6
+ private executionStack;
7
+ private noteHashNullifierCounterMap;
8
+ private splitCounter;
9
+ private previousKernel;
10
+ private nextIteration?;
11
+ private noteHashResetActions;
12
+ private nullifierResetActions;
13
+ private numTransientData?;
14
+ private transientDataSquashingHints;
15
+ private requestedDimensions;
16
+ constructor(previousKernelOutput: PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>, executionStack: PrivateCallExecutionResult[], noteHashNullifierCounterMap: Map<number, number>, splitCounter: number);
17
+ needsReset(): boolean;
18
+ build(oracle: PrivateKernelOracle): Promise<PrivateKernelResetCircuitPrivateInputs>;
19
+ private reduceReadRequestActions;
20
+ private needsResetNoteHashReadRequests;
21
+ private needsResetNullifierReadRequests;
22
+ private needsResetNullifierKeys;
23
+ private needsResetTransientData;
24
+ private needsSiloNoteHashes;
25
+ private needsSiloNullifiers;
26
+ private needsSiloPrivateLogs;
27
+ }
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfcmVzZXRfcHJpdmF0ZV9pbnB1dHNfYnVpb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FNLEVBVzdCO0lBRUQsVUFBVSxJQUFJLE9BQU8sQ0FzQnBCO0lBRUssS0FBSyxDQUFDLE1BQU0sRUFBRSxtQkFBbUIsbURBK0V0QztJQUVELE9BQU8sQ0FBQyx3QkFBd0I7SUEyQmhDLE9BQU8sQ0FBQyw4QkFBOEI7SUF1RHRDLE9BQU8sQ0FBQywrQkFBK0I7SUF1RHZDLE9BQU8sQ0FBQyx1QkFBdUI7SUFhL0IsT0FBTyxDQUFDLHVCQUF1QjtJQXNFL0IsT0FBTyxDQUFDLG1CQUFtQjtJQWMzQixPQUFPLENBQUMsbUJBQW1CO0lBa0IzQixPQUFPLENBQUMsb0JBQW9CO0NBcUI3QiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private_kernel_reset_private_inputs_builder.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/private_kernel_reset_private_inputs_builder.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,mDA+EtC;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"}
@@ -82,7 +82,7 @@ export class PrivateKernelResetPrivateInputsBuilder {
82
82
  return result.some((r)=>r);
83
83
  }
84
84
  }
85
- async build(oracle, noteHashLeafIndexMap) {
85
+ async build(oracle) {
86
86
  if (privateKernelResetDimensionNames.every((name)=>!this.requestedDimensions[name])) {
87
87
  throw new Error('Reset is not required.');
88
88
  }
@@ -92,16 +92,22 @@ export class PrivateKernelResetPrivateInputsBuilder {
92
92
  // The dimensions found must be big enough to reset all values, i.e. empty remainder.
93
93
  const allowRemainder = isInner;
94
94
  const dimensions = findPrivateKernelResetDimensions(this.requestedDimensions, privateKernelResetDimensionsConfig, isInner, allowRemainder);
95
- const previousVkMembershipWitness = await oracle.getVkMembershipWitness(this.previousKernelOutput.verificationKey.keyAsFields);
96
- const vkData = new VkData(this.previousKernelOutput.verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
97
- const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, vkData);
98
95
  this.reduceReadRequestActions(this.noteHashResetActions, dimensions.NOTE_HASH_PENDING_READ, dimensions.NOTE_HASH_SETTLED_READ);
99
96
  this.reduceReadRequestActions(this.nullifierResetActions, dimensions.NULLIFIER_PENDING_READ, dimensions.NULLIFIER_SETTLED_READ);
97
+ // Execute all the expensive node querying operations in parallel.
98
+ const [previousVkMembershipWitness, noteHashReadRequestHints, nullifierReadRequestHints, keyValidationHints] = await Promise.all([
99
+ oracle.getVkMembershipWitness(this.previousKernelOutput.verificationKey.keyAsFields),
100
+ buildNoteHashReadRequestHintsFromResetActions(oracle, this.previousKernel.validationRequests.noteHashReadRequests, this.previousKernel.end.noteHashes, this.noteHashResetActions),
101
+ buildNullifierReadRequestHintsFromResetActions({
102
+ getNullifierMembershipWitness: getNullifierMembershipWitnessResolver(oracle)
103
+ }, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions),
104
+ getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle)
105
+ ]);
106
+ const vkData = new VkData(this.previousKernelOutput.verificationKey, Number(previousVkMembershipWitness.leafIndex), previousVkMembershipWitness.siblingPath);
107
+ const previousKernelData = new PrivateKernelData(this.previousKernelOutput.publicInputs, vkData);
100
108
  // TODO: Enable padding when we have a better idea what are the final amounts we should pad to.
101
109
  const paddedSideEffects = PaddedSideEffects.empty();
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
- getNullifierMembershipWitness: getNullifierMembershipWitnessResolver(oracle)
104
- }, this.previousKernel.validationRequests.nullifierReadRequests, this.nullifierResetActions), await getMasterSecretKeysAndAppKeyGenerators(this.previousKernel.validationRequests.scopedKeyValidationRequestsAndGenerators, dimensions.KEY_VALIDATION, oracle), this.transientDataSquashingHints), dimensions);
110
+ return new PrivateKernelResetCircuitPrivateInputs(previousKernelData, paddedSideEffects, new PrivateKernelResetHints(noteHashReadRequestHints, nullifierReadRequestHints, keyValidationHints, this.transientDataSquashingHints), dimensions);
105
111
  }
106
112
  reduceReadRequestActions(resetActions, maxPending, maxSettled) {
107
113
  let numPending = 0;
@@ -41,4 +41,4 @@ export declare class PrivateKernelExecutionProver {
41
41
  private getVkData;
42
42
  private createPrivateCallData;
43
43
  }
44
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfZXhlY3V0aW9uX3Byb3Zlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL3ByaXZhdGVfa2VybmVsX2V4ZWN1dGlvbl9wcm92ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUUEsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUMzRSxPQUFPLEVBUUwsS0FBSyxpQ0FBaUMsRUFLdEMsS0FBSyxvQ0FBb0MsRUFFMUMsTUFBTSxzQkFBc0IsQ0FBQztBQUU5QixPQUFPLEVBRUwsS0FBSyxzQkFBc0IsRUFDM0IsU0FBUyxFQUlWLE1BQU0sa0JBQWtCLENBQUM7QUFJMUIsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQVN0RSxNQUFNLFdBQVcsa0NBQWtDO0lBQ2pELFFBQVEsRUFBRSxPQUFPLENBQUM7SUFDbEIsa0JBQWtCLEVBQUUsT0FBTyxDQUFDO0lBQzVCLFdBQVcsRUFBRSxPQUFPLEdBQUcsaUJBQWlCLEdBQUcsTUFBTSxHQUFHLE1BQU0sQ0FBQztDQUM1RDtBQUVEOzs7OztHQUtHO0FBQ0gscUJBQWEsNEJBQTRCO0lBSXJDLE9BQU8sQ0FBQyxNQUFNO0lBQ2QsT0FBTyxDQUFDLFlBQVk7SUFDcEIsT0FBTyxDQUFDLFVBQVU7SUFMcEIsT0FBTyxDQUFDLEdBQUcsQ0FBdUQ7SUFFbEUsWU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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
+ {"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,EAGV,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,CAoRlF;IAED;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA+BpC"}
@@ -8,9 +8,9 @@ import { ProtocolContractsList } from '@aztec/protocol-contracts';
8
8
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
9
9
  import { HidingKernelToPublicPrivateInputs, HidingKernelToRollupPrivateInputs, PaddedSideEffectAmounts, PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
10
10
  import { ChonkProof } from '@aztec/stdlib/proofs';
11
- import { collectNoteHashLeafIndexMap, collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
11
+ import { collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
12
12
  import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
13
- import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
13
+ import { PrivateKernelResetPrivateInputsBuilder } from './hints/private_kernel_reset_private_inputs_builder.js';
14
14
  const NULL_SIMULATE_OUTPUT = {
15
15
  publicInputs: PrivateKernelCircuitPublicInputs.empty(),
16
16
  verificationKey: VerificationKeyData.empty(),
@@ -60,7 +60,6 @@ const NULL_SIMULATE_OUTPUT = {
60
60
  let firstIteration = true;
61
61
  let output = NULL_SIMULATE_OUTPUT;
62
62
  const executionSteps = [];
63
- const noteHashLeafIndexMap = collectNoteHashLeafIndexMap(executionResult);
64
63
  const noteHashNullifierCounterMap = collectNoteHashNullifierCounterMap(executionResult);
65
64
  const minRevertibleSideEffectCounter = getFinalMinRevertibleSideEffectCounter(executionResult);
66
65
  const splitCounter = isPrivateOnlyTx ? 0 : minRevertibleSideEffectCounter;
@@ -69,7 +68,7 @@ const NULL_SIMULATE_OUTPUT = {
69
68
  let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, executionStack, noteHashNullifierCounterMap, splitCounter);
70
69
  while(resetBuilder.needsReset()){
71
70
  const witgenTimer = new Timer();
72
- const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
71
+ const privateInputs = await resetBuilder.build(this.oracle);
73
72
  output = generateWitnesses ? await this.proofCreator.generateResetOutput(privateInputs) : await this.proofCreator.simulateReset(privateInputs);
74
73
  executionSteps.push({
75
74
  functionName: 'private_kernel_reset',
@@ -137,7 +136,7 @@ const NULL_SIMULATE_OUTPUT = {
137
136
  let resetBuilder = new PrivateKernelResetPrivateInputsBuilder(output, [], noteHashNullifierCounterMap, splitCounter);
138
137
  while(resetBuilder.needsReset()){
139
138
  const witgenTimer = new Timer();
140
- const privateInputs = await resetBuilder.build(this.oracle, noteHashLeafIndexMap);
139
+ const privateInputs = await resetBuilder.build(this.oracle);
141
140
  output = generateWitnesses ? await this.proofCreator.generateResetOutput(privateInputs) : await this.proofCreator.simulateReset(privateInputs);
142
141
  executionSteps.push({
143
142
  functionName: 'private_kernel_reset',
@@ -2,62 +2,58 @@ import { FUNCTION_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT, VK_TREE_HEIGHT } from '@az
2
2
  import type { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import type { GrumpkinScalar, Point } from '@aztec/foundation/curves/grumpkin';
4
4
  import { MembershipWitness } from '@aztec/foundation/trees';
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';
8
+ import { L2BlockHash } from '@aztec/stdlib/block';
9
+ import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
10
+ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
7
11
  import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
8
- import type { PublicKeys } from '@aztec/stdlib/keys';
9
12
  import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
10
13
  import type { VerificationKeyAsFields } from '@aztec/stdlib/vks';
14
+ import type { ContractStore } from '../storage/contract_store/contract_store.js';
11
15
  /**
12
16
  * Provides functionality needed by the private kernel for interacting with our state trees.
13
- * This is either PrivateKernelOracleImpl, or a mocked test implementation.
14
17
  */
15
- export interface PrivateKernelOracle {
18
+ export declare class PrivateKernelOracle {
19
+ private contractStore;
20
+ private keyStore;
21
+ private node;
22
+ private blockHash;
23
+ constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode, blockHash: L2BlockHash);
16
24
  /** Retrieves the preimage of a contract address from the registered contract instances db. */
17
- getContractAddressPreimage(address: AztecAddress): Promise<{
25
+ getContractAddressPreimage(address: AztecAddress): Promise<ContractInstanceWithAddress & {
18
26
  saltedInitializationHash: Fr;
19
- publicKeys: PublicKeys;
20
- currentContractClassId: Fr;
21
- originalContractClassId: Fr;
22
27
  }>;
23
28
  /** Retrieves the preimage of a contract class id from the contract classes db. */
24
- getContractClassIdPreimage(contractClassId: Fr): Promise<{
25
- artifactHash: Fr;
26
- publicBytecodeCommitment: Fr;
27
- privateFunctionsRoot: Fr;
28
- }>;
29
- /**
30
- * Returns a membership witness with the sibling path and leaf index in our private functions tree.
31
- */
29
+ getContractClassIdPreimage(contractClassId: Fr): Promise<import("@aztec/stdlib/contract").ContractClassIdPreimage>;
30
+ /** Returns a membership witness with the sibling path and leaf index in our private functions tree. */
32
31
  getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<typeof FUNCTION_TREE_HEIGHT>>;
33
32
  /**
34
33
  * Returns a membership witness with the sibling path and leaf index in our protocol VK indexed merkle tree.
35
34
  * Used to validate the previous kernel's verification key.
36
35
  */
37
36
  getVkMembershipWitness(vk: VerificationKeyAsFields): Promise<MembershipWitness<typeof VK_TREE_HEIGHT>>;
38
- /**
39
- * Returns a membership witness with the sibling path and leaf index in our private function indexed merkle tree.
40
- */ getNoteHashMembershipWitness(leafIndex: bigint): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT>>;
41
- /**
42
- * Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree.
43
- */
37
+ /** Returns a membership witness with the sibling path and leaf index in our note hash tree. */
38
+ getNoteHashMembershipWitness(noteHash: Fr): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT> | undefined>;
39
+ /** Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree. */
44
40
  getNullifierMembershipWitness(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
45
- /**
46
- * Returns the root of our note hash merkle tree.
47
- */
41
+ /** Returns the root of our note hash merkle tree. */
48
42
  getNoteHashTreeRoot(): Promise<Fr>;
49
43
  /**
50
44
  * Retrieves the sk_m corresponding to the pk_m.
51
45
  * @throws If the provided public key is not associated with any of the registered accounts.
52
- * @param pkM - The master public key to get secret key for.
46
+ * @param masterPublicKey - The master public key to get secret key for.
53
47
  * @returns A Promise that resolves to sk_m.
54
48
  * @dev Used when feeding the sk_m to the kernel circuit for keys verification.
55
49
  */
56
50
  getMasterSecretKey(masterPublicKey: Point): Promise<GrumpkinScalar>;
57
51
  /** Use debug data to get the function name corresponding to a selector. */
58
52
  getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
59
- /** Returns a membership witness and leaf index to our public data indexed merkle tree,
60
- * along with an associated DelayedPublicMutable containing the class ID to update. */
53
+ /**
54
+ * Returns a membership witness and leaf index to our public data indexed merkle tree,
55
+ * along with an associated DelayedPublicMutable containing the class ID to update.
56
+ */
61
57
  getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
62
58
  }
63
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJpdmF0ZV9rZXJuZWwvcHJpdmF0ZV9rZXJuZWxfb3JhY2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxxQkFBcUIsRUFBRSxjQUFjLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUMvRixPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsS0FBSyxFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDL0UsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDNUQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUMxRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUMzRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRS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EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,cAAc,CAAC,CAAC,CAG5G;IAED,+FAA+F;IAC/F,4BAA4B,CAAC,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,qBAAqB,CAAC,GAAG,SAAS,CAAC,CAE/G;IAED,8GAA8G;IAC9G,6BAA6B,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAE5F;IAED,qDAAqD;IAC/C,mBAAmB,IAAI,OAAO,CAAC,EAAE,CAAC,CAMvC;IAED;;;;;;OAMG;IACI,kBAAkB,CAAC,eAAe,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,CAEzE;IAED,2EAA2E;IACpE,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAElH;IAED;;;OAGG;IACU,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA8B/F;CACF"}
@@ -1,4 +1,92 @@
1
+ import { PUBLIC_DATA_TREE_HEIGHT, VK_TREE_HEIGHT } from '@aztec/constants';
2
+ import { MembershipWitness } from '@aztec/foundation/trees';
3
+ import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
4
+ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
5
+ import { computeContractClassIdPreimage, computeSaltedInitializationHash } from '@aztec/stdlib/contract';
6
+ import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
7
+ import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
8
+ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
1
9
  /**
2
10
  * Provides functionality needed by the private kernel for interacting with our state trees.
3
- * This is either PrivateKernelOracleImpl, or a mocked test implementation.
4
- */ export { };
11
+ */ export class PrivateKernelOracle {
12
+ contractStore;
13
+ keyStore;
14
+ node;
15
+ blockHash;
16
+ constructor(contractStore, keyStore, node, blockHash){
17
+ this.contractStore = contractStore;
18
+ this.keyStore = keyStore;
19
+ this.node = node;
20
+ this.blockHash = blockHash;
21
+ }
22
+ /** Retrieves the preimage of a contract address from the registered contract instances db. */ async getContractAddressPreimage(address) {
23
+ const instance = await this.contractStore.getContractInstance(address);
24
+ if (!instance) {
25
+ throw new Error(`Contract instance not found when getting address preimage. Contract address: ${address}.`);
26
+ }
27
+ return {
28
+ saltedInitializationHash: await computeSaltedInitializationHash(instance),
29
+ ...instance
30
+ };
31
+ }
32
+ /** Retrieves the preimage of a contract class id from the contract classes db. */ async getContractClassIdPreimage(contractClassId) {
33
+ const contractClass = await this.contractStore.getContractClass(contractClassId);
34
+ if (!contractClass) {
35
+ throw new Error(`Contract class not found when getting class id preimage. Class id: ${contractClassId}.`);
36
+ }
37
+ return computeContractClassIdPreimage(contractClass);
38
+ }
39
+ /** Returns a membership witness with the sibling path and leaf index in our private functions tree. */ async getFunctionMembershipWitness(contractClassId, selector) {
40
+ const membershipWitness = await this.contractStore.getFunctionMembershipWitness(contractClassId, selector);
41
+ if (!membershipWitness) {
42
+ throw new Error(`Membership witness not found for contract class id ${contractClassId} and selector ${selector}.`);
43
+ }
44
+ return membershipWitness;
45
+ }
46
+ /**
47
+ * Returns a membership witness with the sibling path and leaf index in our protocol VK indexed merkle tree.
48
+ * Used to validate the previous kernel's verification key.
49
+ */ getVkMembershipWitness(vk) {
50
+ const leafIndex = getVKIndex(vk);
51
+ return Promise.resolve(new MembershipWitness(VK_TREE_HEIGHT, BigInt(leafIndex), getVKSiblingPath(leafIndex)));
52
+ }
53
+ /** Returns a membership witness with the sibling path and leaf index in our note hash tree. */ getNoteHashMembershipWitness(noteHash) {
54
+ return this.node.getNoteHashMembershipWitness(this.blockHash, noteHash);
55
+ }
56
+ /** Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree. */ getNullifierMembershipWitness(nullifier) {
57
+ return this.node.getNullifierMembershipWitness(this.blockHash, nullifier);
58
+ }
59
+ /** Returns the root of our note hash merkle tree. */ async getNoteHashTreeRoot() {
60
+ const header = await this.node.getBlockHeader(this.blockHash);
61
+ if (!header) {
62
+ throw new Error(`No block header found for block hash ${this.blockHash}`);
63
+ }
64
+ return header.state.partial.noteHashTree.root;
65
+ }
66
+ /**
67
+ * Retrieves the sk_m corresponding to the pk_m.
68
+ * @throws If the provided public key is not associated with any of the registered accounts.
69
+ * @param masterPublicKey - The master public key to get secret key for.
70
+ * @returns A Promise that resolves to sk_m.
71
+ * @dev Used when feeding the sk_m to the kernel circuit for keys verification.
72
+ */ getMasterSecretKey(masterPublicKey) {
73
+ return this.keyStore.getMasterSecretKey(masterPublicKey);
74
+ }
75
+ /** Use debug data to get the function name corresponding to a selector. */ getDebugFunctionName(contractAddress, selector) {
76
+ return this.contractStore.getDebugFunctionName(contractAddress, selector);
77
+ }
78
+ /**
79
+ * Returns a membership witness and leaf index to our public data indexed merkle tree,
80
+ * along with an associated DelayedPublicMutable containing the class ID to update.
81
+ */ async getUpdatedClassIdHints(contractAddress) {
82
+ const { delayedPublicMutableSlot, delayedPublicMutableHashSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
83
+ const hashLeafSlot = await computePublicDataTreeLeafSlot(ProtocolContractAddress.ContractInstanceRegistry, delayedPublicMutableHashSlot);
84
+ const updatedClassIdWitness = await this.node.getPublicDataWitness(this.blockHash, hashLeafSlot);
85
+ if (!updatedClassIdWitness) {
86
+ throw new Error(`No public data tree witness found for ${hashLeafSlot}`);
87
+ }
88
+ const readStorage = (storageSlot)=>this.node.getPublicStorageAt(this.blockHash, ProtocolContractAddress.ContractInstanceRegistry, storageSlot);
89
+ const delayedPublicMutableValues = await DelayedPublicMutableValues.readFromTree(delayedPublicMutableSlot, readStorage);
90
+ return new UpdatedClassIdHints(new MembershipWitness(PUBLIC_DATA_TREE_HEIGHT, updatedClassIdWitness.index, updatedClassIdWitness.siblingPath.toTuple()), updatedClassIdWitness.leafPreimage, delayedPublicMutableValues);
91
+ }
92
+ }