@aztec/archiver 0.0.1-commit.d3ec352c → 0.0.1-commit.d58ff9d0

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 (236) hide show
  1. package/README.md +164 -22
  2. package/dest/archiver.d.ts +194 -0
  3. package/dest/archiver.d.ts.map +1 -0
  4. package/dest/archiver.js +949 -0
  5. package/dest/config.d.ts +34 -0
  6. package/dest/config.d.ts.map +1 -0
  7. package/dest/config.js +95 -0
  8. package/dest/errors.d.ts +87 -0
  9. package/dest/errors.d.ts.map +1 -0
  10. package/dest/errors.js +129 -0
  11. package/dest/factory.d.ts +16 -10
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +117 -20
  14. package/dest/index.d.ts +19 -4
  15. package/dest/index.d.ts.map +1 -1
  16. package/dest/index.js +17 -3
  17. package/dest/interfaces.d.ts +9 -0
  18. package/dest/interfaces.d.ts.map +1 -0
  19. package/dest/interfaces.js +3 -0
  20. package/dest/l1/bin/retrieve-calldata.d.ts +3 -0
  21. package/dest/l1/bin/retrieve-calldata.d.ts.map +1 -0
  22. package/dest/l1/bin/retrieve-calldata.js +152 -0
  23. package/dest/l1/calldata_retriever.d.ts +143 -0
  24. package/dest/l1/calldata_retriever.d.ts.map +1 -0
  25. package/dest/l1/calldata_retriever.js +413 -0
  26. package/dest/l1/data_retrieval.d.ts +102 -0
  27. package/dest/l1/data_retrieval.d.ts.map +1 -0
  28. package/dest/{archiver → l1}/data_retrieval.js +85 -165
  29. package/dest/l1/debug_tx.d.ts +19 -0
  30. package/dest/l1/debug_tx.d.ts.map +1 -0
  31. package/dest/l1/debug_tx.js +73 -0
  32. package/dest/l1/spire_proposer.d.ts +70 -0
  33. package/dest/l1/spire_proposer.d.ts.map +1 -0
  34. package/dest/l1/spire_proposer.js +149 -0
  35. package/dest/l1/trace_tx.d.ts +43 -0
  36. package/dest/l1/trace_tx.d.ts.map +1 -0
  37. package/dest/l1/trace_tx.js +91 -0
  38. package/dest/l1/types.d.ts +12 -0
  39. package/dest/l1/types.d.ts.map +1 -0
  40. package/dest/l1/types.js +3 -0
  41. package/dest/l1/validate_historical_logs.d.ts +23 -0
  42. package/dest/l1/validate_historical_logs.d.ts.map +1 -0
  43. package/dest/l1/validate_historical_logs.js +108 -0
  44. package/dest/l1/validate_trace.d.ts +32 -0
  45. package/dest/l1/validate_trace.d.ts.map +1 -0
  46. package/dest/l1/validate_trace.js +154 -0
  47. package/dest/modules/contract_data_source_adapter.d.ts +25 -0
  48. package/dest/modules/contract_data_source_adapter.d.ts.map +1 -0
  49. package/dest/modules/contract_data_source_adapter.js +32 -0
  50. package/dest/modules/data_source_base.d.ts +112 -0
  51. package/dest/modules/data_source_base.d.ts.map +1 -0
  52. package/dest/modules/data_source_base.js +322 -0
  53. package/dest/modules/data_store_updater.d.ts +105 -0
  54. package/dest/modules/data_store_updater.d.ts.map +1 -0
  55. package/dest/modules/data_store_updater.js +393 -0
  56. package/dest/modules/instrumentation.d.ts +63 -0
  57. package/dest/modules/instrumentation.d.ts.map +1 -0
  58. package/dest/modules/instrumentation.js +166 -0
  59. package/dest/modules/l1_synchronizer.d.ts +77 -0
  60. package/dest/modules/l1_synchronizer.d.ts.map +1 -0
  61. package/dest/modules/l1_synchronizer.js +1381 -0
  62. package/dest/modules/outbox_trees_resolver.d.ts +62 -0
  63. package/dest/modules/outbox_trees_resolver.d.ts.map +1 -0
  64. package/dest/modules/outbox_trees_resolver.js +162 -0
  65. package/dest/modules/validation.d.ts +40 -0
  66. package/dest/modules/validation.d.ts.map +1 -0
  67. package/dest/{archiver → modules}/validation.js +41 -17
  68. package/dest/store/block_store.d.ts +303 -0
  69. package/dest/store/block_store.d.ts.map +1 -0
  70. package/dest/store/block_store.js +1206 -0
  71. package/dest/store/contract_class_store.d.ts +31 -0
  72. package/dest/store/contract_class_store.d.ts.map +1 -0
  73. package/dest/store/contract_class_store.js +98 -0
  74. package/dest/store/contract_instance_store.d.ts +51 -0
  75. package/dest/store/contract_instance_store.d.ts.map +1 -0
  76. package/dest/{archiver/kv_archiver_store → store}/contract_instance_store.js +55 -3
  77. package/dest/store/data_stores.d.ts +68 -0
  78. package/dest/store/data_stores.d.ts.map +1 -0
  79. package/dest/store/data_stores.js +54 -0
  80. package/dest/store/function_names_cache.d.ts +17 -0
  81. package/dest/store/function_names_cache.d.ts.map +1 -0
  82. package/dest/store/function_names_cache.js +30 -0
  83. package/dest/store/l2_tips_cache.d.ts +25 -0
  84. package/dest/store/l2_tips_cache.d.ts.map +1 -0
  85. package/dest/store/l2_tips_cache.js +26 -0
  86. package/dest/store/log_store.d.ts +59 -0
  87. package/dest/store/log_store.d.ts.map +1 -0
  88. package/dest/store/log_store.js +310 -0
  89. package/dest/store/log_store_codec.d.ts +78 -0
  90. package/dest/store/log_store_codec.d.ts.map +1 -0
  91. package/dest/store/log_store_codec.js +110 -0
  92. package/dest/store/message_store.d.ts +50 -0
  93. package/dest/store/message_store.d.ts.map +1 -0
  94. package/dest/{archiver/kv_archiver_store → store}/message_store.js +66 -23
  95. package/dest/{archiver/structs → structs}/data_retrieval.d.ts +1 -1
  96. package/dest/structs/data_retrieval.d.ts.map +1 -0
  97. package/dest/structs/inbox_message.d.ts +15 -0
  98. package/dest/structs/inbox_message.d.ts.map +1 -0
  99. package/dest/{archiver/structs → structs}/inbox_message.js +6 -6
  100. package/dest/structs/published.d.ts +2 -0
  101. package/dest/structs/published.d.ts.map +1 -0
  102. package/dest/test/fake_l1_state.d.ts +214 -0
  103. package/dest/test/fake_l1_state.d.ts.map +1 -0
  104. package/dest/test/fake_l1_state.js +517 -0
  105. package/dest/test/index.d.ts +2 -1
  106. package/dest/test/index.d.ts.map +1 -1
  107. package/dest/test/index.js +4 -1
  108. package/dest/test/mock_archiver.d.ts +5 -6
  109. package/dest/test/mock_archiver.d.ts.map +1 -1
  110. package/dest/test/mock_archiver.js +8 -12
  111. package/dest/test/mock_l1_to_l2_message_source.d.ts +6 -7
  112. package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
  113. package/dest/test/mock_l1_to_l2_message_source.js +19 -14
  114. package/dest/test/mock_l2_block_source.d.ts +68 -40
  115. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  116. package/dest/test/mock_l2_block_source.js +347 -145
  117. package/dest/test/mock_structs.d.ts +83 -4
  118. package/dest/test/mock_structs.d.ts.map +1 -1
  119. package/dest/test/mock_structs.js +157 -12
  120. package/dest/test/noop_l1_archiver.d.ts +34 -0
  121. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  122. package/dest/test/noop_l1_archiver.js +88 -0
  123. package/package.json +18 -18
  124. package/src/archiver.ts +785 -0
  125. package/src/config.ts +125 -0
  126. package/src/errors.ts +203 -0
  127. package/src/factory.ts +185 -22
  128. package/src/index.ts +27 -3
  129. package/src/interfaces.ts +9 -0
  130. package/src/l1/README.md +55 -0
  131. package/src/l1/bin/retrieve-calldata.ts +194 -0
  132. package/src/l1/calldata_retriever.ts +529 -0
  133. package/src/{archiver → l1}/data_retrieval.ts +157 -243
  134. package/src/l1/debug_tx.ts +99 -0
  135. package/src/l1/spire_proposer.ts +152 -0
  136. package/src/l1/trace_tx.ts +128 -0
  137. package/src/l1/types.ts +13 -0
  138. package/src/l1/validate_historical_logs.ts +140 -0
  139. package/src/l1/validate_trace.ts +229 -0
  140. package/src/modules/contract_data_source_adapter.ts +46 -0
  141. package/src/modules/data_source_base.ts +466 -0
  142. package/src/modules/data_store_updater.ts +519 -0
  143. package/src/modules/instrumentation.ts +217 -0
  144. package/src/modules/l1_synchronizer.ts +1320 -0
  145. package/src/modules/outbox_trees_resolver.ts +199 -0
  146. package/src/modules/validation.ts +186 -0
  147. package/src/store/block_store.ts +1551 -0
  148. package/src/store/contract_class_store.ts +126 -0
  149. package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +70 -7
  150. package/src/store/data_stores.ts +104 -0
  151. package/src/store/function_names_cache.ts +37 -0
  152. package/src/store/l2_tips_cache.ts +35 -0
  153. package/src/store/log_store.ts +380 -0
  154. package/src/store/log_store_codec.ts +143 -0
  155. package/src/{archiver/kv_archiver_store → store}/message_store.ts +81 -28
  156. package/src/{archiver/structs → structs}/inbox_message.ts +8 -9
  157. package/src/{archiver/structs → structs}/published.ts +0 -1
  158. package/src/test/fake_l1_state.ts +770 -0
  159. package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
  160. package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
  161. package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
  162. package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
  163. package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
  164. package/src/test/fixtures/trace_transaction-proxied.json +128 -0
  165. package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
  166. package/src/test/index.ts +4 -0
  167. package/src/test/mock_archiver.ts +10 -14
  168. package/src/test/mock_l1_to_l2_message_source.ts +16 -15
  169. package/src/test/mock_l2_block_source.ts +416 -161
  170. package/src/test/mock_structs.ts +292 -14
  171. package/src/test/noop_l1_archiver.ts +158 -0
  172. package/dest/archiver/archiver.d.ts +0 -290
  173. package/dest/archiver/archiver.d.ts.map +0 -1
  174. package/dest/archiver/archiver.js +0 -1434
  175. package/dest/archiver/archiver_store.d.ts +0 -256
  176. package/dest/archiver/archiver_store.d.ts.map +0 -1
  177. package/dest/archiver/archiver_store.js +0 -4
  178. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  179. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  180. package/dest/archiver/archiver_store_test_suite.js +0 -1289
  181. package/dest/archiver/config.d.ts +0 -21
  182. package/dest/archiver/config.d.ts.map +0 -1
  183. package/dest/archiver/config.js +0 -55
  184. package/dest/archiver/data_retrieval.d.ts +0 -80
  185. package/dest/archiver/data_retrieval.d.ts.map +0 -1
  186. package/dest/archiver/errors.d.ts +0 -12
  187. package/dest/archiver/errors.d.ts.map +0 -1
  188. package/dest/archiver/errors.js +0 -17
  189. package/dest/archiver/index.d.ts +0 -7
  190. package/dest/archiver/index.d.ts.map +0 -1
  191. package/dest/archiver/index.js +0 -4
  192. package/dest/archiver/instrumentation.d.ts +0 -35
  193. package/dest/archiver/instrumentation.d.ts.map +0 -1
  194. package/dest/archiver/instrumentation.js +0 -140
  195. package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -125
  196. package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
  197. package/dest/archiver/kv_archiver_store/block_store.js +0 -371
  198. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
  199. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
  200. package/dest/archiver/kv_archiver_store/contract_class_store.js +0 -120
  201. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -24
  202. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  203. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -169
  204. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
  205. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -296
  206. package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -49
  207. package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
  208. package/dest/archiver/kv_archiver_store/log_store.js +0 -337
  209. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -39
  210. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  211. package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
  212. package/dest/archiver/structs/inbox_message.d.ts +0 -15
  213. package/dest/archiver/structs/inbox_message.d.ts.map +0 -1
  214. package/dest/archiver/structs/published.d.ts +0 -3
  215. package/dest/archiver/structs/published.d.ts.map +0 -1
  216. package/dest/archiver/validation.d.ts +0 -17
  217. package/dest/archiver/validation.d.ts.map +0 -1
  218. package/dest/rpc/index.d.ts +0 -9
  219. package/dest/rpc/index.d.ts.map +0 -1
  220. package/dest/rpc/index.js +0 -15
  221. package/src/archiver/archiver.ts +0 -1880
  222. package/src/archiver/archiver_store.ts +0 -310
  223. package/src/archiver/archiver_store_test_suite.ts +0 -1295
  224. package/src/archiver/config.ts +0 -79
  225. package/src/archiver/errors.ts +0 -26
  226. package/src/archiver/index.ts +0 -6
  227. package/src/archiver/instrumentation.ts +0 -187
  228. package/src/archiver/kv_archiver_store/block_store.ts +0 -482
  229. package/src/archiver/kv_archiver_store/contract_class_store.ts +0 -176
  230. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -423
  231. package/src/archiver/kv_archiver_store/log_store.ts +0 -407
  232. package/src/archiver/validation.ts +0 -124
  233. package/src/rpc/index.ts +0 -16
  234. /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
  235. /package/dest/{archiver/structs → structs}/published.js +0 -0
  236. /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
