@aztec/pxe 0.0.1-commit.0b941701 → 0.0.1-commit.0c875d939

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 (160) hide show
  1. package/dest/access_scopes.d.ts +9 -0
  2. package/dest/access_scopes.d.ts.map +1 -0
  3. package/dest/access_scopes.js +6 -0
  4. package/dest/block_synchronizer/block_synchronizer.d.ts +5 -3
  5. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  6. package/dest/block_synchronizer/block_synchronizer.js +11 -5
  7. package/dest/contract_function_simulator/contract_function_simulator.d.ts +54 -30
  8. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  9. package/dest/contract_function_simulator/contract_function_simulator.js +169 -65
  10. package/dest/contract_function_simulator/oracle/interfaces.d.ts +10 -10
  11. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  12. package/dest/contract_function_simulator/oracle/oracle.d.ts +5 -5
  13. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/oracle/oracle.js +38 -26
  15. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +36 -36
  16. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +74 -21
  18. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +53 -29
  19. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +85 -61
  21. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  22. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  23. package/dest/contract_sync/contract_sync_service.js +97 -0
  24. package/dest/contract_sync/helpers.d.ts +29 -0
  25. package/dest/contract_sync/helpers.d.ts.map +1 -0
  26. package/dest/contract_sync/{index.js → helpers.js} +13 -12
  27. package/dest/debug/pxe_debug_utils.d.ts +24 -10
  28. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  29. package/dest/debug/pxe_debug_utils.js +28 -18
  30. package/dest/entrypoints/client/bundle/index.d.ts +3 -1
  31. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  32. package/dest/entrypoints/client/bundle/index.js +2 -0
  33. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  34. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  35. package/dest/entrypoints/client/bundle/utils.js +21 -7
  36. package/dest/entrypoints/client/lazy/index.d.ts +3 -1
  37. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  38. package/dest/entrypoints/client/lazy/index.js +2 -0
  39. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  40. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  41. package/dest/entrypoints/client/lazy/utils.js +22 -8
  42. package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
  43. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  44. package/dest/entrypoints/server/index.d.ts +4 -2
  45. package/dest/entrypoints/server/index.d.ts.map +1 -1
  46. package/dest/entrypoints/server/index.js +3 -1
  47. package/dest/entrypoints/server/utils.d.ts +1 -1
  48. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  49. package/dest/entrypoints/server/utils.js +28 -9
  50. package/dest/events/event_service.d.ts +4 -5
  51. package/dest/events/event_service.d.ts.map +1 -1
  52. package/dest/events/event_service.js +5 -6
  53. package/dest/job_coordinator/job_coordinator.d.ts +3 -2
  54. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
  55. package/dest/job_coordinator/job_coordinator.js +3 -2
  56. package/dest/logs/log_service.d.ts +7 -5
  57. package/dest/logs/log_service.d.ts.map +1 -1
  58. package/dest/logs/log_service.js +15 -25
  59. package/dest/notes/note_service.d.ts +7 -7
  60. package/dest/notes/note_service.d.ts.map +1 -1
  61. package/dest/notes/note_service.js +9 -9
  62. package/dest/notes_filter.d.ts +25 -0
  63. package/dest/notes_filter.d.ts.map +1 -0
  64. package/dest/notes_filter.js +4 -0
  65. package/dest/oracle_version.d.ts +3 -3
  66. package/dest/oracle_version.d.ts.map +1 -1
  67. package/dest/oracle_version.js +2 -2
  68. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  69. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  70. package/dest/private_kernel/private_kernel_execution_prover.js +2 -2
  71. package/dest/private_kernel/private_kernel_oracle.d.ts +3 -3
  72. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  73. package/dest/pxe.d.ts +69 -23
  74. package/dest/pxe.d.ts.map +1 -1
  75. package/dest/pxe.js +76 -46
  76. package/dest/storage/address_store/address_store.d.ts +1 -1
  77. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  78. package/dest/storage/address_store/address_store.js +12 -11
  79. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  80. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  81. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  82. package/dest/storage/capsule_store/capsule_store.js +6 -8
  83. package/dest/storage/contract_store/contract_store.d.ts +1 -1
  84. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  85. package/dest/storage/contract_store/contract_store.js +27 -18
  86. package/dest/storage/metadata.d.ts +1 -1
  87. package/dest/storage/metadata.js +1 -1
  88. package/dest/storage/note_store/note_store.d.ts +13 -3
  89. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  90. package/dest/storage/note_store/note_store.js +147 -107
  91. package/dest/storage/private_event_store/private_event_store.d.ts +1 -1
  92. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  93. package/dest/storage/private_event_store/private_event_store.js +84 -61
  94. package/dest/storage/private_event_store/stored_private_event.d.ts +4 -4
  95. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -1
  96. package/dest/storage/private_event_store/stored_private_event.js +2 -2
  97. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +1 -1
  98. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  99. package/dest/storage/tagging_store/recipient_tagging_store.js +31 -19
  100. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  101. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  102. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  103. package/dest/storage/tagging_store/sender_tagging_store.d.ts +1 -1
  104. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  105. package/dest/storage/tagging_store/sender_tagging_store.js +183 -113
  106. package/dest/tagging/get_all_logs_by_tags.d.ts +4 -4
  107. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
  108. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -3
  109. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  110. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -3
  111. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  112. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -3
  113. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  114. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +3 -3
  115. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  116. package/package.json +25 -16
  117. package/src/access_scopes.ts +9 -0
  118. package/src/block_synchronizer/block_synchronizer.ts +23 -19
  119. package/src/contract_function_simulator/contract_function_simulator.ts +317 -120
  120. package/src/contract_function_simulator/oracle/interfaces.ts +12 -12
  121. package/src/contract_function_simulator/oracle/oracle.ts +41 -24
  122. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +97 -101
  123. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +137 -69
  124. package/src/contract_sync/contract_sync_service.ts +152 -0
  125. package/src/contract_sync/{index.ts → helpers.ts} +21 -21
  126. package/src/debug/pxe_debug_utils.ts +63 -19
  127. package/src/entrypoints/client/bundle/index.ts +2 -0
  128. package/src/entrypoints/client/bundle/utils.ts +16 -15
  129. package/src/entrypoints/client/lazy/index.ts +2 -0
  130. package/src/entrypoints/client/lazy/utils.ts +17 -15
  131. package/src/entrypoints/pxe_creation_options.ts +2 -1
  132. package/src/entrypoints/server/index.ts +3 -1
  133. package/src/entrypoints/server/utils.ts +22 -26
  134. package/src/events/event_service.ts +4 -6
  135. package/src/job_coordinator/job_coordinator.ts +4 -3
  136. package/src/logs/log_service.ts +20 -32
  137. package/src/notes/note_service.ts +9 -10
  138. package/src/notes_filter.ts +26 -0
  139. package/src/oracle_version.ts +2 -2
  140. package/src/private_kernel/private_kernel_execution_prover.ts +6 -3
  141. package/src/private_kernel/private_kernel_oracle.ts +2 -2
  142. package/src/pxe.ts +164 -92
  143. package/src/storage/address_store/address_store.ts +15 -15
  144. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  145. package/src/storage/capsule_store/capsule_store.ts +8 -8
  146. package/src/storage/contract_store/contract_store.ts +26 -15
  147. package/src/storage/metadata.ts +1 -1
  148. package/src/storage/note_store/note_store.ts +169 -132
  149. package/src/storage/private_event_store/private_event_store.ts +102 -81
  150. package/src/storage/private_event_store/stored_private_event.ts +3 -3
  151. package/src/storage/tagging_store/recipient_tagging_store.ts +31 -21
  152. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  153. package/src/storage/tagging_store/sender_tagging_store.ts +210 -126
  154. package/src/tagging/get_all_logs_by_tags.ts +3 -3
  155. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +2 -2
  156. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +2 -2
  157. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +2 -2
  158. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +3 -3
  159. package/dest/contract_sync/index.d.ts +0 -23
  160. package/dest/contract_sync/index.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"contract_store.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_store/contract_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEhB,KAAK,gCAAgC,EACrC,YAAY,EACZ,KAAK,qBAAqB,EAC1B,gBAAgB,EAMjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAGjC,MAAM,wBAAwB,CAAC;AAIhC;;;;;;GAMG;AACH,qBAAa,aAAa;;IAWxB,YAAY,KAAK,EAAE,iBAAiB,EAGnC;IAIY,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBlF;IAEK,mBAAmB,CAAC,QAAQ,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAO9E;IA4CK,qBAAqB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAGrD;IAED,4EAA4E;IAC/D,mBAAmB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAGhH;IAEY,mBAAmB,CAAC,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAI3F;IAED,0EAA0E;IAC7D,gBAAgB,CAAC,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,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@
