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

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 (266) hide show
  1. package/dest/access_scopes.d.ts +9 -0
  2. package/dest/access_scopes.d.ts.map +1 -0
  3. package/dest/access_scopes.js +6 -0
  4. package/dest/bin/check_oracle_version.js +1 -1
  5. package/dest/block_synchronizer/block_synchronizer.d.ts +13 -5
  6. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  7. package/dest/block_synchronizer/block_synchronizer.js +74 -20
  8. package/dest/config/index.d.ts +3 -1
  9. package/dest/config/index.d.ts.map +1 -1
  10. package/dest/config/index.js +17 -0
  11. package/dest/config/package_info.js +1 -1
  12. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  13. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  14. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  15. package/dest/contract_function_simulator/contract_function_simulator.d.ts +57 -34
  16. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/contract_function_simulator.js +197 -82
  18. package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
  19. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/execution_note_cache.js +45 -28
  21. package/dest/contract_function_simulator/index.d.ts +2 -2
  22. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/index.js +1 -1
  24. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -3
  25. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  26. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +7 -4
  27. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -3
  28. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  29. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +2 -2
  30. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
  31. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
  33. package/dest/contract_function_simulator/oracle/interfaces.d.ts +17 -13
  34. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
  35. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
  36. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  37. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
  38. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  39. package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
  40. package/dest/contract_function_simulator/oracle/oracle.d.ts +12 -10
  41. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  42. package/dest/contract_function_simulator/oracle/oracle.js +67 -44
  43. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -26
  44. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  45. package/dest/contract_function_simulator/oracle/private_execution.js +1 -37
  46. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +44 -50
  47. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  48. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +83 -54
  49. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +67 -33
  50. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  51. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +131 -110
  52. package/dest/contract_logging.d.ts +22 -0
  53. package/dest/contract_logging.d.ts.map +1 -0
  54. package/dest/contract_logging.js +23 -0
  55. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  56. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  57. package/dest/contract_sync/contract_sync_service.js +97 -0
  58. package/dest/contract_sync/helpers.d.ts +29 -0
  59. package/dest/contract_sync/helpers.d.ts.map +1 -0
  60. package/dest/contract_sync/helpers.js +55 -0
  61. package/dest/debug/pxe_debug_utils.d.ts +24 -10
  62. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  63. package/dest/debug/pxe_debug_utils.js +28 -17
  64. package/dest/entrypoints/client/bundle/index.d.ts +4 -1
  65. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  66. package/dest/entrypoints/client/bundle/index.js +3 -0
  67. package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
  68. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  69. package/dest/entrypoints/client/bundle/utils.js +31 -8
  70. package/dest/entrypoints/client/lazy/index.d.ts +4 -1
  71. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  72. package/dest/entrypoints/client/lazy/index.js +3 -0
  73. package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
  74. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  75. package/dest/entrypoints/client/lazy/utils.js +32 -9
  76. package/dest/entrypoints/pxe_creation_options.d.ts +5 -3
  77. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  78. package/dest/entrypoints/server/index.d.ts +5 -1
  79. package/dest/entrypoints/server/index.d.ts.map +1 -1
  80. package/dest/entrypoints/server/index.js +4 -0
  81. package/dest/entrypoints/server/utils.d.ts +1 -1
  82. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  83. package/dest/entrypoints/server/utils.js +39 -16
  84. package/dest/events/event_service.d.ts +6 -6
  85. package/dest/events/event_service.d.ts.map +1 -1
  86. package/dest/events/event_service.js +19 -22
  87. package/dest/events/private_event_filter_validator.d.ts +5 -5
  88. package/dest/events/private_event_filter_validator.d.ts.map +1 -1
  89. package/dest/events/private_event_filter_validator.js +5 -6
  90. package/dest/job_coordinator/job_coordinator.d.ts +75 -0
  91. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  92. package/dest/job_coordinator/job_coordinator.js +94 -0
  93. package/dest/logs/log_service.d.ts +8 -5
  94. package/dest/logs/log_service.d.ts.map +1 -1
  95. package/dest/logs/log_service.js +28 -30
  96. package/dest/notes/note_service.d.ts +10 -9
  97. package/dest/notes/note_service.d.ts.map +1 -1
  98. package/dest/notes/note_service.js +34 -38
  99. package/dest/notes_filter.d.ts +25 -0
  100. package/dest/notes_filter.d.ts.map +1 -0
  101. package/dest/notes_filter.js +4 -0
  102. package/dest/oracle_version.d.ts +3 -3
  103. package/dest/oracle_version.d.ts.map +1 -1
  104. package/dest/oracle_version.js +4 -3
  105. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  106. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  107. package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
  108. package/dest/private_kernel/hints/index.d.ts +3 -3
  109. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  110. package/dest/private_kernel/hints/index.js +2 -2
  111. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
  112. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  113. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +16 -10
  114. package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
  115. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  116. package/dest/private_kernel/private_kernel_execution_prover.js +12 -13
  117. package/dest/private_kernel/private_kernel_oracle.d.ts +24 -24
  118. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  119. package/dest/private_kernel/private_kernel_oracle.js +94 -2
  120. package/dest/pxe.d.ts +76 -58
  121. package/dest/pxe.d.ts.map +1 -1
  122. package/dest/pxe.js +149 -138
  123. package/dest/storage/address_store/address_store.d.ts +1 -1
  124. package/dest/storage/address_store/address_store.d.ts.map +1 -1
  125. package/dest/storage/address_store/address_store.js +12 -11
  126. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
  127. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
  128. package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
  129. package/dest/storage/capsule_store/capsule_store.d.ts +24 -9
  130. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
  131. package/dest/storage/capsule_store/capsule_store.js +130 -23
  132. package/dest/storage/contract_store/contract_store.d.ts +42 -16
  133. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  134. package/dest/storage/contract_store/contract_store.js +157 -84
  135. package/dest/storage/metadata.d.ts +1 -1
  136. package/dest/storage/metadata.js +1 -1
  137. package/dest/storage/note_store/note_store.d.ts +50 -51
  138. package/dest/storage/note_store/note_store.d.ts.map +1 -1
  139. package/dest/storage/note_store/note_store.js +284 -263
  140. package/dest/storage/note_store/stored_note.d.ts +16 -0
  141. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  142. package/dest/storage/note_store/stored_note.js +43 -0
  143. package/dest/storage/private_event_store/private_event_store.d.ts +47 -7
  144. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
  145. package/dest/storage/private_event_store/private_event_store.js +231 -73
  146. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  147. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  148. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  149. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +15 -8
  150. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  151. package/dest/storage/tagging_store/recipient_tagging_store.js +88 -19
  152. package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
  153. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
  154. package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
  155. package/dest/storage/tagging_store/sender_tagging_store.d.ts +19 -9
  156. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  157. package/dest/storage/tagging_store/sender_tagging_store.js +253 -101
  158. package/dest/tagging/constants.d.ts +2 -0
  159. package/dest/tagging/constants.d.ts.map +1 -0
  160. package/dest/tagging/constants.js +10 -0
  161. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  162. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  163. package/dest/tagging/get_all_logs_by_tags.js +60 -0
  164. package/dest/tagging/index.d.ts +3 -2
  165. package/dest/tagging/index.d.ts.map +1 -1
  166. package/dest/tagging/index.js +2 -10
  167. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -2
  168. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  169. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +12 -12
  170. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
  171. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
  172. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  173. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
  174. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -2
  175. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  176. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +8 -8
  177. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
  178. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
  179. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
  180. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -2
  181. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  182. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +10 -5
  183. package/package.json +27 -18
  184. package/src/access_scopes.ts +9 -0
  185. package/src/bin/check_oracle_version.ts +1 -0
  186. package/src/block_synchronizer/block_synchronizer.ts +93 -32
  187. package/src/config/index.ts +14 -0
  188. package/src/config/package_info.ts +1 -1
  189. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  190. package/src/contract_function_simulator/contract_function_simulator.ts +350 -143
  191. package/src/contract_function_simulator/execution_note_cache.ts +44 -25
  192. package/src/contract_function_simulator/index.ts +1 -1
  193. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +6 -2
  194. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
  195. package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
  196. package/src/contract_function_simulator/oracle/interfaces.ts +22 -12
  197. package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
  198. package/src/contract_function_simulator/oracle/oracle.ts +79 -47
  199. package/src/contract_function_simulator/oracle/private_execution.ts +1 -69
  200. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +119 -137
  201. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +198 -115
  202. package/src/contract_logging.ts +39 -0
  203. package/src/contract_sync/contract_sync_service.ts +152 -0
  204. package/src/contract_sync/helpers.ts +98 -0
  205. package/src/debug/pxe_debug_utils.ts +63 -18
  206. package/src/entrypoints/client/bundle/index.ts +3 -0
  207. package/src/entrypoints/client/bundle/utils.ts +23 -16
  208. package/src/entrypoints/client/lazy/index.ts +3 -0
  209. package/src/entrypoints/client/lazy/utils.ts +24 -17
  210. package/src/entrypoints/pxe_creation_options.ts +4 -2
  211. package/src/entrypoints/server/index.ts +4 -0
  212. package/src/entrypoints/server/utils.ts +33 -41
  213. package/src/events/event_service.ts +19 -25
  214. package/src/events/private_event_filter_validator.ts +3 -5
  215. package/src/job_coordinator/job_coordinator.ts +150 -0
  216. package/src/logs/log_service.ts +40 -34
  217. package/src/notes/note_service.ts +41 -45
  218. package/src/notes_filter.ts +26 -0
  219. package/src/oracle_version.ts +4 -3
  220. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
  221. package/src/private_kernel/hints/index.ts +2 -2
  222. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +39 -28
  223. package/src/private_kernel/private_kernel_execution_prover.ts +15 -14
  224. package/src/private_kernel/private_kernel_oracle.ts +116 -36
  225. package/src/pxe.ts +280 -209
  226. package/src/storage/address_store/address_store.ts +15 -15
  227. package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
  228. package/src/storage/capsule_store/capsule_store.ts +159 -23
  229. package/src/storage/contract_store/contract_store.ts +186 -96
  230. package/src/storage/metadata.ts +1 -1
  231. package/src/storage/note_store/note_store.ts +326 -320
  232. package/src/storage/note_store/stored_note.ts +48 -0
  233. package/src/storage/private_event_store/private_event_store.ts +301 -79
  234. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  235. package/src/storage/tagging_store/recipient_tagging_store.ts +106 -20
  236. package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
  237. package/src/storage/tagging_store/sender_tagging_store.ts +294 -109
  238. package/src/tagging/constants.ts +10 -0
  239. package/src/tagging/get_all_logs_by_tags.ts +92 -0
  240. package/src/tagging/index.ts +2 -11
  241. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +25 -11
  242. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
  243. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
  244. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +10 -7
  245. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -13
  246. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +16 -4
  247. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  248. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  249. package/dest/contract_function_simulator/proxied_node.js +0 -27
  250. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  251. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  252. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  253. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
  254. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
  255. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  256. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  257. package/dest/public_storage/public_storage_service.d.ts +0 -24
  258. package/dest/public_storage/public_storage_service.d.ts.map +0 -1
  259. package/dest/public_storage/public_storage_service.js +0 -26
  260. package/dest/tree_membership/tree_membership_service.d.ts +0 -52
  261. package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
  262. package/dest/tree_membership/tree_membership_service.js +0 -84
  263. package/src/contract_function_simulator/proxied_node.ts +0 -33
  264. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
  265. package/src/public_storage/public_storage_service.ts +0 -33
  266. package/src/tree_membership/tree_membership_service.ts +0 -112
