@aztec/pxe 0.0.1-commit.f295ac2 → 0.0.1-commit.f2ce05ee

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 (187) hide show
  1. package/dest/bin/check_oracle_version.js +1 -1
  2. package/dest/block_synchronizer/block_synchronizer.d.ts +9 -5
  3. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  4. package/dest/block_synchronizer/block_synchronizer.js +62 -16
  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/contract_function_simulator/contract_function_simulator.d.ts +5 -5
  9. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  10. package/dest/contract_function_simulator/contract_function_simulator.js +12 -15
  11. package/dest/contract_function_simulator/index.d.ts +2 -2
  12. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  13. package/dest/contract_function_simulator/index.js +1 -1
  14. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +1 -1
  15. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
  16. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
  17. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  18. package/dest/contract_function_simulator/oracle/interfaces.d.ts +15 -12
  19. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +4 -4
  21. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  22. package/dest/contract_function_simulator/oracle/note_packing_utils.js +4 -4
  23. package/dest/contract_function_simulator/oracle/oracle.d.ts +7 -5
  24. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  25. package/dest/contract_function_simulator/oracle/oracle.js +56 -34
  26. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -22
  27. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  28. package/dest/contract_function_simulator/oracle/private_execution.js +0 -37
  29. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +12 -3
  30. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  31. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +20 -9
  32. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +38 -24
  33. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  34. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +84 -65
  35. package/dest/contract_sync/contract_sync_service.d.ts +41 -0
  36. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  37. package/dest/contract_sync/contract_sync_service.js +82 -0
  38. package/dest/contract_sync/helpers.d.ts +28 -0
  39. package/dest/contract_sync/helpers.d.ts.map +1 -0
  40. package/dest/contract_sync/helpers.js +55 -0
  41. package/dest/debug/pxe_debug_utils.d.ts +22 -9
  42. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  43. package/dest/debug/pxe_debug_utils.js +28 -17
  44. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  45. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  46. package/dest/entrypoints/client/bundle/utils.js +12 -6
  47. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  48. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  49. package/dest/entrypoints/client/lazy/utils.js +13 -7
  50. package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
  51. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  52. package/dest/entrypoints/server/index.d.ts +2 -1
  53. package/dest/entrypoints/server/index.d.ts.map +1 -1
  54. package/dest/entrypoints/server/index.js +1 -0
  55. package/dest/entrypoints/server/utils.d.ts +1 -1
  56. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  57. package/dest/entrypoints/server/utils.js +19 -8
  58. package/dest/events/event_service.d.ts +5 -6
  59. package/dest/events/event_service.d.ts.map +1 -1
  60. package/dest/events/event_service.js +6 -7
  61. package/dest/job_coordinator/job_coordinator.d.ts +3 -2
  62. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
  63. package/dest/job_coordinator/job_coordinator.js +3 -2
  64. package/dest/logs/log_service.d.ts +6 -5
  65. package/dest/logs/log_service.d.ts.map +1 -1
  66. package/dest/logs/log_service.js +20 -19
  67. package/dest/notes/note_service.d.ts +6 -6
  68. package/dest/notes/note_service.d.ts.map +1 -1
  69. package/dest/notes/note_service.js +14 -14
  70. package/dest/oracle_version.d.ts +3 -3
  71. package/dest/oracle_version.d.ts.map +1 -1
  72. package/dest/oracle_version.js +4 -3
  73. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  74. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  75. package/dest/private_kernel/private_kernel_execution_prover.js +2 -2
  76. package/dest/private_kernel/private_kernel_oracle.d.ts +3 -3
  77. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  78. package/dest/pxe.d.ts +13 -2
  79. package/dest/pxe.d.ts.map +1 -1
  80. package/dest/pxe.js +45 -20
  81. package/dest/storage/address_store/address_store.d.ts +1 -1
  82. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  83. package/dest/storage/address_store/address_store.js +12 -11
  84. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  85. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  86. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  87. package/dest/storage/capsule_store/capsule_store.js +6 -8
  88. package/dest/storage/contract_store/contract_store.d.ts +1 -2
  89. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  90. package/dest/storage/contract_store/contract_store.js +27 -30
  91. package/dest/storage/metadata.d.ts +1 -1
  92. package/dest/storage/metadata.js +1 -1
  93. package/dest/storage/note_store/note_store.d.ts +48 -50
  94. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  95. package/dest/storage/note_store/note_store.js +279 -252
  96. package/dest/storage/note_store/stored_note.d.ts +16 -0
  97. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  98. package/dest/storage/note_store/stored_note.js +43 -0
  99. package/dest/storage/private_event_store/private_event_store.d.ts +17 -4
  100. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  101. package/dest/storage/private_event_store/private_event_store.js +198 -147
  102. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  103. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  104. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  105. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +1 -1
  106. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  107. package/dest/storage/tagging_store/recipient_tagging_store.js +31 -19
  108. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  109. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  110. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  111. package/dest/storage/tagging_store/sender_tagging_store.d.ts +1 -1
  112. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  113. package/dest/storage/tagging_store/sender_tagging_store.js +183 -113
  114. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  115. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  116. package/dest/tagging/get_all_logs_by_tags.js +46 -0
  117. package/dest/tagging/index.d.ts +2 -1
  118. package/dest/tagging/index.d.ts.map +1 -1
  119. package/dest/tagging/index.js +1 -0
  120. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -2
  121. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  122. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +2 -2
  123. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
  124. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  125. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
  126. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -2
  127. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  128. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +2 -2
  129. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
  130. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  131. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
  132. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +3 -2
  133. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  134. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +7 -4
  135. package/package.json +25 -16
  136. package/src/bin/check_oracle_version.ts +1 -0
  137. package/src/block_synchronizer/block_synchronizer.ts +76 -33
  138. package/src/config/index.ts +14 -0
  139. package/src/contract_function_simulator/contract_function_simulator.ts +12 -17
  140. package/src/contract_function_simulator/index.ts +1 -1
  141. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  142. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  143. package/src/contract_function_simulator/oracle/interfaces.ts +20 -11
  144. package/src/contract_function_simulator/oracle/note_packing_utils.ts +4 -4
  145. package/src/contract_function_simulator/oracle/oracle.ts +62 -32
  146. package/src/contract_function_simulator/oracle/private_execution.ts +1 -60
  147. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +34 -11
  148. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +107 -74
  149. package/src/contract_sync/contract_sync_service.ts +129 -0
  150. package/src/contract_sync/helpers.ts +93 -0
  151. package/src/debug/pxe_debug_utils.ts +60 -17
  152. package/src/entrypoints/client/bundle/utils.ts +7 -14
  153. package/src/entrypoints/client/lazy/utils.ts +8 -14
  154. package/src/entrypoints/pxe_creation_options.ts +2 -1
  155. package/src/entrypoints/server/index.ts +1 -0
  156. package/src/entrypoints/server/utils.ts +15 -19
  157. package/src/events/event_service.ts +5 -7
  158. package/src/job_coordinator/job_coordinator.ts +4 -3
  159. package/src/logs/log_service.ts +31 -15
  160. package/src/notes/note_service.ts +21 -20
  161. package/src/oracle_version.ts +4 -3
  162. package/src/private_kernel/private_kernel_execution_prover.ts +6 -3
  163. package/src/private_kernel/private_kernel_oracle.ts +2 -2
  164. package/src/pxe.ts +84 -19
  165. package/src/storage/address_store/address_store.ts +15 -15
  166. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  167. package/src/storage/capsule_store/capsule_store.ts +8 -8
  168. package/src/storage/contract_store/contract_store.ts +26 -35
  169. package/src/storage/metadata.ts +1 -1
  170. package/src/storage/note_store/note_store.ts +318 -318
  171. package/src/storage/note_store/stored_note.ts +48 -0
  172. package/src/storage/private_event_store/private_event_store.ts +250 -190
  173. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  174. package/src/storage/tagging_store/recipient_tagging_store.ts +31 -21
  175. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  176. package/src/storage/tagging_store/sender_tagging_store.ts +210 -126
  177. package/src/tagging/get_all_logs_by_tags.ts +68 -0
  178. package/src/tagging/index.ts +1 -0
  179. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +11 -1
  180. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
  181. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +3 -1
  182. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -17
  183. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +12 -3
  184. package/dest/tree_membership/tree_membership_service.d.ts +0 -50
  185. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  186. package/dest/tree_membership/tree_membership_service.js +0 -75
  187. package/src/tree_membership/tree_membership_service.ts +0 -97