1
1
  import { toArray } from '@aztec/foundation/iterable';
2
- import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
2
+ import { FunctionCall, FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
3
3
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
5
5
  import { PrivateFunctionsTree } from './private_functions_tree.js';
@@ -13,20 +13,23 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
13
13
  /** Map from contract class id to private function tree. */ // TODO: Update it to be LRU cache so that it doesn't keep all the data all the time.
14
14
  #privateFunctionTrees = new Map();
15
15
  /** Map from contract address to contract class id */ #contractClassIdMap = new Map();
16
+ #store;
16
17
  #contractArtifacts;
17
18
  #contractInstances;
18
19
  constructor(store){
20
+ this.#store = store;
19
21
  this.#contractArtifacts = store.openMap('contract_artifacts');
20
22
  this.#contractInstances = store.openMap('contracts_instances');
21
23
  }
22
24
  // Setters
23
25
  async addContractArtifact(id, contract) {
26
+ // Validation outside transactionAsync - these are not DB operations
24
27
  const privateFunctions = contract.functions.filter((functionArtifact)=>functionArtifact.functionType === FunctionType.PRIVATE);
25
28
  const privateSelectors = await Promise.all(privateFunctions.map(async (privateFunctionArtifact)=>(await FunctionSelector.fromNameAndParameters(privateFunctionArtifact.name, privateFunctionArtifact.parameters)).toString()));
26
29
  if (privateSelectors.length !== new Set(privateSelectors).size) {
27
30
  throw new Error('Repeated function selectors of private functions');
28
31
  }
29
- await this.#contractArtifacts.set(id.toString(), contractArtifactToBuffer(contract));
32
+ await this.#store.transactionAsync(()=>this.#contractArtifacts.set(id.toString(), contractArtifactToBuffer(contract)));
30
33
  }
31
34
  async addContractInstance(contract) {
32
35
  this.#contractClassIdMap.set(contract.address.toString(), contract.currentContractClassId);
@@ -68,18 +71,24 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
68
71
  return contractClassId && this.getContractArtifact(contractClassId);
69
72
  }
70
73
  // Public getters
71
- async getContractsAddresses() {
72
- const keys = await toArray(this.#contractInstances.keysAsync());
73
- return keys.map(AztecAddress.fromString);
74
- }
75
- /** Returns a contract instance for a given address. Throws if not found. */ async getContractInstance(contractAddress) {
76
- const contract = await this.#contractInstances.getAsync(contractAddress.toString());
77
- return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
78
- }
79
- async getContractArtifact(contractClassId) {
80
- const contract = await this.#contractArtifacts.getAsync(contractClassId.toString());
81
- // TODO(@spalladino): AztecAsyncMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from.
82
- return contract && contractArtifactFromBuffer(Buffer.from(contract));
74
+ getContractsAddresses() {
75
+ return this.#store.transactionAsync(async ()=>{
76
+ const keys = await toArray(this.#contractInstances.keysAsync());
77
+ return keys.map(AztecAddress.fromString);
78
+ });
79
+ }
80
+ /** Returns a contract instance for a given address. Throws if not found. */ getContractInstance(contractAddress) {
81
+ return this.#store.transactionAsync(async ()=>{
82
+ const contract = await this.#contractInstances.getAsync(contractAddress.toString());
83
+ return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
84
+ });
85
+ }
86
+ getContractArtifact(contractClassId) {
87
+ return this.#store.transactionAsync(async ()=>{
88
+ const contract = await this.#contractArtifacts.getAsync(contractClassId.toString());
89
+ // TODO(@spalladino): AztecAsyncMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from.
90
+ return contract && contractArtifactFromBuffer(Buffer.from(contract));
91
+ });
83
92
  }
