@aztec/pxe 0.0.1-commit.03f7ef2 → 0.0.1-commit.04852196a

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 (380) hide show
  1. package/dest/access_scopes.d.ts +9 -0
  2. package/dest/access_scopes.d.ts.map +1 -0
  3. package/dest/access_scopes.js +6 -0
  4. package/dest/bin/check_oracle_version.js +1 -1
  5. package/dest/block_synchronizer/block_synchronizer.d.ts +17 -11
  6. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  7. package/dest/block_synchronizer/block_synchronizer.js +80 -34
  8. package/dest/config/index.d.ts +4 -2
  9. package/dest/config/index.d.ts.map +1 -1
  10. package/dest/config/index.js +18 -1
  11. package/dest/config/package_info.js +1 -1
  12. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  13. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  14. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  15. package/dest/contract_function_simulator/contract_function_simulator.d.ts +65 -40
  16. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/contract_function_simulator.js +212 -92
  18. package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
  19. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/execution_note_cache.js +45 -28
  21. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
  22. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/execution_tagging_index_cache.js +3 -3
  24. package/dest/contract_function_simulator/index.d.ts +2 -2
  25. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  26. package/dest/contract_function_simulator/index.js +1 -1
  27. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
  28. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  29. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +7 -4
  30. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -3
  31. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +2 -2
  33. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  34. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  36. package/dest/contract_function_simulator/oracle/interfaces.d.ts +55 -47
  37. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  38. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
  39. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  40. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
  41. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  42. package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
  43. package/dest/contract_function_simulator/oracle/oracle.d.ts +44 -42
  44. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/oracle/oracle.js +178 -112
  46. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
  47. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  48. package/dest/contract_function_simulator/oracle/private_execution.js +2 -38
  49. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +63 -63
  50. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  51. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +120 -88
  52. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +106 -70
  53. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  54. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +167 -145
  55. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  56. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  57. package/dest/contract_function_simulator/proxied_contract_data_source.js +5 -5
  58. package/dest/contract_logging.d.ts +22 -0
  59. package/dest/contract_logging.d.ts.map +1 -0
  60. package/dest/contract_logging.js +23 -0
  61. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  62. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  63. package/dest/contract_sync/contract_sync_service.js +97 -0
  64. package/dest/contract_sync/helpers.d.ts +29 -0
  65. package/dest/contract_sync/helpers.d.ts.map +1 -0
  66. package/dest/contract_sync/helpers.js +55 -0
  67. package/dest/debug/pxe_debug_utils.d.ts +26 -12
  68. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  69. package/dest/debug/pxe_debug_utils.js +30 -19
  70. package/dest/entrypoints/client/bundle/index.d.ts +4 -1
  71. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  72. package/dest/entrypoints/client/bundle/index.js +3 -0
  73. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  74. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  75. package/dest/entrypoints/client/bundle/utils.js +31 -8
  76. package/dest/entrypoints/client/lazy/index.d.ts +4 -1
  77. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  78. package/dest/entrypoints/client/lazy/index.js +3 -0
  79. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  80. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  81. package/dest/entrypoints/client/lazy/utils.js +32 -9
  82. package/dest/entrypoints/pxe_creation_options.d.ts +5 -3
  83. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  84. package/dest/entrypoints/server/index.d.ts +5 -1
  85. package/dest/entrypoints/server/index.d.ts.map +1 -1
  86. package/dest/entrypoints/server/index.js +4 -0
  87. package/dest/entrypoints/server/utils.d.ts +1 -1
  88. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  89. package/dest/entrypoints/server/utils.js +39 -16
  90. package/dest/error_enriching.d.ts +4 -4
  91. package/dest/error_enriching.d.ts.map +1 -1
  92. package/dest/error_enriching.js +6 -6
  93. package/dest/events/event_service.d.ts +8 -8
  94. package/dest/events/event_service.d.ts.map +1 -1
  95. package/dest/events/event_service.js +21 -24
  96. package/dest/events/private_event_filter_validator.d.ts +6 -6
  97. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  98. package/dest/events/private_event_filter_validator.js +5 -6
  99. package/dest/job_coordinator/job_coordinator.d.ts +75 -0
  100. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  101. package/dest/job_coordinator/job_coordinator.js +94 -0
  102. package/dest/logs/log_service.d.ts +18 -32
  103. package/dest/logs/log_service.d.ts.map +1 -1
  104. package/dest/logs/log_service.js +76 -197
  105. package/dest/notes/note_service.d.ts +13 -12
  106. package/dest/notes/note_service.d.ts.map +1 -1
  107. package/dest/notes/note_service.js +42 -46
  108. package/dest/notes_filter.d.ts +25 -0
  109. package/dest/notes_filter.d.ts.map +1 -0
  110. package/dest/notes_filter.js +4 -0
  111. package/dest/oracle_version.d.ts +3 -3
  112. package/dest/oracle_version.d.ts.map +1 -1
  113. package/dest/oracle_version.js +5 -4
  114. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  115. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  116. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  117. package/dest/private_kernel/hints/index.d.ts +3 -3
  118. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  119. package/dest/private_kernel/hints/index.js +2 -2
  120. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +29 -0
  121. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  122. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +141 -74
  123. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  124. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  125. package/dest/private_kernel/hints/test_utils.js +203 -0
  126. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  127. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  128. package/dest/private_kernel/private_kernel_execution_prover.js +24 -17
  129. package/dest/private_kernel/private_kernel_oracle.d.ts +24 -24
  130. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  131. package/dest/private_kernel/private_kernel_oracle.js +94 -2
  132. package/dest/pxe.d.ts +87 -67
  133. package/dest/pxe.d.ts.map +1 -1
  134. package/dest/pxe.js +211 -189
  135. package/dest/storage/address_store/address_store.d.ts +11 -0
  136. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  137. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +13 -12
  138. package/dest/storage/address_store/index.d.ts +2 -0
  139. package/dest/storage/address_store/index.d.ts.map +1 -0
  140. package/dest/storage/address_store/index.js +1 -0
  141. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +17 -0
  142. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  143. package/dest/storage/{anchor_block_data_provider/anchor_block_data_provider.js → anchor_block_store/anchor_block_store.js} +9 -2
  144. package/dest/storage/anchor_block_store/index.d.ts +2 -0
  145. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  146. package/dest/storage/anchor_block_store/index.js +1 -0
  147. package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
  148. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  149. package/dest/storage/capsule_store/capsule_store.js +253 -0
  150. package/dest/storage/capsule_store/index.d.ts +2 -0
  151. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  152. package/dest/storage/capsule_store/index.js +1 -0
  153. package/dest/storage/contract_store/contract_store.d.ts +93 -0
  154. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  155. package/dest/storage/contract_store/contract_store.js +309 -0
  156. package/dest/storage/contract_store/index.d.ts +2 -0
  157. package/dest/storage/contract_store/index.d.ts.map +1 -0
  158. package/dest/storage/contract_store/index.js +1 -0
  159. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  160. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  161. package/dest/storage/index.d.ts +8 -8
  162. package/dest/storage/index.d.ts.map +1 -1
  163. package/dest/storage/index.js +7 -7
  164. package/dest/storage/metadata.d.ts +1 -1
  165. package/dest/storage/metadata.js +1 -1
  166. package/dest/storage/note_store/index.d.ts +3 -0
  167. package/dest/storage/note_store/index.d.ts.map +1 -0
  168. package/dest/storage/note_store/index.js +2 -0
  169. package/dest/storage/note_store/note_store.d.ts +83 -0
  170. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  171. package/dest/storage/note_store/note_store.js +343 -0
  172. package/dest/storage/note_store/stored_note.d.ts +16 -0
  173. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  174. package/dest/storage/note_store/stored_note.js +43 -0
  175. package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
  176. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  177. package/dest/storage/private_event_store/private_event_store.js +273 -0
  178. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  179. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  180. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  181. package/dest/storage/tagging_store/index.d.ts +4 -0
  182. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  183. package/dest/storage/tagging_store/index.js +3 -0
  184. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
  185. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  186. package/dest/storage/tagging_store/recipient_tagging_store.js +111 -0
  187. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  188. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  189. package/dest/storage/tagging_store/sender_address_book_store.js +36 -0
  190. package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.d.ts → tagging_store/sender_tagging_store.d.ts} +20 -10
  191. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  192. package/dest/storage/tagging_store/sender_tagging_store.js +348 -0
  193. package/dest/tagging/constants.d.ts +2 -2
  194. package/dest/tagging/constants.d.ts.map +1 -1
  195. package/dest/tagging/constants.js +10 -3
  196. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  197. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  198. package/dest/tagging/get_all_logs_by_tags.js +60 -0
  199. package/dest/tagging/index.d.ts +16 -4
  200. package/dest/tagging/index.d.ts.map +1 -1
  201. package/dest/tagging/index.js +15 -3
  202. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +6 -6
  203. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  204. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +13 -13
  205. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  206. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +7 -7
  207. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  208. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +16 -12
  209. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +17 -0
  210. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  211. package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.js +9 -27
  212. package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.d.ts +1 -1
  213. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  214. package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.js +5 -8
  215. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +18 -0
  216. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  217. package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.js +25 -21
  218. package/package.json +27 -18
  219. package/src/access_scopes.ts +9 -0
  220. package/src/bin/check_oracle_version.ts +1 -0
  221. package/src/block_synchronizer/block_synchronizer.ts +99 -46
  222. package/src/config/index.ts +15 -1
  223. package/src/config/package_info.ts +1 -1
  224. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  225. package/src/contract_function_simulator/contract_function_simulator.ts +366 -156
  226. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  227. package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -5
  228. package/src/contract_function_simulator/index.ts +1 -1
  229. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +6 -2
  230. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
  231. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  232. package/src/contract_function_simulator/oracle/interfaces.ts +62 -49
  233. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  234. package/src/contract_function_simulator/oracle/oracle.ts +194 -134
  235. package/src/contract_function_simulator/oracle/private_execution.ts +2 -70
  236. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +157 -168
  237. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +245 -167
  238. package/src/contract_function_simulator/proxied_contract_data_source.ts +7 -7
  239. package/src/contract_logging.ts +39 -0
  240. package/src/contract_sync/contract_sync_service.ts +152 -0
  241. package/src/contract_sync/helpers.ts +98 -0
  242. package/src/debug/pxe_debug_utils.ts +65 -20
  243. package/src/entrypoints/client/bundle/index.ts +3 -0
  244. package/src/entrypoints/client/bundle/utils.ts +23 -16
  245. package/src/entrypoints/client/lazy/index.ts +3 -0
  246. package/src/entrypoints/client/lazy/utils.ts +24 -17
  247. package/src/entrypoints/pxe_creation_options.ts +4 -2
  248. package/src/entrypoints/server/index.ts +4 -0
  249. package/src/entrypoints/server/utils.ts +33 -41
  250. package/src/error_enriching.ts +7 -15
  251. package/src/events/event_service.ts +22 -28
  252. package/src/events/private_event_filter_validator.ts +4 -6
  253. package/src/job_coordinator/job_coordinator.ts +150 -0
  254. package/src/logs/log_service.ts +122 -273
  255. package/src/notes/note_service.ts +45 -49
  256. package/src/notes_filter.ts +26 -0
  257. package/src/oracle_version.ts +5 -4
  258. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  259. package/src/private_kernel/hints/index.ts +2 -2
  260. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +196 -138
  261. package/src/private_kernel/hints/test_utils.ts +325 -0
  262. package/src/private_kernel/private_kernel_execution_prover.ts +27 -19
  263. package/src/private_kernel/private_kernel_oracle.ts +116 -36
  264. package/src/pxe.ts +339 -261
  265. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +16 -16
  266. package/src/storage/address_store/index.ts +1 -0
  267. package/src/storage/{anchor_block_data_provider/anchor_block_data_provider.ts → anchor_block_store/anchor_block_store.ts} +9 -1
  268. package/src/storage/anchor_block_store/index.ts +1 -0
  269. package/src/storage/capsule_store/capsule_store.ts +315 -0
  270. package/src/storage/capsule_store/index.ts +1 -0
  271. package/src/storage/contract_store/contract_store.ts +429 -0
  272. package/src/storage/contract_store/index.ts +1 -0
  273. package/src/storage/index.ts +7 -7
  274. package/src/storage/metadata.ts +1 -1
  275. package/src/storage/note_store/index.ts +2 -0
  276. package/src/storage/note_store/note_store.ts +418 -0
  277. package/src/storage/note_store/stored_note.ts +48 -0
  278. package/src/storage/private_event_store/private_event_store.ts +384 -0
  279. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  280. package/src/storage/tagging_store/index.ts +3 -0
  281. package/src/storage/tagging_store/recipient_tagging_store.ts +143 -0
  282. package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
  283. package/src/storage/tagging_store/sender_tagging_store.ts +429 -0
  284. package/src/tagging/constants.ts +10 -3
  285. package/src/tagging/get_all_logs_by_tags.ts +92 -0
  286. package/src/tagging/index.ts +18 -3
  287. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +29 -18
  288. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  289. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +17 -16
  290. package/src/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.ts +15 -33
  291. package/src/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.ts +5 -13
  292. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +75 -0
  293. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  294. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  295. package/dest/contract_function_simulator/proxied_node.js +0 -27
  296. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  297. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  298. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  299. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
  300. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  301. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  302. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  303. package/dest/public_storage/public_storage_service.d.ts +0 -24
  304. package/dest/public_storage/public_storage_service.d.ts.map +0 -1
  305. package/dest/public_storage/public_storage_service.js +0 -26
  306. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
  307. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  308. package/dest/storage/address_data_provider/index.d.ts +0 -2
  309. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  310. package/dest/storage/address_data_provider/index.js +0 -1
  311. package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts +0 -9
  312. package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts.map +0 -1
  313. package/dest/storage/anchor_block_data_provider/index.d.ts +0 -2
  314. package/dest/storage/anchor_block_data_provider/index.d.ts.map +0 -1
  315. package/dest/storage/anchor_block_data_provider/index.js +0 -1
  316. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -57
  317. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  318. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -146
  319. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  320. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  321. package/dest/storage/capsule_data_provider/index.js +0 -1
  322. package/dest/storage/contract_data_provider/contract_data_provider.d.ts +0 -66
  323. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  324. package/dest/storage/contract_data_provider/contract_data_provider.js +0 -224
  325. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  326. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  327. package/dest/storage/contract_data_provider/index.js +0 -1
  328. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  329. package/dest/storage/note_data_provider/index.d.ts +0 -3
  330. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  331. package/dest/storage/note_data_provider/index.js +0 -2
  332. package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -84
  333. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  334. package/dest/storage/note_data_provider/note_data_provider.js +0 -322
  335. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -51
  336. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  337. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -115
  338. package/dest/storage/tagging_data_provider/index.d.ts +0 -3
  339. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  340. package/dest/storage/tagging_data_provider/index.js +0 -2
  341. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts +0 -31
  342. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.d.ts.map +0 -1
  343. package/dest/storage/tagging_data_provider/recipient_tagging_data_provider.js +0 -65
  344. package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts.map +0 -1
  345. package/dest/storage/tagging_data_provider/sender_tagging_data_provider.js +0 -196
  346. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts +0 -21
  347. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts.map +0 -1
  348. package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.js +0 -42
  349. package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts +0 -21
  350. package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +0 -1
  351. package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts.map +0 -1
  352. package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts +0 -18
  353. package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +0 -1
  354. package/dest/tagging/utils.d.ts +0 -18
  355. package/dest/tagging/utils.d.ts.map +0 -1
  356. package/dest/tagging/utils.js +0 -25
  357. package/dest/tree_membership/tree_membership_service.d.ts +0 -52
  358. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  359. package/dest/tree_membership/tree_membership_service.js +0 -84
  360. package/src/contract_function_simulator/proxied_node.ts +0 -33
  361. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
  362. package/src/public_storage/public_storage_service.ts +0 -33
  363. package/src/storage/address_data_provider/index.ts +0 -1
  364. package/src/storage/anchor_block_data_provider/index.ts +0 -1
  365. package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -179
  366. package/src/storage/capsule_data_provider/index.ts +0 -1
  367. package/src/storage/contract_data_provider/contract_data_provider.ts +0 -319
  368. package/src/storage/contract_data_provider/index.ts +0 -1
  369. package/src/storage/note_data_provider/index.ts +0 -2
  370. package/src/storage/note_data_provider/note_data_provider.ts +0 -412
  371. package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -162
  372. package/src/storage/tagging_data_provider/index.ts +0 -2
  373. package/src/storage/tagging_data_provider/recipient_tagging_data_provider.ts +0 -86
  374. package/src/storage/tagging_data_provider/sender_tagging_data_provider.ts +0 -244
  375. package/src/tagging/recipient_sync/new_recipient_tagging_data_provider.ts +0 -53
  376. package/src/tagging/sync/utils/load_and_store_new_tagging_indexes.ts +0 -72
  377. package/src/tagging/utils.ts +0 -32
  378. package/src/tree_membership/tree_membership_service.ts +0 -112
  379. /package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +0 -0
  380. /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
