@aztec/pxe 0.0.1-commit.d1f2d6c → 0.0.1-commit.d431d1c

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 (100) hide show
  1. package/dest/block_synchronizer/block_synchronizer.d.ts +4 -6
  2. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  3. package/dest/block_synchronizer/block_synchronizer.js +11 -51
  4. package/dest/config/index.d.ts +1 -3
  5. package/dest/config/index.d.ts.map +1 -1
  6. package/dest/config/index.js +0 -17
  7. package/dest/contract_function_simulator/contract_function_simulator.d.ts +1 -1
  8. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  9. package/dest/contract_function_simulator/contract_function_simulator.js +4 -1
  10. package/dest/contract_function_simulator/oracle/interfaces.d.ts +4 -7
  11. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  12. package/dest/contract_function_simulator/oracle/oracle.d.ts +2 -4
  13. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/oracle/oracle.js +9 -19
  15. package/dest/contract_function_simulator/oracle/private_execution.d.ts +6 -5
  16. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/oracle/private_execution.js +1 -10
  18. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +1 -9
  19. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +5 -17
  21. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +6 -14
  22. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +33 -31
  24. package/dest/debug/pxe_debug_utils.d.ts +1 -1
  25. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  26. package/dest/debug/pxe_debug_utils.js +1 -2
  27. package/dest/logs/log_service.d.ts +1 -1
  28. package/dest/logs/log_service.d.ts.map +1 -1
  29. package/dest/logs/log_service.js +11 -18
  30. package/dest/notes/note_service.d.ts +2 -3
  31. package/dest/notes/note_service.d.ts.map +1 -1
  32. package/dest/notes/note_service.js +6 -8
  33. package/dest/oracle_version.d.ts +3 -3
  34. package/dest/oracle_version.d.ts.map +1 -1
  35. package/dest/oracle_version.js +3 -4
  36. package/dest/pxe.d.ts +1 -1
  37. package/dest/pxe.d.ts.map +1 -1
  38. package/dest/pxe.js +7 -10
  39. package/dest/storage/note_store/note_store.d.ts +55 -43
  40. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  41. package/dest/storage/note_store/note_store.js +252 -238
  42. package/dest/storage/private_event_store/private_event_store.d.ts +4 -17
  43. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  44. package/dest/storage/private_event_store/private_event_store.js +135 -163
  45. package/dest/tagging/index.d.ts +1 -2
  46. package/dest/tagging/index.d.ts.map +1 -1
  47. package/dest/tagging/index.js +0 -1
  48. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +2 -3
  49. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  50. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +2 -2
  51. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +2 -3
  52. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  53. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +2 -5
  54. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +2 -3
  55. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  56. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +2 -2
  57. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
  58. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  59. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +8 -5
  60. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +2 -3
  61. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  62. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +4 -7
  63. package/dest/tree_membership/tree_membership_service.d.ts +50 -0
  64. package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
  65. package/dest/tree_membership/tree_membership_service.js +75 -0
  66. package/package.json +16 -16
  67. package/src/block_synchronizer/block_synchronizer.ts +14 -53
  68. package/src/config/index.ts +0 -14
  69. package/src/contract_function_simulator/contract_function_simulator.ts +9 -1
  70. package/src/contract_function_simulator/oracle/interfaces.ts +3 -12
  71. package/src/contract_function_simulator/oracle/oracle.ts +13 -26
  72. package/src/contract_function_simulator/oracle/private_execution.ts +1 -20
  73. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +6 -33
  74. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +38 -46
  75. package/src/debug/pxe_debug_utils.ts +1 -2
  76. package/src/logs/log_service.ts +8 -25
  77. package/src/notes/note_service.ts +11 -15
  78. package/src/oracle_version.ts +3 -4
  79. package/src/pxe.ts +8 -32
  80. package/src/storage/note_store/note_store.ts +313 -279
  81. package/src/storage/private_event_store/private_event_store.ts +175 -214
  82. package/src/tagging/index.ts +0 -1
  83. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +1 -11
  84. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +1 -7
  85. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +1 -3
  86. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +17 -5
  87. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +3 -12
  88. package/src/tree_membership/tree_membership_service.ts +97 -0
  89. package/dest/storage/note_store/stored_note.d.ts +0 -16
  90. package/dest/storage/note_store/stored_note.d.ts.map +0 -1
  91. package/dest/storage/note_store/stored_note.js +0 -43
  92. package/dest/storage/private_event_store/stored_private_event.d.ts +0 -23
  93. package/dest/storage/private_event_store/stored_private_event.d.ts.map +0 -1
  94. package/dest/storage/private_event_store/stored_private_event.js +0 -56
  95. package/dest/tagging/get_all_logs_by_tags.d.ts +0 -24
  96. package/dest/tagging/get_all_logs_by_tags.d.ts.map +0 -1
  97. package/dest/tagging/get_all_logs_by_tags.js +0 -46
  98. package/src/storage/note_store/stored_note.ts +0 -48
  99. package/src/storage/private_event_store/stored_private_event.ts +0 -73
  100. package/src/tagging/get_all_logs_by_tags.ts +0 -68