84
93
  /** Returns a contract class for a given class id. Throws if not found. */ async getContractClass(contractClassId) {
85
94
  const artifact = await this.getContractArtifact(contractClassId);
@@ -210,15 +219,15 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
210
219
  if (!functionDao) {
211
220
  throw new Error(`Unknown function ${functionName} in contract ${contract.name}.`);
212
221
  }
213
- return {
222
+ return FunctionCall.from({
214
223
  name: functionDao.name,
215
- args: encodeArguments(functionDao, args),
224
+ to,
216
225
  selector: await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters),
217
226
  type: functionDao.functionType,
218
- to,
219
227
  hideMsgSender: false,
220
228
  isStatic: functionDao.isStatic,
229
+ args: encodeArguments(functionDao, args),
221
230
  returnTypes: functionDao.returnTypes
222
- };
231
+ });
223
232
  }
224
233
  }
@@ -1,2 +1,2 @@
1
- export declare const PXE_DATA_SCHEMA_VERSION = 2;
1
+ export declare const PXE_DATA_SCHEMA_VERSION = 3;
2
2
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0YWRhdGEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL21ldGFkYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQU8sTUFBTSx1QkFBdUIsSUFBSSxDQUFDIn0=
@@ -1 +1 @@
1
- export const PXE_DATA_SCHEMA_VERSION = 2;
1
+ export const PXE_DATA_SCHEMA_VERSION = 3;
@@ -2,8 +2,9 @@ import type { Fr } from '@aztec/foundation/schemas';
2
2
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { DataInBlock } from '@aztec/stdlib/block';
5
- import { NoteDao, type NotesFilter } from '@aztec/stdlib/note';
5
+ import { NoteDao } from '@aztec/stdlib/note';
6
6
  import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