@@ -0,0 +1,31 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
+ import type { ContractClassPublic, ContractClassPublicWithCommitment } from '@aztec/stdlib/contract';
4
+ /**
5
+ * LMDB-based contract class storage for the archiver.
6
+ */
7
+ export declare class ContractClassStore {
8
+ #private;
9
+ private db;
10
+ constructor(db: AztecAsyncKVStore);
11
+ /**
12
+ * Adds multiple contract classes to the store.
13
+ * @param data - Contract classes (with bytecode commitments) to add.
14
+ * @param blockNumber - L2 block number where the classes were registered.
15
+ * @returns True if every insert succeeded.
16
+ */
17
+ addContractClasses(data: ContractClassPublicWithCommitment[], blockNumber: number): Promise<boolean>;
18
+ /**
19
+ * Removes multiple contract classes from the store, but only if they were registered at or after the given block.
20
+ * @param data - Contract classes to delete.
21
+ * @param blockNumber - Lower bound on the block number at which the classes were registered.
22
+ * @returns True if every delete succeeded.
23
+ */
24
+ deleteContractClasses(data: ContractClassPublic[], blockNumber: number): Promise<boolean>;
25
+ addContractClass(contractClass: ContractClassPublic, bytecodeCommitment: Fr, blockNumber: number): Promise<void>;
26
+ deleteContractClass(contractClass: ContractClassPublic, blockNumber: number): Promise<void>;
27
+ getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
28
+ getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
29
+ getContractClassIds(): Promise<Fr[]>;
30
+ }
31
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfY2xhc3Nfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yZS9jb250cmFjdF9jbGFzc19zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFHcEQsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFFeEUsT0FBTyxLQUFLLEVBQ1YsbUJBQW1CLEVBRW5CLGlDQUFpQyxFQUNsQyxNQUFNLHdCQUF3QixDQUFDO0FBRWhDOztHQUVHO0FBQ0gscUJBQWEsa0JBQWtCOztJQUlqQixPQUFPLENBQUMsRUFBRTtJQUF0QixZQUFvQixFQUFFLEVBQUUsaUJBQWlCLEVBR3hDO0lBRUQ7Ozs7O09BS0c7SUFDRyxrQkFBa0IsQ0FBQyxJQUFJLEVBQUUsaUNBQWlDLEVBQUUsRUFBRSxXQUFXLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FJekc7SUFFRDs7Ozs7T0FLRztJQUNHLHFCQUFxQixDQUFDLElBQUksRUFBRSxtQkFBbUIsRUFBRSxFQUFFLFdBQVcsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUU5RjtJQUVLLGdCQUFnQixDQUNwQixhQUFhLEVBQUUsbUJBQW1CLEVBQ2xDLGtCQUFrQixFQUFFLEVBQ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BAAkB,EAAE,EAAE,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAwBf;IAEK,mBAAmB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAahG;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAGvE;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAG3D;IAEK,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAEzC;CACF"}
@@ -0,0 +1,98 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { toArray } from '@aztec/foundation/iterable';
3
+ import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize';
4
+ import { isProtocolContractClass } from '@aztec/protocol-contracts';
5
+ /**
6
+ * LMDB-based contract class storage for the archiver.
7
+ */ export class ContractClassStore {
8
+ db;
9
+ #contractClasses;
10
+ #bytecodeCommitments;
11
+ constructor(db){
12
+ this.db = db;
13
+ this.#contractClasses = db.openMap('archiver_contract_classes');
14
+ this.#bytecodeCommitments = db.openMap('archiver_bytecode_commitments');
15
+ }
16
+ /**
17
+ * Adds multiple contract classes to the store.
18
+ * @param data - Contract classes (with bytecode commitments) to add.
19
+ * @param blockNumber - L2 block number where the classes were registered.
20
+ * @returns True if every insert succeeded.
21
+ */ async addContractClasses(data, blockNumber) {
22
+ return (await Promise.all(data.map((c)=>this.addContractClass(c, c.publicBytecodeCommitment, blockNumber)))).every(Boolean);
23
+ }
24
+ /**
25
+ * Removes multiple contract classes from the store, but only if they were registered at or after the given block.
26
+ * @param data - Contract classes to delete.
27
+ * @param blockNumber - Lower bound on the block number at which the classes were registered.
28
+ * @returns True if every delete succeeded.
29
+ */ async deleteContractClasses(data, blockNumber) {
30
+ return (await Promise.all(data.map((c)=>this.deleteContractClass(c, blockNumber)))).every(Boolean);
31
+ }
32
+ async addContractClass(contractClass, bytecodeCommitment, blockNumber) {
33
+ await this.db.transactionAsync(async ()=>{
34
+ const key = contractClass.id.toString();
35
+ const existing = await this.#contractClasses.getAsync(key);
36
+ if (existing !== undefined) {
37
+ // Protocol contracts are preloaded at block 0, so a later on-chain (re-)publish of a bundled
38
+ // protocol class id is valid and must be a no-op. Keep the existing block-0 entry untouched
39
+ // (do not bump its block number) so it survives reorgs of the publishing block.
40
+ if (isProtocolContractClass(contractClass.id)) {
41
+ return;
42
+ }
43
+ // An L1 reorg can re-present an already-stored checkpoint, replaying this class at the same
44
+ // block; treat that as a no-op. A duplicate at a different block still signals double-processing.
45
+ if (deserializeContractClassPublic(existing).l2BlockNumber === blockNumber) {
46
+ return;
47
+ }
48
+ throw new Error(`Contract class ${key} already exists, cannot add again at block ${blockNumber}`);
49
+ }
50
+ await this.#contractClasses.set(key, serializeContractClassPublic({
51
+ ...contractClass,
52
+ l2BlockNumber: blockNumber
53
+ }));
54
+ await this.#bytecodeCommitments.set(key, bytecodeCommitment.toBuffer());
55
+ });
56
+ }
57
+ async deleteContractClass(contractClass, blockNumber) {
58
+ // Protocol contracts are preloaded at block 0 and must never be deleted, even when the block that
59
+ // (re-)published them on-chain is unwound by a reorg.
60
+ if (isProtocolContractClass(contractClass.id)) {
61
+ return;
62
+ }
63
+ const restoredContractClass = await this.#contractClasses.getAsync(contractClass.id.toString());
64
+ if (restoredContractClass && deserializeContractClassPublic(restoredContractClass).l2BlockNumber >= blockNumber) {
65
+ await this.db.transactionAsync(async ()=>{
66
+ await this.#contractClasses.delete(contractClass.id.toString());
67
+ await this.#bytecodeCommitments.delete(contractClass.id.toString());
68
+ });
69
+ }
70
+ }
71
+ async getContractClass(id) {
72
+ const contractClass = await this.#contractClasses.getAsync(id.toString());
73
+ return contractClass && {
74
+ ...deserializeContractClassPublic(contractClass),
75
+ id
76
+ };
77
+ }
78
+ async getBytecodeCommitment(id) {
79
+ const value = await this.#bytecodeCommitments.getAsync(id.toString());
80
+ return value === undefined ? undefined : Fr.fromBuffer(value);
81
+ }
82
+ async getContractClassIds() {
83
+ return (await toArray(this.#contractClasses.keysAsync())).map((key)=>Fr.fromHexString(key));
84
+ }
85
+ }
86
+ function serializeContractClassPublic(contractClass) {
87
+ return serializeToBuffer(contractClass.l2BlockNumber, numToUInt8(contractClass.version), contractClass.artifactHash, contractClass.packedBytecode.length, contractClass.packedBytecode, contractClass.privateFunctionsRoot);
88
+ }
89
+ function deserializeContractClassPublic(buffer) {
90
+ const reader = BufferReader.asReader(buffer);
91
+ return {
92
+ l2BlockNumber: reader.readNumber(),
93
+ version: reader.readUInt8(),
94
+ artifactHash: reader.readObject(Fr),
95
+ packedBytecode: reader.readBuffer(),
96
+ privateFunctionsRoot: reader.readObject(Fr)
97
+ };
98
+ }
@@ -0,0 +1,51 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
+ import { type ContractInstanceUpdateWithAddress, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
5
+ import type { UInt64 } from '@aztec/stdlib/types';
6
+ type ContractInstanceUpdateKey = [string, string] | [string, string, number];
7
+ /**
8
+ * LMDB-based contract instance storage for the archiver.
9
+ */
10
+ export declare class ContractInstanceStore {
11
+ #private;
12
+ private db;
13
+ constructor(db: AztecAsyncKVStore);
14
+ /**
15
+ * Adds multiple contract instances to the store.
16
+ * @param data - Contract instances to add.
17
+ * @param blockNumber - L2 block number where the instances were deployed.
18
+ * @returns True if every insert succeeded.
19
+ */
20
+ addContractInstances(data: ContractInstanceWithAddress[], blockNumber: number): Promise<boolean>;
21
+ /**
22
+ * Removes multiple contract instances from the store.
23
+ * @param data - Contract instances to delete.
24
+ * @returns True if every delete succeeded.
25
+ */
26
+ deleteContractInstances(data: ContractInstanceWithAddress[]): Promise<boolean>;
27
+ /**
28
+ * Adds multiple contract instance updates to the store.
29
+ * @param data - Contract instance updates to add.
30
+ * @param timestamp - Timestamp at which the updates were scheduled.
31
+ * @returns True if every insert succeeded.
32
+ */
33
+ addContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], timestamp: UInt64): Promise<boolean>;
34
+ /**
35
+ * Removes multiple contract instance updates from the store.
36
+ * @param data - Contract instance updates to delete.
37
+ * @param timestamp - Timestamp at which the updates were scheduled.
38
+ * @returns True if every delete succeeded.
39
+ */
40
+ deleteContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], timestamp: UInt64): Promise<boolean>;
41
+ addContractInstance(contractInstance: ContractInstanceWithAddress, blockNumber: number): Promise<void>;
42
+ deleteContractInstance(contractInstance: ContractInstanceWithAddress): Promise<void>;
43
+ getUpdateKey(contractAddress: AztecAddress, timestamp: UInt64, logIndex?: number): ContractInstanceUpdateKey;
44
+ addContractInstanceUpdate(contractInstanceUpdate: ContractInstanceUpdateWithAddress, timestamp: UInt64, logIndex: number): Promise<void>;
45
+ deleteContractInstanceUpdate(contractInstanceUpdate: ContractInstanceUpdateWithAddress, timestamp: UInt64, logIndex: number): Promise<void>;
46
+ getCurrentContractInstanceClassId(address: AztecAddress, timestamp: UInt64, originalClassId: Fr): Promise<Fr>;
47
+ getContractInstance(address: AztecAddress, timestamp: UInt64): Promise<ContractInstanceWithAddress | undefined>;
48
+ getContractInstanceDeploymentBlockNumber(address: AztecAddress): Promise<number | undefined>;
49
+ }
50
+ export {};
51
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3RfaW5zdGFuY2Vfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yZS9jb250cmFjdF9pbnN0YW5jZV9zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsT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AE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAUnF;IAED,YAAY,CAAC,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,yBAAyB,CAM3G;IAED,yBAAyB,CACvB,sBAAsB,EAAE,iCAAiC,EACzD,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAKf;IAED,4BAA4B,CAC1B,sBAAsB,EAAE,iCAAiC,EACzD,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAEf;IAEK,iCAAiC,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAoBlH;IAEK,mBAAmB,CACvB,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAalD;IAED,wCAAwC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE3F;CACF"}
@@ -1,6 +1,7 @@
1
+ import { isProtocolContract } from '@aztec/protocol-contracts';
1
2
  import { SerializableContractInstance, SerializableContractInstanceUpdate } from '@aztec/stdlib/contract';