@@ -1,303 +1,317 @@
1
1
  import { toArray } from '@aztec/foundation/iterable';
2
- import { Semaphore } from '@aztec/foundation/queue';
2
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
3
3
  import { NoteStatus } from '@aztec/stdlib/note';
4
- import { StoredNote } from './stored_note.js';
4
+ import { NoteDao } from '@aztec/stdlib/note';
5
5
  /**
6
6
  * NoteStore manages the storage and retrieval of notes.
7
7
  *
8
- * Notes can be active or nullified. This class processes new notes, nullifications, and performs rollback handling in
9
- * the case of a reorg.
8
+ * Notes can be active or nullified. This class processes new notes, nullifications,
9
+ * and performs rollback handling in the case of a reorg.
10
10
  **/ export class NoteStore {
11
- storeName = 'note';
12
11
  #store;
13
12
  // Note that we use the siloedNullifier as the note id in the store as it's guaranteed to be unique.
14
- // Main storage for notes. Avoid performing full scans on it as it contains all notes PXE knows, use
15
- // #nullifiersByContractAddress or #nullifiersByNullificationBlockNumber to find relevant note nullifiers that can be
16
- // used to read into this map instead.
17
- // nullifier => StoredNote (serialized)
18
- #notes;
19
- // Indexes which notes (via their nullifiers) belong to a contract. Used in `getNotes` to reduce the amount of notes
20
- // checked.
21
- // contract address => nullifier
22
- #nullifiersByContractAddress;
23
- // Groups note nullifiers by the block number they were added to the nullifier tree. Used in `rollback` to handle
24
- // re-orgs.
25
- // block number => nullifier (block number in which nullifier is included)
26
- #nullifiersByNullificationBlockNumber;
27
- // In-memory changes performed during a not-yet committed job. When `commit` is called with said job's id, these
28
- // changes are persisted in the DB maps specified above and cleared.
29
- // jobId => nullifier => StoredNote (serialized)
30
- #notesForJob;
31
- // Per job locks to prevent multiple concurrent writes to affect each other.
32
- // jobId => lock
33
- #jobLocks;
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;
34
23
  constructor(store){
35
24
  this.#store = store;
36
25
  this.#notes = store.openMap('notes');
37
- this.#nullifiersByContractAddress = store.openMultiMap('note_nullifiers_by_contract');
38
- this.#nullifiersByNullificationBlockNumber = store.openMultiMap('note_block_number_to_nullifier');
39
- this.#jobLocks = new Map();
40
- this.#notesForJob = new Map();
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();
41
35
  }
42
36
  /**
43
- * Adds multiple notes to the notes store under the specified scope.
37
+ * Creates and initializes a new NoteStore instance.
44
38
  *
45
- * Notes are stored using their siloedNullifier as the key, which provides uniqueness. Each note is indexed by
46
- * multiple criteria for efficient retrieval.
39
+ * This factory method creates a NoteStore and restores any existing
40
+ * scope-specific indexes from the database.
47
41
  *
48
- * @param notes - Notes to store
49
- * @param scope - The scope (user/account) under which to store the notes
50
- * @param jobId - The job context for staged writes
51
- */ addNotes(notes, scope, jobId) {
52
- return this.#withJobLock(jobId, ()=>Promise.all(notes.map((noteDao)=>this.#addNote(noteDao, scope, jobId))));
53
- }
54
- async #addNote(note, scope, jobId) {
55
- const noteForJob = await this.#readNote(note.siloedNullifier.toString(), jobId) ?? new StoredNote(note, new Set());
56
- // Make sure the note is linked to the scope and staged for this job
57
- noteForJob.addScope(scope.toString());
58
- this.#writeNote(noteForJob, jobId);
59
- }
60
- async #readNote(nullifier, jobId) {
61
- // First check staged notes for this job
62
- const noteForJob = this.#getNotesForJob(jobId).get(nullifier);
63
- if (noteForJob) {
64
- return noteForJob;
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`));
65
49
  }
66
- // Then check persistent storage
67
- const noteBuffer = await this.#notes.getAsync(nullifier);
68
- if (noteBuffer) {
69
- return StoredNote.fromBuffer(noteBuffer);
70
- }
71
- return undefined;
72
- }
73
- #writeNote(note, jobId) {
74
- this.#getNotesForJob(jobId).set(note.noteDao.siloedNullifier.toString(), note);
50
+ return pxeDB;
75
51
  }
76
52
  /**
77
- * Retrieves notes based on the provided filter criteria.
53
+ * Adds a new scope to the note data provider.
78
54
  *
79
- * This method queries both active and optionally nullified notes based on the filter parameters.
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.
80
57
  *
81
- * @param filter - Filter criteria including contractAddress (required), and optional owner,
82
- * storageSlot, status, scopes, and siloedNullifier.
83
- * @params jobId - the job context to read from.
84
- * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
85
- * returned once if this is the case)
86
- * @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
87
- */ async getNotes(filter, jobId) {
88
- if (filter.scopes !== undefined && filter.scopes.length === 0) {
89
- throw new Error('Trying to get notes with an empty scopes array');
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;
90
64
  }
91
- const targetStatus = filter.status ?? NoteStatus.ACTIVE;
92
- const foundNotes = new Map();
93
- const nullifiersOfContract = await this.#nullifiersOfContract(filter.contractAddress, jobId);
94
- for (const nullifier of nullifiersOfContract){
95
- const note = await this.#readNote(nullifier, jobId);
96
- // Defensive: hitting this case means we're mishandling contract indices or in-memory job data
97
- if (!note) {
98
- throw new Error('PXE note database is corrupted.');
99
- }
100
- // Apply filters
101
- if (targetStatus === NoteStatus.ACTIVE && note.isNullified()) {
102
- continue;
103
- }
104
- if (filter.owner && !note.noteDao.owner.equals(filter.owner)) {
105
- continue;
106
- }
107
- if (filter.storageSlot && !note.noteDao.storageSlot.equals(filter.storageSlot)) {
108
- continue;
109
- }
110
- if (filter.siloedNullifier && !note.noteDao.siloedNullifier.equals(filter.siloedNullifier)) {
111
- continue;
112
- }
113
- if (filter.scopes && note.scopes.intersection(new Set(filter.scopes.map((s)=>s.toString()))).size === 0) {
114
- continue;
115
- }
116
- foundNotes.set(note.noteDao.siloedNullifier.toString(), note.noteDao);
117
- }
118
- // Sort by block number, then by tx index within block, then by note index within tx
119
- return [
120
- ...foundNotes.values()
121
- ].sort((a, b)=>{
122
- if (a.l2BlockNumber !== b.l2BlockNumber) {
123
- return a.l2BlockNumber - b.l2BlockNumber;
124
- }
125
- if (a.txIndexInBlock !== b.txIndexInBlock) {
126
- return a.txIndexInBlock - b.txIndexInBlock;
127
- }
128
- return a.noteIndexInTx - b.noteIndexInTx;
129
- });
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;
130
69
  }
131
70
  /**
132
- * Transitions notes from "active" to "nullified" state.
71
+ * Adds multiple notes to the data provider under the specified scope.
133
72
  *
134
- * This operation processes a batch of nullifiers to mark the corresponding notes as spent/nullified.
135
- * The operation is atomic - if any nullifier is not found, the entire operation fails and no notes are modified.
73
+ * Notes are stored using their siloedNullifier as the key, which provides uniqueness. Each note is indexed
74
+ * by multiple criteria for efficient retrieval.
136
75
  *
137
- * applyNullifiers is idempotent: the same nullifier can be applied multiple times without error.
138
- * This relaxes constraints on usage of NoteService#storeNote, which can then be run concurrently in a Promise.all
139
- * context without risking unnecessarily defensive checks failing.
140
- *
141
- * @param nullifiers - Array of nullifiers with their block numbers to process
142
- * @param jobId - The job context for staged writes
143
- * @returns Array of NoteDao objects that were nullified
144
- * @throws Error if any nullifier is not found in this notes store
145
- */ applyNullifiers(nullifiers, jobId) {
146
- return this.#withJobLock(jobId, ()=>this.#store.transactionAsync(async ()=>{
147
- if (nullifiers.length === 0) {
148
- return [];
149
- }
150
- const notesToNullify = await Promise.all(nullifiers.map(async (nullifierInBlock)=>{
151
- const nullifier = nullifierInBlock.data.toString();
152
- const storedNote = await this.#readNote(nullifier, jobId);
153
- if (!storedNote) {
154
- throw new Error(`Attempted to mark a note as nullified which does not exist in PXE DB`);
155
- }
156
- return {
157
- storedNote: await this.#readNote(nullifier, jobId),
158
- blockNumber: nullifierInBlock.l2BlockNumber
159
- };
160
- }));
161
- const notesNullifiedInThisCall = new Map();
162
- for (const noteToNullify of notesToNullify){
163
- // Safe to coerce (!) because we throw if we find any undefined above
164
- const note = noteToNullify.storedNote;
165
- // Skip already nullified notes
166
- if (note.isNullified()) {
167
- continue;
168
- }
169
- note.markAsNullified(noteToNullify.blockNumber);
170
- this.#writeNote(note, jobId);
171
- notesNullifiedInThisCall.set(note.noteDao.siloedNullifier.toString(), note.noteDao);
172
- }
173
- return [
174
- ...notesNullifiedInThisCall.values()
175
- ];
176
- }));
76
+ * @param notes - Notes to store
77
+ * @param scope - The scope (user/account) under which to store the notes
78
+ */ addNotes(notes, scope) {
79
+ return this.#store.transactionAsync(async ()=>{
80
+ if (!await this.#scopes.hasAsync(scope.toString())) {
81
+ await this.addScope(scope);
82
+ }
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);
89
+ }
90
+ });
177
91
  }
178
92
  /**
179
93
  * Synchronizes notes and nullifiers to a specific block number.
180
94
  *
181
- * This method ensures that the state of notes and nullifiers is consistent with the specified block number.
182
- * It restores any notes that were nullified after the given block and deletes any active notes created after that
183
- * block.
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.
184
98
  *
185
99
  * IMPORTANT: This method must be called within a transaction to ensure atomicity.
186
100
  *
187
101
  * @param blockNumber - The new chain tip after a reorg
188
102
  * @param synchedBlockNumber - The block number up to which PXE managed to sync before the reorg happened.
189
103
  */ async rollback(blockNumber, synchedBlockNumber) {
190
- if (this.#notesForJob.size > 0) {
191
- throw new Error('PXE note store rollback is not allowed while jobs are running');
192
- }
193
- await this.#rewindNullifiedNotesAfterBlock(blockNumber, synchedBlockNumber);
104
+ await this.#rewindNullifiersAfterBlock(blockNumber, synchedBlockNumber);
194
105
  await this.#deleteActiveNotesAfterBlock(blockNumber);
195
106
  }
196
107
  /**
197
- * Deletes (removes) all notes created after the specified block number.
108
+ * Deletes (removes) all active notes created after the specified block number.
198
109
  *
199
- * Permanently delete notes from the notes store, e.g. during a reorg.
110
+ * Permanently delete notes from the active notes store, e.g. during a reorg.
111
+ * Note: This only affects #notes (active notes), not #nullifiedNotes.
200
112
  *
201
113
  * @param blockNumber - Notes created after this block number will be deleted
202
114
  */ async #deleteActiveNotesAfterBlock(blockNumber) {
203
115
  const notes = await toArray(this.#notes.valuesAsync());
204
- for (const noteBuffer of notes){
205
- const storedNote = StoredNote.fromBuffer(noteBuffer);
206
- if (storedNote.noteDao.l2BlockNumber > blockNumber) {
207
- const noteNullifier = storedNote.noteDao.siloedNullifier.toString();
208
- await this.#notes.delete(noteNullifier);
209
- await this.#nullifiersByContractAddress.deleteValue(storedNote.noteDao.contractAddress.toString(), noteNullifier);
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
+ }
210
127
  }
211
128
  }
212
129
  }
213
130
  /**
214
131
  * Rewinds nullifications after a given block number.
215
132
  *
216
- * This operation "un-nullifies" notes, rolling back nullifications that occurred in orphaned blocks, e.g. during a
217
- * reorg.
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.
218
136
  *
219
137
  * @param blockNumber - Revert nullifications that occurred after this block
220
- * @param anchorBlockNumber - Upper bound for the block range to process
221
- */ async #rewindNullifiedNotesAfterBlock(blockNumber, anchorBlockNumber) {
138
+ * @param synchedBlockNumber - Upper bound for the block range to process
139
+ */ async #rewindNullifiersAfterBlock(blockNumber, synchedBlockNumber) {
140
+ const noteIdsToReinsert = [];
222
141
  const currentBlockNumber = blockNumber + 1;
223
- for(let i = currentBlockNumber; i <= anchorBlockNumber; i++){
224
- const noteNullifiersToReinsert = await toArray(this.#nullifiersByNullificationBlockNumber.getValuesAsync(i));
225
- const nullifiedNoteBuffers = await Promise.all(noteNullifiersToReinsert.map(async (noteNullifier)=>{
226
- const note = await this.#notes.getAsync(noteNullifier);
227
- if (!note) {
228
- throw new Error(`PXE DB integrity error: no note found with nullifier ${noteNullifier}`);
229
- }
230
- return note;
231
- }));
232
- const storedNotes = nullifiedNoteBuffers.map((buffer)=>StoredNote.fromBuffer(buffer));
233
- for (const storedNote of storedNotes){
234
- const noteNullifier = storedNote.noteDao.siloedNullifier.toString();
235
- const scopes = storedNote.scopes;
236
- if (scopes.size === 0) {
237
- // We should never run into this error because notes always have a scope assigned to them - either on initial
238
- // insertion via `addNotes` or when removing their nullifiers.
239
- throw new Error(`No scopes found for nullified note with nullifier ${noteNullifier}`);
240
- }
241
- storedNote.markAsActive();
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}`);
155
+ }
156
+ for (const scope of scopes){
242
157
  await Promise.all([
243
- this.#notes.set(noteNullifier, storedNote.toBuffer()),
244
- this.#nullifiersByNullificationBlockNumber.deleteValue(i, noteNullifier)
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)
245
161
  ]);