@@ -1,9 +1,53 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
1
2
  import { toArray } from '@aztec/foundation/iterable';
2
- import { isProtocolContract } from '@aztec/protocol-contracts';
3
- import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
3
+ import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize';
4
+ import { FunctionCall, FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
4
5
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
6
  import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
6
7
  import { PrivateFunctionsTree } from './private_functions_tree.js';
8
+ const VERSION = 1;
9
+ /**
10
+ * All contract class data except the large packedBytecode.
11
+ * The expensive data from the ContractClass is precomputed and stored in this format to avoid redundant hashing.
12
+ * Since we have to store the artifacts anyway, the final ContractClass is reconstructed by combining this data
13
+ * with the packedBytecode obtained from the former. That way we can have quick class lookups without wasted storage.
14
+ */ export class SerializableContractClassData {
15
+ version = VERSION;
16
+ id;
17
+ artifactHash;
18
+ privateFunctionsRoot;
19
+ publicBytecodeCommitment;
20
+ privateFunctions;
21
+ constructor(data){
22
+ this.id = data.id;
23
+ this.artifactHash = data.artifactHash;
24
+ this.privateFunctionsRoot = data.privateFunctionsRoot;
25
+ this.publicBytecodeCommitment = data.publicBytecodeCommitment;
26
+ this.privateFunctions = data.privateFunctions;
27
+ }
28
+ toBuffer() {
29
+ return serializeToBuffer(numToUInt8(this.version), this.id, this.artifactHash, this.privateFunctionsRoot, this.publicBytecodeCommitment, this.privateFunctions.length, ...this.privateFunctions.map((fn)=>serializeToBuffer(fn.selector, fn.vkHash)));
30
+ }
31
+ static fromBuffer(bufferOrReader) {
32
+ const reader = BufferReader.asReader(bufferOrReader);
33
+ const version = reader.readUInt8();
34
+ if (version !== VERSION) {
35
+ throw new Error(`Unexpected contract class data version ${version}`);
36
+ }
37
+ return new SerializableContractClassData({
38
+ id: reader.readObject(Fr),
39
+ artifactHash: reader.readObject(Fr),
40
+ privateFunctionsRoot: reader.readObject(Fr),
41
+ publicBytecodeCommitment: reader.readObject(Fr),
42
+ privateFunctions: reader.readVector({
43
+ fromBuffer: (r)=>({
44
+ selector: r.readObject(FunctionSelector),
45
+ vkHash: r.readObject(Fr)
46
+ })
47
+ })
48
+ });
49
+ }
50
+ }
7
51
  /**
8
52
  * ContractStore serves as a data manager and retriever for Aztec.nr contracts.
9
53
  * It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
@@ -13,21 +57,46 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
13
57
  */ export class ContractStore {
14
58
  /** 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.
15
59
  #privateFunctionTrees = new Map();
16
- /** Map from contract address to contract class id */ #contractClassIdMap = new Map();
60
+ /**
61
+ * In-memory cache of deserialized ContractArtifact objects, keyed by class id string.
62
+ * Avoids repeated LMDB reads + JSON.parse + Zod validation on every oracle call.
63
+ * Artifacts are large but immutable after registration — safe to cache for the lifetime of the store.
64
+ */ // TODO: Update it to be LRU cache so that it doesn't keep all the data all the time.
65
+ #contractArtifactCache = new Map();
66
+ /** Map from contract address to contract class id (avoids KV round-trip on hot path). */ #contractClassIdMap = new Map();
67
+ #store;
17
68
  #contractArtifacts;
69
+ #contractClassData;
18
70
  #contractInstances;
19
71
  constructor(store){
72
+ this.#store = store;
20
73
  this.#contractArtifacts = store.openMap('contract_artifacts');
74
+ this.#contractClassData = store.openMap('contract_classes');
21
75
  this.#contractInstances = store.openMap('contracts_instances');
22
76
  }
23
77
  // Setters
24
- async addContractArtifact(id, contract) {
78
+ /**
79
+ * Registers a new contract artifact and its corresponding class data.
80
+ * IMPORTANT: This method does not verify that the provided artifact matches the class data or that the class id matches the artifact.
81
+ * It is the caller's responsibility to ensure the consistency and correctness of the provided data.
82
+ * This is done to avoid redundant, expensive contract class computations
83
+ */ async addContractArtifact(contract, contractClassWithIdAndPreimage) {
84
+ const contractClass = contractClassWithIdAndPreimage ?? await getContractClassFromArtifact(contract);
85
+ const key = contractClass.id.toString();
86
+ if (this.#contractArtifactCache.has(key)) {
87
+ return contractClass.id;
88
+ }
25
89
  const privateFunctions = contract.functions.filter((functionArtifact)=>functionArtifact.functionType === FunctionType.PRIVATE);
26
- const privateSelectors = await Promise.all(privateFunctions.map(async (privateFunctionArtifact)=>(await FunctionSelector.fromNameAndParameters(privateFunctionArtifact.name, privateFunctionArtifact.parameters)).toString()));
90
+ const privateSelectors = await Promise.all(privateFunctions.map(async (fn)=>(await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters)).toString()));
27
91
  if (privateSelectors.length !== new Set(privateSelectors).size) {
28
92
  throw new Error('Repeated function selectors of private functions');
29
93
  }
30
- await this.#contractArtifacts.set(id.toString(), contractArtifactToBuffer(contract));
94
+ this.#contractArtifactCache.set(key, contract);
95
+ await this.#store.transactionAsync(async ()=>{
96
+ await this.#contractArtifacts.set(key, contractArtifactToBuffer(contract));
97
+ await this.#contractClassData.set(key, new SerializableContractClassData(contractClass).toBuffer());
98
+ });
99
+ return contractClass.id;
31
100
  }
