@aztec/pxe 0.0.1-commit.fcb71a6 → 0.0.1-commit.fffb133c

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 (218) hide show
  1. package/dest/bin/check_oracle_version.js +1 -1
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +10 -4
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  4. package/dest/block_synchronizer/block_synchronizer.js +66 -18
  5. package/dest/config/index.d.ts +3 -1
  6. package/dest/config/index.d.ts.map +1 -1
  7. package/dest/config/index.js +17 -0
  8. package/dest/config/package_info.js +1 -1
  9. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  10. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  11. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  12. package/dest/contract_function_simulator/contract_function_simulator.d.ts +8 -9
  13. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/contract_function_simulator.js +32 -21
  15. package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
  16. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/execution_note_cache.js +45 -28
  18. package/dest/contract_function_simulator/index.d.ts +2 -2
  19. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/index.js +1 -1
  21. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
  22. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +6 -3
  24. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
  25. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  26. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  27. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  29. package/dest/contract_function_simulator/oracle/interfaces.d.ts +15 -11
  30. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
  32. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  33. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
  34. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
  36. package/dest/contract_function_simulator/oracle/oracle.d.ts +10 -8
  37. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  38. package/dest/contract_function_simulator/oracle/oracle.js +43 -32
  39. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
  40. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/oracle/private_execution.js +1 -37
  42. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +11 -17
  43. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  44. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +23 -39
  45. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +27 -17
  46. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  47. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +72 -72
  48. package/dest/contract_sync/index.d.ts +23 -0
  49. package/dest/contract_sync/index.d.ts.map +1 -0
  50. package/dest/contract_sync/index.js +54 -0
  51. package/dest/debug/pxe_debug_utils.d.ts +1 -1
  52. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  53. package/dest/debug/pxe_debug_utils.js +3 -2
  54. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  55. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  56. package/dest/entrypoints/client/bundle/utils.js +10 -1
  57. package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
  58. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  59. package/dest/entrypoints/client/lazy/utils.js +10 -1
  60. package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
  61. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  62. package/dest/entrypoints/server/index.d.ts +3 -1
  63. package/dest/entrypoints/server/index.d.ts.map +1 -1
  64. package/dest/entrypoints/server/index.js +2 -0
  65. package/dest/entrypoints/server/utils.d.ts +1 -1
  66. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  67. package/dest/entrypoints/server/utils.js +11 -7
  68. package/dest/events/event_service.d.ts +4 -3
  69. package/dest/events/event_service.d.ts.map +1 -1
  70. package/dest/events/event_service.js +17 -19
  71. package/dest/events/private_event_filter_validator.d.ts +5 -5
  72. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  73. package/dest/events/private_event_filter_validator.js +5 -6
  74. package/dest/job_coordinator/job_coordinator.d.ts +74 -0
  75. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  76. package/dest/job_coordinator/job_coordinator.js +93 -0
  77. package/dest/logs/log_service.d.ts +3 -2
  78. package/dest/logs/log_service.d.ts.map +1 -1
  79. package/dest/logs/log_service.js +21 -13
  80. package/dest/notes/note_service.d.ts +5 -4
  81. package/dest/notes/note_service.d.ts.map +1 -1
  82. package/dest/notes/note_service.js +30 -34
  83. package/dest/oracle_version.d.ts +3 -3
  84. package/dest/oracle_version.d.ts.map +1 -1
  85. package/dest/oracle_version.js +4 -3
  86. package/dest/private_kernel/hints/index.d.ts +2 -2
  87. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  88. package/dest/private_kernel/hints/index.js +1 -1
  89. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
  90. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  91. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +13 -7
  92. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  93. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  94. package/dest/private_kernel/private_kernel_execution_prover.js +4 -5
  95. package/dest/private_kernel/private_kernel_oracle.d.ts +24 -28
  96. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  97. package/dest/private_kernel/private_kernel_oracle.js +90 -2
  98. package/dest/pxe.d.ts +8 -36
  99. package/dest/pxe.d.ts.map +1 -1
  100. package/dest/pxe.js +70 -93
  101. package/dest/storage/capsule_store/capsule_store.d.ts +24 -9
  102. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  103. package/dest/storage/capsule_store/capsule_store.js +132 -23
  104. package/dest/storage/contract_store/contract_store.d.ts +1 -2
  105. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  106. package/dest/storage/contract_store/contract_store.js +0 -12
  107. package/dest/storage/note_store/note_store.d.ts +45 -56
  108. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  109. package/dest/storage/note_store/note_store.js +244 -263
  110. package/dest/storage/note_store/stored_note.d.ts +16 -0
  111. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  112. package/dest/storage/note_store/stored_note.js +43 -0
  113. package/dest/storage/private_event_store/private_event_store.d.ts +47 -7
  114. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  115. package/dest/storage/private_event_store/private_event_store.js +203 -68
  116. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  117. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  118. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  119. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +15 -8
  120. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  121. package/dest/storage/tagging_store/recipient_tagging_store.js +69 -12
  122. package/dest/storage/tagging_store/sender_tagging_store.d.ts +19 -9
  123. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  124. package/dest/storage/tagging_store/sender_tagging_store.js +110 -28
  125. package/dest/tagging/constants.d.ts +2 -0
  126. package/dest/tagging/constants.d.ts.map +1 -0
  127. package/dest/tagging/constants.js +10 -0
  128. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  129. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  130. package/dest/tagging/get_all_logs_by_tags.js +46 -0
  131. package/dest/tagging/index.d.ts +3 -2
  132. package/dest/tagging/index.d.ts.map +1 -1
  133. package/dest/tagging/index.js +2 -10
  134. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -2
  135. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  136. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +8 -8
  137. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
  138. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  139. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
  140. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -2
  141. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  142. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +8 -8
  143. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
  144. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  145. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
  146. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -2
  147. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  148. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +10 -5
  149. package/package.json +18 -18
  150. package/src/bin/check_oracle_version.ts +1 -0
  151. package/src/block_synchronizer/block_synchronizer.ts +77 -20
  152. package/src/config/index.ts +14 -0
  153. package/src/config/package_info.ts +1 -1
  154. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  155. package/src/contract_function_simulator/contract_function_simulator.ts +37 -26
  156. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  157. package/src/contract_function_simulator/index.ts +1 -1
  158. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +5 -1
  159. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  160. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  161. package/src/contract_function_simulator/oracle/interfaces.ts +20 -10
  162. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  163. package/src/contract_function_simulator/oracle/oracle.ts +56 -41
  164. package/src/contract_function_simulator/oracle/private_execution.ts +1 -69
  165. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +39 -44
  166. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +90 -76
  167. package/src/contract_sync/index.ts +98 -0
  168. package/src/debug/pxe_debug_utils.ts +3 -2
  169. package/src/entrypoints/client/bundle/utils.ts +7 -1
  170. package/src/entrypoints/client/lazy/utils.ts +7 -2
  171. package/src/entrypoints/pxe_creation_options.ts +2 -1
  172. package/src/entrypoints/server/index.ts +2 -0
  173. package/src/entrypoints/server/utils.ts +11 -15
  174. package/src/events/event_service.ts +17 -21
  175. package/src/events/private_event_filter_validator.ts +3 -5
  176. package/src/job_coordinator/job_coordinator.ts +149 -0
  177. package/src/logs/log_service.ts +27 -9
  178. package/src/notes/note_service.ts +37 -40
  179. package/src/oracle_version.ts +4 -3
  180. package/src/private_kernel/hints/index.ts +1 -1
  181. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +33 -22
  182. package/src/private_kernel/private_kernel_execution_prover.ts +3 -5
  183. package/src/private_kernel/private_kernel_oracle.ts +116 -36
  184. package/src/pxe.ts +123 -127
  185. package/src/storage/capsule_store/capsule_store.ts +159 -23
  186. package/src/storage/contract_store/contract_store.ts +0 -20
  187. package/src/storage/note_store/note_store.ts +286 -317
  188. package/src/storage/note_store/stored_note.ts +48 -0
  189. package/src/storage/private_event_store/private_event_store.ts +277 -76
  190. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  191. package/src/storage/tagging_store/recipient_tagging_store.ts +89 -13
  192. package/src/storage/tagging_store/sender_tagging_store.ts +129 -28
  193. package/src/tagging/constants.ts +10 -0
  194. package/src/tagging/get_all_logs_by_tags.ts +68 -0
  195. package/src/tagging/index.ts +2 -11
  196. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +21 -7
  197. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
  198. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +10 -7
  199. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -13
  200. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +16 -4
  201. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  202. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  203. package/dest/contract_function_simulator/proxied_node.js +0 -27
  204. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  205. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  206. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  207. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  208. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  209. package/dest/public_storage/public_storage_service.d.ts +0 -24
  210. package/dest/public_storage/public_storage_service.d.ts.map +0 -1
  211. package/dest/public_storage/public_storage_service.js +0 -26
  212. package/dest/tree_membership/tree_membership_service.d.ts +0 -52
  213. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  214. package/dest/tree_membership/tree_membership_service.js +0 -84
  215. package/src/contract_function_simulator/proxied_node.ts +0 -33
  216. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
  217. package/src/public_storage/public_storage_service.ts +0 -33
  218. package/src/tree_membership/tree_membership_service.ts +0 -112