7
+ import type { NotesFilter } from '../../notes_filter.js';
7
8
  /**
8
9
  * NoteStore manages the storage and retrieval of notes.
9
10
  *
@@ -35,7 +36,6 @@ export declare class NoteStore implements StagedStore {
35
36
  * @params jobId - the job context to read from.
36
37
  * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
37
38
  * returned once if this is the case)
38
- * @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
39
39
  */
40
40
  getNotes(filter: NotesFilter, jobId: string): Promise<NoteDao[]>;
41
41
  /**
@@ -67,7 +67,17 @@ export declare class NoteStore implements StagedStore {
67
67
  * @param synchedBlockNumber - The block number up to which PXE managed to sync before the reorg happened.
68
68
  */
69
69
  rollback(blockNumber: number, synchedBlockNumber: number): Promise<void>;
70
+ /**
71
+ * Commits in memory job data to persistent storage.
72
+ *
73
+ * Called by JobCoordinator when a job completes successfully.
74
+ *
75
+ * Note: JobCoordinator wraps all commits in a single transaction, so we don't need our own transactionAsync here
76
+ * (and using one would throw on IndexedDB as it does not support nested txs).
77
+ *
78
+ * @param jobId - The jobId identifying which staged data to commit
79
+ */
70
80
  commit(jobId: string): Promise<void>;
71
81
  discardStaged(jobId: string): Promise<void>;
72
82
  }