+ anchorBlockHeader;
9
+ jobId;
10
+ constructor(noteStore, aztecNode, anchorBlockHeader, jobId){
11
+ this.noteStore = noteStore;
11
12
  this.aztecNode = aztecNode;
12
- this.anchorBlockDataProvider = anchorBlockDataProvider;
13
+ this.anchorBlockHeader = anchorBlockHeader;
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
@@ -51,11 +52,12 @@ export class NoteService {
51
52
  * This allows recent nullifications to be processed even if the node is not an archive node.
52
53
  *
53
54
  * @param contractAddress - The contract whose notes should be checked and nullified.
54
- */ async syncNoteNullifiers(contractAddress) {
55
- const syncedBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
56
- const contractNotes = await this.noteDataProvider.getNotes({
57
- contractAddress
58
- });
55
+ */ async syncNoteNullifiers(contractAddress, scopes) {
56
+ const anchorBlockHash = await this.anchorBlockHeader.hash();
57
+ const contractNotes = await this.noteStore.getNotes({
58
+ contractAddress,
59
+ scopes
60
+ }, this.jobId);
59
61
  if (contractNotes.length === 0) {
60
62
  return;
61
63
  }
@@ -72,7 +74,7 @@ export class NoteService {
72
74
  }, [
73
75
  []
74
76
  ]);
75
- const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
77
+ const nullifierIndexes = (await Promise.all(nullifierBatches.map((batch)=>this.aztecNode.findLeavesIndexes(anchorBlockHash, MerkleTreeId.NULLIFIER_TREE, batch)))).flat();
76
78
  const foundNullifiers = nullifiersToCheck.map((nullifier, i)=>{
77
79
  if (nullifierIndexes[i] !== undefined) {
78
80
  return {
@@ -83,10 +85,10 @@ export class NoteService {
83
85
  };
84
86
  }
85
87
  }).filter((nullifier)=>nullifier !== undefined);
86
- await this.noteDataProvider.applyNullifiers(foundNullifiers);
88
+ await this.noteStore.applyNullifiers(foundNullifiers, this.jobId);
87
89
  }
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`.
90
+ async validateAndStoreNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, recipient) {
91
+ // We are going to store the new note in the NoteStore, which will let us later return it via `getNotes`.
90
92
  // There's two things we need to check before we do this however:
91
93
  // - we must make sure the note does actually exist in the note hash tree
92
94
  // - we need to check if the note has already been nullified
@@ -104,49 +106,43 @@ export class NoteService {
104
106
  // number which *should* be recent enough to be available, even for non-archive nodes.
105
107
  // Also note that the note should never be ahead of the synced block here since `fetchTaggedLogs` only processes
106
108
  // logs up to the synced block making this only an additional safety check.
107
- const syncedBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
109
+ const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
110
+ const anchorBlockHash = await this.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
  }
@@ -0,0 +1,25 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
+ import type { NoteStatus } from '@aztec/stdlib/note';
4
+ import type { AccessScopes } from './access_scopes.js';
5
+ /**
6
+ * A filter used to fetch notes.
7
+ * @remarks This filter is applied as an intersection of all its params.
8
+ */
9
+ export type NotesFilter = {
10
+ /**
11
+ * The contract address the note belongs to.
12
+ * @remarks Providing a contract address is required as we need that information to trigger private state sync.
13
+ */
14
+ contractAddress: AztecAddress;
15
+ /** The owner of the note. */
16
+ owner?: AztecAddress;
17
+ /** The specific storage location of the note on the contract. */
18
+ storageSlot?: Fr;
19
+ /** The status of the note. Defaults to 'ACTIVE'. */
20
+ status?: NoteStatus;
21
+ /** The siloed nullifier for the note. */
22
+ siloedNullifier?: Fr;
23
+ scopes: AccessScopes;
24
+ };
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZXNfZmlsdGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvbm90ZXNfZmlsdGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3pELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXJELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXZEOzs7R0FHRztBQUNILE1BQU0sTUFBTSxXQUFXLEdBQUc7SUFDeEI7OztPQUdHO0lBQ0gsZUFBZSxFQUFFLFlBQVksQ0FBQztJQUM5Qiw2QkFBNkI7SUFDN0IsS0FBSyxDQUFDLEVBQUUsWUFBWSxDQUFDO0lBQ3JCLGlFQUFpRTtJQUNqRSxXQUFXLENBQUMsRUFBRSxFQUFFLENBQUM7SUFDakIsb0RBQW9EO0lBQ3BELE1BQU0sQ0FBQyxFQUFFLFVBQVUsQ0FBQztJQUNwQix5Q0FBeUM7SUFDekMsZUFBZSxDQUFDLEVBQUUsRUFBRSxDQUFDO0lBQ3JCLE1BQU0sRUFBRSxZQUFZLENBQUM7Q0FDdEIsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes_filter.d.ts","sourceRoot":"","sources":["../src/notes_filter.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,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,eAAe,EAAE,YAAY,CAAC;IAC9B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,WAAW,CAAC,EAAE,EAAE,CAAC;IACjB,oDAAoD;IACpD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,yCAAyC;IACzC,eAAe,CAAC,EAAE,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * A filter used to fetch notes.
3
+ * @remarks This filter is applied as an intersection of all its params.
4
+ */ export { };
@@ -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 = 14;
2
+ export declare const ORACLE_INTERFACE_HASH = "9fb918682455c164ce8dd3acb71c751e2b9b2fc48913604069c9ea885fa378ca";
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxLQUFLLENBQUM7QUFLakMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
@@ -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,KAAK,CAAC;AAKjC,eAAO,MAAM,qBAAqB,qEAAqE,CAAC"}
@@ -2,9 +2,10 @@
2
2
  /// to version the oracle interface to ensure that developers get a reasonable error message if they use incompatible
3
3
  /// versions of Aztec.nr and PXE. The Noir counterpart is in `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
4
4
  ///
5
- /// @dev Whenever a contract function or Noir test is run, the `utilityAssertCompatibleOracleVersion` oracle is called
5
+ /// @dev Whenever a contract function or Noir test is run, the `aztec_utl_assertCompatibleOracleVersion` 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 = 14;
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 = '9fb918682455c164ce8dd3acb71c751e2b9b2fc48913604069c9ea885fa378ca';
@@ -0,0 +1,4 @@
1
+ import type { PrivateKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
2
+ import type { UInt64 } from '@aztec/stdlib/types';
3
+ export declare function computeTxExpirationTimestamp(previousKernel: PrivateKernelCircuitPublicInputs, txLifetime?: number): UInt64;
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZV90eF9leHBpcmF0aW9uX3RpbWVzdGFtcC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL2hpbnRzL2NvbXB1dGVfdHhfZXhwaXJhdGlvbl90aW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsZ0NBQWdDLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM3RSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQXFCbEQsd0JBQWdCLDRCQUE0QixDQUMxQyxjQUFjLEVBQUUsZ0NBQWdDLEVBQ2hELFVBQVUsU0FBa0IsR0FDM0IsTUFBTSxDQStCUiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute_tx_expiration_timestamp.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/compute_tx_expiration_timestamp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAqBlD,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,gCAAgC,EAChD,UAAU,SAAkB,GAC3B,MAAM,CA+BR"}
@@ -1,41 +1,41 @@
1
- import { MAX_INCLUDE_BY_TIMESTAMP_DURATION } from '@aztec/constants';
1
+ import { MAX_TX_LIFETIME } from '@aztec/constants';
2
2
  const ROUNDED_DURATIONS = [
3
3
  3600,
4
4
  1800,
5
5
  1
6
6
  ];
7
- function roundTimestamp(blockTimestamp, includeByTimestamp) {
7
+ function roundTimestamp(blockTimestamp, expirationTimestamp) {
8
8
  return ROUNDED_DURATIONS.reduce((timestamp, duration)=>{
9
9
  if (timestamp <= blockTimestamp) {
10
10
  // The timestamp must be greater than the block timestamp.
11
11
  // If it is too small, round it down again using a smaller duration.
12
- const totalDuration = includeByTimestamp - blockTimestamp;
12
+ const totalDuration = expirationTimestamp - blockTimestamp;
13
13
  const roundedDuration = totalDuration - totalDuration % BigInt(duration);
14
14
  return blockTimestamp + roundedDuration;
15
15
  }
16
16
  return timestamp;
17
17
  }, 0n);
18
18
  }
19
- export function computeTxIncludeByTimestamp(previousKernel, maxDuration = MAX_INCLUDE_BY_TIMESTAMP_DURATION) {
20
- if (maxDuration > MAX_INCLUDE_BY_TIMESTAMP_DURATION) {
21
- throw new Error(`Custom max duration cannot be greater than the max allowed. Max allowed: ${MAX_INCLUDE_BY_TIMESTAMP_DURATION}. Custom value: ${maxDuration}.`);
19
+ export function computeTxExpirationTimestamp(previousKernel, txLifetime = MAX_TX_LIFETIME) {
20
+ if (txLifetime > MAX_TX_LIFETIME) {
21
+ throw new Error(`Custom tx lifetime cannot be greater than the max allowed. Max allowed: ${MAX_TX_LIFETIME}. Custom value: ${txLifetime}.`);
22
22
  }
23
23
  const anchorBlockTimestamp = previousKernel.constants.anchorBlockHeader.globalVariables.timestamp;
24
- const maxTimestamp = anchorBlockTimestamp + BigInt(maxDuration);
25
- const includeByTimestamp = previousKernel.includeByTimestamp;
26
- // If the includeByTimestamp set during the tx execution is greater than or equal to the max allowed duration,
24
+ const maxTimestamp = anchorBlockTimestamp + BigInt(txLifetime);
25
+ const expirationTimestamp = previousKernel.expirationTimestamp;
26
+ // If the expirationTimestamp set during the tx execution is greater than or equal to the max allowed duration,
27
27
  // use the maximum allowed timestamp.
28
28
  // Note: It shouldn't be larger than the max allowed duration, but we check for it anyway.
29
- if (includeByTimestamp >= maxTimestamp) {
29
+ if (expirationTimestamp >= maxTimestamp) {
30
30
  return maxTimestamp;
31
31
  }
32
32
  // Round it down to the nearest hour/min/second to reduce precision and avoid revealing the exact value.
33
33
  // This makes it harder for others to infer what function calls may have been used to produce a specific timestamp.
34
- const roundedTimestamp = roundTimestamp(anchorBlockTimestamp, includeByTimestamp);
34
+ const roundedTimestamp = roundTimestamp(anchorBlockTimestamp, expirationTimestamp);
35
35
  // The tx can't be published if the timestamp is the same or less than the anchor block's timestamp.
36
36
  // Future blocks will have a greater timestamp, so the tx would never be included.
37
37
  if (roundedTimestamp <= anchorBlockTimestamp) {
38
- throw new Error(`Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${includeByTimestamp}.`);
38
+ throw new Error(`Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${expirationTimestamp}.`);
39
39
  }
40
40
  return roundedTimestamp;
41
41
  }
@@ -1,3 +1,3 @@
1
- export * from './build_private_kernel_reset_private_inputs.js';
2
- export * from './compute_tx_include_by_timestamp.js';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9oaW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGdEQUFnRCxDQUFDO0FBQy9ELGNBQWMsc0NBQXNDLENBQUMifQ==
1
+ export * from './private_kernel_reset_private_inputs_builder.js';
2
+ export * from './compute_tx_expiration_timestamp.js';
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';
2
- export * from './compute_tx_include_by_timestamp.js';
1
+ export * from './private_kernel_reset_private_inputs_builder.js';
2
+ export * from './compute_tx_expiration_timestamp.js';
@@ -0,0 +1,29 @@
1
+ import { type PrivateKernelCircuitPublicInputs, PrivateKernelResetCircuitPrivateInputs, PrivateKernelResetDimensions, 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
+ getRequestedDimensions(): PrivateKernelResetDimensions;
18
+ needsReset(): boolean;
19
+ build(oracle: PrivateKernelOracle): Promise<PrivateKernelResetCircuitPrivateInputs>;
20
+ private reduceReadRequestActions;
21
+ private needsResetNoteHashReadRequests;
22
+ private needsResetNullifierReadRequests;
23
+ private needsResetKeyValidationRequests;
24
+ private needsResetTransientData;
25
+ private needsSiloNoteHashes;
26
+ private needsSiloNullifiers;
27
+ private needsSiloPrivateLogs;
28
+ }
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfcmVzZXRfcHJpdmF0ZV9pbnB1dHNfYnVpbGRlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL2hpbnRzL3ByaXZhdGVfa2VybmVsX3Jlc2V0X3ByaXZhdGVfaW5wdXRzX2J1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZUEsT0FBTyxFQUtMLEtBQUssZ0NBQWdDLEVBRXJDLHNDQUFzQyxFQUN0Qyw0QkFBNEIsRUFFNUIsS0FBSywyQkFBMkIsRUFhakMsTUFBTSxzQkFBc0IsQ0FBQztBQUM5QixPQUFPLEVBQUUsS0FBSywwQkFBMEIsRUFBaUIsTUFBTSxrQkFBa0IsQ0FBQztBQUdsRixPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBbUN2RSxxQkFBYSxzQ0FBc0M7SUFlL0MsT0FBTyxDQUFDLG9CQUFvQjtJQUM1QixPQUFPLENBQUMsY0FBYztJQUN0QixPQUFPLENBQUMsMkJBQTJCO0lBQ25DLE9BQU8sQ0FBQyxZQUFZO0lBakJ0QixPQUFPLENBQUMsY0FBYyxDQUFtQztJQUV6RCxPQUFPLENBQUMsYUFBYSxDQUFDLENBQTZCO0lBRW5ELE9BQU8sQ0FBQyxvQkFBb0IsQ0FBcUU7SUFDakcsT0FBTyxDQUFDLHFCQUFxQixDQUFxRTtJQUNsRyxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FBUztJQUNsQyxPQUFPLENBQUMsMkJBQTJCLENBR2pDO0lBQ0YsT0FBTyxDQUFDLG1CQUFtQixDQUF3QztJQUVuRSxZQUNVLG9CQUFvQixFQUFFLDJCQUEyQixDQUFDLGdDQUFnQyxDQUFDLEVBQ25GLGNBQWMsRUFBRSwwQkFBMEIsRUFBRSxFQUM1QywyQkFBMkIsRUFBRSxHQUFHLENBQUMsTUFBTSxFQUFFLE1BQU0sQ0FBQyxFQUNoRCxZQUFZLEVBQUUsTUFBTSxFQUk3QjtJQUVELHNCQUFzQixJQUFJLDRCQUE0QixDQUVyRDtJQUVELFVBQVUsSUFBSSxPQUFPLENBc0JwQjtJQUVLLEtBQUssQ0FBQyxNQUFNLEVBQUUsbUJBQW1CLG1EQThFdEM7SUFFRCxPQUFPLENBQUMsd0JBQXdCO0lBMkJoQyxPQUFPLENBQUMsOEJBQThCO0lBMEV0QyxPQUFPLENBQUMsK0JBQStCO0lBeUV2QyxPQUFPLENBQUMsK0JBQStCO0lBYXZDLE9BQU8sQ0FBQyx1QkFBdUI7SUEwRi9CLE9BQU8sQ0FBQyxtQkFBbUI7SUFpQjNCLE9BQU8sQ0FBQyxtQkFBbUI7SUFpQjNCLE9BQU8sQ0FBQyxvQkFBb0I7Q0FxQjdCIn0=
@@ -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,EACtC,4BAA4B,EAE5B,KAAK,2BAA2B,EAajC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,0BAA0B,EAAiB,MAAM,kBAAkB,CAAC;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAmCvE,qBAAa,sCAAsC;IAe/C,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,2BAA2B;IACnC,OAAO,CAAC,YAAY;IAjBtB,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,CAGjC;IACF,OAAO,CAAC,mBAAmB,CAAwC;IAEnE,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,EAI7B;IAED,sBAAsB,IAAI,4BAA4B,CAErD;IAED,UAAU,IAAI,OAAO,CAsBpB;IAEK,KAAK,CAAC,MAAM,EAAE,mBAAmB,mDA8EtC;IAED,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,8BAA8B;IA0EtC,OAAO,CAAC,+BAA+B;IAyEvC,OAAO,CAAC,+BAA+B;IAavC,OAAO,CAAC,uBAAuB;IA0F/B,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,oBAAoB;CAqB7B"}