32
101
  async addContractInstance(contract) {
33
102
  this.#contractClassIdMap.set(contract.address.toString(), contract.currentContractClassId);
@@ -35,25 +104,17 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
35
104
  }
36
105
  // Private getters
37
106
  async #getContractClassId(contractAddress) {
38
- if (!this.#contractClassIdMap.has(contractAddress.toString())) {
107
+ const key = contractAddress.toString();
108
+ if (!this.#contractClassIdMap.has(key)) {
39
109
  const instance = await this.getContractInstance(contractAddress);
40
110
  if (!instance) {
41
111
  return;
42
112
  }
43
- this.#contractClassIdMap.set(contractAddress.toString(), instance.currentContractClassId);
113
+ this.#contractClassIdMap.set(key, instance.currentContractClassId);
44
114
  }
45
- return this.#contractClassIdMap.get(contractAddress.toString());
115
+ return this.#contractClassIdMap.get(key);
46
116
  }
47
- /**
48
- * Retrieve or create a ContractTree instance based on the provided class id.
49
- * If an existing tree with the same class id is found in the cache, it will be returned.
50
- * Otherwise, a new ContractTree instance will be created using the contract data from the database
51
- * and added to the cache before returning.
52
- *
53
- * @param classId - The class id of the contract for which the ContractTree is required.
54
- * @returns A ContractTree instance associated with the specified contract address.
55
- * @throws An Error if the contract is not found in the ContractDatabase.
56
- */ async #getPrivateFunctionTreeForClassId(classId) {
117
+ async #getPrivateFunctionTreeForClassId(classId) {
57
118
  if (!this.#privateFunctionTrees.has(classId.toString())) {
58
119
  const artifact = await this.getContractArtifact(classId);
59
120
  if (!artifact) {
@@ -64,27 +125,54 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
64
125
  }
65
126
  return this.#privateFunctionTrees.get(classId.toString());
66
127
  }