73
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2Uvbm90ZV9zdG9yZS9ub3RlX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFxQyxNQUFNLGlCQUFpQixDQUFDO0FBQzVGLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxPQUFPLEVBQWMsS0FBSyxXQUFXLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUUzRSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsT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,SAAU,YAAW,WAAW;;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAU;IA+BpC,YAAY,KAAK,EAAE,iBAAiB,EAQnC;IAED;;;;;;;;;OASG;IACI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAarF;IAcD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAgG/D;IAED;;;;;;;;;;;;;;OAcG;IACH,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAyChF;IAED;;;;;;;;;;;OAWG;IACU,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpF;IA6ED;;;;;;;;;OASG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUzC;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1C;CAkCF"}
@@ -1,4 +1,3 @@
1
- import { toArray } from '@aztec/foundation/iterable';
2
1
  import { Semaphore } from '@aztec/foundation/queue';
3
2
  import { NoteStatus } from '@aztec/stdlib/note';
4
3
  import { StoredNote } from './stored_note.js';
@@ -49,26 +48,18 @@ import { StoredNote } from './stored_note.js';
49
48
  * @param scope - The scope (user/account) under which to store the notes
50
49
  * @param jobId - The job context for staged writes
51
50
  */ 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);
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
+ }))));
59
56
  }
60
57
  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;
65
- }
66
- // Then check persistent storage
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.
67
60
  const noteBuffer = await this.#notes.getAsync(nullifier);
68
- if (noteBuffer) {
69
- return StoredNote.fromBuffer(noteBuffer);
70
- }
71
- return undefined;
61
+ const noteForJob = this.#getNotesForJob(jobId).get(nullifier);
62
+ return noteForJob ?? (noteBuffer ? StoredNote.fromBuffer(noteBuffer) : undefined);
72
63
  }
73
64
  #writeNote(note, jobId) {
74
65
  this.#getNotesForJob(jobId).set(note.noteDao.siloedNullifier.toString(), note);
@@ -83,49 +74,84 @@ import { StoredNote } from './stored_note.js';
83
74
  * @params jobId - the job context to read from.
84
75
  * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
85
76
  * 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');