@@ -1,317 +1,344 @@
1
- import { toArray } from '@aztec/foundation/iterable';
2
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
1
+ import { Semaphore } from '@aztec/foundation/queue';
3
2
  import { NoteStatus } from '@aztec/stdlib/note';
4
- import { NoteDao } from '@aztec/stdlib/note';
3
+ import { StoredNote } from './stored_note.js';
5
4
  /**
6
5
  * NoteStore manages the storage and retrieval of notes.
7
6
  *
8
- * Notes can be active or nullified. This class processes new notes, nullifications,
9
- * and performs rollback handling in the case of a reorg.
7
+ * Notes can be active or nullified. This class processes new notes, nullifications, and performs rollback handling in
8
+ * the case of a reorg.
10
9
  **/ export class NoteStore {
10
+ storeName = 'note';
11
11
  #store;
12
12
  // Note that we use the siloedNullifier as the note id in the store as it's guaranteed to be unique.
13
- /** noteId (siloedNullifier) -> NoteDao (serialized) */ #notes;
14
- /** noteId (siloedNullifier) -> NoteDao (serialized) */ #nullifiedNotes;
15
- /** blockNumber -> siloedNullifier */ #nullifiersByBlockNumber;
16
- /** noteId (siloedNullifier) -> scope */ #nullifiedNotesToScope;
17
- /** contractAddress -> noteId (siloedNullifier) */ #nullifiedNotesByContract;
18
- /** storageSlot -> noteId (siloedNullifier) */ #nullifiedNotesByStorageSlot;
19
- /** scope (AztecAddress) -> true */ #scopes;
20
- /** noteId (siloedNullifier) -> scope */ #notesToScope;
21
- /** scope -> MultiMap(contractAddress -> noteId) */ #notesByContractAndScope;
22
- /** scope -> MultiMap(storageSlot -> noteId) */ #notesByStorageSlotAndScope;
13
+ // Main storage for notes. Avoid performing full scans on it as it contains all notes PXE knows, use
14
+ // #nullifiersByContractAddress or #nullifiersByNullificationBlockNumber to find relevant note nullifiers that can be
15
+ // used to read into this map instead.
16
+ // nullifier => StoredNote (serialized)
17
+ #notes;
18
+ // Indexes which notes (via their nullifiers) belong to a contract. Used in `getNotes` to reduce the amount of notes
19
+ // checked.
20
+ // contract address => nullifier
21
+ #nullifiersByContractAddress;
22
+ // Groups note nullifiers by the block number they were added to the nullifier tree. Used in `rollback` to handle
23
+ // re-orgs.
24
+ // block number => nullifier (block number in which nullifier is included)
25
+ #nullifiersByNullificationBlockNumber;
26
+ // In-memory changes performed during a not-yet committed job. When `commit` is called with said job's id, these
27
+ // changes are persisted in the DB maps specified above and cleared.
28
+ // jobId => nullifier => StoredNote (serialized)
29
+ #notesForJob;
30
+ // Per job locks to prevent multiple concurrent writes to affect each other.
31
+ // jobId => lock
32
+ #jobLocks;
23
33
  constructor(store){
24
34
  this.#store = store;
25
35
  this.#notes = store.openMap('notes');
26
- this.#nullifiedNotes = store.openMap('nullified_notes');
27
- this.#nullifiersByBlockNumber = store.openMultiMap('nullifier_to_block_number');
28
- this.#nullifiedNotesToScope = store.openMultiMap('nullified_notes_to_scope');
29
- this.#nullifiedNotesByContract = store.openMultiMap('nullified_notes_by_contract');
30
- this.#nullifiedNotesByStorageSlot = store.openMultiMap('nullified_notes_by_storage_slot');
31
- this.#scopes = store.openMap('scopes');
32
- this.#notesToScope = store.openMultiMap('notes_to_scope');
33
- this.#notesByContractAndScope = new Map();
34
- this.#notesByStorageSlotAndScope = new Map();
36
+ this.#nullifiersByContractAddress = store.openMultiMap('note_nullifiers_by_contract');
37
+ this.#nullifiersByNullificationBlockNumber = store.openMultiMap('note_block_number_to_nullifier');
38
+ this.#jobLocks = new Map();
39
+ this.#notesForJob = new Map();
35
40
  }
36
41
  /**
37
- * Creates and initializes a new NoteStore instance.
42
+ * Adds multiple notes to the notes store under the specified scope.
38
43
  *
39
- * This factory method creates a NoteStore and restores any existing
40
- * scope-specific indexes from the database.
44
+ * Notes are stored using their siloedNullifier as the key, which provides uniqueness. Each note is indexed by
45
+ * multiple criteria for efficient retrieval.
41
46
  *
42
- * @param store - The key-value store to use for persistence
43
- * @returns Promise resolving to a fully initialized NoteStore instance
44
- */ static async create(store) {
45
- const pxeDB = new NoteStore(store);
46
- for await (const scope of pxeDB.#scopes.keysAsync()){
47
- pxeDB.#notesByContractAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_contract`));
48
- pxeDB.#notesByStorageSlotAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_storage_slot`));
49
- }
50
- return pxeDB;
47
+ * @param notes - Notes to store
48
+ * @param scope - The scope (user/account) under which to store the notes
49
+ * @param jobId - The job context for staged writes
50
+ */ addNotes(notes, scope, jobId) {
51
+ return this.#withJobLock(jobId, ()=>this.#store.transactionAsync(()=>Promise.all(notes.map(async (note)=>{
52
+ const noteForJob = await this.#readNote(note.siloedNullifier.toString(), jobId) ?? new StoredNote(note, new Set());
53
+ noteForJob.addScope(scope.toString());
54
+ this.#writeNote(noteForJob, jobId);
55
+ }))));
51
56
  }