@@ -5,38 +5,95 @@
5
5
  *
6
6
  * @dev Chain reorgs do not need to be handled here because both the finalized and aged indexes refer to finalized
7
7
  * blocks, which by definition cannot be affected by reorgs.
8
- *
9
- * TODO(benesjan): Relocate to yarn-project/pxe/src/storage/tagging_store
10
8
  */ export class RecipientTaggingStore {
9
+ storeName = 'recipient_tagging';
11
10
  #store;
12
11
  #highestAgedIndex;
13
12
  #highestFinalizedIndex;
13
+ // jobId => secret => number
14
+ #highestAgedIndexForJob;
15
+ // jobId => secret => number
16
+ #highestFinalizedIndexForJob;
14
17
  constructor(store){
15
18
  this.#store = store;
16
19
  this.#highestAgedIndex = this.#store.openMap('highest_aged_index');
17
20
  this.#highestFinalizedIndex = this.#store.openMap('highest_finalized_index');
21
+ this.#highestAgedIndexForJob = new Map();
22
+ this.#highestFinalizedIndexForJob = new Map();
23
+ }
24
+ #getHighestAgedIndexForJob(jobId) {
25
+ let highestAgedIndexForJob = this.#highestAgedIndexForJob.get(jobId);
26
+ if (!highestAgedIndexForJob) {
27
+ highestAgedIndexForJob = new Map();
28
+ this.#highestAgedIndexForJob.set(jobId, highestAgedIndexForJob);
29
+ }
30
+ return highestAgedIndexForJob;
31
+ }
32
+ async #readHighestAgedIndex(jobId, secret) {
33
+ return this.#getHighestAgedIndexForJob(jobId).get(secret) ?? await this.#highestAgedIndex.getAsync(secret);
34
+ }
35
+ #writeHighestAgedIndex(jobId, secret, index) {
36
+ this.#getHighestAgedIndexForJob(jobId).set(secret, index);
37
+ }
38
+ #getHighestFinalizedIndexForJob(jobId) {
39
+ let jobStagedHighestFinalizedIndex = this.#highestFinalizedIndexForJob.get(jobId);
40
+ if (!jobStagedHighestFinalizedIndex) {
41
+ jobStagedHighestFinalizedIndex = new Map();
42
+ this.#highestFinalizedIndexForJob.set(jobId, jobStagedHighestFinalizedIndex);
43
+ }
44
+ return jobStagedHighestFinalizedIndex;
45
+ }
46
+ async #readHighestFinalizedIndex(jobId, secret) {
47
+ return this.#getHighestFinalizedIndexForJob(jobId).get(secret) ?? await this.#highestFinalizedIndex.getAsync(secret);
48
+ }
49
+ #writeHighestFinalizedIndex(jobId, secret, index) {
50
+ this.#getHighestFinalizedIndexForJob(jobId).set(secret, index);
51
+ }
52
+ /**
53
+ * Writes all job-specific in-memory data to persistent storage.
54
+ *
55
+ * @remark This method must run in a DB transaction context. It's designed to be called from JobCoordinator#commitJob.
56
+ */ async commit(jobId) {
57
+ const highestAgedIndexForJob = this.#highestAgedIndexForJob.get(jobId);
58
+ if (highestAgedIndexForJob) {
59
+ for (const [secret, index] of highestAgedIndexForJob.entries()){
60
+ await this.#highestAgedIndex.set(secret, index);
61
+ }
62
+ }
63
+ const highestFinalizedIndexForJob = this.#highestFinalizedIndexForJob.get(jobId);
64
+ if (highestFinalizedIndexForJob) {
65
+ for (const [secret, index] of highestFinalizedIndexForJob.entries()){
66
+ await this.#highestFinalizedIndex.set(secret, index);
67
+ }
68
+ }
69
+ return this.discardStaged(jobId);
70
+ }
71
+ discardStaged(jobId) {
72
+ this.#highestAgedIndexForJob.delete(jobId);
73
+ this.#highestFinalizedIndexForJob.delete(jobId);
74
+ return Promise.resolve();
18
75
  }