77
+ */ getNotes(filter, jobId) {
78
+ if (filter.scopes !== 'ALL_SCOPES' && filter.scopes.length === 0) {
79
+ return Promise.resolve([]);
90
80
  }
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;
81
+ return this.#store.transactionAsync(async ()=>{
82
+ const targetStatus = filter.status ?? NoteStatus.ACTIVE;
83
+ // The code below might read a bit unnatural, the reason is that we need to be careful in how we use `await` inside
84
+ // `transactionAsync`, otherwise browsers might choose to auto-commit the IndexedDB transaction forcing us to
85
+ // explicitly handle that condition. The rule we need to honor is: do not await unless you generate a database
86
+ // read or write or you're done using the DB for the remainder of the transaction. The following sequence is
87
+ // unsafe in IndexedDB:
88
+ //
89
+ // 1. start transactionAsync()
90
+ // 2. await readDb() <-- OK, transaction alive because we issued DB ops
91
+ // 3. run a bunch of computations (no await involved) <-- OK, tx alive because we are in the same microtask
92
+ // 4. await doSthNotInDb() <-- no DB ops issued in this task, browser's free to decide to commit the tx
93
+ // 5. await readDb() <-- BOOM, TransactionInactiveError
94
+ //
95
+ // Note that the real issue is in step number 5: we try to continue using a transaction that the browser might
96
+ // have already committed.
97
+ //
98
+ // We need to read candidate notes which are either indexed by contract address in the DB (in
99
+ // #nullifiersByContractAddress), or lie in memory for the not yet committed `jobId`.
100
+ // So we collect promises based on both sources without awaiting for them.
101
+ const noteReadPromises = new Map();
102
+ // Awaiting the getValuesAsync iterator is fine because it's reading from the DB
103
+ for await (const nullifier of this.#nullifiersByContractAddress.getValuesAsync(filter.contractAddress.toString())){
104
+ // Each #readNote will perform a DB read
105
+ noteReadPromises.set(nullifier, this.#readNote(nullifier, jobId));
115
106
  }
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;
107
+ // Add staged nullifiers from job, no awaits involved, so we are fine
108
+ for (const storedNote of this.#getNotesForJob(jobId).values()){
109
+ if (storedNote.noteDao.contractAddress.equals(filter.contractAddress)) {
110
+ const nullifier = storedNote.noteDao.siloedNullifier.toString();
111
+ if (!noteReadPromises.has(nullifier)) {
112
+ noteReadPromises.set(nullifier, Promise.resolve(storedNote));
113
+ }
114
+ }
124
115
  }
125
- if (a.txIndexInBlock !== b.txIndexInBlock) {
126
- return a.txIndexInBlock - b.txIndexInBlock;
116
+ // By now we have pending DB requests from all the #readNote calls. Await them all together.
117
+ const notes = await Promise.all(noteReadPromises.values());
118
+ // The rest of the function is await-free, and just deals with filtering and sorting our findings.
119
+ const foundNotes = new Map();
120
+ for (const note of notes){
121
+ // Defensive: hitting this case means we're mishandling contract indices or in-memory job data
122
+ if (!note) {
123
+ throw new Error('PXE note database is corrupted.');
124
+ }
125
+ // Apply filters
126
+ if (targetStatus === NoteStatus.ACTIVE && note.isNullified()) {
127
+ continue;
128
+ }
129
+ if (filter.owner && !note.noteDao.owner.equals(filter.owner)) {
130
+ continue;
131
+ }
132
+ if (filter.storageSlot && !note.noteDao.storageSlot.equals(filter.storageSlot)) {
133
+ continue;
134
+ }
135
+ if (filter.siloedNullifier && !note.noteDao.siloedNullifier.equals(filter.siloedNullifier)) {
136
+ continue;
137
+ }
138
+ if (filter.scopes !== 'ALL_SCOPES' && note.scopes.intersection(new Set(filter.scopes.map((s)=>s.toString()))).size === 0) {
139
+ continue;
140
+ }
141
+ foundNotes.set(note.noteDao.siloedNullifier.toString(), note.noteDao);
127
142
  }
128
- return a.noteIndexInTx - b.noteIndexInTx;
143
+ // Sort by block number, then by tx index within block, then by note index within tx
144
+ return [
145
+ ...foundNotes.values()
146
+ ].sort((a, b)=>{
147
+ if (a.l2BlockNumber !== b.l2BlockNumber) {
148
+ return a.l2BlockNumber - b.l2BlockNumber;
149
+ }
150
+ if (a.txIndexInBlock !== b.txIndexInBlock) {
151
+ return a.txIndexInBlock - b.txIndexInBlock;
152
+ }
153
+ return a.noteIndexInTx - b.noteIndexInTx;
154
+ });
129
155
  });
130
156
  }
131
157
  /**
@@ -143,10 +169,13 @@ import { StoredNote } from './stored_note.js';
143
169
  * @returns Array of NoteDao objects that were nullified
144
170
  * @throws Error if any nullifier is not found in this notes store
145
171
  */ applyNullifiers(nullifiers, jobId) {
172
+ if (nullifiers.length === 0) {
173
+ return Promise.resolve([]);
174
+ }
175
+ if (nullifiers.some((n)=>n.l2BlockNumber === 0)) {
176
+ return Promise.reject(new Error('applyNullifiers: nullifiers cannot have been emitted at block 0'));
177
+ }
146
178
  return this.#withJobLock(jobId, ()=>this.#store.transactionAsync(async ()=>{
147
- if (nullifiers.length === 0) {
148
- return [];
149
- }
150
179
  const notesToNullify = await Promise.all(nullifiers.map(async (nullifierInBlock)=>{
151
180
  const nullifier = nullifierInBlock.data.toString();
152
181
  const storedNote = await this.#readNote(nullifier, jobId);
@@ -154,13 +183,12 @@ import { StoredNote } from './stored_note.js';
154
183
  throw new Error(`Attempted to mark a note as nullified which does not exist in PXE DB`);
155
184
  }
156
185
  return {
157
- storedNote: await this.#readNote(nullifier, jobId),
186
+ storedNote,
158
187
  blockNumber: nullifierInBlock.l2BlockNumber
159
188
  };
160
189
  }));