2
3
  /**
3
- * LMDB implementation of the ArchiverDataStore interface.
4
+ * LMDB-based contract instance storage for the archiver.
4
5
  */ export class ContractInstanceStore {
5
6
  db;
6
7
  #contractInstances;
@@ -12,13 +13,64 @@ import { SerializableContractInstance, SerializableContractInstanceUpdate } from
12
13
  this.#contractInstancePublishedAt = db.openMap('archiver_contract_instances_publication_block_number');
13
14
  this.#contractInstanceUpdates = db.openMap('archiver_contract_instance_updates');
14
15
  }
16
+ /**
17
+ * Adds multiple contract instances to the store.
18
+ * @param data - Contract instances to add.
19
+ * @param blockNumber - L2 block number where the instances were deployed.
20
+ * @returns True if every insert succeeded.
21
+ */ async addContractInstances(data, blockNumber) {
22
+ return (await Promise.all(data.map((c)=>this.addContractInstance(c, blockNumber)))).every(Boolean);
23
+ }
24
+ /**
25
+ * Removes multiple contract instances from the store.
26
+ * @param data - Contract instances to delete.
27
+ * @returns True if every delete succeeded.
28
+ */ async deleteContractInstances(data) {
29
+ return (await Promise.all(data.map((c)=>this.deleteContractInstance(c)))).every(Boolean);
30
+ }
31
+ /**
32
+ * Adds multiple contract instance updates to the store.
33
+ * @param data - Contract instance updates to add.
34
+ * @param timestamp - Timestamp at which the updates were scheduled.
35
+ * @returns True if every insert succeeded.
36
+ */ async addContractInstanceUpdates(data, timestamp) {
37
+ return (await Promise.all(data.map((update, logIndex)=>this.addContractInstanceUpdate(update, timestamp, logIndex)))).every(Boolean);
38
+ }
39
+ /**
40
+ * Removes multiple contract instance updates from the store.
41
+ * @param data - Contract instance updates to delete.
42
+ * @param timestamp - Timestamp at which the updates were scheduled.
43
+ * @returns True if every delete succeeded.
44
+ */ async deleteContractInstanceUpdates(data, timestamp) {
45
+ return (await Promise.all(data.map((update, logIndex)=>this.deleteContractInstanceUpdate(update, timestamp, logIndex)))).every(Boolean);
46
+ }
15
47
  addContractInstance(contractInstance, blockNumber) {
16
48
  return this.db.transactionAsync(async ()=>{
17
- await this.#contractInstances.set(contractInstance.address.toString(), new SerializableContractInstance(contractInstance).toBuffer());
18
- await this.#contractInstancePublishedAt.set(contractInstance.address.toString(), blockNumber);
49
+ const key = contractInstance.address.toString();
50
+ if (await this.#contractInstances.hasAsync(key)) {
51
+ // Protocol contracts are preloaded at block 0, so a later on-chain (re-)publish of a bundled
52
+ // protocol instance is valid and must be a no-op. Keep the existing block-0 entry untouched.
53
+ if (isProtocolContract(contractInstance.address)) {
54
+ return;
55
+ }
56
+ const existingBlockNumber = await this.#contractInstancePublishedAt.getAsync(key);
57
+ // An L1 reorg can re-present an already-stored checkpoint, replaying this instance at the same
58
+ // block; treat that as a no-op. A duplicate at a different block still signals double-processing.
59
+ if (existingBlockNumber === blockNumber) {
60
+ return;
61
+ }
62
+ throw new Error(`Contract instance at ${key} already exists (deployed at block ${existingBlockNumber}), cannot add again at block ${blockNumber}`);
63
+ }
64
+ await this.#contractInstances.set(key, new SerializableContractInstance(contractInstance).toBuffer());
65
+ await this.#contractInstancePublishedAt.set(key, blockNumber);
19
66
  });
20
67
  }
