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

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 (274) 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 +13 -5
  6. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  7. package/dest/block_synchronizer/block_synchronizer.js +74 -20
  8. package/dest/config/index.d.ts +3 -1
  9. package/dest/config/index.d.ts.map +1 -1
  10. package/dest/config/index.js +17 -0
  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 +57 -34
  16. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/contract_function_simulator.js +199 -81
  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 +17 -13
  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 +12 -10
  44. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/oracle/oracle.js +67 -44
  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 +1 -37
  49. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +45 -47
  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 +91 -60
  52. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +67 -33
  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 +131 -110
  55. package/dest/contract_logging.d.ts +22 -0
  56. package/dest/contract_logging.d.ts.map +1 -0
  57. package/dest/contract_logging.js +23 -0
  58. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  59. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  60. package/dest/contract_sync/contract_sync_service.js +97 -0
  61. package/dest/contract_sync/helpers.d.ts +29 -0
  62. package/dest/contract_sync/helpers.d.ts.map +1 -0
  63. package/dest/contract_sync/helpers.js +55 -0
  64. package/dest/debug/pxe_debug_utils.d.ts +24 -10
  65. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  66. package/dest/debug/pxe_debug_utils.js +28 -17
  67. package/dest/entrypoints/client/bundle/index.d.ts +4 -1
  68. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  69. package/dest/entrypoints/client/bundle/index.js +3 -0
  70. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  71. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  72. package/dest/entrypoints/client/bundle/utils.js +31 -8
  73. package/dest/entrypoints/client/lazy/index.d.ts +4 -1
  74. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  75. package/dest/entrypoints/client/lazy/index.js +3 -0
  76. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  77. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  78. package/dest/entrypoints/client/lazy/utils.js +32 -9
  79. package/dest/entrypoints/pxe_creation_options.d.ts +5 -3
  80. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  81. package/dest/entrypoints/server/index.d.ts +5 -1
  82. package/dest/entrypoints/server/index.d.ts.map +1 -1
  83. package/dest/entrypoints/server/index.js +4 -0
  84. package/dest/entrypoints/server/utils.d.ts +1 -1
  85. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  86. package/dest/entrypoints/server/utils.js +39 -16
  87. package/dest/events/event_service.d.ts +6 -6
  88. package/dest/events/event_service.d.ts.map +1 -1
  89. package/dest/events/event_service.js +19 -22
  90. package/dest/events/private_event_filter_validator.d.ts +5 -5
  91. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  92. package/dest/events/private_event_filter_validator.js +5 -6
  93. package/dest/job_coordinator/job_coordinator.d.ts +75 -0
  94. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  95. package/dest/job_coordinator/job_coordinator.js +94 -0
  96. package/dest/logs/log_service.d.ts +8 -5
  97. package/dest/logs/log_service.d.ts.map +1 -1
  98. package/dest/logs/log_service.js +31 -33
  99. package/dest/notes/note_service.d.ts +10 -9
  100. package/dest/notes/note_service.d.ts.map +1 -1
  101. package/dest/notes/note_service.js +34 -38
  102. package/dest/notes_filter.d.ts +25 -0
  103. package/dest/notes_filter.d.ts.map +1 -0
  104. package/dest/notes_filter.js +4 -0
  105. package/dest/oracle_version.d.ts +3 -3
  106. package/dest/oracle_version.d.ts.map +1 -1
  107. package/dest/oracle_version.js +4 -3
  108. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  109. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  110. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  111. package/dest/private_kernel/hints/index.d.ts +3 -3
  112. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  113. package/dest/private_kernel/hints/index.js +2 -2
  114. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +29 -0
  115. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  116. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +141 -74
  117. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  118. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  119. package/dest/private_kernel/hints/test_utils.js +203 -0
  120. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  121. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  122. package/dest/private_kernel/private_kernel_execution_prover.js +24 -17
  123. package/dest/private_kernel/private_kernel_oracle.d.ts +24 -24
  124. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  125. package/dest/private_kernel/private_kernel_oracle.js +94 -2
  126. package/dest/pxe.d.ts +76 -58
  127. package/dest/pxe.d.ts.map +1 -1
  128. package/dest/pxe.js +151 -136
  129. package/dest/storage/address_store/address_store.d.ts +1 -1
  130. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  131. package/dest/storage/address_store/address_store.js +12 -11
  132. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  133. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  134. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  135. package/dest/storage/capsule_store/capsule_store.d.ts +24 -9
  136. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  137. package/dest/storage/capsule_store/capsule_store.js +130 -23
  138. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  139. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  140. package/dest/storage/contract_store/contract_store.js +157 -72
  141. package/dest/storage/metadata.d.ts +1 -1
  142. package/dest/storage/metadata.js +1 -1
  143. package/dest/storage/note_store/note_store.d.ts +50 -51
  144. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  145. package/dest/storage/note_store/note_store.js +284 -263
  146. package/dest/storage/note_store/stored_note.d.ts +16 -0
  147. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  148. package/dest/storage/note_store/stored_note.js +43 -0
  149. package/dest/storage/private_event_store/private_event_store.d.ts +47 -7
  150. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  151. package/dest/storage/private_event_store/private_event_store.js +231 -73
  152. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  153. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  154. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  155. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +16 -9
  156. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  157. package/dest/storage/tagging_store/recipient_tagging_store.js +88 -19
  158. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  159. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  160. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  161. package/dest/storage/tagging_store/sender_tagging_store.d.ts +20 -10
  162. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  163. package/dest/storage/tagging_store/sender_tagging_store.js +254 -102
  164. package/dest/tagging/constants.d.ts +2 -0
  165. package/dest/tagging/constants.d.ts.map +1 -0
  166. package/dest/tagging/constants.js +10 -0
  167. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  168. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  169. package/dest/tagging/get_all_logs_by_tags.js +60 -0
  170. package/dest/tagging/index.d.ts +4 -3
  171. package/dest/tagging/index.d.ts.map +1 -1
  172. package/dest/tagging/index.js +3 -11
  173. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +5 -5
  174. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  175. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +13 -13
  176. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  177. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +7 -7
  178. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  179. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +16 -12
  180. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +5 -8
  181. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  182. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +9 -12
  183. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
  184. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  185. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
  186. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +7 -7
  187. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  188. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +23 -19
  189. package/package.json +27 -18
  190. package/src/access_scopes.ts +9 -0
  191. package/src/bin/check_oracle_version.ts +1 -0
  192. package/src/block_synchronizer/block_synchronizer.ts +93 -32
  193. package/src/config/index.ts +14 -0
  194. package/src/config/package_info.ts +1 -1
  195. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  196. package/src/contract_function_simulator/contract_function_simulator.ts +353 -140
  197. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  198. package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -5
  199. package/src/contract_function_simulator/index.ts +1 -1
  200. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +6 -2
  201. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
  202. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  203. package/src/contract_function_simulator/oracle/interfaces.ts +22 -12
  204. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  205. package/src/contract_function_simulator/oracle/oracle.ts +79 -47
  206. package/src/contract_function_simulator/oracle/private_execution.ts +1 -69
  207. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +131 -140
  208. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +198 -115
  209. package/src/contract_logging.ts +39 -0
  210. package/src/contract_sync/contract_sync_service.ts +152 -0
  211. package/src/contract_sync/helpers.ts +98 -0
  212. package/src/debug/pxe_debug_utils.ts +63 -18
  213. package/src/entrypoints/client/bundle/index.ts +3 -0
  214. package/src/entrypoints/client/bundle/utils.ts +23 -16
  215. package/src/entrypoints/client/lazy/index.ts +3 -0
  216. package/src/entrypoints/client/lazy/utils.ts +24 -17
  217. package/src/entrypoints/pxe_creation_options.ts +4 -2
  218. package/src/entrypoints/server/index.ts +4 -0
  219. package/src/entrypoints/server/utils.ts +33 -41
  220. package/src/events/event_service.ts +19 -25
  221. package/src/events/private_event_filter_validator.ts +3 -5
  222. package/src/job_coordinator/job_coordinator.ts +150 -0
  223. package/src/logs/log_service.ts +51 -40
  224. package/src/notes/note_service.ts +41 -45
  225. package/src/notes_filter.ts +26 -0
  226. package/src/oracle_version.ts +4 -3
  227. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  228. package/src/private_kernel/hints/index.ts +2 -2
  229. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +196 -138
  230. package/src/private_kernel/hints/test_utils.ts +325 -0
  231. package/src/private_kernel/private_kernel_execution_prover.ts +27 -19
  232. package/src/private_kernel/private_kernel_oracle.ts +116 -36
  233. package/src/pxe.ts +283 -202
  234. package/src/storage/address_store/address_store.ts +15 -15
  235. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  236. package/src/storage/capsule_store/capsule_store.ts +159 -23
  237. package/src/storage/contract_store/contract_store.ts +186 -76
  238. package/src/storage/metadata.ts +1 -1
  239. package/src/storage/note_store/note_store.ts +326 -320
  240. package/src/storage/note_store/stored_note.ts +48 -0
  241. package/src/storage/private_event_store/private_event_store.ts +301 -79
  242. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  243. package/src/storage/tagging_store/recipient_tagging_store.ts +111 -21
  244. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  245. package/src/storage/tagging_store/sender_tagging_store.ts +297 -112
  246. package/src/tagging/constants.ts +10 -0
  247. package/src/tagging/get_all_logs_by_tags.ts +92 -0
  248. package/src/tagging/index.ts +3 -12
  249. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +27 -16
  250. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  251. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +17 -16
  252. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +13 -15
  253. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -13
  254. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +26 -23
  255. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  256. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  257. package/dest/contract_function_simulator/proxied_node.js +0 -27
  258. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  259. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  260. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  261. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
  262. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  263. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  264. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  265. package/dest/public_storage/public_storage_service.d.ts +0 -24
  266. package/dest/public_storage/public_storage_service.d.ts.map +0 -1
  267. package/dest/public_storage/public_storage_service.js +0 -26
  268. package/dest/tree_membership/tree_membership_service.d.ts +0 -52
  269. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  270. package/dest/tree_membership/tree_membership_service.js +0 -84
  271. package/src/contract_function_simulator/proxied_node.ts +0 -33
  272. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
  273. package/src/public_storage/public_storage_service.ts +0 -33
  274. package/src/tree_membership/tree_membership_service.ts +0 -112