246
162
  }
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
+ ]);
247
171
  }
248
172
  }
249
- commit(jobId) {
250
- return this.#withJobLock(jobId, async ()=>{
251
- for (const [nullifier, storedNote] of this.#getNotesForJob(jobId)){
252
- await this.#notes.set(nullifier, storedNote.toBuffer());
253
- await this.#nullifiersByContractAddress.set(storedNote.noteDao.contractAddress.toString(), nullifier);
254
- if (storedNote.nullifiedAt !== undefined) {
255
- await this.#nullifiersByNullificationBlockNumber.set(storedNote.nullifiedAt, nullifier);
256
- }
173
+ /**
174
+ * Retrieves notes based on the provided filter criteria.
175
+ *
176
+ * This method queries both active and optionally nullified notes based on the filter
177
+ * parameters.
178
+ *
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');
257
197
  }
258
- this.#clearJobData(jobId);
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
259
203
  });
260
- }
261
- discardStaged(jobId) {
262
- return this.#withJobLock(jobId, ()=>Promise.resolve(this.#clearJobData(jobId)));
263
- }
264
- #clearJobData(jobId) {
265
- this.#notesForJob.delete(jobId);
266
- this.#jobLocks.delete(jobId);
267
- }
268
- /**
269
- * Functions run withJobLock are forced to wait for each other, i.e. if they share a `jobId`, they run serially
270
- * instead of concurrently. This is needed because staged data is stored in memory, and concurrent async operations
271
- * (e.g., Promise.all in `storeNote`) could otherwise interleave and corrupt state.
272
- */ async #withJobLock(jobId, fn) {
273
- let lock = this.#jobLocks.get(jobId);
274
- if (!lock) {
275
- lock = new Semaphore(1);
276
- this.#jobLocks.set(jobId, lock);
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
+ });
220
+ }
277
221
  }