67
- async #getContractArtifactByAddress(contractAddress) {
68
- const contractClassId = await this.#getContractClassId(contractAddress);
69
- return contractClassId && this.getContractArtifact(contractClassId);
128
+ async #getArtifactByAddress(contractAddress) {
129
+ const classId = await this.#getContractClassId(contractAddress);
130
+ return classId && this.getContractArtifact(classId);
70
131
  }
71
132
  // Public getters
72
- async getContractsAddresses() {
73
- const keys = await toArray(this.#contractInstances.keysAsync());
74
- return keys.map(AztecAddress.fromString);
133
+ getContractsAddresses() {
134
+ return this.#store.transactionAsync(async ()=>{
135
+ const keys = await toArray(this.#contractInstances.keysAsync());
136
+ return keys.map(AztecAddress.fromString);
137
+ });
75
138
  }
76
- /** Returns a contract instance for a given address. Throws if not found. */ async getContractInstance(contractAddress) {
77
- const contract = await this.#contractInstances.getAsync(contractAddress.toString());
78
- return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
139
+ /** Returns a contract instance for a given address. */ getContractInstance(contractAddress) {
140
+ return this.#store.transactionAsync(async ()=>{
141
+ const contract = await this.#contractInstances.getAsync(contractAddress.toString());
142
+ return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
143
+ });
79
144
  }