@@ -1 +1 @@
1
- {"version":3,"file":"load_private_logs_for_sender_recipient_pair.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,GAC7B,OAAO,CAAC,aAAa,EAAE,CAAC,CAyG1B"}
1
+ {"version":3,"file":"load_private_logs_for_sender_recipient_pair.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,mCAAmC,EAC3C,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,EAAE,CAAC,CAmH1B"}
@@ -1,19 +1,19 @@
1
- import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../index.js';
1
+ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../constants.js';
2
2
  import { findHighestIndexes } from './utils/find_highest_indexes.js';
3
3
  import { loadLogsForRange } from './utils/load_logs_for_range.js';
4
4
  /**
5
- * Loads private logs for `app` and sender-recipient pair defined by `secret` and updates the highest aged and
5
+ * Loads private logs for the app-sender-recipient triplet defined by `secret` and updates the highest aged and
6
6
  * finalized indexes in the db. At most load logs from blocks up to and including `anchorBlockNumber`.
7
7
  *
8
8
  * @dev This function can be safely executed "in parallel" for other sender-recipient pairs because the data in
9
9
  * in the tagging data provider is indexed by the secret and hence completely disjoint.
10
- */ export async function loadPrivateLogsForSenderRecipientPair(secret, app, aztecNode, taggingStore, anchorBlockNumber) {
10
+ */ export async function loadPrivateLogsForSenderRecipientPair(secret, aztecNode, taggingStore, anchorBlockNumber, anchorBlockHash, jobId) {
11
11
  // # Explanation of how the algorithm works
12
12
  // When we perform the sync we will look at logs that correspond to the tagging index range
13
13
  // (highestAgedIndex, highestFinalizedIndex + WINDOW_LEN]
14
14
  //
15
15
  // highestAgedIndex is the highest index that was used in a tx that is included in a block at least
16
- // `MAX_INCLUDE_BY_TIMESTAMP_DURATION` seconds ago.
16
+ // `MAX_TX_LIFETIME` seconds ago.
17
17
  // highestFinalizedIndex is the highest index that was used in a tx that is included in a finalized block.
18
18
  //
19
19
  // "(" denotes an open end of the range - the index is not included in the range.
@@ -25,19 +25,19 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
25
25
  // ever appear.
26
26
  //
27
27
  // This relies on the "maximum inclusion timestamp" rule enforced by the kernel and rollup circuits:
28
- // - a transaction's maximum inclusion timestamp is at most `MAX_INCLUDE_BY_TIMESTAMP_DURATION` seconds after
28
+ // - a transaction's maximum inclusion timestamp is at most `MAX_TX_LIFETIME` seconds after
29
29
  // the timestamp of its anchor block; and
30
30
  // - a rollup only includes transactions whose inclusion timestamp is >= the L2 block's timestamp.
31
31
  //
32
32
  // Suppose some device used index `I` in a transaction anchored to block `B_N` at time `N`, and that block is now at
33
- // least `MAX_INCLUDE_BY_TIMESTAMP_DURATION` seconds in the past. Then there is no possibility of any *other* device
33
+ // least `MAX_TX_LIFETIME` seconds in the past. Then there is no possibility of any *other* device
34
34
  // trying to use an index <= `I` while anchoring to a *newer* block than `B_N` because if we were anchoring to
35
35
  // a newer block than `B_N` then we would already have seen the log with index `I` and hence the device would have
36
36
  // chosen a larger index.
37
37
  // If that *other* device would anchor to a block older than `B_N` then that tx could never be included in a block
38
38
  // because it would already have been expired.
39
39
  //
40
- // Therefore, once we see that index `I` has been used in a block that is at least `MAX_INCLUDE_BY_TIMESTAMP_DURATION`
40
+ // Therefore, once we see that index `I` has been used in a block that is at least `MAX_TX_LIFETIME`
41
41
  // seconds old, we can safely stop syncing logs for all indexes <= `I` and set highestAgedIndex = `I`.
42
42
  //
43
43
  // ## Explanation of the upper bound `highestFinalizedIndex + WINDOW_LEN`
@@ -55,14 +55,14 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
55
55
  throw new Error('Node failed to return latest block header when syncing logs');
56
56
  }
57
57
  [finalizedBlockNumber, currentTimestamp] = [
58
- l2Tips.finalized.number,
58
+ l2Tips.finalized.block.number,
59
59
  latestBlockHeader.globalVariables.timestamp
60
60
  ];
61
61
  }