278
- await lock.acquire();
279
- try {
280
- return await fn();
281
- } finally{
282
- lock.release();
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
+ }
283
244
  }
284
- }
285
- #getNotesForJob(jobId) {
286
- let notesForJob = this.#notesForJob.get(jobId);
287
- if (!notesForJob) {
288
- notesForJob = new Map();
289
- this.#notesForJob.set(jobId, notesForJob);
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
+ }
290
251
  }
291
- return notesForJob;
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;
292
263
  }
293
- async #nullifiersOfContract(contractAddress, jobId) {
294
- // Collect persisted nullifiers for this contract
295
- const persistedNullifiers = await toArray(this.#nullifiersByContractAddress.getValuesAsync(contractAddress.toString()));
296
- // Collect staged nullifiers from the job where the note's contract matches
297
- const stagedNullifiers = this.#getNotesForJob(jobId).values().filter((storedNote)=>storedNote.noteDao.contractAddress.equals(contractAddress)).map((storedNote)=>storedNote.noteDao.siloedNullifier.toString());
298
- return new Set([
299
- ...persistedNullifiers,
300
- ...stagedNullifiers
301
- ]);
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([]);
277
+ }
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
+ });
302
316
  }
303
317
  }
@@ -2,7 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
3
  import type { EventSelector } from '@aztec/stdlib/abi';