19
- getHighestAgedIndex(secret) {
20
- return this.#highestAgedIndex.getAsync(secret.toString());
76
+ getHighestAgedIndex(secret, jobId) {
77
+ return this.#readHighestAgedIndex(jobId, secret.toString());
21
78
  }
22
- async updateHighestAgedIndex(secret, index) {
23
- const currentIndex = await this.#highestAgedIndex.getAsync(secret.toString());
79
+ async updateHighestAgedIndex(secret, index, jobId) {
80
+ const currentIndex = await this.#readHighestAgedIndex(jobId, secret.toString());
24
81
  if (currentIndex !== undefined && index <= currentIndex) {
25
82
  // Log sync should never set a lower highest aged index.
26
83
  throw new Error(`New highest aged index (${index}) must be higher than the current one (${currentIndex})`);
27
84
  }
28
- await this.#highestAgedIndex.set(secret.toString(), index);
85
+ this.#writeHighestAgedIndex(jobId, secret.toString(), index);
29
86
  }
30
- getHighestFinalizedIndex(secret) {
31
- return this.#highestFinalizedIndex.getAsync(secret.toString());
87
+ getHighestFinalizedIndex(secret, jobId) {
88
+ return this.#readHighestFinalizedIndex(jobId, secret.toString());
32
89
  }
33
- async updateHighestFinalizedIndex(secret, index) {
34
- const currentIndex = await this.#highestFinalizedIndex.getAsync(secret.toString());
90
+ async updateHighestFinalizedIndex(secret, index, jobId) {
91
+ const currentIndex = await this.#readHighestFinalizedIndex(jobId, secret.toString());
35
92
  if (currentIndex !== undefined && index < currentIndex) {
36
93
  // Log sync should never set a lower highest finalized index but it can happen that it would try to set the same
37
94
  // one because we are loading logs from highest aged index + 1 and not from the highest finalized index.
38
95
  throw new Error(`New highest finalized index (${index}) must be higher than the current one (${currentIndex})`);
39
96
  }
40
- await this.#highestFinalizedIndex.set(secret.toString(), index);
97
+ this.#writeHighestFinalizedIndex(jobId, secret.toString(), index);
41
98
  }
42
99
  }
@@ -1,14 +1,23 @@
1
1
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
2
  import type { DirectionalAppTaggingSecret, PreTag } from '@aztec/stdlib/logs';
3
3
  import { TxHash } from '@aztec/stdlib/tx';
4
+ import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
4
5
  /**
5
6
  * Data provider of tagging data used when syncing the sender tagging indexes. The recipient counterpart of this class
6
- * is called RecipientTaggingStore. We have the providers separate for the sender and recipient because
7
+ * is called RecipientTaggingStore. We have the data stores separate for sender and recipient because
7
8
  * the algorithms are completely disjoint and there is not data reuse between the two.
8
9
  */
9
- export declare class SenderTaggingStore {
10
+ export declare class SenderTaggingStore implements StagedStore {
10
11
  #private;
12
+ readonly storeName = "sender_tagging";
11
13
  constructor(store: AztecAsyncKVStore);
14
+ /**
15
+ * Writes all job-specific in-memory data to persistent storage.
16
+ *
17
+ * @remark This method must run in a DB transaction context. It's designed to be called from JobCoordinator#commitJob.
18
+ */
19
+ commit(jobId: string): Promise<void>;
20
+ discardStaged(jobId: string): Promise<void>;
12
21
  /**
13
22
  * Stores pending indexes.
14
23
  * @remarks Ignores the index if the same preTag + txHash combination already exists in the db with the same index.
@@ -17,6 +26,7 @@ export declare class SenderTaggingStore {
17
26
  * @param preTags - The pre-tags containing the directional app tagging secrets and the indexes that are to be
18
27
  * stored in the db.
19
28
  * @param txHash - The tx in which the pretags were used in private logs.
29
+ * @param jobId - job context for staged writes to this store. See `JobCoordinator` for more details.
20
30
  * @throws If any two pre-tags contain the same directional app tagging secret. This is enforced because we care
21
31
  * only about the highest index for a given secret that was used in the tx. Hence this check is a good way to catch
22
32
  * bugs.
@@ -30,7 +40,7 @@ export declare class SenderTaggingStore {
30
40
  * This is enforced because this should never happen if the syncing is done correctly as we look for logs from higher
31
41
  * indexes than finalized ones.
32
42
  */
33
- storePendingIndexes(preTags: PreTag[], txHash: TxHash): Promise<void>;
43
+ storePendingIndexes(preTags: PreTag[], txHash: TxHash, jobId: string): Promise<void>;
34
44
  /**
35
45
  * Returns the transaction hashes of all pending transactions that contain indexes within a specified range
36
46
  * for a given directional app tagging secret.
@@ -40,28 +50,28 @@ export declare class SenderTaggingStore {
40
50
  * @returns An array of unique transaction hashes for pending transactions that contain indexes in the range
41
51
  * [startIndex, endIndex). Returns an empty array if no pending indexes exist in the range.
42
52
  */
43
- getTxHashesOfPendingIndexes(secret: DirectionalAppTaggingSecret, startIndex: number, endIndex: number): Promise<TxHash[]>;
53
+ getTxHashesOfPendingIndexes(secret: DirectionalAppTaggingSecret, startIndex: number, endIndex: number, jobId: string): Promise<TxHash[]>;
44
54
  /**
45
55
  * Returns the last (highest) finalized index for a given secret.
46
56
  * @param secret - The secret to get the last finalized index for.
47
57
  * @returns The last (highest) finalized index for the given secret.
48
58
  */
49
- getLastFinalizedIndex(secret: DirectionalAppTaggingSecret): Promise<number | undefined>;
59
+ getLastFinalizedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
50
60
  /**
51
61
  * Returns the last used index for a given directional app tagging secret, considering both finalized and pending
52
62
  * indexes.
53
63
  * @param secret - The directional app tagging secret to query the last used index for.
54
64
  * @returns The last used index.
55
65
  */
56
- getLastUsedIndex(secret: DirectionalAppTaggingSecret): Promise<number | undefined>;
66
+ getLastUsedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
57
67
  /**
58
68
  * Drops all pending indexes corresponding to the given transaction hashes.
59
69
  */
60
- dropPendingIndexes(txHashes: TxHash[]): Promise<void>;
70
+ dropPendingIndexes(txHashes: TxHash[], jobId: string): Promise<void>;
61
71
  /**
62
72
  * Updates pending indexes corresponding to the given transaction hashes to be finalized and prunes any lower pending
63
73
  * indexes.
64
74
  */
65
- finalizePendingIndexes(txHashes: TxHash[]): Promise<void>;
75
+ finalizePendingIndexes(txHashes: TxHash[], jobId: string): Promise<void>;
66
76
  }
67
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZGVyX3RhZ2dpbmdfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3RhZ2dpbmdfc3RvcmUvc2VuZGVyX3RhZ2dpbmdfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFDeEUsT0FBTyxLQUFLLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDOUUsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBSTFDOzs7O0dBSUc7QUFDSCxxQkFBYSxrQkFBa0I7O0lBa0I3QixZQUFZLEtBQUssRUFBRSxpQkFBaUIsRUFLbkM7SUFFRDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7T0FvQkc7SUFDRyxtQkFBbUI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QUFPLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQyxDQVl0RztJQUVEOztPQUVHO0lBQ0csa0JBQWtCLENBQUMsUUFBUSxFQUFFLE1BQU0sRUFBRSxFQUFFLEtBQUssRUFBRSxNQUFNLGlCQXFCekQ7SUFFRDs7O09BR0c7SUFDRyxzQkFBc0IsQ0FBQyxRQUFRLEVBQUUsTUFBTSxFQUFFLEVBQUUsS0FBSyxFQUFFLE1BQU0saUJBcUQ3RDtDQUNGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"sender_tagging_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/sender_tagging_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C;;;;GAIG;AACH,qBAAa,kBAAkB;;IAkB7B,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,iBAiD1D;IAED;;;;;;;;OAQG;IACG,2BAA2B,CAC/B,MAAM,EAAE,2BAA2B,EACnC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;IAED;;;;OAIG;IACH,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEtF;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAYvF;IAED;;OAEG;IACG,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAqB1C;IAED;;;OAGG;I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,SAAS,CAAC,CAYtG;IAED;;OAEG;IACG,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,iBAqBzD;IAED;;;OAGG;IACG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,iBAqD7D;CACF"}
@@ -1,11 +1,12 @@
1
1
  import { toArray } from '@aztec/foundation/iterable';
2
2
  import { TxHash } from '@aztec/stdlib/tx';
3
- import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
3
+ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.js';
4
4
  /**
5
5
  * Data provider of tagging data used when syncing the sender tagging indexes. The recipient counterpart of this class
6
- * is called RecipientTaggingStore. We have the providers separate for the sender and recipient because
6
+ * is called RecipientTaggingStore. We have the data stores separate for sender and recipient because
7
7
  * the algorithms are completely disjoint and there is not data reuse between the two.
8
8
  */ export class SenderTaggingStore {
9
+ storeName = 'sender_tagging';
9
10
  #store;
10
11
  // Stores the pending indexes for each directional app tagging secret. Pending here means that the tx that contained
11
12
  // the private logs with tags corresponding to these indexes has not been finalized yet.
@@ -15,15 +16,95 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
15
16
  // the smaller ones are irrelevant due to tx atomicity.
16
17
  //
17
18
  // TODO(#17615): This assumes no logs are used in the non-revertible phase.
19
+ //
20
+ // directional app tagging secret => { pending index, txHash }[]
18
21
  #pendingIndexes;
22
+ // jobId => directional app tagging secret => { pending index, txHash }[]
23
+ #pendingIndexesForJob;
19
24
  // Stores the last (highest) finalized index for each directional app tagging secret. We care only about the last
20
25
  // index because unlike the pending indexes, it will never happen that a finalized index would be removed and hence
21
26
  // we don't need to store the history.
27
+ //
28
+ // directional app tagging secret => highest finalized index
22
29
  #lastFinalizedIndexes;
30
+ // jobId => directional app tagging secret => highest finalized index
31
+ #lastFinalizedIndexesForJob;
23
32
  constructor(store){
24
33
  this.#store = store;
25
34
  this.#pendingIndexes = this.#store.openMap('pending_indexes');
26
35
  this.#lastFinalizedIndexes = this.#store.openMap('last_finalized_indexes');
36
+ this.#pendingIndexesForJob = new Map();
37
+ this.#lastFinalizedIndexesForJob = new Map();
38
+ }
39
+ #getPendingIndexesForJob(jobId) {
40
+ let pendingIndexesForJob = this.#pendingIndexesForJob.get(jobId);
41
+ if (!pendingIndexesForJob) {
42
+ pendingIndexesForJob = new Map();
43
+ this.#pendingIndexesForJob.set(jobId, pendingIndexesForJob);
44
+ }
45
+ return pendingIndexesForJob;
46
+ }
47
+ #getLastFinalizedIndexesForJob(jobId) {
48
+ let jobStagedLastFinalizedIndexes = this.#lastFinalizedIndexesForJob.get(jobId);
49
+ if (!jobStagedLastFinalizedIndexes) {
50
+ jobStagedLastFinalizedIndexes = new Map();
51
+ this.#lastFinalizedIndexesForJob.set(jobId, jobStagedLastFinalizedIndexes);
52
+ }
53
+ return jobStagedLastFinalizedIndexes;
54
+ }
55
+ async #readPendingIndexes(jobId, secret) {
56
+ const jobStagedPendingIndexes = this.#getPendingIndexesForJob(jobId);
57
+ const pendingIndexes = jobStagedPendingIndexes.get(secret);
58
+ // We return the staged version of this if it exists, if not, we read from the DB.
59
+ // If the DB also has nothing, we return an empty array [].
60
+ return pendingIndexes !== undefined ? pendingIndexes : await this.#pendingIndexes.getAsync(secret) ?? [];
61
+ }
62
+ #writePendingIndexes(jobId, secret, pendingIndexes) {
63
+ this.#getPendingIndexesForJob(jobId).set(secret, pendingIndexes);
64
+ }
65
+ /**
66
+ * Returns a job view of all the secrets that have a corresponding list of pending indexes either in persistent
67
+ * storage or the current job.
68
+ */ async #readSecretsWithPendingIndexes(jobId) {
69
+ const storedSecrets = new Set(await toArray(this.#pendingIndexes.keysAsync()));
70
+ const stagedSecrets = this.#getPendingIndexesForJob(jobId).keys();
71
+ return [
72
+ ...storedSecrets.union(new Set(stagedSecrets))
73
+ ];
74
+ }
75
+ async #readLastFinalizedIndex(jobId, secret) {
76
+ return this.#getLastFinalizedIndexesForJob(jobId).get(secret) ?? await this.#lastFinalizedIndexes.getAsync(secret);
77
+ }
78
+ #writeLastFinalizedIndex(jobId, secret, lastFinalizedIndex) {
79
+ this.#getLastFinalizedIndexesForJob(jobId).set(secret, lastFinalizedIndex);
80
+ }
81
+ /**
82
+ * Writes all job-specific in-memory data to persistent storage.
83
+ *
84
+ * @remark This method must run in a DB transaction context. It's designed to be called from JobCoordinator#commitJob.
85
+ */ async commit(jobId) {
86
+ const pendingIndexesForJob = this.#pendingIndexesForJob.get(jobId);
87
+ if (pendingIndexesForJob) {
88
+ for (const [secret, pendingIndexes] of pendingIndexesForJob.entries()){
89
+ if (pendingIndexes.length === 0) {
90
+ await this.#pendingIndexes.delete(secret);
91
+ } else {
92
+ await this.#pendingIndexes.set(secret, pendingIndexes);
93
+ }
94
+ }
95
+ }
96
+ const lastFinalizedIndexesForJob = this.#lastFinalizedIndexesForJob.get(jobId);
97
+ if (lastFinalizedIndexesForJob) {
98
+ for (const [secret, lastFinalizedIndex] of lastFinalizedIndexesForJob.entries()){
99
+ await this.#lastFinalizedIndexes.set(secret, lastFinalizedIndex);
100
+ }
101
+ }
102
+ return this.discardStaged(jobId);
103
+ }
104
+ discardStaged(jobId) {
105
+ this.#pendingIndexesForJob.delete(jobId);
106
+ this.#lastFinalizedIndexesForJob.delete(jobId);
107
+ return Promise.resolve();
27
108
  }