62
62
  let start, end;
63
63
  {
64
- const currentHighestAgedIndex = await taggingStore.getHighestAgedIndex(secret);
65
- const currentHighestFinalizedIndex = await taggingStore.getHighestFinalizedIndex(secret);
64
+ const currentHighestAgedIndex = await taggingStore.getHighestAgedIndex(secret, jobId);
65
+ const currentHighestFinalizedIndex = await taggingStore.getHighestFinalizedIndex(secret, jobId);
66
66
  // We don't want to include the highest aged index so we start from `currentHighestAgedIndex + 1` (or 0 if not set)
67
67
  start = currentHighestAgedIndex === undefined ? 0 : currentHighestAgedIndex + 1;
68
68
  // The highest index a sender can choose is "highest finalized index + window length" but given that
@@ -72,7 +72,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
72
72
  const logs = [];
73
73
  while(true){
74
74
  // Get private logs with their block timestamps and corresponding tagging indexes
75
- const privateLogsWithIndexes = await loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber);
75
+ const privateLogsWithIndexes = await loadLogsForRange(secret, aztecNode, start, end, anchorBlockNumber, anchorBlockHash);
76
76
  if (privateLogsWithIndexes.length === 0) {
77
77
  break;
78
78
  }
@@ -80,7 +80,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
80
80
  const { highestAgedIndex, highestFinalizedIndex } = findHighestIndexes(privateLogsWithIndexes, currentTimestamp, finalizedBlockNumber);
81
81
  // Store updates in data provider and update local variables
82
82
  if (highestAgedIndex !== undefined) {
83
- await taggingStore.updateHighestAgedIndex(secret, highestAgedIndex);
83
+ await taggingStore.updateHighestAgedIndex(secret, highestAgedIndex, jobId);
84
84
  }
85
85
  if (highestFinalizedIndex === undefined) {
86
86
  break;
@@ -89,7 +89,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
89
89
  // This is just a sanity check as this should never happen.
90
90
  throw new Error('Highest aged index lower than highest finalized index invariant violated');
91
91
  }
92
- await taggingStore.updateHighestFinalizedIndex(secret, highestFinalizedIndex);
92
+ await taggingStore.updateHighestFinalizedIndex(secret, highestFinalizedIndex, jobId);
93
93
  // For the next iteration we want to look only at indexes for which we have not attempted to load logs yet while
94
94
  // ensuring that we do not look further than WINDOW_LEN ahead of the highest finalized index.
95
95
  start = end;
@@ -1,4 +1,4 @@
1
- import { MAX_INCLUDE_BY_TIMESTAMP_DURATION } from '@aztec/constants';
1
+ import { MAX_TX_LIFETIME } from '@aztec/constants';
2
2
  /**
3
3
  * Finds the highest aged and the highest finalized tagging indexes.
4
4
  */ export function findHighestIndexes(privateLogsWithIndexes, currentTimestamp, finalizedBlockNumber) {
@@ -6,7 +6,7 @@ import { MAX_INCLUDE_BY_TIMESTAMP_DURATION } from '@aztec/constants';
6
6
  let highestFinalizedIndex = undefined;
7
7
  for (const { log, taggingIndex } of privateLogsWithIndexes){
8
8
  const ageInSeconds = currentTimestamp - log.blockTimestamp;
9
- if (ageInSeconds >= BigInt(MAX_INCLUDE_BY_TIMESTAMP_DURATION) && (highestAgedIndex === undefined || taggingIndex > highestAgedIndex)) {
9
+ if (ageInSeconds >= BigInt(MAX_TX_LIFETIME) && (highestAgedIndex === undefined || taggingIndex > highestAgedIndex)) {
10
10
  highestAgedIndex = taggingIndex;
11
11
  }
12
12
  if (log.blockNumber <= finalizedBlockNumber && (highestFinalizedIndex === undefined || taggingIndex > highestFinalizedIndex)) {
@@ -1,14 +1,14 @@
1
1
  import type { BlockNumber } from '@aztec/foundation/branded-types';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ import type { BlockHash } from '@aztec/stdlib/block';
3
3
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
4
- import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
4
+ import type { ExtendedDirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
5
5
  /**
6
- * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range, `app` and
7
- * `secret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and `end` is
8
- * exclusive.
6
+ * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range and
7
+ * `extendedSecret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and
8
+ * `end` is exclusive.
9
9
  */
10
- export declare function loadLogsForRange(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, start: number, end: number, anchorBlockNumber: BlockNumber): Promise<Array<{
10
+ export declare function loadLogsForRange(extendedSecret: ExtendedDirectionalAppTaggingSecret, aztecNode: AztecNode, start: number, end: number, anchorBlockNumber: BlockNumber, anchorBlockHash: BlockHash): Promise<Array<{
11
11
  log: TxScopedL2Log;
12
12
  taggingIndex: number;
13
13
  }>>;
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9sb2dzX2Zvcl9yYW5nZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvdXRpbHMvbG9hZF9sb2dzX2Zvcl9yYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBVSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUc3Rjs7OztHQUlHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUNwQyxNQUFNLEVBQUUsMkJBQTJCLEVBQ25DLEdBQUcsRUFBRSxZQUFZLEVBQ2pCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLEtBQUssRUFBRSxNQUFNLEVBQ2IsR0FBRyxFQUFFLE1BQU0sRUFDWCxpQkFBaUIsRUFBRSxXQUFXLEdBQzdCLE9BQU8sQ0FBQyxLQUFLLENBQUM7SUFBRSxHQUFHLEVBQUUsYUFBYSxDQUFDO0lBQUMsWUFBWSxFQUFFLE1BQU0sQ0FBQTtDQUFFLENBQUMsQ0FBQyxDQXdCOUQifQ==
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9sb2dzX2Zvcl9yYW5nZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvdXRpbHMvbG9hZF9sb2dzX2Zvcl9yYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSxtQ0FBbUMsRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUs3Rjs7OztHQUlHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUNwQyxjQUFjLEVBQUUsbUNBQW1DLEVBQ25ELFNBQVMsRUFBRSxTQUFTLEVBQ3BCLEtBQUssRUFBRSxNQUFNLEVBQ2IsR0FBRyxFQUFFLE1BQU0sRUFDWCxpQkFBaUIsRUFBRSxXQUFXLEVBQzlCLGVBQWUsRUFBRSxTQUFTLEdBQ3pCLE9BQU8sQ0FBQyxLQUFLLENBQUM7SUFBRSxHQUFHLEVBQUUsYUFBYSxDQUFDO0lBQUMsWUFBWSxFQUFFLE1BQU0sQ0FBQTtDQUFFLENBQUMsQ0FBQyxDQXVCOUQifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"load_logs_for_range.d.ts","sourceRoot":"","sources":["../../../../src/tagging/recipient_sync/utils/load_logs_for_range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAG7F;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,iBAAiB,EAAE,WAAW,GAC7B,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAwB9D"}
1
+ {"version":3,"file":"load_logs_for_range.d.ts","sourceRoot":"","sources":["../../../../src/tagging/recipient_sync/utils/load_logs_for_range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK7F;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,mCAAmC,EACnD,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAuB9D"}
@@ -1,21 +1,25 @@
1
- import { SiloedTag, Tag } from '@aztec/stdlib/logs';
1
+ import { SiloedTag } from '@aztec/stdlib/logs';
2
+ import { getAllPrivateLogsByTags } from '../../get_all_logs_by_tags.js';
2
3
  /**
3
- * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range, `app` and
4
- * `secret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and `end` is
5
- * exclusive.
6
- */ export async function loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber) {
7
- // Derive tags for the window
8
- const preTags = Array(end - start).fill(0).map((_, i)=>({
9
- secret,
4
+ * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range and
5
+ * `extendedSecret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and
6
+ * `end` is exclusive.
7
+ */ export async function loadLogsForRange(extendedSecret, aztecNode, start, end, anchorBlockNumber, anchorBlockHash) {
8
+ // Derive siloed tags for the window
9
+ const siloedTags = await Promise.all(Array.from({
10
+ length: end - start
11
+ }, (_, i)=>SiloedTag.compute({
12
+ extendedSecret,
10
13
  index: start + i
11
- }));
12
- const siloedTags = await Promise.all(preTags.map((preTag)=>Tag.compute(preTag))).then((tags)=>Promise.all(tags.map((tag)=>SiloedTag.compute(tag, app))));
13
- const logs = await aztecNode.getPrivateLogsByTags(siloedTags);
14
+ })));
15
+ // We use the utility function below to retrieve all logs for the tags across all pages, so we don't need to handle
16
+ // pagination here.
17
+ const logs = await getAllPrivateLogsByTags(aztecNode, siloedTags, anchorBlockHash);
14
18
  // Pair logs with their corresponding tagging indexes
15
19
  const logsWithIndexes = [];
16
20
  for(let i = 0; i < logs.length; i++){
17
21
  const logsForTag = logs[i];
18
- const taggingIndex = preTags[i].index;
22
+ const taggingIndex = start + i;
19
23
  for (const log of logsForTag){
20
24
  if (log.blockNumber <= anchorBlockNumber) {
21
25
  logsWithIndexes.push({
@@ -1,20 +1,17 @@
1
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
1
+ import type { BlockHash } from '@aztec/stdlib/block';
2
2
  import type { AztecNode } from '@aztec/stdlib/interfaces/server';
3
- import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
3
+ import type { ExtendedDirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
4
4
  import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagging_store.js';
5
5
  /**
6
6
  * Syncs tagging indexes. This function needs to be called whenever a private log is being sent.
7
7
  *
8
- * @param secret - The secret that's unique for (sender, recipient, contract) tuple while the direction of
8
+ * @param secret - The secret that's unique for (sender, recipient, app) tuple while the direction of
9
9
  * sender -> recipient matters.
10
- * @param app - The address of the contract that the logs are tagged for. Needs to be provided because we perform
11
- * second round of siloing in this function which is necessary because kernels do it as well (they silo first field
12
- * of the private log which corresponds to the tag).
13
10
  * @remarks When syncing the indexes as sender we don't care about the log contents - we only care about the highest
14
11
  * pending and highest finalized indexes as that guides the next index choice when sending a log. The next index choice
15
12
  * is simply the highest pending index plus one (or finalized if pending is undefined).
16
13
  * @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
17
14
  * updates its status accordingly.
18
15
  */
19
- export declare function syncSenderTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: SenderTaggingStore): Promise<void>;
20
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY19zZW5kZXJfdGFnZ2luZ19pbmRleGVzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGFnZ2luZy9zZW5kZXJfc3luYy9zeW5jX3NlbmRlcl90YWdnaW5nX2luZGV4ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUV0RSxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBSzlGOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFDSCx3QkFBc0Isd0JBQXdCLENBQzVDLE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsR0FBRyxFQUFFLFlBQVksRUFDakIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsWUFBWSxFQUFFLGtCQUFrQixHQUMvQixPQUFPLENBQUMsSUFBSSxDQUFDLENBbUVmIn0=
16
+ export declare function syncSenderTaggingIndexes(secret: ExtendedDirectionalAppTaggingSecret, aztecNode: AztecNode, taggingStore: SenderTaggingStore, anchorBlockHash: BlockHash, jobId: string): Promise<void>;
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY19zZW5kZXJfdGFnZ2luZ19pbmRleGVzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGFnZ2luZy9zZW5kZXJfc3luYy9zeW5jX3NlbmRlcl90YWdnaW5nX2luZGV4ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDckQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsbUNBQW1DLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUU5RSxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBSzlGOzs7Ozs7Ozs7O0dBVUc7QUFDSCx3QkFBc0Isd0JBQXdCLENBQzVDLE1BQU0sRUFBRSxtQ0FBbUMsRUFDM0MsU0FBUyxFQUFFLFNBQVMsRUFDcEIsWUFBWSxFQUFFLGtCQUFrQixFQUNoQyxlQUFlLEVBQUUsU0FBUyxFQUMxQixLQUFLLEVBQUUsTUFBTSxHQUNaLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FtRWYifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"sync_sender_tagging_indexes.d.ts","sourceRoot":"","sources":["../../../src/tagging/sender_sync/sync_sender_tagging_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AAK9F;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAmEf"}
1
+ {"version":3,"file":"sync_sender_tagging_indexes.d.ts","sourceRoot":"","sources":["../../../src/tagging/sender_sync/sync_sender_tagging_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AAK9F;;;;;;;;;;GAUG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,mCAAmC,EAC3C,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,EAChC,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAmEf"}
@@ -1,20 +1,17 @@
1
- import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../index.js';
1
+ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../constants.js';
2
2
  import { getStatusChangeOfPending } from './utils/get_status_change_of_pending.js';
3
3
  import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_tagging_indexes.js';
4
4
  /**
5
5
  * Syncs tagging indexes. This function needs to be called whenever a private log is being sent.
6
6
  *
7
- * @param secret - The secret that's unique for (sender, recipient, contract) tuple while the direction of
7
+ * @param secret - The secret that's unique for (sender, recipient, app) tuple while the direction of
8
8
  * sender -> recipient matters.
9
- * @param app - The address of the contract that the logs are tagged for. Needs to be provided because we perform
10
- * second round of siloing in this function which is necessary because kernels do it as well (they silo first field
11
- * of the private log which corresponds to the tag).
12
9
  * @remarks When syncing the indexes as sender we don't care about the log contents - we only care about the highest
13
10
  * pending and highest finalized indexes as that guides the next index choice when sending a log. The next index choice
14
11
  * is simply the highest pending index plus one (or finalized if pending is undefined).
15
12
  * @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
16
13
  * updates its status accordingly.
17
- */ export async function syncSenderTaggingIndexes(secret, app, aztecNode, taggingStore) {
14
+ */ export async function syncSenderTaggingIndexes(secret, aztecNode, taggingStore, anchorBlockHash, jobId) {
18
15
  // # Explanation of how syncing works
19
16
  //
20
17
  // When choosing an index, we select: highest pending index + 1 (or highest finalized index + 1 if no pending).
@@ -32,7 +29,7 @@ import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_taggin
32
29
  // # Note on performance
33
30
  // Each window advance requires two queries (logs + tx status). For example, syncing indexes 0–500 with a window of
34
31
  // 100 takes at least 10 round trips (5 windows × 2 queries).
35
- const finalizedIndex = await taggingStore.getLastFinalizedIndex(secret);
32
+ const finalizedIndex = await taggingStore.getLastFinalizedIndex(secret, jobId);
36
33
  let start = finalizedIndex === undefined ? 0 : finalizedIndex + 1;
37
34
  let end = start + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN;
38
35
  let previousFinalizedIndex = finalizedIndex;
@@ -40,17 +37,17 @@ import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_taggin
40
37
  while(true){
41
38
  // Load and store indexes for the current window. These indexes may already exist in the database if txs using
42
39
  // them were previously sent from this PXE. Any duplicates are handled by the tagging data provider.
43
- await loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode, taggingStore);
40
+ await loadAndStoreNewTaggingIndexes(secret, start, end, aztecNode, taggingStore, anchorBlockHash, jobId);
44
41
  // Retrieve all indexes within the current window from storage and update their status accordingly.
45
- const pendingTxHashes = await taggingStore.getTxHashesOfPendingIndexes(secret, start, end);
42
+ const pendingTxHashes = await taggingStore.getTxHashesOfPendingIndexes(secret, start, end, jobId);
46
43
  if (pendingTxHashes.length === 0) {
47
44
  break;
48
45
  }
49
46
  const { txHashesToFinalize, txHashesToDrop } = await getStatusChangeOfPending(pendingTxHashes, aztecNode);
50
- await taggingStore.dropPendingIndexes(txHashesToDrop);
51
- await taggingStore.finalizePendingIndexes(txHashesToFinalize);
47
+ await taggingStore.dropPendingIndexes(txHashesToDrop, jobId);
48
+ await taggingStore.finalizePendingIndexes(txHashesToFinalize, jobId);
52
49
  // We check if the finalized index has been updated.
53
- newFinalizedIndex = await taggingStore.getLastFinalizedIndex(secret);
50
+ newFinalizedIndex = await taggingStore.getLastFinalizedIndex(secret, jobId);
54
51
  if (previousFinalizedIndex !== newFinalizedIndex) {
55
52
  // A new finalized index was found, so we'll run the loop again. For example:
56
53
  // - Previous finalized index: 10
@@ -8,4 +8,4 @@ export declare function getStatusChangeOfPending(pending: TxHash[], aztecNode: A
8
8
  txHashesToFinalize: TxHash[];
9
9
  txHashesToDrop: TxHash[];
10
10
  }>;
11
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEVBQUUsTUFBTSxFQUFZLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQ7OztHQUdHO0FBQ0gsd0JBQXNCLHdCQUF3QixDQUM1QyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQ2pCLFNBQVMsRUFBRSxTQUFTLEdBQ25CLE9BQU8sQ0FBQztJQUFFLGtCQUFrQixFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQUMsY0FBYyxFQUFFLE1BQU0sRUFBRSxDQUFBO0NBQUUsQ0FBQyxDQWlDckUifQ==
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEVBQUUsTUFBTSxFQUFZLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQ7OztHQUdHO0FBQ0gsd0JBQXNCLHdCQUF3QixDQUM1QyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQ2pCLFNBQVMsRUFBRSxTQUFTLEdBQ25CLE9BQU8sQ0FBQztJQUFFLGtCQUFrQixFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQUMsY0FBYyxFQUFFLE1BQU0sRUFBRSxDQUFBO0NBQUUsQ0FBQyxDQXlCckUifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"get_status_change_of_pending.d.ts","sourceRoot":"","sources":["../../../../src/tagging/sender_sync/utils/get_status_change_of_pending.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAY,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC;IAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiCrE"}
1
+ {"version":3,"file":"get_status_change_of_pending.d.ts","sourceRoot":"","sources":["../../../../src/tagging/sender_sync/utils/get_status_change_of_pending.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAY,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC;IAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAyBrE"}
@@ -3,26 +3,23 @@ import { TxStatus } from '@aztec/stdlib/tx';
3
3
  * Based on receipts obtained from `aztecNode` returns which pending transactions changed their status to finalized or
4
4
  * dropped.
5
5
  */ export async function getStatusChangeOfPending(pending, aztecNode) {
6
- // Get receipts for all pending tx hashes and the finalized block number.
7
- const [receipts, { finalized }] = await Promise.all([
8
- Promise.all(pending.map((pendingTxHash)=>aztecNode.getTxReceipt(pendingTxHash))),
9
- aztecNode.getL2Tips()
10
- ]);
6
+ // Get receipts for all pending tx hashes.
7
+ const receipts = await Promise.all(pending.map((pendingTxHash)=>aztecNode.getTxReceipt(pendingTxHash)));
11
8
  const txHashesToFinalize = [];
12
9
  const txHashesToDrop = [];
13
10
  for(let i = 0; i < receipts.length; i++){
14
11
  const receipt = receipts[i];
15
12
  const txHash = pending[i];
16
- if (receipt.status === TxStatus.SUCCESS && receipt.blockNumber && receipt.blockNumber <= finalized.number) {
13
+ if (receipt.status === TxStatus.FINALIZED && receipt.hasExecutionSucceeded()) {
17
14
  // Tx has been included in a block and the corresponding block is finalized --> we mark the indexes as
18
15
  // finalized.
19
16
  txHashesToFinalize.push(txHash);
20
- } else if (receipt.status === TxStatus.DROPPED || receipt.status === TxStatus.APP_LOGIC_REVERTED || receipt.status === TxStatus.TEARDOWN_REVERTED || receipt.status === TxStatus.BOTH_REVERTED) {
17
+ } else if (receipt.isDropped() || receipt.hasExecutionReverted()) {
21
18
  // Tx was dropped or reverted --> we drop the corresponding pending indexes.
22
19
  // TODO(#17615): Don't drop pending indexes corresponding to non-revertible phases.
23
20
  txHashesToDrop.push(txHash);
24
21
  } else {
25
- // Tx is still pending or the corresponding block is not yet finalized --> we don't do anything.
22
+ // Tx is still pending, not yet finalized, or was mined successfully but not yet finalized --> we don't do anything.
26
23
  }
27
24
  }
28
25
  return {
@@ -1,18 +1,18 @@
1
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
1
+ import type { BlockHash } from '@aztec/stdlib/block';
2
2
  import type { AztecNode } from '@aztec/stdlib/interfaces/server';
3
- import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
3
+ import type { ExtendedDirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
4
4
  import type { SenderTaggingStore } from '../../../storage/tagging_store/sender_tagging_store.js';
5
5
  /**
6
6
  * Loads tagging indexes from the Aztec node and stores them in the tagging data provider.
7
7
  * @remarks This function is one of two places by which a pending index can get to the tagging data provider. The other
8
8
  * place is when a tx is being sent from this PXE.
9
- * @param secret - The directional app tagging secret that's unique for (sender, recipient, contract) tuple.
10
- * @param app - The address of the contract that the logs are tagged for. Used for siloing tags to match
11
- * kernel circuit behavior.
9
+ * @param extendedSecret - The extended directional app tagging secret that's unique for (sender, recipient, app) tuple.
12
10
  * @param start - The starting index (inclusive) of the window to process.
13
11
  * @param end - The ending index (exclusive) of the window to process.
14
12
  * @param aztecNode - The Aztec node instance to query for logs.
15
13
  * @param taggingStore - The data provider to store pending indexes.
14
+ * @param jobId - Job identifier, used to keep writes in-memory until they can be persisted in a data integrity
15
+ * preserving way.
16
16
  */
17
- export declare function loadAndStoreNewTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, start: number, end: number, aztecNode: AztecNode, taggingStore: SenderTaggingStore): Promise<void>;
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvbG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBVSxNQUFNLG9CQUFvQixDQUFDO0FBSTlFLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0RBQXdELENBQUM7QUFFakc7Ozs7Ozs7Ozs7O0dBV0c7QUFDSCx3QkFBc0IsNkJBQTZCLENBQ2pELE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsR0FBRyxFQUFFLFlBQVksRUFDakIsS0FBSyxFQUFFLE1BQU0sRUFDYixHQUFHLEVBQUUsTUFBTSxFQUNYLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFlBQVksRUFBRSxrQkFBa0IsaUJBa0JqQyJ9
17
+ export declare function loadAndStoreNewTaggingIndexes(extendedSecret: ExtendedDirectionalAppTaggingSecret, start: number, end: number, aztecNode: AztecNode, taggingStore: SenderTaggingStore, anchorBlockHash: BlockHash, jobId: string): Promise<void>;
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvbG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSxtQ0FBbUMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBSTlFLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0RBQXdELENBQUM7QUFHakc7Ozs7Ozs7Ozs7O0dBV0c7QUFDSCx3QkFBc0IsNkJBQTZCLENBQ2pELGNBQWMsRUFBRSxtQ0FBbUMsRUFDbkQsS0FBSyxFQUFFLE1BQU0sRUFDYixHQUFHLEVBQUUsTUFBTSxFQUNYLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFlBQVksRUFBRSxrQkFBa0IsRUFDaEMsZUFBZSxFQUFFLFNBQVMsRUFDMUIsS0FBSyxFQUFFLE1BQU0saUJBZWQifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"load_and_store_new_tagging_indexes.d.ts","sourceRoot":"","sources":["../../../../src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAU,MAAM,oBAAoB,CAAC;AAI9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAEjG;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,iBAkBjC"}
1
+ {"version":3,"file":"load_and_store_new_tagging_indexes.d.ts","sourceRoot":"","sources":["../../../../src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AAI9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAGjG;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,cAAc,EAAE,mCAAmC,EACnD,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,EAChC,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,iBAed"}
@@ -1,50 +1,54 @@
1
- import { SiloedTag, Tag } from '@aztec/stdlib/logs';
1
+ import { SiloedTag } from '@aztec/stdlib/logs';
2
2
  import { TxHash } from '@aztec/stdlib/tx';
3
+ import { getAllPrivateLogsByTags } from '../../get_all_logs_by_tags.js';
3
4
  /**
4
5
  * Loads tagging indexes from the Aztec node and stores them in the tagging data provider.
5
6
  * @remarks This function is one of two places by which a pending index can get to the tagging data provider. The other
6
7
  * place is when a tx is being sent from this PXE.
7
- * @param secret - The directional app tagging secret that's unique for (sender, recipient, contract) tuple.
8
- * @param app - The address of the contract that the logs are tagged for. Used for siloing tags to match
9
- * kernel circuit behavior.
8
+ * @param extendedSecret - The extended directional app tagging secret that's unique for (sender, recipient, app) tuple.
10
9
  * @param start - The starting index (inclusive) of the window to process.
11
10
  * @param end - The ending index (exclusive) of the window to process.
12
11
  * @param aztecNode - The Aztec node instance to query for logs.
13
12
  * @param taggingStore - The data provider to store pending indexes.
14
- */ export async function loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode, taggingStore) {
13
+ * @param jobId - Job identifier, used to keep writes in-memory until they can be persisted in a data integrity
14
+ * preserving way.
15
+ */ export async function loadAndStoreNewTaggingIndexes(extendedSecret, start, end, aztecNode, taggingStore, anchorBlockHash, jobId) {
15
16
  // We compute the tags for the current window of indexes
16
- const preTagsForWindow = Array(end - start).fill(0).map((_, i)=>({
17
- secret,
17
+ const siloedTagsForWindow = await Promise.all(Array.from({
18
+ length: end - start
19
+ }, (_, i)=>SiloedTag.compute({
20
+ extendedSecret,
18
21
  index: start + i
19
- }));
20
- const siloedTagsForWindow = await Promise.all(preTagsForWindow.map(async (preTag)=>SiloedTag.compute(await Tag.compute(preTag), app)));
21
- const txsForTags = await getTxsContainingTags(siloedTagsForWindow, aztecNode);
22
- const highestIndexMap = getTxHighestIndexMap(txsForTags, preTagsForWindow);
22
+ })));
23
+ const txsForTags = await getTxsContainingTags(siloedTagsForWindow, aztecNode, anchorBlockHash);
24
+ const highestIndexMap = getTxHighestIndexMap(txsForTags, start, siloedTagsForWindow.length);
23
25
  // Now we iterate over the map, reconstruct the preTags and tx hash and store them in the db.
24
26
  for (const [txHashStr, highestIndex] of highestIndexMap.entries()){
25
27
  const txHash = TxHash.fromString(txHashStr);
26
28
  await taggingStore.storePendingIndexes([
27
29
  {
28
- secret,
30
+ extendedSecret,
29
31
  index: highestIndex
30
32
  }
31
- ], txHash);
33
+ ], txHash, jobId);
32
34
  }
33
35
  }
34
36
  // Returns txs that used the given tags. A tag might have been used in multiple txs and for this reason we return
35
37
  // an array for each tag.
36
- async function getTxsContainingTags(tags, aztecNode) {
37
- const allLogs = await aztecNode.getPrivateLogsByTags(tags);
38
+ async function getTxsContainingTags(tags, aztecNode, anchorBlockHash) {
39
+ // We use the utility function below to retrieve all logs for the tags across all pages, so we don't need to handle
40
+ // pagination here.
41
+ const allLogs = await getAllPrivateLogsByTags(aztecNode, tags, anchorBlockHash);
38
42
  return allLogs.map((logs)=>logs.map((log)=>log.txHash));
39
43
  }
40
44
  // Returns a map of txHash to the highest index for that txHash.
41
- function getTxHighestIndexMap(txHashesForTags, preTagsForWindow) {
42
- if (txHashesForTags.length !== preTagsForWindow.length) {
43
- throw new Error(`Number of tx hashes arrays does not match number of pre-tags. ${txHashesForTags.length} !== ${preTagsForWindow.length}`);
45
+ function getTxHighestIndexMap(txHashesForTags, start, count) {
46
+ if (txHashesForTags.length !== count) {
47
+ throw new Error(`Number of tx hashes arrays does not match number of tags. ${txHashesForTags.length} !== ${count}`);
44
48
  }
45
49
  const highestIndexMap = new Map();
46
50
  for(let i = 0; i < txHashesForTags.length; i++){
47
- const taggingIndex = preTagsForWindow[i].index;
51
+ const taggingIndex = start + i;
48
52
  const txHashesForTag = txHashesForTags[i];
49
53
  for (const txHash of txHashesForTag){
50
54
  const key = txHash.toString();
package/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "@aztec/pxe",
3
- "version": "0.0.1-commit.c7c42ec",
3
+ "version": "0.0.1-commit.c949de6bc",
4
4
  "type": "module",
5
+ "typedocOptions": {
6
+ "entryPoints": [
7
+ "./src/entrypoints/server/index.ts",
8
+ "./src/entrypoints/client/lazy/index.ts",
9
+ "./src/config/index.ts"
10
+ ],
11
+ "name": "PXE",
12
+ "tsconfig": "./tsconfig.json"
13
+ },
5
14
  "exports": {
6
15
  "./server": "./dest/entrypoints/server/index.js",
7
16
  "./client/lazy": "./dest/entrypoints/client/lazy/index.js",
@@ -11,7 +20,7 @@
11
20
  },
12
21
  "bin": "./dest/bin/index.js",
13
22
  "scripts": {
14
- "build": "yarn clean && yarn generate && tsgo -b",
23
+ "build": "yarn clean && yarn generate && ../scripts/tsc.sh",
15
24
  "build:dev": "../scripts/tsc.sh --watch",
16
25
  "clean": "rm -rf ./dest .tsbuildinfo ./src/config/package_info.ts",
17
26
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
@@ -61,19 +70,19 @@
61
70
  ]
62
71
  },
63
72
  "dependencies": {
64
- "@aztec/bb-prover": "0.0.1-commit.c7c42ec",
65
- "@aztec/bb.js": "0.0.1-commit.c7c42ec",
66
- "@aztec/builder": "0.0.1-commit.c7c42ec",
67
- "@aztec/constants": "0.0.1-commit.c7c42ec",
68
- "@aztec/ethereum": "0.0.1-commit.c7c42ec",
69
- "@aztec/foundation": "0.0.1-commit.c7c42ec",
70
- "@aztec/key-store": "0.0.1-commit.c7c42ec",
71
- "@aztec/kv-store": "0.0.1-commit.c7c42ec",
72
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.c7c42ec",
73
- "@aztec/noir-types": "0.0.1-commit.c7c42ec",
74
- "@aztec/protocol-contracts": "0.0.1-commit.c7c42ec",
75
- "@aztec/simulator": "0.0.1-commit.c7c42ec",
76
- "@aztec/stdlib": "0.0.1-commit.c7c42ec",
73
+ "@aztec/bb-prover": "0.0.1-commit.c949de6bc",
74
+ "@aztec/bb.js": "0.0.1-commit.c949de6bc",
75
+ "@aztec/builder": "0.0.1-commit.c949de6bc",
76
+ "@aztec/constants": "0.0.1-commit.c949de6bc",
77
+ "@aztec/ethereum": "0.0.1-commit.c949de6bc",
78
+ "@aztec/foundation": "0.0.1-commit.c949de6bc",
79
+ "@aztec/key-store": "0.0.1-commit.c949de6bc",
80
+ "@aztec/kv-store": "0.0.1-commit.c949de6bc",
81
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.c949de6bc",
82
+ "@aztec/noir-types": "0.0.1-commit.c949de6bc",
83
+ "@aztec/protocol-contracts": "0.0.1-commit.c949de6bc",
84
+ "@aztec/simulator": "0.0.1-commit.c949de6bc",
85
+ "@aztec/stdlib": "0.0.1-commit.c949de6bc",
77
86
  "koa": "^2.16.1",
78
87
  "koa-router": "^13.1.1",
79
88
  "lodash.omit": "^4.5.0",
@@ -82,14 +91,14 @@
82
91
  "viem": "npm:@aztec/viem@2.38.2"
83
92
  },
84
93
  "devDependencies": {
85
- "@aztec/merkle-tree": "0.0.1-commit.c7c42ec",
86
- "@aztec/noir-test-contracts.js": "0.0.1-commit.c7c42ec",
94
+ "@aztec/merkle-tree": "0.0.1-commit.c949de6bc",
95
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.c949de6bc",
87
96
  "@jest/globals": "^30.0.0",
88
97
  "@types/jest": "^30.0.0",
89
98
  "@types/lodash.omit": "^4.5.7",
90
99
  "@types/lodash.times": "^4.3.9",
91
100
  "@types/node": "^22.15.17",
92
- "@typescript/native-preview": "7.0.0-dev.20251126.1",
101
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
93
102
  "jest": "^30.0.0",
94
103
  "jest-mock-extended": "^4.0.0",
95
104
  "lodash.times": "^4.3.2",
@@ -0,0 +1,9 @@
1
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+
3
+ /**
4
+ * Controls which accounts' private state and keys are accessible during execution.
5
+ * - `'ALL_SCOPES'`: All registered accounts' private state and keys are accessible.
6
+ * - `AztecAddress[]` with entries: Only the specified accounts' private state and keys are accessible.
7
+ * - `[]` (empty array): Deny-all. No private state is visible and no keys are accessible.
8
+ */
9
+ export type AccessScopes = 'ALL_SCOPES' | AztecAddress[];
@@ -1,3 +1,4 @@
1
+ /* eslint-disable import-x/no-named-as-default-member */
1
2
  import { keccak256String } from '@aztec/foundation/crypto/keccak';
2
3
 
3
4
  import { readFileSync } from 'fs';