21
68
  deleteContractInstance(contractInstance) {
69
+ // Protocol contracts are preloaded at block 0 and must never be deleted, even when the block that
70
+ // (re-)published them on-chain is unwound by a reorg.
71
+ if (isProtocolContract(contractInstance.address)) {
72
+ return Promise.resolve();
73
+ }
22
74
  return this.db.transactionAsync(async ()=>{
23
75
  await this.#contractInstances.delete(contractInstance.address.toString());
24
76
  await this.#contractInstancePublishedAt.delete(contractInstance.address.toString());
@@ -0,0 +1,68 @@
1
+ import type { L1BlockId } from '@aztec/ethereum/l1-types';
2
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
+ import type { BlockHash } from '@aztec/stdlib/block';
4
+ import type { ContractDataSource } from '@aztec/stdlib/contract';
5
+ import { BlockStore } from './block_store.js';
6
+ import { ContractClassStore } from './contract_class_store.js';
7
+ import { ContractInstanceStore } from './contract_instance_store.js';
8
+ import { FunctionNamesCache } from './function_names_cache.js';
9
+ import { LogStore } from './log_store.js';
10
+ import { MessageStore } from './message_store.js';
11
+ export declare const ARCHIVER_DB_VERSION = 7;
12
+ /**
13
+ * Represents the latest L1 block processed by the archiver for various objects in L2.
14
+ */
15
+ export type ArchiverL1SynchPoint = {
16
+ /** Number of the last L1 block that added a new L2 checkpoint metadata. */
17
+ blocksSynchedTo?: bigint;
18
+ /** Last L1 block checked for L1 to L2 messages. */
19
+ messagesSynchedTo?: L1BlockId;
20
+ };
21
+ /**
22
+ * Bundle of archiver-owned LMDB substores plus the in-memory caches that span them.
23
+ *
24
+ * Replaces the former `KVArchiverDataStore` pass-through wrapper. Callers reach into
25
+ * the relevant substore directly (e.g. `stores.blocks.getBlock`) and use
26
+ * {@link createArchiverDataStores} to wire them up against a shared KV store.
27
+ */
28
+ export type ArchiverDataStores = {
29
+ /** The underlying key-value store. Use {@link AztecAsyncKVStore.transactionAsync} to compose updates atomically. */
30
+ db: AztecAsyncKVStore;
31
+ /** Blocks, checkpoints, tx effects, proven/finalized state. */
32
+ blocks: BlockStore;
33
+ /** Public, private and contract class logs. */
34
+ logs: LogStore;
35
+ /** L1 to L2 messages and message sync state. */
36
+ messages: MessageStore;
37
+ /** Contract classes (with bytecode commitments). */
38
+ contractClasses: ContractClassStore;
39
+ /** Contract instances and contract instance updates. */
40
+ contractInstances: ContractInstanceStore;
41
+ /** In-memory cache of public function selectors -> names. */
42
+ functionNames: FunctionNamesCache;
43
+ };
44
+ /**
45
+ * Wires up the archiver substores against a shared KV store and returns the
46
+ * {@link ArchiverDataStores} bundle.
47
+ *
48
+ * @param genesisBlockHash - Hash of the synthetic genesis block, forwarded to the {@link LogStore} so it
49
+ * can resolve a genesis `referenceBlock` (used by the PXE during early sync) instead of treating it as a
50
+ * reorg.
51
+ */
52
+ export declare function createArchiverDataStores(db: AztecAsyncKVStore, genesisBlockHash: BlockHash): ArchiverDataStores;
53
+ /**
54
+ * Returns the L1 sync point of the archiver, combining the block sync point from {@link BlockStore}
55
+ * and the message sync point from {@link MessageStore}.
56
+ */
57
+ export declare function getArchiverSynchPoint(stores: ArchiverDataStores): Promise<ArchiverL1SynchPoint>;
58
+ /**
59
+ * Backs up the underlying KV store to the given folder. Returns the path to the resulting db file.
60
+ */
61
+ export declare function backupArchiverDataStores(stores: ArchiverDataStores, path: string, compress?: boolean): Promise<string>;
62
+ /**
63
+ * Returns a {@link ContractDataSource} adapter over {@link ArchiverDataStores}.
64
+ * Used by contexts (e.g. offline epoch re-prover tools) that need a ContractDataSource
65
+ * but do not need a full archiver instance.
66
+ */
67
+ export declare function createContractDataSource(stores: ArchiverDataStores): ContractDataSource;
68
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLC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AkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAMrG;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,UAAO,GACd,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAEvF"}
@@ -0,0 +1,54 @@
1
+ import { join } from 'path';
2
+ import { ArchiverContractDataSourceAdapter } from '../modules/contract_data_source_adapter.js';
3
+ import { BlockStore } from './block_store.js';
4
+ import { ContractClassStore } from './contract_class_store.js';
5
+ import { ContractInstanceStore } from './contract_instance_store.js';
6
+ import { FunctionNamesCache } from './function_names_cache.js';
7
+ import { LogStore } from './log_store.js';
8
+ import { MessageStore } from './message_store.js';
9
+ export const ARCHIVER_DB_VERSION = 7;
10
+ /**
11
+ * Wires up the archiver substores against a shared KV store and returns the
12
+ * {@link ArchiverDataStores} bundle.
13
+ *
14
+ * @param genesisBlockHash - Hash of the synthetic genesis block, forwarded to the {@link LogStore} so it
15
+ * can resolve a genesis `referenceBlock` (used by the PXE during early sync) instead of treating it as a
16
+ * reorg.
17
+ */ export function createArchiverDataStores(db, genesisBlockHash) {
18
+ const blocks = new BlockStore(db);
19
+ return {
20
+ db,
21
+ blocks,
22
+ logs: new LogStore(db, blocks, genesisBlockHash),
23
+ messages: new MessageStore(db),
24
+ contractClasses: new ContractClassStore(db),
25
+ contractInstances: new ContractInstanceStore(db),
26
+ functionNames: new FunctionNamesCache()
27
+ };
28
+ }
29
+ /**
30
+ * Returns the L1 sync point of the archiver, combining the block sync point from {@link BlockStore}
31
+ * and the message sync point from {@link MessageStore}.
32
+ */ export async function getArchiverSynchPoint(stores) {
33
+ const [blocksSynchedTo, messagesSynchedTo] = await Promise.all([
34
+ stores.blocks.getSynchedL1BlockNumber(),
35
+ stores.messages.getSynchedL1Block()
36
+ ]);
37
+ return {
38
+ blocksSynchedTo,
39
+ messagesSynchedTo
40
+ };
41
+ }
42
+ /**
43
+ * Backs up the underlying KV store to the given folder. Returns the path to the resulting db file.
44
+ */ export async function backupArchiverDataStores(stores, path, compress = true) {
45
+ await stores.db.backupTo(path, compress);
46
+ return join(path, 'data.mdb');
47
+ }
48
+ /**
49
+ * Returns a {@link ContractDataSource} adapter over {@link ArchiverDataStores}.
50
+ * Used by contexts (e.g. offline epoch re-prover tools) that need a ContractDataSource
51
+ * but do not need a full archiver instance.
52
+ */ export function createContractDataSource(stores) {
53
+ return new ArchiverContractDataSourceAdapter(stores);
54
+ }
@@ -0,0 +1,17 @@
1
+ import { FunctionSelector } from '@aztec/stdlib/abi';
2
+ /**
3
+ * In-memory cache mapping public function selectors to function names.
4
+ *
5
+ * Populated opportunistically (e.g. by PXE registering signatures from artifacts) so the
6
+ * archiver can attach human-readable names to logs and traces. Bounded by
7
+ * {@link MAX_FUNCTION_SIGNATURES} to avoid unbounded growth from untrusted callers.
8
+ */
9
+ export declare class FunctionNamesCache {
10
+ private readonly log;
11
+ private readonly names;
12
+ /** Adds the given public function signatures to the cache. */
13
+ register(signatures: string[]): Promise<void>;
14
+ /** Looks up a function name for the given selector, or returns undefined if not registered. */
15
+ get(selector: FunctionSelector): string | undefined;
16
+ }
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnVuY3Rpb25fbmFtZXNfY2FjaGUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yZS9mdW5jdGlvbl9uYW1lc19jYWNoZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUtyRDs7Ozs7O0dBTUc7QUFDSCxxQkFBYSxrQkFBa0I7SUFDN0IsT0FBTyxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQXdDO0lBQzVELE9BQU8sQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFrQztJQUV4RCw4REFBOEQ7SUFDakQsUUFBUSxDQUFDLFVBQVUsRUFBRSxNQUFNLEVBQUUsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBWXpEO0lBRUQsK0ZBQStGO0lBQ3hGLEdBQUcsQ0FBQyxRQUFRLEVBQUUsZ0JBQWdCLEdBQUcsTUFBTSxHQUFHLFNBQVMsQ0FFekQ7Q0FDRiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function_names_cache.d.ts","sourceRoot":"","sources":["../../src/store/function_names_cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;;;;;GAMG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwC;IAC5D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkC;IAExD,8DAA8D;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAYzD;IAED,+FAA+F;IACxF,GAAG,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAEzD;CACF"}
@@ -0,0 +1,30 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { FunctionSelector } from '@aztec/stdlib/abi';
3
+ const MAX_FUNCTION_SIGNATURES = 1000;
4
+ const MAX_FUNCTION_NAME_LEN = 256;
5
+ /**
6
+ * In-memory cache mapping public function selectors to function names.
7
+ *
8
+ * Populated opportunistically (e.g. by PXE registering signatures from artifacts) so the
9
+ * archiver can attach human-readable names to logs and traces. Bounded by
10
+ * {@link MAX_FUNCTION_SIGNATURES} to avoid unbounded growth from untrusted callers.
11
+ */ export class FunctionNamesCache {
12
+ log = createLogger('archiver:data-stores');
13
+ names = new Map();
14
+ /** Adds the given public function signatures to the cache. */ async register(signatures) {
15
+ for (const sig of signatures){
16
+ if (this.names.size > MAX_FUNCTION_SIGNATURES) {
17
+ return;
18
+ }
19
+ try {
20
+ const selector = await FunctionSelector.fromSignature(sig);
21
+ this.names.set(selector.toString(), sig.slice(0, sig.indexOf('(')).slice(0, MAX_FUNCTION_NAME_LEN));
22
+ } catch {
23
+ this.log.warn(`Failed to parse signature: ${sig}. Ignoring`);
24
+ }
25
+ }
26
+ }
27
+ /** Looks up a function name for the given selector, or returns undefined if not registered. */ get(selector) {
28
+ return this.names.get(selector.toString());
29
+ }
30
+ }
@@ -0,0 +1,25 @@
1
+ import type { BlockHash, L2Tips } from '@aztec/stdlib/block';
2
+ import type { BlockStore } from './block_store.js';
3
+ /**
4
+ * In-memory cache for L2 chain tips (proposed, checkpointed, proven, finalized).
5
+ * Populated from the BlockStore on first access, then kept up-to-date by the ArchiverDataStoreUpdater.
6
+ * Refresh calls should happen *after* the store transaction that mutates block data has committed,
7
+ * so the cache loads from committed state and is never replaced if the writer aborts.
8
+ */
9
+ export declare class L2TipsCache {
10
+ #private;
11
+ private blockStore;
12
+ private readonly initialBlockHash;
13
+ /**
14
+ * The genesis block hash is dynamic — derived from the injected initial header, which depends on
15
+ * `genesisTimestamp` and any prefilled state — so it is supplied here rather than read from store.
16
+ * The genesis checkpoint hash, by contrast, is the static protocol constant and is resolved
17
+ * inside the block store.
18
+ */
19
+ constructor(blockStore: BlockStore, initialBlockHash: BlockHash);
20
+ /** Returns the cached L2 tips. Loads from the block store on first call. */
21
+ getL2Tips(): Promise<L2Tips>;
22
+ /** Reloads the L2 tips from the block store. Should be called after the writer transaction has committed. */
23
+ refresh(): Promise<void>;
24
+ }
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDJfdGlwc19jYWNoZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3N0b3JlL2wyX3RpcHNfY2FjaGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRTdELE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRW5EOzs7OztHQUtHO0FBQ0gscUJBQWEsV0FBVzs7SUFVcEIsT0FBTyxDQUFDLFVBQVU7SUFDbEIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxnQkFBZ0I7SUFSbkM7Ozs7O09BS0c7SUFDSCxZQUNVLFVBQVUsRUFBRSxVQUFVLEVBQ2IsZ0JBQWdCLEVBQUUsU0FBUyxFQUMxQztJQUVKLDRFQUE0RTtJQUNyRSxTQUFTLElBQUksT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUVsQztJQUVELDZHQUE2RztJQUNoRyxPQUFPLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUdwQztDQUNGIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"l2_tips_cache.d.ts","sourceRoot":"","sources":["../../src/store/l2_tips_cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,WAAW;;IAUpB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IARnC;;;;;OAKG;IACH,YACU,UAAU,EAAE,UAAU,EACb,gBAAgB,EAAE,SAAS,EAC1C;IAEJ,4EAA4E;IACrE,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,6GAA6G;IAChG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpC;CACF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * In-memory cache for L2 chain tips (proposed, checkpointed, proven, finalized).
3
+ * Populated from the BlockStore on first access, then kept up-to-date by the ArchiverDataStoreUpdater.
4
+ * Refresh calls should happen *after* the store transaction that mutates block data has committed,
5
+ * so the cache loads from committed state and is never replaced if the writer aborts.
6
+ */ export class L2TipsCache {
7
+ blockStore;
8
+ initialBlockHash;
9
+ #tipsPromise;
10
+ /**
11
+ * The genesis block hash is dynamic — derived from the injected initial header, which depends on
12
+ * `genesisTimestamp` and any prefilled state — so it is supplied here rather than read from store.
13
+ * The genesis checkpoint hash, by contrast, is the static protocol constant and is resolved
14
+ * inside the block store.
15
+ */ constructor(blockStore, initialBlockHash){
16
+ this.blockStore = blockStore;
17
+ this.initialBlockHash = initialBlockHash;
18
+ }
19
+ /** Returns the cached L2 tips. Loads from the block store on first call. */ getL2Tips() {
20
+ return this.#tipsPromise ??= this.blockStore.getL2TipsData(this.initialBlockHash);
21
+ }
22
+ /** Reloads the L2 tips from the block store. Should be called after the writer transaction has committed. */ async refresh() {
23
+ this.#tipsPromise = this.blockStore.getL2TipsData(this.initialBlockHash);
24
+ await this.#tipsPromise;
25
+ }
26
+ }
@@ -0,0 +1,59 @@
1
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
+ import type { BlockHash, L2Block } from '@aztec/stdlib/block';
3
+ import type { LogResult, PrivateLogsQuery, PublicLogsQuery } from '@aztec/stdlib/logs';
4
+ import type { BlockStore } from './block_store.js';
5
+ /**
6
+ * Indexes every emitted private and public log under a composite hex-string key
7
+ * `[contractAddress (public only)]-tag-blockNumber-txIndexWithinBlock-logIndexWithinTx`,
8
+ * where each numeric segment is zero-padded to 8 lowercase hex digits (4 bytes BE) and
9
+ * `contractAddress` / `tag` are the bare 64-hex-char field representations (no `0x` prefix). The
10
+ * fixed-width zero-padded hex segments sort lexicographically in the same order as the canonical
11
+ * `(contract, tag, blockNumber, txIndexWithinBlock, logIndexWithinTx)` tuple, so a single ordered
12
+ * range scan answers every {@link PrivateLogsQuery} / {@link PublicLogsQuery}.
13
+ *
14
+ * Per-block secondary indices (`#privateKeysByBlock`, `#publicKeysByBlock`) record the exact primary
15
+ * keys written for each block so {@link deleteLogs} can drop them on reorg without having to range
16
+ * scan by block (block isn't the leading key segment).
17
+ *
18
+ * Contract-class logs are no longer stored or served by the log store.
19
+ */
20
+ export declare class LogStore {
21
+ #private;
22
+ private db;
23
+ private blockStore;
24
+ private readonly genesisBlockHash;
25
+ /**
26
+ * @param genesisBlockHash - Hash of the synthetic genesis block. During early sync the PXE anchors to
27
+ * genesis and passes its hash as a query `referenceBlock`; since the archiver never indexes the
28
+ * genesis block, the store recognizes this hash directly and resolves it to the genesis block number
29
+ * rather than mistaking it for a reorg.
30
+ */
31
+ constructor(db: AztecAsyncKVStore, blockStore: BlockStore, genesisBlockHash: BlockHash);
32
+ /**
33
+ * Indexes every emitted private and public log from the given blocks. Wraps the write in a single
34
+ * `db.transactionAsync` so the primary entries and the per-block secondary indices stay consistent.
35
+ *
36
+ * A block is only ever added once; on reorg the archiver calls {@link deleteLogs} first, so we write
37
+ * the secondary index entries with a plain `set` (overwrite) rather than read-modify-append.
38
+ */
39
+ addLogs(blocks: L2Block[]): Promise<boolean>;
40
+ /**
41
+ * Deletes every log indexed under any of the given blocks. Secondary-index driven, so it doesn't
42
+ * have to range-scan the primary maps.
43
+ */
44
+ deleteLogs(blocks: L2Block[]): Promise<boolean>;
45
+ /** Returns one inner array per element of `query.tags`, in input order. */
46
+ getPrivateLogsByTags(query: PrivateLogsQuery): Promise<LogResult[][]>;
47
+ /** Returns one inner array per element of `query.tags`, in input order. */
48
+ getPublicLogsByTags(query: PublicLogsQuery): Promise<LogResult[][]>;
49
+ /**
50
+ * Reads back every private log indexed for the given block via the per-block secondary index. Order
51
+ * matches the canonical composite-key order (`tag`, `blockNumber`, `txIndexWithinBlock`,
52
+ * `logIndexWithinTx`). Used by the data-store-updater test suite to verify the indexed-vs-block-body
53
+ * counts without depending on the removed `getPublicLogs(LogFilter)` API.
54
+ */
55
+ getPrivateLogsForBlock(blockNumber: number): Promise<LogResult[]>;
56
+ /** {@in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