161
190
  const notesNullifiedInThisCall = new Map();
162
191
  for (const noteToNullify of notesToNullify){
163
- // Safe to coerce (!) because we throw if we find any undefined above
164
192
  const note = noteToNullify.storedNote;
165
193
  // Skip already nullified notes
166
194
  if (note.isNullified()) {
@@ -200,15 +228,22 @@ import { StoredNote } from './stored_note.js';
200
228
  *
201
229
  * @param blockNumber - Notes created after this block number will be deleted
202
230
  */ async #deleteActiveNotesAfterBlock(blockNumber) {
203
- const notes = await toArray(this.#notes.valuesAsync());
204
- for (const noteBuffer of notes){
231
+ // Collect notes to delete during iteration to keep IndexedDB transaction alive.
232
+ const notesToDelete = [];
233
+ for await (const noteBuffer of this.#notes.valuesAsync()){
205
234
  const storedNote = StoredNote.fromBuffer(noteBuffer);
206
235
  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);
236
+ notesToDelete.push({
237
+ nullifier: storedNote.noteDao.siloedNullifier.toString(),
238
+ contractAddress: storedNote.noteDao.contractAddress.toString()
239
+ });
210
240
  }
211
241
  }
242
+ // Delete all collected notes. Each delete is a DB operation that keeps the transaction alive.
243
+ for (const { nullifier, contractAddress } of notesToDelete){
244
+ await this.#notes.delete(nullifier);
245
+ await this.#nullifiersByContractAddress.deleteValue(contractAddress, nullifier);
246
+ }
212
247
  }
213
248
  /**
214
249
  * Rewinds nullifications after a given block number.
@@ -219,47 +254,62 @@ import { StoredNote } from './stored_note.js';
219
254
  * @param blockNumber - Revert nullifications that occurred after this block
220
255
  * @param anchorBlockNumber - Upper bound for the block range to process
221
256
  */ async #rewindNullifiedNotesAfterBlock(blockNumber, anchorBlockNumber) {
222
- 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}`);
257
+ // First pass: collect all nullifiers for all blocks, starting reads during iteration to keep tx alive.
258
+ const nullifiersByBlock = new Map();
259
+ for(let i = blockNumber + 1; i <= anchorBlockNumber; i++){
260
+ const blockNullifiers = [];
261
+ for await (const nullifier of this.#nullifiersByNullificationBlockNumber.getValuesAsync(i)){
262
+ // Start read immediately during iteration to keep IndexedDB transaction alive
263
+ blockNullifiers.push({
264
+ nullifier,
265
+ noteReadPromise: this.#notes.getAsync(nullifier)
266
+ });
267
+ }
268
+ if (blockNullifiers.length > 0) {
269
+ nullifiersByBlock.set(i, blockNullifiers);
270
+ }
271
+ }
272
+ // Second pass: await reads and perform writes
273
+ for (const [block, nullifiers] of nullifiersByBlock){
274
+ for (const { nullifier, noteReadPromise } of nullifiers){
275
+ const noteBuffer = await noteReadPromise;
276
+ if (!noteBuffer) {
277
+ throw new Error(`PXE DB integrity error: no note found with nullifier ${nullifier}`);
229
278
  }
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}`);
279
+ const storedNote = StoredNote.fromBuffer(noteBuffer);
280
+ if (storedNote.scopes.size === 0) {
281
+ throw new Error(`No scopes found for nullified note with nullifier ${nullifier}`);
240
282
  }
241
283
  storedNote.markAsActive();