28
109
  /**
29
110
  * Stores pending indexes.
@@ -33,6 +114,7 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
33
114
  * @param preTags - The pre-tags containing the directional app tagging secrets and the indexes that are to be
34
115
  * stored in the db.
35
116
  * @param txHash - The tx in which the pretags were used in private logs.
117
+ * @param jobId - job context for staged writes to this store. See `JobCoordinator` for more details.
36
118
  * @throws If any two pre-tags contain the same directional app tagging secret. This is enforced because we care
37
119
  * only about the highest index for a given secret that was used in the tx. Hence this check is a good way to catch
38
120
  * bugs.
@@ -45,7 +127,7 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
45
127
  * @throws If the newly stored pending index is lower than or equal to the last finalized index for the same secret.
46
128
  * This is enforced because this should never happen if the syncing is done correctly as we look for logs from higher
47
129
  * indexes than finalized ones.
48
- */ async storePendingIndexes(preTags, txHash) {
130
+ */ async storePendingIndexes(preTags, txHash, jobId) {
49
131
  // The secrets in pre-tags should be unique because we always store just the highest index per given secret-txHash
50
132
  // pair. Below we check that this is the case.
51
133
  const secretsSet = new Set(preTags.map((preTag)=>preTag.secret.toString()));
@@ -55,7 +137,7 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
55
137
  for (const { secret, index } of preTags){
56
138
  // First we check that for any secret the highest used index in tx is not further than window length from
57
139
  // the highest finalized index.
58
- const finalizedIndex = await this.getLastFinalizedIndex(secret) ?? 0;
140
+ const finalizedIndex = await this.getLastFinalizedIndex(secret, jobId) ?? 0;
59
141
  if (index > finalizedIndex + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN) {
60
142
  throw new Error(`Highest used index ${index} is further than window length from the highest finalized index ${finalizedIndex}.
61
143
  Tagging window length ${UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN} is configured too low. Contact the Aztec team
@@ -63,13 +145,13 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
63
145
  }
64
146
  // Throw if the new pending index is lower than or equal to the last finalized index
65
147
  const secretStr = secret.toString();
66
- const lastFinalizedIndex = await this.#lastFinalizedIndexes.getAsync(secretStr);
148
+ const lastFinalizedIndex = await this.#readLastFinalizedIndex(jobId, secretStr);
67
149
  if (lastFinalizedIndex !== undefined && index <= lastFinalizedIndex) {
68
150
  throw new Error(`Cannot store pending index ${index} for secret ${secretStr}: ` + `it is lower than or equal to the last finalized index ${lastFinalizedIndex}`);
69
151
  }
70
152
  // Check if this secret + txHash combination already exists
71
153
  const txHashStr = txHash.toString();
72
- const existingForSecret = await this.#pendingIndexes.getAsync(secretStr) ?? [];
154
+ const existingForSecret = await this.#readPendingIndexes(jobId, secretStr);
73
155
  const existingForSecretAndTx = existingForSecret.find((entry)=>entry.txHash === txHashStr);
74
156
  if (existingForSecretAndTx) {
75
157
  // If it exists with a different index, throw an error
@@ -79,7 +161,7 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
79
161
  // If it exists with the same index, ignore the update (no-op)
80
162
  } else {
81
163
  // If it doesn't exist, add it
82
- await this.#pendingIndexes.set(secretStr, [
164
+ this.#writePendingIndexes(jobId, secretStr, [
83
165
  ...existingForSecret,
84
166
  {
85
167
  index,
@@ -97,8 +179,8 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
97
179
  * @param endIndex - The upper bound of the index range (exclusive).
98
180
  * @returns An array of unique transaction hashes for pending transactions that contain indexes in the range
99
181
  * [startIndex, endIndex). Returns an empty array if no pending indexes exist in the range.
100
- */ async getTxHashesOfPendingIndexes(secret, startIndex, endIndex) {
101
- const existing = await this.#pendingIndexes.getAsync(secret.toString()) ?? [];
182
+ */ async getTxHashesOfPendingIndexes(secret, startIndex, endIndex, jobId) {
183
+ const existing = await this.#readPendingIndexes(jobId, secret.toString());
102
184
  const txHashes = existing.filter((entry)=>entry.index >= startIndex && entry.index < endIndex).map((entry)=>entry.txHash);
103
185
  return Array.from(new Set(txHashes)).map(TxHash.fromString);
104
186
  }
@@ -106,20 +188,20 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
106
188
  * Returns the last (highest) finalized index for a given secret.
107
189
  * @param secret - The secret to get the last finalized index for.
108
190
  * @returns The last (highest) finalized index for the given secret.
109
- */ getLastFinalizedIndex(secret) {
110
- return this.#lastFinalizedIndexes.getAsync(secret.toString());
191
+ */ getLastFinalizedIndex(secret, jobId) {
192
+ return this.#readLastFinalizedIndex(jobId, secret.toString());
111
193
  }
112
194
  /**
113
195
  * Returns the last used index for a given directional app tagging secret, considering both finalized and pending
114
196
  * indexes.
115
197
  * @param secret - The directional app tagging secret to query the last used index for.
116
198
  * @returns The last used index.
117
- */ async getLastUsedIndex(secret) {
199
+ */ async getLastUsedIndex(secret, jobId) {
118
200
  const secretStr = secret.toString();
119
- const pendingTxScopedIndexes = await this.#pendingIndexes.getAsync(secretStr) ?? [];
201
+ const pendingTxScopedIndexes = await this.#readPendingIndexes(jobId, secretStr);
120
202
  const pendingIndexes = pendingTxScopedIndexes.map((entry)=>entry.index);
121
203
  if (pendingTxScopedIndexes.length === 0) {
122
- return this.#lastFinalizedIndexes.getAsync(secretStr);
204
+ return this.#readLastFinalizedIndex(jobId, secretStr);
123
205
  }
124
206
  // As the last used index we return the highest one from the pending indexes. Note that this value will be always
125
207
  // higher than the last finalized index because we prune lower pending indexes when a tx is finalized.
@@ -127,21 +209,21 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
127
209
  }
128
210
  /**
129
211
  * Drops all pending indexes corresponding to the given transaction hashes.
130
- */ async dropPendingIndexes(txHashes) {
212
+ */ async dropPendingIndexes(txHashes, jobId) {
131
213
  if (txHashes.length === 0) {
132
214
  return;
133
215
  }
134
- const txHashStrs = new Set(txHashes.map((txHash)=>txHash.toString()));
135
- const allSecrets = await toArray(this.#pendingIndexes.keysAsync());
216
+ const txHashStrings = new Set(txHashes.map((txHash)=>txHash.toString()));
217
+ const allSecrets = await this.#readSecretsWithPendingIndexes(jobId);
136
218
  for (const secret of allSecrets){
137
- const pendingData = await this.#pendingIndexes.getAsync(secret);
219
+ const pendingData = await this.#readPendingIndexes(jobId, secret);
138
220
  if (pendingData) {
139
- const filtered = pendingData.filter((item)=>!txHashStrs.has(item.txHash));
221
+ const filtered = pendingData.filter((item)=>!txHashStrings.has(item.txHash));
140
222
  if (filtered.length === 0) {
141
- await this.#pendingIndexes.delete(secret);
223
+ this.#writePendingIndexes(jobId, secret, []);
142
224
  } else if (filtered.length !== pendingData.length) {
143
225
  // Some items were filtered out, so update the pending data
144
- await this.#pendingIndexes.set(secret, filtered);
226
+ this.#writePendingIndexes(jobId, secret, filtered);
145
227
  }
146
228
  // else: No items were filtered out (txHashes not found for this secret) --> no-op
147
229
  }
@@ -150,15 +232,15 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
150
232
  /**
151
233
  * Updates pending indexes corresponding to the given transaction hashes to be finalized and prunes any lower pending
152
234
  * indexes.
153
- */ async finalizePendingIndexes(txHashes) {
235
+ */ async finalizePendingIndexes(txHashes, jobId) {
154
236
  if (txHashes.length === 0) {
155
237
  return;
156
238
  }
157
239
  for (const txHash of txHashes){
158
240
  const txHashStr = txHash.toString();
159
- const allSecrets = await toArray(this.#pendingIndexes.keysAsync());
241
+ const allSecrets = await this.#readSecretsWithPendingIndexes(jobId);
160
242
  for (const secret of allSecrets){
161
- const pendingData = await this.#pendingIndexes.getAsync(secret);
243
+ const pendingData = await this.#readPendingIndexes(jobId, secret);
162
244
  if (!pendingData) {
163
245
  continue;
164
246
  }
@@ -171,14 +253,14 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
171
253
  // values are irrelevant.
172
254
  throw new Error(`Multiple pending indexes found for tx hash ${txHashStr} and secret ${secret}`);
173
255
  }
174
- let lastFinalized = await this.#lastFinalizedIndexes.getAsync(secret);
256
+ let lastFinalized = await this.#readLastFinalizedIndex(jobId, secret);
175
257
  const newFinalized = matchingIndexes[0];
176
258
  if (newFinalized < (lastFinalized ?? 0)) {
177
259
  // This should never happen because when last finalized index was finalized we should have pruned the lower
178
260
  // pending indexes.
179
261
  throw new Error(`New finalized index ${newFinalized} is smaller than the current last finalized index ${lastFinalized}`);
180
262
  }
181
- await this.#lastFinalizedIndexes.set(secret, newFinalized);
263
+ this.#writeLastFinalizedIndex(jobId, secret, newFinalized);
182
264
  lastFinalized = newFinalized;
183
265
  // When we add pending indexes, we ensure they are higher than the last finalized index. However, because we
184
266
  // cannot control the order in which transactions are finalized, there may be pending indexes that are now
@@ -186,9 +268,9 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
186
268
  // outdated pending indexes.
187
269
  const remainingItemsOfHigherIndex = pendingData.filter((item)=>item.index > (lastFinalized ?? 0));
188
270
  if (remainingItemsOfHigherIndex.length === 0) {
189
- await this.#pendingIndexes.delete(secret);
271
+ this.#writePendingIndexes(jobId, secret, []);
190
272
  } else {
191
- await this.#pendingIndexes.set(secret, remainingItemsOfHigherIndex);
273
+ this.#writePendingIndexes(jobId, secret, remainingItemsOfHigherIndex);
192
274
  }
193
275
  }
194
276
  }
@@ -0,0 +1,2 @@
1
+ export declare const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGFnZ2luZy9jb25zdGFudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBU0EsZUFBTyxNQUFNLHNDQUFzQyxLQUFLLENBQUMifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/tagging/constants.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,sCAAsC,KAAK,CAAC"}
@@ -0,0 +1,10 @@
1
+ // This window has to be as large as the largest expected number of logs emitted in a tx for a given directional app
2
+ // tagging secret. If we get more tag indexes consumed than this window, an error is thrown in `PXE::proveTx` function.
3
+ // This is set to a larger value than MAX_PRIVATE_LOGS_PER_TX (currently 64) because there could be more than
4
+ // MAX_PRIVATE_LOGS_PER_TX indexes consumed in case the logs are squashed. This happens when the log contains a note
5
+ // and the note is nullified in the same tx.
6
+ //
7
+ // Having a large window significantly slowed down `e2e_l1_with_wall_time` test as there we perform sync for more than
8
+ // 1000 secrets. For this reason we set it to a relatively low value of 20. 20 should be sufficient for all the use
9
+ // cases.
10
+ export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
@@ -0,0 +1,24 @@
1
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ import type { L2BlockHash } from '@aztec/stdlib/block';
3
+ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
4
+ import type { SiloedTag, Tag, TxScopedL2Log } from '@aztec/stdlib/logs';
5
+ /**
6
+ * Fetches all private logs for the given tags, automatically paginating through all pages.
7
+ * @param aztecNode - The Aztec node to query.
8
+ * @param tags - The siloed tags to search for.
9
+ * @param anchorBlockHash - reference block for the Aztec node query, throws if block is not found there (typically
10
+ * because of reorgs).
11
+ * @returns An array of log arrays, one per tag, containing all logs across all pages.
12
+ */
13
+ export declare function getAllPrivateLogsByTags(aztecNode: AztecNode, tags: SiloedTag[], anchorBlockHash: L2BlockHash): Promise<TxScopedL2Log[][]>;
14
+ /**
15
+ * Fetches all public logs for the given tags from a contract, automatically paginating through all pages.
16
+ * @param aztecNode - The Aztec node to query.
17
+ * @param contractAddress - The contract address to search logs for.
18
+ * @param tags - The tags to search for.
19
+ * @param anchorBlockHash - reference block for the Aztec node query, throws if block is not found there (typically
20
+ * because of reorgs).
21
+ * @returns An array of log arrays, one per tag, containing all logs across all pages.
22
+ */
23
+ export declare function getAllPublicLogsByTagsFromContract(aztecNode: AztecNode, contractAddress: AztecAddress, tags: Tag[], anchorBlockHash: L2BlockHash): Promise<TxScopedL2Log[][]>;
24
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2FsbF9sb2dzX2J5X3RhZ3MuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2dldF9hbGxfbG9nc19ieV90YWdzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBL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uBAAuB,CACrC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,EAAE,EACjB,eAAe,EAAE,WAAW,GAC3B,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAE5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,kCAAkC,CAChD,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,GAAG,EAAE,EACX,eAAe,EAAE,WAAW,GAC3B,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAI5B"}
@@ -0,0 +1,46 @@
1
+ import { MAX_LOGS_PER_TAG } from '@aztec/stdlib/interfaces/api-limit';
2
+ /**
3
+ * Generic pagination helper that fetches all pages of results.
4
+ * @param numTags - The number of tags being queried (determines result array size).
5
+ * @param fetchPage - Function that fetches a single page of results given a page number.
6
+ * @returns An array of arrays, one per tag, containing all results across all pages.
7
+ */ async function getAllPages(numTags, fetchPage) {
8
+ const allResultsPerTag = Array.from({
9
+ length: numTags
10
+ }, ()=>[]);
11
+ let page = 0;
12
+ let hasMore = true;
13
+ while(hasMore){
14
+ const resultsPage = await fetchPage(page);
15
+ hasMore = false;
16
+ for(let i = 0; i < resultsPage.length; i++){
17
+ allResultsPerTag[i].push(...resultsPage[i]);
18
+ if (resultsPage[i].length === MAX_LOGS_PER_TAG) {
19
+ hasMore = true;
20
+ }
21
+ }
22
+ page++;
23
+ }
24
+ return allResultsPerTag;
25
+ }
26
+ /**
27
+ * Fetches all private logs for the given tags, automatically paginating through all pages.
28
+ * @param aztecNode - The Aztec node to query.
29
+ * @param tags - The siloed tags to search for.
30
+ * @param anchorBlockHash - reference block for the Aztec node query, throws if block is not found there (typically
31
+ * because of reorgs).
32
+ * @returns An array of log arrays, one per tag, containing all logs across all pages.
33
+ */ export function getAllPrivateLogsByTags(aztecNode, tags, anchorBlockHash) {
34
+ return getAllPages(tags.length, (page)=>aztecNode.getPrivateLogsByTags(tags, page, anchorBlockHash));
35
+ }
36
+ /**
37
+ * Fetches all public logs for the given tags from a contract, automatically paginating through all pages.
38
+ * @param aztecNode - The Aztec node to query.
39
+ * @param contractAddress - The contract address to search logs for.
40
+ * @param tags - The tags to search for.
41
+ * @param anchorBlockHash - reference block for the Aztec node query, throws if block is not found there (typically
42
+ * because of reorgs).
43
+ * @returns An array of log arrays, one per tag, containing all logs across all pages.
44
+ */ export function getAllPublicLogsByTagsFromContract(aztecNode, contractAddress, tags, anchorBlockHash) {
45
+ return getAllPages(tags.length, (page)=>aztecNode.getPublicLogsByTagsFromContract(contractAddress, tags, page, anchorBlockHash));
46
+ }
@@ -10,7 +10,8 @@
10
10
  */
11
11
  export { loadPrivateLogsForSenderRecipientPair } from './recipient_sync/load_private_logs_for_sender_recipient_pair.js';
12
12
  export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
13
- export declare const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
13
+ export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
14
+ export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
14
15
  export { DirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
15
16
  export { type PreTag } from '@aztec/stdlib/logs';
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7R0FTRztBQUVILE9BQU8sRUFBRSxxQ0FBcUMsRUFBRSxNQUFNLGlFQUFpRSxDQUFDO0FBQ3hILE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBV3hGLGVBQU8sTUFBTSxzQ0FBc0MsS0FBSyxDQUFDO0FBR3pELE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDakYsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUMifQ==
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7R0FTRztBQUVILE9BQU8sRUFBRSxxQ0FBcUMsRUFBRSxNQUFNLGlFQUFpRSxDQUFDO0FBQ3hILE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBQ3hGLE9BQU8sRUFBRSxzQ0FBc0MsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3hFLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxrQ0FBa0MsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBR3hHLE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDakYsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qCAAqC,EAAE,MAAM,iEAAiE,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAWxF,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAGzD,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qCAAqC,EAAE,MAAM,iEAAiE,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAGxG,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
@@ -9,15 +9,7 @@
9
9
  * @module tagging
10
10
  */ export { loadPrivateLogsForSenderRecipientPair } from './recipient_sync/load_private_logs_for_sender_recipient_pair.js';
11
11
  export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
12
- // This window has to be as large as the largest expected number of logs emitted in a tx for a given directional app
13
- // tagging secret. If we get more tag indexes consumed than this window, an error is thrown in `PXE::proveTx` function.
14
- // This is set to a larger value than MAX_PRIVATE_LOGS_PER_TX (currently 64) because there could be more than
15
- // MAX_PRIVATE_LOGS_PER_TX indexes consumed in case the logs are squashed. This happens when the log contains a note
16
- // and the note is nullified in the same tx.
17
- //
18
- // Having a large window significantly slowed down `e2e_l1_with_wall_time` test as there we perform sync for more than
19
- // 1000 secrets. For this reason we set it to a relatively low value of 20. 20 should be sufficient for all the use
20
- // cases.
21
- export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
12
+ export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
13
+ export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
22
14
  // Re-export tagging-related types from stdlib
23
15
  export { DirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
@@ -1,5 +1,6 @@
1
1
  import type { BlockNumber } from '@aztec/foundation/branded-types';
2
2
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
+ import type { L2BlockHash } from '@aztec/stdlib/block';
3
4
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
4
5
  import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
5
6
  import type { RecipientTaggingStore } from '../../storage/tagging_store/recipient_tagging_store.js';
@@ -10,5 +11,5 @@ import type { RecipientTaggingStore } from '../../storage/tagging_store/recipien
10
11
  * @dev This function can be safely executed "in parallel" for other sender-recipient pairs because the data in
11
12
  * in the tagging data provider is indexed by the secret and hence completely disjoint.
12
13
  */
13
- export declare function loadPrivateLogsForSenderRecipientPair(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockNumber: BlockNumber): Promise<TxScopedL2Log[]>;
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvbG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVyRixPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHdEQUF3RCxDQUFDO0FBS3BHOzs7Ozs7R0FNRztBQUNILHdCQUFzQixxQ0FBcUMsQ0FDekQsTUFBTSxFQUFFLDJCQUEyQixFQUNuQyxHQUFHLEVBQUUsWUFBWSxFQUNqQixTQUFTLEVBQUUsU0FBUyxFQUNwQixZQUFZLEVBQUUscUJBQXFCLEVBQ25DLGlCQUFpQixFQUFFLFdBQVcsR0FDN0IsT0FBTyxDQUFDLGFBQWEsRUFBRSxDQUFDLENBeUcxQiJ9
14
+ export declare function loadPrivateLogsForSenderRecipientPair(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockNumber: BlockNumber, anchorBlockHash: L2BlockHash, jobId: string): Promise<TxScopedL2Log[]>;
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvbG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN2RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0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