80
- async getContractArtifact(contractClassId) {
81
- const contract = await this.#contractArtifacts.getAsync(contractClassId.toString());
82
- // TODO(@spalladino): AztecAsyncMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from.
83
- return contract && contractArtifactFromBuffer(Buffer.from(contract));
145
+ /** Returns the raw contract artifact for a given class id. */ async getContractArtifact(contractClassId) {
146
+ const key = contractClassId.toString();
147
+ const cached = this.#contractArtifactCache.get(key);
148
+ if (cached) {
149
+ return cached;
150
+ }
151
+ const artifact = await this.#store.transactionAsync(async ()=>{
152
+ const buf = await this.#contractArtifacts.getAsync(key);
153
+ return buf && contractArtifactFromBuffer(buf);
154
+ });
155
+ if (artifact) {
156
+ this.#contractArtifactCache.set(key, artifact);
157
+ }
158
+ return artifact;
84
159
  }
85
- /** Returns a contract class for a given class id. Throws if not found. */ async getContractClass(contractClassId) {
160
+ /** Returns a contract class for a given class id. */ async getContractClassWithPreimage(contractClassId) {
161
+ const key = contractClassId.toString();
162
+ const buf = await this.#contractClassData.getAsync(key);
163
+ if (!buf) {
164
+ return undefined;
165
+ }
166
+ const classData = SerializableContractClassData.fromBuffer(buf);
86
167
  const artifact = await this.getContractArtifact(contractClassId);
87
- return artifact && getContractClassFromArtifact(artifact);
168
+ if (!artifact) {
169
+ return undefined;
170
+ }
171
+ const packedBytecode = artifact.functions.find((f)=>f.name === 'public_dispatch')?.bytecode ?? Buffer.alloc(0);
172
+ return {
173
+ ...classData,
174
+ packedBytecode
175
+ };
88
176
  }
89
177
  async getContract(address) {
90
178
  const instance = await this.getContractInstance(address);
@@ -102,17 +190,18 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
102
190
  }
103
191
  /**
104
192
  * Retrieves the artifact of a specified function within a given contract.
105
- * The function is identified by its selector, which is a unique code generated from the function's signature.
106
- * Throws an error if the contract address or function selector are invalid or not found.
107
193
  *
108
194
  * @param contractAddress - The AztecAddress representing the contract containing the function.
109
195
  * @param selector - The function selector.
110
196
  * @returns The corresponding function's artifact as an object.
111
197
  */ async getFunctionArtifact(contractAddress, selector) {
112
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
113
- const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
114
- return fnArtifact && {
115
- ...fnArtifact,
198
+ const artifact = await this.#getArtifactByAddress(contractAddress);
199
+ if (!artifact) {
200
+ return undefined;
201
+ }
202
+ const fn = await this.#findFunctionArtifactBySelector(artifact, selector);
203
+ return fn && {
204
+ ...fn,
116
205
  contractName: artifact.name
117
206
  };
118
207
  }
@@ -128,40 +217,38 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
128
217
  };
129
218
  }