242
284
  await Promise.all([
243
- this.#notes.set(noteNullifier, storedNote.toBuffer()),
244
- this.#nullifiersByNullificationBlockNumber.deleteValue(i, noteNullifier)
285
+ this.#notes.set(nullifier, storedNote.toBuffer()),
286
+ this.#nullifiersByNullificationBlockNumber.deleteValue(block, nullifier)
245
287
  ]);
246
288
  }
247
289
  }
248
290
  }
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
- }
291
+ /**
292
+ * Commits in memory job data to persistent storage.
293
+ *
294
+ * Called by JobCoordinator when a job completes successfully.
295
+ *
296
+ * Note: JobCoordinator wraps all commits in a single transaction, so we don't need our own transactionAsync here
297
+ * (and using one would throw on IndexedDB as it does not support nested txs).
298
+ *
299
+ * @param jobId - The jobId identifying which staged data to commit
300
+ */ async commit(jobId) {
301
+ for (const [nullifier, storedNote] of this.#getNotesForJob(jobId)){
302
+ await this.#notes.set(nullifier, storedNote.toBuffer());
303
+ await this.#nullifiersByContractAddress.set(storedNote.noteDao.contractAddress.toString(), nullifier);
304
+ if (storedNote.nullifiedAt !== undefined) {
305
+ await this.#nullifiersByNullificationBlockNumber.set(storedNote.nullifiedAt, nullifier);
257
306
  }
258
- this.#clearJobData(jobId);
259
- });
307
+ }
308
+ this.#clearJobData(jobId);
260
309
  }
261
310
  discardStaged(jobId) {
262
- return this.#withJobLock(jobId, ()=>Promise.resolve(this.#clearJobData(jobId)));
311
+ this.#clearJobData(jobId);
312
+ return Promise.resolve();
263
313
  }
264
314
  #clearJobData(jobId) {
265
315
  this.#notesForJob.delete(jobId);
@@ -290,14 +340,4 @@ import { StoredNote } from './stored_note.js';
290
340
  }
291
341
  return notesForJob;
292
342
  }
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
- ]);
302
- }
303
343
  }
@@ -88,4 +88,4 @@ export declare class PrivateEventStore implements StagedStore {
88
88
  discardStaged(jobId: string): Promise<void>;
89
89
  }
90
90
  export {};
91
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9ldmVudF9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvcHJpdmF0ZV9ldmVudF9zdG9yZS9wcml2YXRlX2V2ZW50X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUlwRCxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBcUMsTUFBTSxpQkFBaUIsQ0FBQztBQUM1RixPQUFPLEtBQUssRUFBRSxhQUFhLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUN2RCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFckQsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFDNUUsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFHdkQsTUFBTSxNQUFNLHVCQUF1QixHQUFHO0lBQ3BDLGVBQWUsRUFBRSxZQUFZLENBQUM7SUFDO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sRUFBRSxNQUFNLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FzQ3BGO0lBRUQ7Ozs7Ozs7OztPQVNHO0lBQ0csTUFBTSxDQUFDLEtBQUssRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQWdCekM7SUFFRDs7T0FFRztJQUNILGFBQWEsQ0FBQyxLQUFLLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FHMUM7Q0EwRUYifQ==
@@ -1 +1 @@
1
- {"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;AAIpD,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;AAChE,OAAO,KAAK,EAAE,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;AAGvD,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;AAEF,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;IAgB7C,MAAM,yCAAuC;IAE7C,YAAY,KAAK,EAAE,iBAAiB,EAQnC;IAED;;;;;;;;;;;OAWG;IACH,oBAAoB,CAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,EAAE,EACd,UAAU,EAAE,EAAE,EAAE,EAChB,qBAAqB,EAAE,EAAE,EACzB,QAAQ,EAAE,oBAAoB,EAC9B,KAAK,EAAE,MAAM,iBAuCd;IAED;;;;;;;;;;OAUG;IACI,gBAAgB,CACrB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqE/B;IAED;;;;;;;;;;;;;;;;OAgBG;IACU,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BpF;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAenC;IAED;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1C;CA4EF"}
1
+ {"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;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAA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