52
- /**
53
- * Adds a new scope to the note data provider.
54
- *
55
- * Scopes provide privacy isolation by creating separate indexes for each user.
56
- * Each scope gets its own set of indexes for efficient note retrieval by various criteria.
57
- *
58
- * @param scope - The AztecAddress representing the scope/user to add
59
- * @returns Promise resolving to true if scope was added, false if it already existed
60
- */ async addScope(scope) {
61
- const scopeString = scope.toString();
62
- if (await this.#scopes.hasAsync(scopeString)) {
63
- return false;
64
- }
65
- await this.#scopes.set(scopeString, true);
66
- this.#notesByContractAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_contract`));
67
- this.#notesByStorageSlotAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_storage_slot`));
68
- return true;
57
+ async #readNote(nullifier, jobId) {
58
+ // Always issue DB read to keep IndexedDB transaction alive (they auto-commit when a new micro-task starts and there
59
+ // are no pending read requests). The staged value still takes precedence if it exists.
60
+ const noteBuffer = await this.#notes.getAsync(nullifier);
61
+ const noteForJob = this.#getNotesForJob(jobId).get(nullifier);
62
+ return noteForJob ?? (noteBuffer ? StoredNote.fromBuffer(noteBuffer) : undefined);
63
+ }
64
+ #writeNote(note, jobId) {
65
+ this.#getNotesForJob(jobId).set(note.noteDao.siloedNullifier.toString(), note);
69
66
  }