130
219
  async getPublicFunctionArtifact(contractAddress) {
131
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
132
- const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
133
- return fnArtifact && {
134
- ...fnArtifact,
220
+ const artifact = await this.#getArtifactByAddress(contractAddress);
221
+ const fn = artifact && artifact.functions.find((f)=>f.functionType === FunctionType.PUBLIC);
222
+ return fn && {
223
+ ...fn,
135
224
  contractName: artifact.name
136
225
  };
137
226
  }
138
227
  async getFunctionAbi(contractAddress, selector) {
139
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
228
+ const artifact = await this.#getArtifactByAddress(contractAddress);
140
229
  return artifact && await this.#findFunctionAbiBySelector(artifact, selector);
141
230
  }
142
231
  /**
143
232
  * Retrieves the debug metadata of a specified function within a given contract.
144
- * The function is identified by its selector, which is a unique code generated from the function's signature.
145
- * Returns undefined if the debug metadata for the given function is not found.
146
- * Throws if the contract has not been added to the database.
147
233
  *
148
234
  * @param contractAddress - The AztecAddress representing the contract containing the function.
149
235
  * @param selector - The function selector.
150
- * @returns The corresponding function's artifact as an object.
236
+ * @returns The corresponding function's debug metadata, or undefined.
151
237
  */ async getFunctionDebugMetadata(contractAddress, selector) {
152
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
153
- const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
154
- return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
238
+ const artifact = await this.#getArtifactByAddress(contractAddress);
239
+ if (!artifact) {
240
+ return undefined;
241
+ }
242
+ const fn = await this.#findFunctionArtifactBySelector(artifact, selector);
243
+ return fn && getFunctionDebugMetadata(artifact, fn);
155
244
  }
156
245
  async getPublicFunctionDebugMetadata(contractAddress) {
157
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
158
- const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
159
- return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
246
+ const artifact = await this.#getArtifactByAddress(contractAddress);
247
+ const fn = artifact && artifact.functions.find((f)=>f.functionType === FunctionType.PUBLIC);
248
+ return fn && getFunctionDebugMetadata(artifact, fn);
160
249
  }
161
250
  /**
162
251
  * Retrieve the function membership witness for the given contract class and function selector.
163
- * The function membership witness represents a proof that the function belongs to the specified contract.
164
- * Throws an error if the contract address or function selector is unknown.
165
252
  *
166
253
  * @param contractClassId - The id of the class.
167
254
  * @param selector - The function selector.
@@ -171,18 +258,16 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
171
258
  return tree?.getFunctionMembershipWitness(selector);
172
259
  }
173
260
  async getDebugContractName(contractAddress) {
174
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
261
+ const artifact = await this.#getArtifactByAddress(contractAddress);
175
262
  return artifact?.name;
176
263
  }
177
264
  async getDebugFunctionName(contractAddress, selector) {
178
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
179
- const fnArtifact = artifact && await this.#findFunctionAbiBySelector(artifact, selector);
180
- return `${artifact?.name ?? contractAddress}:${fnArtifact?.name ?? selector}`;
265
+ const artifact = await this.#getArtifactByAddress(contractAddress);
266
+ const fn = artifact && await this.#findFunctionAbiBySelector(artifact, selector);
267
+ return `${artifact?.name ?? contractAddress}:${fn?.name ?? selector}`;
181
268
  }
182
269
  async #findFunctionArtifactBySelector(artifact, selector) {
183
- const functions = artifact.functions;
184
- for(let i = 0; i < functions.length; i++){
185
- const fn = functions[i];
270
+ for (const fn of artifact.functions){
186
271
  const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
187
272
  if (fnSelector.equals(selector)) {
188
273
  return fn;
@@ -190,12 +275,10 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
190
275
  }
191
276
  }
192
277
  async #findFunctionAbiBySelector(artifact, selector) {
193
- const functions = [
278
+ for (const fn of [
194
279
  ...artifact.functions,
195
280
  ...artifact.nonDispatchPublicFunctions ?? []
196
- ];
197
- for(let i = 0; i < functions.length; i++){
198
- const fn = functions[i];
281
+ ]){
199
282
  const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
200
283
  if (fnSelector.equals(selector)) {
201
284
  return fn;
@@ -211,26 +294,16 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
211
294
  if (!functionDao) {
212
295
  throw new Error(`Unknown function ${functionName} in contract ${contract.name}.`);
213
296
  }
214
- return {
297
+ const selector = await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters);
298
+ return FunctionCall.from({
215
299
  name: functionDao.name,
216
- args: encodeArguments(functionDao, args),
217
- selector: await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters),
218
- type: functionDao.functionType,
219
300
  to,
301
+ selector,
302
+ type: functionDao.functionType,
220
303
  hideMsgSender: false,
221
304
  isStatic: functionDao.isStatic,
305
+ args: encodeArguments(functionDao, args),
222
306
  returnTypes: functionDao.returnTypes
223
- };
224
- }
225
- // Synchronize target contract data
226
- async syncPrivateState(contractAddress, functionToInvokeAfterSync, utilityExecutor) {
227
- // Protocol contracts don't have private state to sync
228
- if (!isProtocolContract(contractAddress)) {
229
- const syncPrivateStateFunctionCall = await this.getFunctionCall('sync_private_state', [], contractAddress);
230
- if (functionToInvokeAfterSync && functionToInvokeAfterSync.equals(syncPrivateStateFunctionCall.selector)) {
231
- throw new Error('Forbidden `sync_private_state` invocation. `sync_private_state` can only be invoked by PXE, manual execution can lead to inconsistencies.');
232
- }
233
- return utilityExecutor(syncPrivateStateFunctionCall);
234
- }
307
+ });
235
308
  }
236
309
  }
@@ -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;
@@ -1,84 +1,83 @@
1
- import type { Fr } from '@aztec/foundation/curves/bn254';
1
+ import type { Fr } from '@aztec/foundation/schemas';
2
2
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
3
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { DataInBlock } from '@aztec/stdlib/block';
5
- import { type NotesFilter } from '@aztec/stdlib/note';
6
5
  import { NoteDao } from '@aztec/stdlib/note';
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
  *
10
- * Notes can be active or nullified. This class processes new notes, nullifications,
11
- * and performs rollback handling in the case of a reorg.
11
+ * Notes can be active or nullified. This class processes new notes, nullifications, and performs rollback handling in
12
+ * the case of a reorg.
12
13
  **/
13
- export declare class NoteStore {
14
+ export declare class NoteStore implements StagedStore {
14
15
  #private;
15
- private constructor();
16
+ readonly storeName: string;
17
+ constructor(store: AztecAsyncKVStore);
16
18
  /**
17
- * Creates and initializes a new NoteStore instance.
19
+ * Adds multiple notes to the notes store under the specified scope.
18
20
  *
19
- * This factory method creates a NoteStore and restores any existing
20
- * scope-specific indexes from the database.
21
+ * Notes are stored using their siloedNullifier as the key, which provides uniqueness. Each note is indexed by
22
+ * multiple criteria for efficient retrieval.
21
23
  *
22
- * @param store - The key-value store to use for persistence
23
- * @returns Promise resolving to a fully initialized NoteStore instance
24
+ * @param notes - Notes to store
25
+ * @param scope - The scope (user/account) under which to store the notes
26
+ * @param jobId - The job context for staged writes
24
27
  */
25
- static create(store: AztecAsyncKVStore): Promise<NoteStore>;
28
+ addNotes(notes: NoteDao[], scope: AztecAddress, jobId: string): Promise<void[]>;
26
29
  /**
27
- * Adds a new scope to the note data provider.
30
+ * Retrieves notes based on the provided filter criteria.
28
31
  *
29
- * Scopes provide privacy isolation by creating separate indexes for each user.
30
- * Each scope gets its own set of indexes for efficient note retrieval by various criteria.
32
+ * This method queries both active and optionally nullified notes based on the filter parameters.
31
33
  *
32
- * @param scope - The AztecAddress representing the scope/user to add
33
- * @returns Promise resolving to true if scope was added, false if it already existed
34
+ * @param filter - Filter criteria including contractAddress (required), and optional owner,
35
+ * storageSlot, status, scopes, and siloedNullifier.
36
+ * @params jobId - the job context to read from.
37
+ * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
38
+ * returned once if this is the case)
34
39
  */
35
- addScope(scope: AztecAddress): Promise<boolean>;
40
+ getNotes(filter: NotesFilter, jobId: string): Promise<NoteDao[]>;
36
41
  /**
37
- * Adds multiple notes to the data provider under the specified scope.
42
+ * Transitions notes from "active" to "nullified" state.
38
43
  *
39
- * Notes are stored using their index from the notes hash tree as the key, which provides
40
- * uniqueness and maintains creation order. Each note is indexed by multiple criteria
41
- * for efficient retrieval.
44
+ * This operation processes a batch of nullifiers to mark the corresponding notes as spent/nullified.
45
+ * The operation is atomic - if any nullifier is not found, the entire operation fails and no notes are modified.
42
46
  *
43
- * @param notes - Notes to store
44
- * @param scope - The scope (user/account) under which to store the notes
47
+ * applyNullifiers is idempotent: the same nullifier can be applied multiple times without error.
48
+ * This relaxes constraints on usage of NoteService#validateAndStoreNote, which can then be run concurrently in a Promise.all
49
+ * context without risking unnecessarily defensive checks failing.
50
+ *
51
+ * @param nullifiers - Array of nullifiers with their block numbers to process
52
+ * @param jobId - The job context for staged writes
53
+ * @returns Array of NoteDao objects that were nullified
54
+ * @throws Error if any nullifier is not found in this notes store
45
55
  */
46
- addNotes(notes: NoteDao[], scope: AztecAddress): Promise<void>;
56
+ applyNullifiers(nullifiers: DataInBlock<Fr>[], jobId: string): Promise<NoteDao[]>;
47
57
  /**
48
58
  * Synchronizes notes and nullifiers to a specific block number.
49
59
  *
50
- * This method ensures that the state of notes and nullifiers is consistent with the
51
- * specified block number. It restores any notes that were nullified after the given block
52
- * and deletes any active notes created after that block.
60
+ * This method ensures that the state of notes and nullifiers is consistent with the specified block number.
61
+ * It restores any notes that were nullified after the given block and deletes any active notes created after that
62
+ * block.
63
+ *
64
+ * IMPORTANT: This method must be called within a transaction to ensure atomicity.
53
65
  *
54
66
  * @param blockNumber - The new chain tip after a reorg
55
67
  * @param synchedBlockNumber - The block number up to which PXE managed to sync before the reorg happened.
56
68
  */
57
- rollbackNotesAndNullifiers(blockNumber: number, synchedBlockNumber: number): Promise<void>;
69
+ rollback(blockNumber: number, synchedBlockNumber: number): Promise<void>;
58
70
  /**
59
- * Retrieves notes based on the provided filter criteria.
71
+ * Commits in memory job data to persistent storage.
60
72
  *
61
- * This method queries both active and optionally nullified notes based on the filter
62
- * parameters.
73
+ * Called by JobCoordinator when a job completes successfully.
63
74
  *
64
- * @param filter - Filter criteria including contractAddress (required), and optional
65
- * owner, storageSlot, status, scopes, and siloedNullifier.
66
- * @returns Filtered and deduplicated notes (a note might be present in multiple scopes - we ensure it is only
67
- * returned once if this is the case)
68
- * @throws If filtering by an empty scopes array. Scopes have to be set to undefined or to a non-empty array.
69
- */
70
- getNotes(filter: NotesFilter): Promise<NoteDao[]>;
71
- /**
72
- * Transitions notes from "active" to "nullified" state.
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).
73
77
  *
74
- * This operation processes a batch of nullifiers to mark the corresponding notes
75
- * as spent/nullified. The operation is atomic - if any nullifier is not found,
76
- * the entire operation fails and no notes are modified.
77
- *
78
- * @param nullifiers - Array of nullifiers with their block numbers to process
79
- * @returns Promise resolving to array of nullified NoteDao objects
80
- * @throws Error if any nullifier is not found in the active notes
78
+ * @param jobId - The jobId identifying which staged data to commit
81
79
  */
82
- applyNullifiers(nullifiers: DataInBlock<Fr>[]): Promise<NoteDao[]>;
80
+ commit(jobId: string): Promise<void>;
81
+ discardStaged(jobId: string): Promise<void>;
83
82
  }
84
-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../../../src/storage/note_store/note_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;;;;IAKI;AACJ,qBAAa,SAAS;;IAiBpB,OAAO,eAgBN;IAED;;;;;;;;OAQG;IACH,OAAoB,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAOvE;IAED;;;;;;;;OAQG;IACU,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAY3D;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7D;IAED;;;;;;;;;OASG;IACU,0BAA0B,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGtG;IAuFD;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAwGtD;IAED;;;;;;;;;;OAUG;IACH,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CA8DjE;CACF"}
1
+ {"version":3,"file":"note_store.d.ts","sourceRoot":"","sources":["../../../src/storage/note_store/note_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2BA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