4
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { InTx, TxHash } from '@aztec/stdlib/tx';
5
+ import { type InTx, TxHash } from '@aztec/stdlib/tx';
6
6
  import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
7
7
  import type { PackedPrivateEvent } from '../../pxe.js';
8
8
  export type PrivateEventStoreFilter = {
@@ -28,6 +28,8 @@ export declare class PrivateEventStore implements StagedStore {
28
28
  readonly storeName: string;
29
29
  logger: import("@aztec/foundation/log").Logger;
30
30
  constructor(store: AztecAsyncKVStore);
31
+ commit(jobId: string): Promise<void>;
32
+ discardStaged(jobId: string): Promise<void>;
31
33
  /**
32
34
  * Store a private event log.
33
35
  * @param eventSelector - The event selector of the event.
@@ -71,21 +73,6 @@ export declare class PrivateEventStore implements StagedStore {
71
73
  * IMPORTANT: This method must be called within a transaction to ensure atomicity.
72
74
  */
73
75
  rollback(blockNumber: number, synchedBlockNumber: number): Promise<void>;
74
- /**
75
- * Commits in memory job data to persistent storage.
76
- *
77
- * Called by JobCoordinator when a job completes successfully.
78
- *
79
- * Note: JobCoordinator wraps all commits in a single transaction, so we don't need our own transactionAsync here
80
- * (and using one would throw on IndexedDB as it does not support nested txs).
81
- *
82
- * @param jobId - The jobId identifying which staged data to commit
83
- */
84
- commit(jobId: string): Promise<void>;
85
- /**
86
- * Discards in memory job data without persisting it.
87
- */
88
- discardStaged(jobId: string): Promise<void>;
89
76
  }
90
77
  export {};
91
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9ldmVudF9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvcHJpdmF0ZV9ldmVudF9zdG9yZS9wcml2YXRlX2V2ZW50X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUlwRCxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBcUMsTUFBTSxpQkFBaUIsQ0FBQztBQUM1RixPQUFPLEtBQUssRUFBRSxhQUFhLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUN2RCxPQUFPLE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{"version":3,"file":"private_event_store.d.ts","sourceRoot":"","sources":["../../../src/storage/private_event_store/private_event_store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,YAAY,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAgBF,KAAK,oBAAoB,GAAG,IAAI,GAAG;IACjC,eAAe,EAAE,YAAY,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,qBAAa,iBAAkB,YAAW,WAAW;;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAmB;IAe7C,MAAM,yCAAuC;IAE7C,YAAY,KAAK,EAAE,iBAAiB,EAQnC;IAMK,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAezC;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1C;IAoDD;;;;;;;;;;;OAWG;IACH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