70
67
  /**
71
- * Adds multiple notes to the data provider under the specified scope.
68
+ * Retrieves notes based on the provided filter criteria.
72
69
  *
73
- * Notes are stored using their siloedNullifier as the key, which provides uniqueness. Each note is indexed
74
- * by multiple criteria for efficient retrieval.
70
+ * This method queries both active and optionally nullified notes based on the filter parameters.
75
71
  *
76
- * @param notes - Notes to store
77
- * @param scope - The scope (user/account) under which to store the notes
78
- */ addNotes(notes, scope) {
72
+ * @param filter - Filter criteria including contractAddress (required), and optional owner,
73
+ * storageSlot, status, scopes, and siloedNullifier.
74
+ * @params jobId - the job context to read from.
75
+ * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
76
+ * returned once if this is the case)
77
+ * @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
78
+ */ getNotes(filter, jobId) {
79
+ if (filter.scopes !== undefined && filter.scopes.length === 0) {
80
+ return Promise.reject(new Error('Trying to get notes with an empty scopes array'));
81
+ }
79
82
  return this.#store.transactionAsync(async ()=>{
80
- if (!await this.#scopes.hasAsync(scope.toString())) {
81
- await this.addScope(scope);
83
+ const targetStatus = filter.status ?? NoteStatus.ACTIVE;
84
+ // The code below might read a bit unnatural, the reason is that we need to be careful in how we use `await` inside
85
+ // `transactionAsync`, otherwise browsers might choose to auto-commit the IndexedDB transaction forcing us to
86
+ // explicitly handle that condition. The rule we need to honor is: do not await unless you generate a database
87
+ // read or write or you're done using the DB for the remainder of the transaction. The following sequence is
88
+ // unsafe in IndexedDB:
89
+ //
90
+ // 1. start transactionAsync()
91
+ // 2. await readDb() <-- OK, transaction alive because we issued DB ops
92
+ // 3. run a bunch of computations (no await involved) <-- OK, tx alive because we are in the same microtask
93
+ // 4. await doSthNotInDb() <-- no DB ops issued in this task, browser's free to decide to commit the tx
94
+ // 5. await readDb() <-- BOOM, TransactionInactiveError
95
+ //
96
+ // Note that the real issue is in step number 5: we try to continue using a transaction that the browser might
97
+ // have already committed.
98
+ //
99
+ // We need to read candidate notes which are either indexed by contract address in the DB (in
100
+ // #nullifiersByContractAddress), or lie in memory for the not yet committed `jobId`.
101
+ // So we collect promises based on both sources without awaiting for them.
102
+ const noteReadPromises = new Map();
103
+ // Awaiting the getValuesAsync iterator is fine because it's reading from the DB
104
+ for await (const nullifier of this.#nullifiersByContractAddress.getValuesAsync(filter.contractAddress.toString())){
105
+ // Each #readNote will perform a DB read
106
+ noteReadPromises.set(nullifier, this.#readNote(nullifier, jobId));
82
107
  }
83
- for (const dao of notes){
84
- const noteId = dao.siloedNullifier.toString();
85
- await this.#notes.set(noteId, dao.toBuffer());
86
- await this.#notesToScope.set(noteId, scope.toString());
87
- await this.#notesByContractAndScope.get(scope.toString()).set(dao.contractAddress.toString(), noteId);
88
- await this.#notesByStorageSlotAndScope.get(scope.toString()).set(dao.storageSlot.toString(), noteId);
108
+ // Add staged nullifiers from job, no awaits involved, so we are fine
109
+ for (const storedNote of this.#getNotesForJob(jobId).values()){
110
+ if (storedNote.noteDao.contractAddress.equals(filter.contractAddress)) {
111
+ const nullifier = storedNote.noteDao.siloedNullifier.toString();
112
+ if (!noteReadPromises.has(nullifier)) {
113
+ noteReadPromises.set(nullifier, Promise.resolve(storedNote));
114
+ }
115
+ }
89
116
  }
117
+ // By now we have pending DB requests from all the #readNote calls. Await them all together.
118
+ const notes = await Promise.all(noteReadPromises.values());
119
+ // The rest of the function is await-free, and just deals with filtering and sorting our findings.
120
+ const foundNotes = new Map();
121
+ for (const note of notes){
122
+ // Defensive: hitting this case means we're mishandling contract indices or in-memory job data
123
+ if (!note) {
124
+ throw new Error('PXE note database is corrupted.');
125
+ }
126
+ // Apply filters
127
+ if (targetStatus === NoteStatus.ACTIVE && note.isNullified()) {
128
+ continue;
129
+ }
130
+ if (filter.owner && !note.noteDao.owner.equals(filter.owner)) {
131
+ continue;
132
+ }
133
+ if (filter.storageSlot && !note.noteDao.storageSlot.equals(filter.storageSlot)) {
134
+ continue;
135
+ }
136
+ if (filter.siloedNullifier && !note.noteDao.siloedNullifier.equals(filter.siloedNullifier)) {
137
+ continue;
138
+ }
139
+ if (filter.scopes && note.scopes.intersection(new Set(filter.scopes.map((s)=>s.toString()))).size === 0) {
140
+ continue;
141
+ }
142
+ foundNotes.set(note.noteDao.siloedNullifier.toString(), note.noteDao);
143
+ }
144
+ // Sort by block number, then by tx index within block, then by note index within tx
145
+ return [
146
+ ...foundNotes.values()
147
+ ].sort((a, b)=>{
148
+ if (a.l2BlockNumber !== b.l2BlockNumber) {
149
+ return a.l2BlockNumber - b.l2BlockNumber;
150
+ }
151
+ if (a.txIndexInBlock !== b.txIndexInBlock) {
152
+ return a.txIndexInBlock - b.txIndexInBlock;
153
+ }
154
+ return a.noteIndexInTx - b.noteIndexInTx;
155
+ });
90
156
  });
91
157
  }
92
158
  /**
159
+ * Transitions notes from "active" to "nullified" state.
160
+ *
161
+ * This operation processes a batch of nullifiers to mark the corresponding notes as spent/nullified.
162
+ * The operation is atomic - if any nullifier is not found, the entire operation fails and no notes are modified.
163
+ *
164
+ * applyNullifiers is idempotent: the same nullifier can be applied multiple times without error.
165
+ * This relaxes constraints on usage of NoteService#validateAndStoreNote, which can then be run concurrently in a Promise.all
166
+ * context without risking unnecessarily defensive checks failing.
167
+ *
168
+ * @param nullifiers - Array of nullifiers with their block numbers to process
169
+ * @param jobId - The job context for staged writes
170
+ * @returns Array of NoteDao objects that were nullified
171
+ * @throws Error if any nullifier is not found in this notes store
172
+ */ applyNullifiers(nullifiers, jobId) {
173
+ if (nullifiers.length === 0) {
174
+ return Promise.resolve([]);
175
+ }
176
+ if (nullifiers.some((n)=>n.l2BlockNumber === 0)) {
177
+ return Promise.reject(new Error('applyNullifiers: nullifiers cannot have been emitted at block 0'));
178
+ }
179
+ return this.#withJobLock(jobId, ()=>this.#store.transactionAsync(async ()=>{
180
+ const notesToNullify = await Promise.all(nullifiers.map(async (nullifierInBlock)=>{
181
+ const nullifier = nullifierInBlock.data.toString();
182
+ const storedNote = await this.#readNote(nullifier, jobId);
183
+ if (!storedNote) {
184
+ throw new Error(`Attempted to mark a note as nullified which does not exist in PXE DB`);
185
+ }
186
+ return {
187
+ storedNote,
188
+ blockNumber: nullifierInBlock.l2BlockNumber
189
+ };
190
+ }));
191
+ const notesNullifiedInThisCall = new Map();
192
+ for (const noteToNullify of notesToNullify){
193
+ const note = noteToNullify.storedNote;
194
+ // Skip already nullified notes
195
+ if (note.isNullified()) {
196
+ continue;
197
+ }
198
+ note.markAsNullified(noteToNullify.blockNumber);
199
+ this.#writeNote(note, jobId);
200
+ notesNullifiedInThisCall.set(note.noteDao.siloedNullifier.toString(), note.noteDao);
201
+ }
202
+ return [
203
+ ...notesNullifiedInThisCall.values()
204
+ ];
205
+ }));
206
+ }
207
+ /**
93
208
  * Synchronizes notes and nullifiers to a specific block number.
94
209
  *
95
- * This method ensures that the state of notes and nullifiers is consistent with the
96
- * specified block number. It restores any notes that were nullified after the given block
97
- * and deletes any active notes created after that block.
210
+ * This method ensures that the state of notes and nullifiers is consistent with the specified block number.
211
+ * It restores any notes that were nullified after the given block and deletes any active notes created after that
212
+ * block.
98
213
  *
99
214
  * IMPORTANT: This method must be called within a transaction to ensure atomicity.
100
215
  *
101
216
  * @param blockNumber - The new chain tip after a reorg
102
217
  * @param synchedBlockNumber - The block number up to which PXE managed to sync before the reorg happened.
103
218
  */ async rollback(blockNumber, synchedBlockNumber) {
104
- await this.#rewindNullifiersAfterBlock(blockNumber, synchedBlockNumber);
219
+ if (this.#notesForJob.size > 0) {
220
+ throw new Error('PXE note store rollback is not allowed while jobs are running');
221
+ }
222
+ await this.#rewindNullifiedNotesAfterBlock(blockNumber, synchedBlockNumber);
105
223
  await this.#deleteActiveNotesAfterBlock(blockNumber);
106
224
  }
107
225
  /**
108
- * Deletes (removes) all active notes created after the specified block number.
226
+ * Deletes (removes) all notes created after the specified block number.
109
227
  *
110
- * Permanently delete notes from the active notes store, e.g. during a reorg.
111
- * Note: This only affects #notes (active notes), not #nullifiedNotes.
228
+ * Permanently delete notes from the notes store, e.g. during a reorg.
112
229
  *
113
230
  * @param blockNumber - Notes created after this block number will be deleted
114
231
  */ async #deleteActiveNotesAfterBlock(blockNumber) {
115
- const notes = await toArray(this.#notes.valuesAsync());
116
- for (const note of notes){
117
- const noteDao = NoteDao.fromBuffer(note);
118
- if (noteDao.l2BlockNumber > blockNumber) {
119
- const noteId = noteDao.siloedNullifier.toString();
120
- await this.#notes.delete(noteId);
121
- await this.#notesToScope.delete(noteId);
122
- const scopes = await toArray(this.#scopes.keysAsync());
123
- for (const scope of scopes){
124
- await this.#notesByContractAndScope.get(scope).deleteValue(noteDao.contractAddress.toString(), noteId);
125
- await this.#notesByStorageSlotAndScope.get(scope).deleteValue(noteDao.storageSlot.toString(), noteId);
126
- }
232
+ // Collect notes to delete during iteration to keep IndexedDB transaction alive.
233
+ const notesToDelete = [];
234
+ for await (const noteBuffer of this.#notes.valuesAsync()){
235
+ const storedNote = StoredNote.fromBuffer(noteBuffer);
236
+ if (storedNote.noteDao.l2BlockNumber > blockNumber) {
237
+ notesToDelete.push({
238
+ nullifier: storedNote.noteDao.siloedNullifier.toString(),
239
+ contractAddress: storedNote.noteDao.contractAddress.toString()
240
+ });
127
241
  }
128
242
  }
243
+ // Delete all collected notes. Each delete is a DB operation that keeps the transaction alive.
244
+ for (const { nullifier, contractAddress } of notesToDelete){
245
+ await this.#notes.delete(nullifier);
246
+ await this.#nullifiersByContractAddress.deleteValue(contractAddress, nullifier);
247
+ }
129
248
  }
130
249
  /**
131
250
  * Rewinds nullifications after a given block number.
132
251
  *
133
- * This operation "unnullifies" notes, rolling back nullifications that occurred
134
- * in orphaned blocks, e.g. during a reorg. The notes are restored to the
135
- * active notes store and removed from the nullified store.
252
+ * This operation "un-nullifies" notes, rolling back nullifications that occurred in orphaned blocks, e.g. during a
253
+ * reorg.
136
254
  *
137
255
  * @param blockNumber - Revert nullifications that occurred after this block
138
- * @param synchedBlockNumber - Upper bound for the block range to process
139
- */ async #rewindNullifiersAfterBlock(blockNumber, synchedBlockNumber) {
140
- const noteIdsToReinsert = [];
141
- const currentBlockNumber = blockNumber + 1;
142
- for(let i = currentBlockNumber; i <= synchedBlockNumber; i++){
143
- // noteId === siloedNullifier.toString(), so we can use nullifiers directly as noteIds
144
- noteIdsToReinsert.push(...await toArray(this.#nullifiersByBlockNumber.getValuesAsync(i)));
145
- }
146
- const nullifiedNoteBuffers = await Promise.all(noteIdsToReinsert.map((noteId)=>this.#nullifiedNotes.getAsync(noteId)));
147
- const noteDaos = nullifiedNoteBuffers.filter((buffer)=>buffer != undefined).map((buffer)=>NoteDao.fromBuffer(buffer));
148
- for (const dao of noteDaos){
149
- const noteId = dao.siloedNullifier.toString();
150
- const scopes = await toArray(this.#nullifiedNotesToScope.getValuesAsync(noteId));
151
- if (scopes.length === 0) {
152
- // We should never run into this error because notes always have a scope assigned to them - either on initial
153
- // insertion via `addNotes` or when removing their nullifiers.
154
- throw new Error(`No scopes found for nullified note with nullifier ${noteId}`);
256
+ * @param anchorBlockNumber - Upper bound for the block range to process
257
+ */ async #rewindNullifiedNotesAfterBlock(blockNumber, anchorBlockNumber) {
258
+ // First pass: collect all nullifiers for all blocks, starting reads during iteration to keep tx alive.
259
+ const nullifiersByBlock = new Map();
260
+ for(let i = blockNumber + 1; i <= anchorBlockNumber; i++){
261
+ const blockNullifiers = [];
262
+ for await (const nullifier of this.#nullifiersByNullificationBlockNumber.getValuesAsync(i)){
263
+ // Start read immediately during iteration to keep IndexedDB transaction alive
264
+ blockNullifiers.push({
265
+ nullifier,
266
+ noteReadPromise: this.#notes.getAsync(nullifier)
267
+ });
268
+ }
269
+ if (blockNullifiers.length > 0) {
270
+ nullifiersByBlock.set(i, blockNullifiers);
155
271
  }
156
- for (const scope of scopes){
272
+ }
273
+ // Second pass: await reads and perform writes
274
+ for (const [block, nullifiers] of nullifiersByBlock){
275
+ for (const { nullifier, noteReadPromise } of nullifiers){
276
+ const noteBuffer = await noteReadPromise;
277
+ if (!noteBuffer) {
278
+ throw new Error(`PXE DB integrity error: no note found with nullifier ${nullifier}`);
279
+ }
280
+ const storedNote = StoredNote.fromBuffer(noteBuffer);
281
+ if (storedNote.scopes.size === 0) {
282
+ throw new Error(`No scopes found for nullified note with nullifier ${nullifier}`);
283
+ }
284
+ storedNote.markAsActive();
157
285
  await Promise.all([
158
- this.#notesByContractAndScope.get(scope.toString()).set(dao.contractAddress.toString(), noteId),
159
- this.#notesByStorageSlotAndScope.get(scope.toString()).set(dao.storageSlot.toString(), noteId),
160
- this.#notesToScope.set(noteId, scope)
286
+ this.#notes.set(nullifier, storedNote.toBuffer()),
287
+ this.#nullifiersByNullificationBlockNumber.deleteValue(block, nullifier)
161
288
  ]);
162
289
  }
163
- await Promise.all([
164
- this.#notes.set(noteId, dao.toBuffer()),
165
- this.#nullifiedNotes.delete(noteId),
166
- this.#nullifiedNotesToScope.delete(noteId),
167
- this.#nullifiersByBlockNumber.deleteValue(dao.l2BlockNumber, dao.siloedNullifier.toString()),
168
- this.#nullifiedNotesByContract.deleteValue(dao.contractAddress.toString(), noteId),
169
- this.#nullifiedNotesByStorageSlot.deleteValue(dao.storageSlot.toString(), noteId)
170
- ]);
171
290
  }
172
291
  }
173
292
  /**
174
- * Retrieves notes based on the provided filter criteria.
293
+ * Commits in memory job data to persistent storage.
175
294
  *
176
- * This method queries both active and optionally nullified notes based on the filter
177
- * parameters.
295
+ * Called by JobCoordinator when a job completes successfully.
178
296
  *
179
- * @param filter - Filter criteria including contractAddress (required), and optional
180
- * owner, storageSlot, status, scopes, and siloedNullifier.
181
- * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
182
- * returned once if this is the case)
183
- * @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
184
- */ async getNotes(filter) {
185
- filter.status = filter.status ?? NoteStatus.ACTIVE;
186
- // throw early if scopes is an empty array
187
- if (filter.scopes !== undefined && filter.scopes.length === 0) {
188
- throw new Error('Trying to get notes with an empty scopes array. Scopes have to be set to undefined if intending on not filtering by scopes.');
189
- }
190
- const candidateNoteSources = [];
191
- filter.scopes ??= (await toArray(this.#scopes.keysAsync())).map((addressString)=>AztecAddress.fromString(addressString));
192
- const activeNoteIdsPerScope = [];
193
- for (const scope of new Set(filter.scopes)){
194
- const formattedScopeString = scope.toString();
195
- if (!await this.#scopes.hasAsync(formattedScopeString)) {
196
- throw new Error('Trying to get incoming notes of a scope that is not in the PXE database');
197
- }
198
- activeNoteIdsPerScope.push(filter.storageSlot ? await toArray(this.#notesByStorageSlotAndScope.get(formattedScopeString).getValuesAsync(filter.storageSlot.toString())) : await toArray(this.#notesByContractAndScope.get(formattedScopeString).getValuesAsync(filter.contractAddress.toString())));
199
- }
200
- candidateNoteSources.push({
201
- ids: new Set(activeNoteIdsPerScope.flat()),
202
- notes: this.#notes
203
- });
204
- // If status is ACTIVE_OR_NULLIFIED we add nullified notes as candidates on top of the default active ones.
205
- if (filter.status === NoteStatus.ACTIVE_OR_NULLIFIED) {
206
- const nullifiedIds = filter.storageSlot ? await toArray(this.#nullifiedNotesByStorageSlot.getValuesAsync(filter.storageSlot.toString())) : await toArray(this.#nullifiedNotesByContract.getValuesAsync(filter.contractAddress.toString()));
207
- const setOfScopes = new Set(filter.scopes.map((s)=>s.toString()));
208
- const filteredNullifiedIds = new Set();
209
- for (const noteId of nullifiedIds){
210
- const scopeList = await toArray(this.#nullifiedNotesToScope.getValuesAsync(noteId));
211
- if (scopeList.some((scope)=>setOfScopes.has(scope))) {
212
- filteredNullifiedIds.add(noteId);
213
- }
214
- }
215
- if (filteredNullifiedIds.size > 0) {
216
- candidateNoteSources.push({
217
- ids: filteredNullifiedIds,
218
- notes: this.#nullifiedNotes
219
- });
297
+ * Note: JobCoordinator wraps all commits in a single transaction, so we don't need our own transactionAsync here
298
+ * (and using one would throw on IndexedDB as it does not support nested txs).
299
+ *
300
+ * @param jobId - The jobId identifying which staged data to commit
301
+ */ async commit(jobId) {
302
+ for (const [nullifier, storedNote] of this.#getNotesForJob(jobId)){
303
+ await this.#notes.set(nullifier, storedNote.toBuffer());
304
+ await this.#nullifiersByContractAddress.set(storedNote.noteDao.contractAddress.toString(), nullifier);
305
+ if (storedNote.nullifiedAt !== undefined) {
306
+ await this.#nullifiersByNullificationBlockNumber.set(storedNote.nullifiedAt, nullifier);
220
307
  }
221
308
  }
222
- const result = [];
223
- for (const { ids, notes } of candidateNoteSources){
224
- for (const id of ids){
225
- const serializedNote = await notes.getAsync(id);
226
- if (!serializedNote) {
227
- continue;
228
- }
229
- const note = NoteDao.fromBuffer(serializedNote);
230
- if (!note.contractAddress.equals(filter.contractAddress)) {
231
- continue;
232
- }
233
- if (filter.owner && !note.owner.equals(filter.owner)) {
234
- continue;
235
- }
236
- if (filter.storageSlot && !note.storageSlot.equals(filter.storageSlot)) {
237
- continue;
238
- }
239
- if (filter.siloedNullifier && !note.siloedNullifier.equals(filter.siloedNullifier)) {
240
- continue;
241
- }
242
- result.push(note);
243
- }
309
+ this.#clearJobData(jobId);
310
+ }
311
+ discardStaged(jobId) {
312
+ this.#clearJobData(jobId);
313
+ return Promise.resolve();
314
+ }
315
+ #clearJobData(jobId) {
316
+ this.#notesForJob.delete(jobId);
317
+ this.#jobLocks.delete(jobId);
318
+ }
319
+ /**
320
+ * Functions run withJobLock are forced to wait for each other, i.e. if they share a `jobId`, they run serially
321
+ * instead of concurrently. This is needed because staged data is stored in memory, and concurrent async operations
322
+ * (e.g., Promise.all in `validateAndStoreNote`) could otherwise interleave and corrupt state.
323
+ */ async #withJobLock(jobId, fn) {
324
+ let lock = this.#jobLocks.get(jobId);
325
+ if (!lock) {
326
+ lock = new Semaphore(1);
327
+ this.#jobLocks.set(jobId, lock);
244
328
  }
245
- // A note might be present in multiple scopes - we ensure it is only returned once
246
- const deduplicated = [];
247
- for (const note of result){
248
- if (!deduplicated.some((existing)=>existing.equals(note))) {
249
- deduplicated.push(note);
250
- }
329
+ await lock.acquire();
330
+ try {
331
+ return await fn();
332
+ } finally{
333
+ lock.release();
251
334
  }
252
- // Sort by block number, then by tx index within block, then by note index within tx
253
- deduplicated.sort((a, b)=>{
254
- if (a.l2BlockNumber !== b.l2BlockNumber) {
255
- return a.l2BlockNumber - b.l2BlockNumber;
256
- }
257
- if (a.txIndexInBlock !== b.txIndexInBlock) {
258
- return a.txIndexInBlock - b.txIndexInBlock;
259
- }
260
- return a.noteIndexInTx - b.noteIndexInTx;
261
- });
262
- return deduplicated;
263
335
  }
264
- /**
265
- * Transitions notes from "active" to "nullified" state.
266
- *
267
- * This operation processes a batch of nullifiers to mark the corresponding notes
268
- * as spent/nullified. The operation is atomic - if any nullifier is not found,
269
- * the entire operation fails and no notes are modified.
270
- *
271
- * @param nullifiers - Array of nullifiers with their block numbers to process
272
- * @returns Promise resolving to array of nullified NoteDao objects
273
- * @throws Error if any nullifier is not found in the active notes
274
- */ applyNullifiers(nullifiers) {
275
- if (nullifiers.length === 0) {
276
- return Promise.resolve([]);
336
+ #getNotesForJob(jobId) {
337
+ let notesForJob = this.#notesForJob.get(jobId);
338
+ if (!notesForJob) {
339
+ notesForJob = new Map();
340
+ this.#notesForJob.set(jobId, notesForJob);
277
341
  }
278
- return this.#store.transactionAsync(async ()=>{
279
- const nullifiedNotes = [];
280
- for (const blockScopedNullifier of nullifiers){
281
- const { data: nullifier, l2BlockNumber: blockNumber } = blockScopedNullifier;
282
- const noteId = nullifier.toString();
283
- const noteBuffer = await this.#notes.getAsync(noteId);
284
- if (!noteBuffer) {
285
- // Check if already nullified (noteId === siloedNullifier, so we can check #nullifiedNotes directly)
286
- if (await this.#nullifiedNotes.hasAsync(noteId)) {
287
- throw new Error(`Nullifier already applied in applyNullifiers`);
288
- }
289
- throw new Error('Nullifier not found in applyNullifiers');
290
- }
291
- const noteScopes = await toArray(this.#notesToScope.getValuesAsync(noteId));
292
- if (noteScopes.length === 0) {
293
- // We should never run into this error because notes always have a scope assigned to them - either on initial
294
- // insertion via `addNotes` or when removing their nullifiers.
295
- throw new Error('Note scopes are missing in applyNullifiers');
296
- }
297
- const note = NoteDao.fromBuffer(noteBuffer);
298
- nullifiedNotes.push(note);
299
- await this.#notes.delete(noteId);
300
- await this.#notesToScope.delete(noteId);
301
- const scopes = await toArray(this.#scopes.keysAsync());
302
- for (const scope of scopes){
303
- await this.#notesByContractAndScope.get(scope).deleteValue(note.contractAddress.toString(), noteId);
304
- await this.#notesByStorageSlotAndScope.get(scope).deleteValue(note.storageSlot.toString(), noteId);
305
- }
306
- for (const scope of noteScopes){
307
- await this.#nullifiedNotesToScope.set(noteId, scope);
308
- }
309
- await this.#nullifiedNotes.set(noteId, note.toBuffer());
310
- await this.#nullifiersByBlockNumber.set(blockNumber, noteId);
311
- await this.#nullifiedNotesByContract.set(note.contractAddress.toString(), noteId);
312
- await this.#nullifiedNotesByStorageSlot.set(note.storageSlot.toString(), noteId);
313
- }
314
- return nullifiedNotes;
315
- });
342
+ return notesForJob;
316
343
  }
317
344
  }
@@ -0,0 +1,16 @@
1
+ import { BlockNumber } from '@aztec/foundation/branded-types';
2
+ import { NoteDao } from '@aztec/stdlib/note';
3
+ export declare class StoredNote {
4
+ readonly noteDao: NoteDao;
5
+ readonly scopes: Set<string>;
6
+ private _nullifiedAt;
7
+ constructor(noteDao: NoteDao, scopes: Set<string>, _nullifiedAt?: BlockNumber | undefined);
8
+ static fromBuffer(buffer: Buffer): StoredNote;
9
+ toBuffer(): Buffer;
10
+ addScope(scope: string): void;
11
+ markAsNullified(blockNumber: BlockNumber): void;
12
+ markAsActive(): void;
13
+ isNullified(): boolean;
14
+ get nullifiedAt(): BlockNumber | undefined;
15
+ }
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmVkX25vdGUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL25vdGVfc3RvcmUvc3RvcmVkX25vdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRTlELE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUU3QyxxQkFBYSxVQUFVO0lBRW5CLFFBQVEsQ0FBQyxPQUFPLEVBQUUsT0FBTztJQUN6QixRQUFRLENBQUMsTUFBTSxFQUFFLEdBQUcsQ0FBQyxNQUFNLENBQUM7SUFDNUIsT0FBTyxDQUFDLFlBQVk7SUFIdEIsWUFDVyxPQUFPLEVBQUUsT0FBTyxFQUNoQixNQUFNLEVBQUUsR0FBRyxDQUFDLE1BQU0sQ0FBQyxFQUNwQixZQUFZLEdBQUUsV0FBVyxHQUFHLFNBQXFCLEVBQ3ZEO0lBRUosTUFBTSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUUsTUFBTSxjQVUvQjtJQUVELFFBQVEsSUFBSSxNQUFNLENBR2pCO0lBRUQsUUFBUSxDQUFDLEtBQUssRUFBRSxNQUFNLFFBRXJCO0lBRUQsZUFBZSxDQUFDLFdBQVcsRUFBRSxXQUFXLFFBRXZDO0lBRUQsWUFBWSxTQUVYO0lBRUQsV0FBVyxZQUVWO0lBRUQsSUFBSSxXQUFXLDRCQUVkO0NBQ0YifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stored_note.d.ts","sourceRoot":"","sources":["../../../src/storage/note_store/stored_note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,qBAAa,UAAU;IAEnB,QAAQ,CAAC,OAAO,EAAE,OAAO;IACzB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC;IAC5B,OAAO,CAAC,YAAY;IAHtB,YACW,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,EACpB,YAAY,GAAE,WAAW,GAAG,SAAqB,EACvD;IAEJ,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,cAU/B;IAED,QAAQ,IAAI,MAAM,CAGjB;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,QAErB;IAED,eAAe,CAAC,WAAW,EAAE,WAAW,QAEvC;IAED,YAAY,SAEX;IAED,WAAW,YAEV;IAED,IAAI,WAAW,4BAEd;CACF"}