@aztec/archiver 0.0.0-test.1 → 0.0.1-commit.023c3e5

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 (225) hide show
  1. package/README.md +164 -9
  2. package/dest/archiver.d.ts +136 -0
  3. package/dest/archiver.d.ts.map +1 -0
  4. package/dest/archiver.js +781 -0
  5. package/dest/config.d.ts +30 -0
  6. package/dest/config.d.ts.map +1 -0
  7. package/dest/config.js +71 -0
  8. package/dest/errors.d.ts +41 -0
  9. package/dest/errors.d.ts.map +1 -0
  10. package/dest/errors.js +62 -0
  11. package/dest/factory.d.ts +13 -16
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +103 -55
  14. package/dest/index.d.ts +10 -4
  15. package/dest/index.d.ts.map +1 -1
  16. package/dest/index.js +8 -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 +149 -0
  23. package/dest/l1/calldata_retriever.d.ts +112 -0
  24. package/dest/l1/calldata_retriever.d.ts.map +1 -0
  25. package/dest/l1/calldata_retriever.js +471 -0
  26. package/dest/l1/data_retrieval.d.ts +88 -0
  27. package/dest/l1/data_retrieval.d.ts.map +1 -0
  28. package/dest/l1/data_retrieval.js +312 -0
  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 +157 -0
  35. package/dest/l1/trace_tx.d.ts +97 -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_trace.d.ts +32 -0
  42. package/dest/l1/validate_trace.d.ts.map +1 -0
  43. package/dest/l1/validate_trace.js +154 -0
  44. package/dest/modules/data_source_base.d.ts +84 -0
  45. package/dest/modules/data_source_base.d.ts.map +1 -0
  46. package/dest/modules/data_source_base.js +260 -0
  47. package/dest/modules/data_store_updater.d.ts +73 -0
  48. package/dest/modules/data_store_updater.d.ts.map +1 -0
  49. package/dest/modules/data_store_updater.js +302 -0
  50. package/dest/modules/instrumentation.d.ts +37 -0
  51. package/dest/modules/instrumentation.d.ts.map +1 -0
  52. package/dest/modules/instrumentation.js +110 -0
  53. package/dest/modules/l1_synchronizer.d.ts +75 -0
  54. package/dest/modules/l1_synchronizer.d.ts.map +1 -0
  55. package/dest/modules/l1_synchronizer.js +1112 -0
  56. package/dest/modules/validation.d.ts +17 -0
  57. package/dest/modules/validation.d.ts.map +1 -0
  58. package/dest/modules/validation.js +104 -0
  59. package/dest/store/block_store.d.ts +192 -0
  60. package/dest/store/block_store.d.ts.map +1 -0
  61. package/dest/store/block_store.js +721 -0
  62. package/dest/store/contract_class_store.d.ts +18 -0
  63. package/dest/store/contract_class_store.d.ts.map +1 -0
  64. package/dest/{archiver/kv_archiver_store → store}/contract_class_store.js +25 -27
  65. package/dest/store/contract_instance_store.d.ts +24 -0
  66. package/dest/store/contract_instance_store.d.ts.map +1 -0
  67. package/dest/store/contract_instance_store.js +77 -0
  68. package/dest/store/kv_archiver_store.d.ts +340 -0
  69. package/dest/store/kv_archiver_store.d.ts.map +1 -0
  70. package/dest/store/kv_archiver_store.js +446 -0
  71. package/dest/store/log_store.d.ts +54 -0
  72. package/dest/store/log_store.d.ts.map +1 -0
  73. package/dest/store/log_store.js +436 -0
  74. package/dest/store/message_store.d.ts +40 -0
  75. package/dest/store/message_store.d.ts.map +1 -0
  76. package/dest/store/message_store.js +188 -0
  77. package/dest/structs/data_retrieval.d.ts +27 -0
  78. package/dest/structs/data_retrieval.d.ts.map +1 -0
  79. package/dest/structs/inbox_message.d.ts +15 -0
  80. package/dest/structs/inbox_message.d.ts.map +1 -0
  81. package/dest/structs/inbox_message.js +39 -0
  82. package/dest/structs/published.d.ts +2 -0
  83. package/dest/structs/published.d.ts.map +1 -0
  84. package/dest/structs/published.js +1 -0
  85. package/dest/test/fake_l1_state.d.ts +190 -0
  86. package/dest/test/fake_l1_state.d.ts.map +1 -0
  87. package/dest/test/fake_l1_state.js +383 -0
  88. package/dest/test/index.d.ts +2 -1
  89. package/dest/test/index.d.ts.map +1 -1
  90. package/dest/test/index.js +4 -1
  91. package/dest/test/mock_archiver.d.ts +16 -8
  92. package/dest/test/mock_archiver.d.ts.map +1 -1
  93. package/dest/test/mock_archiver.js +18 -14
  94. package/dest/test/mock_l1_to_l2_message_source.d.ts +9 -6
  95. package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
  96. package/dest/test/mock_l1_to_l2_message_source.js +30 -7
  97. package/dest/test/mock_l2_block_source.d.ts +62 -16
  98. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  99. package/dest/test/mock_l2_block_source.js +263 -32
  100. package/dest/test/mock_structs.d.ts +85 -0
  101. package/dest/test/mock_structs.d.ts.map +1 -0
  102. package/dest/test/mock_structs.js +171 -0
  103. package/dest/test/noop_l1_archiver.d.ts +23 -0
  104. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  105. package/dest/test/noop_l1_archiver.js +68 -0
  106. package/package.json +31 -33
  107. package/src/archiver.ts +543 -0
  108. package/src/config.ts +95 -0
  109. package/src/errors.ts +102 -0
  110. package/src/factory.ts +144 -71
  111. package/src/index.ts +10 -3
  112. package/src/interfaces.ts +9 -0
  113. package/src/l1/README.md +98 -0
  114. package/src/l1/bin/retrieve-calldata.ts +187 -0
  115. package/src/l1/calldata_retriever.ts +641 -0
  116. package/src/l1/data_retrieval.ts +495 -0
  117. package/src/l1/debug_tx.ts +99 -0
  118. package/src/l1/spire_proposer.ts +160 -0
  119. package/src/l1/trace_tx.ts +128 -0
  120. package/src/l1/types.ts +13 -0
  121. package/src/l1/validate_trace.ts +229 -0
  122. package/src/modules/data_source_base.ts +367 -0
  123. package/src/modules/data_store_updater.ts +423 -0
  124. package/src/modules/instrumentation.ts +157 -0
  125. package/src/modules/l1_synchronizer.ts +930 -0
  126. package/src/modules/validation.ts +129 -0
  127. package/src/store/block_store.ts +966 -0
  128. package/src/{archiver/kv_archiver_store → store}/contract_class_store.ts +26 -32
  129. package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +37 -29
  130. package/src/store/kv_archiver_store.ts +639 -0
  131. package/src/store/log_store.ts +575 -0
  132. package/src/store/message_store.ts +261 -0
  133. package/src/structs/inbox_message.ts +41 -0
  134. package/src/structs/published.ts +1 -0
  135. package/src/test/fake_l1_state.ts +599 -0
  136. package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
  137. package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
  138. package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
  139. package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
  140. package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
  141. package/src/test/fixtures/trace_transaction-proxied.json +128 -0
  142. package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
  143. package/src/test/index.ts +4 -0
  144. package/src/test/mock_archiver.ts +22 -16
  145. package/src/test/mock_l1_to_l2_message_source.ts +26 -8
  146. package/src/test/mock_l2_block_source.ts +313 -42
  147. package/src/test/mock_structs.ts +311 -0
  148. package/src/test/noop_l1_archiver.ts +109 -0
  149. package/dest/archiver/archiver.d.ts +0 -197
  150. package/dest/archiver/archiver.d.ts.map +0 -1
  151. package/dest/archiver/archiver.js +0 -900
  152. package/dest/archiver/archiver_store.d.ts +0 -220
  153. package/dest/archiver/archiver_store.d.ts.map +0 -1
  154. package/dest/archiver/archiver_store.js +0 -4
  155. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  156. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  157. package/dest/archiver/archiver_store_test_suite.js +0 -794
  158. package/dest/archiver/config.d.ts +0 -37
  159. package/dest/archiver/config.d.ts.map +0 -1
  160. package/dest/archiver/config.js +0 -46
  161. package/dest/archiver/data_retrieval.d.ts +0 -74
  162. package/dest/archiver/data_retrieval.d.ts.map +0 -1
  163. package/dest/archiver/data_retrieval.js +0 -283
  164. package/dest/archiver/errors.d.ts +0 -4
  165. package/dest/archiver/errors.d.ts.map +0 -1
  166. package/dest/archiver/errors.js +0 -5
  167. package/dest/archiver/index.d.ts +0 -8
  168. package/dest/archiver/index.d.ts.map +0 -1
  169. package/dest/archiver/index.js +0 -5
  170. package/dest/archiver/instrumentation.d.ts +0 -29
  171. package/dest/archiver/instrumentation.d.ts.map +0 -1
  172. package/dest/archiver/instrumentation.js +0 -99
  173. package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -87
  174. package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
  175. package/dest/archiver/kv_archiver_store/block_store.js +0 -217
  176. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
  177. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
  178. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -21
  179. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  180. package/dest/archiver/kv_archiver_store/contract_instance_store.js +0 -63
  181. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -153
  182. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
  183. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -254
  184. package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -49
  185. package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
  186. package/dest/archiver/kv_archiver_store/log_store.js +0 -364
  187. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -33
  188. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  189. package/dest/archiver/kv_archiver_store/message_store.js +0 -85
  190. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts +0 -12
  191. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts.map +0 -1
  192. package/dest/archiver/kv_archiver_store/nullifier_store.js +0 -73
  193. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts +0 -23
  194. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts.map +0 -1
  195. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.js +0 -49
  196. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +0 -175
  197. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +0 -1
  198. package/dest/archiver/memory_archiver_store/memory_archiver_store.js +0 -636
  199. package/dest/archiver/structs/data_retrieval.d.ts +0 -27
  200. package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
  201. package/dest/archiver/structs/published.d.ts +0 -11
  202. package/dest/archiver/structs/published.d.ts.map +0 -1
  203. package/dest/archiver/structs/published.js +0 -1
  204. package/dest/rpc/index.d.ts +0 -10
  205. package/dest/rpc/index.d.ts.map +0 -1
  206. package/dest/rpc/index.js +0 -18
  207. package/src/archiver/archiver.ts +0 -1181
  208. package/src/archiver/archiver_store.ts +0 -263
  209. package/src/archiver/archiver_store_test_suite.ts +0 -810
  210. package/src/archiver/config.ts +0 -92
  211. package/src/archiver/data_retrieval.ts +0 -422
  212. package/src/archiver/errors.ts +0 -5
  213. package/src/archiver/index.ts +0 -7
  214. package/src/archiver/instrumentation.ts +0 -132
  215. package/src/archiver/kv_archiver_store/block_store.ts +0 -283
  216. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -358
  217. package/src/archiver/kv_archiver_store/log_store.ts +0 -444
  218. package/src/archiver/kv_archiver_store/message_store.ts +0 -102
  219. package/src/archiver/kv_archiver_store/nullifier_store.ts +0 -97
  220. package/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts +0 -61
  221. package/src/archiver/memory_archiver_store/memory_archiver_store.ts +0 -801
  222. package/src/archiver/structs/published.ts +0 -11
  223. package/src/rpc/index.ts +0 -20
  224. /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
  225. /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
@@ -1,87 +0,0 @@
1
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
- import { type InBlock, L2Block } from '@aztec/stdlib/block';
4
- import { BlockHeader, TxEffect, TxHash, TxReceipt } from '@aztec/stdlib/tx';
5
- import type { L1Published } from '../structs/published.js';
6
- export { type TxEffect, type TxHash, TxReceipt } from '@aztec/stdlib/tx';
7
- /**
8
- * LMDB implementation of the ArchiverDataStore interface.
9
- */
10
- export declare class BlockStore {
11
- #private;
12
- private db;
13
- constructor(db: AztecAsyncKVStore);
14
- /**
15
- * Append new blocks to the store's list.
16
- * @param blocks - The L2 blocks to be added to the store.
17
- * @returns True if the operation is successful.
18
- */
19
- addBlocks(blocks: L1Published<L2Block>[]): Promise<boolean>;
20
- /**
21
- * Unwinds blocks from the database
22
- * @param from - The tip of the chain, passed for verification purposes,
23
- * ensuring that we don't end up deleting something we did not intend
24
- * @param blocksToUnwind - The number of blocks we are to unwind
25
- * @returns True if the operation is successful
26
- */
27
- unwindBlocks(from: number, blocksToUnwind: number): Promise<boolean>;
28
- /**
29
- * Gets up to `limit` amount of L2 blocks starting from `from`.
30
- * @param start - Number of the first block to return (inclusive).
31
- * @param limit - The number of blocks to return.
32
- * @returns The requested L2 blocks
33
- */
34
- getBlocks(start: number, limit: number): AsyncIterableIterator<L1Published<L2Block>>;
35
- /**
36
- * Gets an L2 block.
37
- * @param blockNumber - The number of the block to return.
38
- * @returns The requested L2 block.
39
- */
40
- getBlock(blockNumber: number): Promise<L1Published<L2Block> | undefined>;
41
- /**
42
- * Gets the headers for a sequence of L2 blocks.
43
- * @param start - Number of the first block to return (inclusive).
44
- * @param limit - The number of blocks to return.
45
- * @returns The requested L2 block headers
46
- */
47
- getBlockHeaders(start: number, limit: number): AsyncIterableIterator<BlockHeader>;
48
- private getBlockFromBlockStorage;
49
- /**
50
- * Gets a tx effect.
51
- * @param txHash - The txHash of the tx corresponding to the tx effect.
52
- * @returns The requested tx effect (or undefined if not found).
53
- */
54
- getTxEffect(txHash: TxHash): Promise<InBlock<TxEffect> | undefined>;
55
- /**
56
- * Gets a receipt of a settled tx.
57
- * @param txHash - The hash of a tx we try to get the receipt for.
58
- * @returns The requested tx receipt (or undefined if not found).
59
- */
60
- getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
61
- /**
62
- * Looks up which block included the requested tx effect.
63
- * @param txHash - The txHash of the tx.
64
- * @returns The block number and index of the tx.
65
- */
66
- getTxLocation(txHash: TxHash): Promise<[blockNumber: number, txIndex: number] | undefined>;
67
- /**
68
- * Looks up which block deployed a particular contract.
69
- * @param contractAddress - The address of the contract to look up.
70
- * @returns The block number and index of the contract.
71
- */
72
- getContractLocation(contractAddress: AztecAddress): Promise<[blockNumber: number, index: number] | undefined>;
73
- /**
74
- * Gets the number of the latest L2 block processed.
75
- * @returns The number of the latest L2 block processed.
76
- */
77
- getSynchedL2BlockNumber(): Promise<number>;
78
- /**
79
- * Gets the most recent L1 block processed.
80
- * @returns The L1 block that published the latest L2 block
81
- */
82
- getSynchedL1BlockNumber(): Promise<bigint | undefined>;
83
- setSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<boolean>;
84
- getProvenL2BlockNumber(): Promise<number>;
85
- setProvenL2BlockNumber(blockNumber: number): Promise<boolean>;
86
- }
87
- //# sourceMappingURL=block_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/block_store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAA6C,MAAM,iBAAiB,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OAIG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAI1F;;;;OAIG;IACH,mBAAmB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAI7G;;;OAGG;IACG,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAKhD;;;OAGG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAItD,uBAAuB,CAAC,aAAa,EAAE,MAAM;IAIvC,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/C,sBAAsB,CAAC,WAAW,EAAE,MAAM;CAe3C"}
@@ -1,217 +0,0 @@
1
- import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
2
- import { toArray } from '@aztec/foundation/iterable';
3
- import { createLogger } from '@aztec/foundation/log';
4
- import { Body, L2Block, L2BlockHash } from '@aztec/stdlib/block';
5
- import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
6
- import { BlockHeader, TxReceipt } from '@aztec/stdlib/tx';
7
- export { TxReceipt } from '@aztec/stdlib/tx';
8
- /**
9
- * LMDB implementation of the ArchiverDataStore interface.
10
- */ export class BlockStore {
11
- db;
12
- /** Map block number to block data */ #blocks;
13
- /** Map block hash to block body */ #blockBodies;
14
- /** Stores L1 block number in which the last processed L2 block was included */ #lastSynchedL1Block;
15
- /** Stores l2 block number of the last proven block */ #lastProvenL2Block;
16
- /** Stores l2 epoch number of the last proven epoch */ #lastProvenL2Epoch;
17
- /** Index mapping transaction hash (as a string) to its location in a block */ #txIndex;
18
- /** Index mapping a contract's address (as a string) to its location in a block */ #contractIndex;
19
- #log;
20
- constructor(db){
21
- this.db = db;
22
- this.#log = createLogger('archiver:block_store');
23
- this.#blocks = db.openMap('archiver_blocks');
24
- this.#blockBodies = db.openMap('archiver_block_bodies');
25
- this.#txIndex = db.openMap('archiver_tx_index');
26
- this.#contractIndex = db.openMap('archiver_contract_index');
27
- this.#lastSynchedL1Block = db.openSingleton('archiver_last_synched_l1_block');
28
- this.#lastProvenL2Block = db.openSingleton('archiver_last_proven_l2_block');
29
- this.#lastProvenL2Epoch = db.openSingleton('archiver_last_proven_l2_epoch');
30
- }
31
- /**
32
- * Append new blocks to the store's list.
33
- * @param blocks - The L2 blocks to be added to the store.
34
- * @returns True if the operation is successful.
35
- */ async addBlocks(blocks) {
36
- if (blocks.length === 0) {
37
- return true;
38
- }
39
- return await this.db.transactionAsync(async ()=>{
40
- for (const block of blocks){
41
- await this.#blocks.set(block.data.number, {
42
- header: block.data.header.toBuffer(),
43
- archive: block.data.archive.toBuffer(),
44
- l1: block.l1
45
- });
46
- for(let i = 0; i < block.data.body.txEffects.length; i++){
47
- const txEffect = block.data.body.txEffects[i];
48
- await this.#txIndex.set(txEffect.txHash.toString(), [
49
- block.data.number,
50
- i
51
- ]);
52
- }
53
- await this.#blockBodies.set((await block.data.hash()).toString(), block.data.body.toBuffer());
54
- }
55
- await this.#lastSynchedL1Block.set(blocks[blocks.length - 1].l1.blockNumber);
56
- return true;
57
- });
58
- }
59
- /**
60
- * Unwinds blocks from the database
61
- * @param from - The tip of the chain, passed for verification purposes,
62
- * ensuring that we don't end up deleting something we did not intend
63
- * @param blocksToUnwind - The number of blocks we are to unwind
64
- * @returns True if the operation is successful
65
- */ async unwindBlocks(from, blocksToUnwind) {
66
- return await this.db.transactionAsync(async ()=>{
67
- const last = await this.getSynchedL2BlockNumber();
68
- if (from !== last) {
69
- throw new Error(`Can only unwind blocks from the tip (requested ${from} but current tip is ${last})`);
70
- }
71
- for(let i = 0; i < blocksToUnwind; i++){
72
- const blockNumber = from - i;
73
- const block = await this.getBlock(blockNumber);
74
- if (block === undefined) {
75
- this.#log.warn(`Cannot remove block ${blockNumber} from the store since we don't have it`);
76
- continue;
77
- }
78
- await this.#blocks.delete(block.data.number);
79
- await Promise.all(block.data.body.txEffects.map((tx)=>this.#txIndex.delete(tx.txHash.toString())));
80
- const blockHash = (await block.data.hash()).toString();
81
- await this.#blockBodies.delete(blockHash);
82
- this.#log.debug(`Unwound block ${blockNumber} ${blockHash}`);
83
- }
84
- return true;
85
- });
86
- }
87
- /**
88
- * Gets up to `limit` amount of L2 blocks starting from `from`.
89
- * @param start - Number of the first block to return (inclusive).
90
- * @param limit - The number of blocks to return.
91
- * @returns The requested L2 blocks
92
- */ async *getBlocks(start, limit) {
93
- for await (const blockStorage of this.#blocks.valuesAsync(this.#computeBlockRange(start, limit))){
94
- const block = await this.getBlockFromBlockStorage(blockStorage);
95
- yield block;
96
- }
97
- }
98
- /**
99
- * Gets an L2 block.
100
- * @param blockNumber - The number of the block to return.
101
- * @returns The requested L2 block.
102
- */ async getBlock(blockNumber) {
103
- const blockStorage = await this.#blocks.getAsync(blockNumber);
104
- if (!blockStorage || !blockStorage.header) {
105
- return Promise.resolve(undefined);
106
- }
107
- return this.getBlockFromBlockStorage(blockStorage);
108
- }
109
- /**
110
- * Gets the headers for a sequence of L2 blocks.
111
- * @param start - Number of the first block to return (inclusive).
112
- * @param limit - The number of blocks to return.
113
- * @returns The requested L2 block headers
114
- */ async *getBlockHeaders(start, limit) {
115
- for await (const blockStorage of this.#blocks.valuesAsync(this.#computeBlockRange(start, limit))){
116
- yield BlockHeader.fromBuffer(blockStorage.header);
117
- }
118
- }
119
- async getBlockFromBlockStorage(blockStorage) {
120
- const header = BlockHeader.fromBuffer(blockStorage.header);
121
- const archive = AppendOnlyTreeSnapshot.fromBuffer(blockStorage.archive);
122
- const blockHash = (await header.hash()).toString();
123
- const blockBodyBuffer = await this.#blockBodies.getAsync(blockHash);
124
- if (blockBodyBuffer === undefined) {
125
- throw new Error(`Could not retrieve body for block ${header.globalVariables.blockNumber.toNumber()} ${blockHash}`);
126
- }
127
- const body = Body.fromBuffer(blockBodyBuffer);
128
- const l2Block = new L2Block(archive, header, body);
129
- return {
130
- data: l2Block,
131
- l1: blockStorage.l1
132
- };
133
- }
134
- /**
135
- * Gets a tx effect.
136
- * @param txHash - The txHash of the tx corresponding to the tx effect.
137
- * @returns The requested tx effect (or undefined if not found).
138
- */ async getTxEffect(txHash) {
139
- const [blockNumber, txIndex] = await this.getTxLocation(txHash) ?? [];
140
- if (typeof blockNumber !== 'number' || typeof txIndex !== 'number') {
141
- return undefined;
142
- }
143
- const block = await this.getBlock(blockNumber);
144
- if (!block) {
145
- return undefined;
146
- }
147
- return {
148
- data: block.data.body.txEffects[txIndex],
149
- l2BlockNumber: block.data.number,
150
- l2BlockHash: (await block.data.hash()).toString()
151
- };
152
- }
153
- /**
154
- * Gets a receipt of a settled tx.
155
- * @param txHash - The hash of a tx we try to get the receipt for.
156
- * @returns The requested tx receipt (or undefined if not found).
157
- */ async getSettledTxReceipt(txHash) {
158
- const [blockNumber, txIndex] = await this.getTxLocation(txHash) ?? [];
159
- if (typeof blockNumber !== 'number' || typeof txIndex !== 'number') {
160
- return undefined;
161
- }
162
- const block = await this.getBlock(blockNumber);
163
- const tx = block.data.body.txEffects[txIndex];
164
- return new TxReceipt(txHash, TxReceipt.statusFromRevertCode(tx.revertCode), '', tx.transactionFee.toBigInt(), L2BlockHash.fromField(await block.data.hash()), block.data.number);
165
- }
166
- /**
167
- * Looks up which block included the requested tx effect.
168
- * @param txHash - The txHash of the tx.
169
- * @returns The block number and index of the tx.
170
- */ getTxLocation(txHash) {
171
- return this.#txIndex.getAsync(txHash.toString());
172
- }
173
- /**
174
- * Looks up which block deployed a particular contract.
175
- * @param contractAddress - The address of the contract to look up.
176
- * @returns The block number and index of the contract.
177
- */ getContractLocation(contractAddress) {
178
- return this.#contractIndex.getAsync(contractAddress.toString());
179
- }
180
- /**
181
- * Gets the number of the latest L2 block processed.
182
- * @returns The number of the latest L2 block processed.
183
- */ async getSynchedL2BlockNumber() {
184
- const [lastBlockNumber] = await toArray(this.#blocks.keysAsync({
185
- reverse: true,
186
- limit: 1
187
- }));
188
- return typeof lastBlockNumber === 'number' ? lastBlockNumber : INITIAL_L2_BLOCK_NUM - 1;
189
- }
190
- /**
191
- * Gets the most recent L1 block processed.
192
- * @returns The L1 block that published the latest L2 block
193
- */ getSynchedL1BlockNumber() {
194
- return this.#lastSynchedL1Block.getAsync();
195
- }
196
- setSynchedL1BlockNumber(l1BlockNumber) {
197
- return this.#lastSynchedL1Block.set(l1BlockNumber);
198
- }
199
- async getProvenL2BlockNumber() {
200
- return await this.#lastProvenL2Block.getAsync() ?? 0;
201
- }
202
- setProvenL2BlockNumber(blockNumber) {
203
- return this.#lastProvenL2Block.set(blockNumber);
204
- }
205
- #computeBlockRange(start, limit) {
206
- if (limit < 1) {
207
- throw new Error(`Invalid limit: ${limit}`);
208
- }
209
- if (start < INITIAL_L2_BLOCK_NUM) {
210
- throw new Error(`Invalid start: ${start}`);
211
- }
212
- return {
213
- start,
214
- limit
215
- };
216
- }
217
- }
@@ -1,18 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
- import type { ContractClassPublic, ExecutablePrivateFunctionWithMembershipProof, UnconstrainedFunctionWithMembershipProof } from '@aztec/stdlib/contract';
4
- /**
5
- * LMDB implementation of the ArchiverDataStore interface.
6
- */
7
- export declare class ContractClassStore {
8
- #private;
9
- private db;
10
- constructor(db: AztecAsyncKVStore);
11
- addContractClass(contractClass: ContractClassPublic, bytecodeCommitment: Fr, blockNumber: number): Promise<void>;
12
- deleteContractClasses(contractClass: ContractClassPublic, blockNumber: number): Promise<void>;
13
- getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
14
- getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
15
- getContractClassIds(): Promise<Fr[]>;
16
- addFunctions(contractClassId: Fr, newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[], newUnconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
17
- }
18
- //# sourceMappingURL=contract_class_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract_class_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/contract_class_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EACV,mBAAmB,EAEnB,4CAA4C,EAC5C,wCAAwC,EACzC,MAAM,wBAAwB,CAAC;AAGhC;;GAEG;AACH,qBAAa,kBAAkB;;IAIjB,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAKnC,gBAAgB,CACpB,aAAa,EAAE,mBAAmB,EAClC,kBAAkB,EAAE,EAAE,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAQV,qBAAqB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7F,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAKlE,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAKtD,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAIpC,YAAY,CAChB,eAAe,EAAE,EAAE,EACnB,mBAAmB,EAAE,4CAA4C,EAAE,EACnE,yBAAyB,EAAE,wCAAwC,EAAE,GACpE,OAAO,CAAC,OAAO,CAAC;CA4BpB"}
@@ -1,21 +0,0 @@
1
- import type { Fr } from '@aztec/foundation/fields';
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
- type ContractInstanceUpdateKey = [string, number] | [string, number, number];
6
- /**
7
- * LMDB implementation of the ArchiverDataStore interface.
8
- */
9
- export declare class ContractInstanceStore {
10
- #private;
11
- constructor(db: AztecAsyncKVStore);
12
- addContractInstance(contractInstance: ContractInstanceWithAddress): Promise<void>;
13
- deleteContractInstance(contractInstance: ContractInstanceWithAddress): Promise<void>;
14
- getUpdateKey(contractAddress: AztecAddress, blockNumber: number, logIndex?: number): ContractInstanceUpdateKey;
15
- addContractInstanceUpdate(contractInstanceUpdate: ContractInstanceUpdateWithAddress, blockNumber: number, logIndex: number): Promise<void>;
16
- deleteContractInstanceUpdate(contractInstanceUpdate: ContractInstanceUpdateWithAddress, blockNumber: number, logIndex: number): Promise<void>;
17
- getCurrentContractInstanceClassId(address: AztecAddress, blockNumber: number, originalClassId: Fr): Promise<Fr>;
18
- getContractInstance(address: AztecAddress, blockNumber: number): Promise<ContractInstanceWithAddress | undefined>;
19
- }
20
- export {};
21
- //# sourceMappingURL=contract_instance_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract_instance_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/contract_instance_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,EAGjC,MAAM,wBAAwB,CAAC;AAEhC,KAAK,yBAAyB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7E;;GAEG;AACH,qBAAa,qBAAqB;;gBAIpB,EAAE,EAAE,iBAAiB;IAKjC,mBAAmB,CAAC,gBAAgB,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjF,sBAAsB,CAAC,gBAAgB,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpF,YAAY,CAAC,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,yBAAyB;IAQ9G,yBAAyB,CACvB,sBAAsB,EAAE,iCAAiC,EACzD,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAOhB,4BAA4B,CAC1B,sBAAsB,EAAE,iCAAiC,EACzD,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAMV,iCAAiC,CACrC,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,EAAE,GAClB,OAAO,CAAC,EAAE,CAAC;IAqBR,mBAAmB,CACvB,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC;CAcpD"}
@@ -1,63 +0,0 @@
1
- import { SerializableContractInstance, SerializableContractInstanceUpdate } from '@aztec/stdlib/contract';
2
- /**
3
- * LMDB implementation of the ArchiverDataStore interface.
4
- */ export class ContractInstanceStore {
5
- #contractInstances;
6
- #contractInstanceUpdates;
7
- constructor(db){
8
- this.#contractInstances = db.openMap('archiver_contract_instances');
9
- this.#contractInstanceUpdates = db.openMap('archiver_contract_instance_updates');
10
- }
11
- addContractInstance(contractInstance) {
12
- return this.#contractInstances.set(contractInstance.address.toString(), new SerializableContractInstance(contractInstance).toBuffer());
13
- }
14
- deleteContractInstance(contractInstance) {
15
- return this.#contractInstances.delete(contractInstance.address.toString());
16
- }
17
- getUpdateKey(contractAddress, blockNumber, logIndex) {
18
- if (logIndex === undefined) {
19
- return [
20
- contractAddress.toString(),
21
- blockNumber
22
- ];
23
- } else {
24
- return [
25
- contractAddress.toString(),
26
- blockNumber,
27
- logIndex
28
- ];
29
- }
30
- }
31
- addContractInstanceUpdate(contractInstanceUpdate, blockNumber, logIndex) {
32
- return this.#contractInstanceUpdates.set(this.getUpdateKey(contractInstanceUpdate.address, blockNumber, logIndex), new SerializableContractInstanceUpdate(contractInstanceUpdate).toBuffer());
33
- }
34
- deleteContractInstanceUpdate(contractInstanceUpdate, blockNumber, logIndex) {
35
- return this.#contractInstanceUpdates.delete(this.getUpdateKey(contractInstanceUpdate.address, blockNumber, logIndex));
36
- }
37
- async getCurrentContractInstanceClassId(address, blockNumber, originalClassId) {
38
- // We need to find the last update before the given block number
39
- const queryResult = await this.#contractInstanceUpdates.valuesAsync({
40
- reverse: true,
41
- end: this.getUpdateKey(address, blockNumber + 1),
42
- limit: 1
43
- }).next();
44
- if (queryResult.done) {
45
- return originalClassId;
46
- }
47
- const serializedUpdate = queryResult.value;
48
- const update = SerializableContractInstanceUpdate.fromBuffer(serializedUpdate);
49
- if (blockNumber < update.blockOfChange) {
50
- return update.prevContractClassId.isZero() ? originalClassId : update.prevContractClassId;
51
- }
52
- return update.newContractClassId;
53
- }
54
- async getContractInstance(address, blockNumber) {
55
- const contractInstance = await this.#contractInstances.getAsync(address.toString());
56
- if (!contractInstance) {
57
- return undefined;
58
- }
59
- const instance = SerializableContractInstance.fromBuffer(contractInstance).withAddress(address);
60
- instance.currentContractClassId = await this.getCurrentContractInstanceClassId(address, blockNumber, instance.originalContractClassId);
61
- return instance;
62
- }
63
- }
@@ -1,153 +0,0 @@
1
- import type { Fr } from '@aztec/foundation/fields';
2
- import type { AztecAsyncKVStore, StoreSize } from '@aztec/kv-store';
3
- import { FunctionSelector } from '@aztec/stdlib/abi';
4
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { InBlock, L2Block } from '@aztec/stdlib/block';
6
- import type { ContractClassPublic, ContractInstanceUpdateWithAddress, ContractInstanceWithAddress, ExecutablePrivateFunctionWithMembershipProof, UnconstrainedFunctionWithMembershipProof } from '@aztec/stdlib/contract';
7
- import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
8
- import { type LogFilter, PrivateLog, type TxScopedL2Log } from '@aztec/stdlib/logs';
9
- import type { InboxLeaf } from '@aztec/stdlib/messaging';
10
- import type { BlockHeader, TxHash, TxReceipt } from '@aztec/stdlib/tx';
11
- import type { ArchiverDataStore, ArchiverL1SynchPoint } from '../archiver_store.js';
12
- import type { DataRetrieval } from '../structs/data_retrieval.js';
13
- import type { L1Published } from '../structs/published.js';
14
- /**
15
- * LMDB implementation of the ArchiverDataStore interface.
16
- */
17
- export declare class KVArchiverDataStore implements ArchiverDataStore {
18
- #private;
19
- private db;
20
- static readonly SCHEMA_VERSION = 1;
21
- private functionNames;
22
- constructor(db: AztecAsyncKVStore, logsMaxPageSize?: number);
23
- getContractFunctionName(_address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
24
- registerContractFunctionSignatures(_address: AztecAddress, signatures: string[]): Promise<void>;
25
- getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
26
- getContractClassIds(): Promise<Fr[]>;
27
- getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
28
- addContractClasses(data: ContractClassPublic[], bytecodeCommitments: Fr[], blockNumber: number): Promise<boolean>;
29
- deleteContractClasses(data: ContractClassPublic[], blockNumber: number): Promise<boolean>;
30
- getBytecodeCommitment(contractClassId: Fr): Promise<Fr | undefined>;
31
- addFunctions(contractClassId: Fr, privateFunctions: ExecutablePrivateFunctionWithMembershipProof[], unconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
32
- addContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
33
- deleteContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
34
- addContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], blockNumber: number): Promise<boolean>;
35
- deleteContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], blockNumber: number): Promise<boolean>;
36
- /**
37
- * Append new blocks to the store's list.
38
- * @param blocks - The L2 blocks to be added to the store and the last processed L1 block.
39
- * @returns True if the operation is successful.
40
- */
41
- addBlocks(blocks: L1Published<L2Block>[]): Promise<boolean>;
42
- /**
43
- * Unwinds blocks from the database
44
- * @param from - The tip of the chain, passed for verification purposes,
45
- * ensuring that we don't end up deleting something we did not intend
46
- * @param blocksToUnwind - The number of blocks we are to unwind
47
- * @returns True if the operation is successful
48
- */
49
- unwindBlocks(from: number, blocksToUnwind: number): Promise<boolean>;
50
- /**
51
- * Gets up to `limit` amount of L2 blocks starting from `from`.
52
- *
53
- * @param start - Number of the first block to return (inclusive).
54
- * @param limit - The number of blocks to return.
55
- * @returns The requested L2 blocks
56
- */
57
- getBlocks(start: number, limit: number): Promise<L1Published<L2Block>[]>;
58
- /**
59
- * Gets up to `limit` amount of L2 blocks headers starting from `from`.
60
- *
61
- * @param start - Number of the first block to return (inclusive).
62
- * @param limit - The number of blocks to return.
63
- * @returns The requested L2 blocks
64
- */
65
- getBlockHeaders(start: number, limit: number): Promise<BlockHeader[]>;
66
- /**
67
- * Gets a tx effect.
68
- * @param txHash - The txHash of the tx corresponding to the tx effect.
69
- * @returns The requested tx effect (or undefined if not found).
70
- */
71
- getTxEffect(txHash: TxHash): Promise<InBlock<import("@aztec/stdlib/tx").TxEffect> | undefined>;
72
- /**
73
- * Gets a receipt of a settled tx.
74
- * @param txHash - The hash of a tx we try to get the receipt for.
75
- * @returns The requested tx receipt (or undefined if not found).
76
- */
77
- getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
78
- /**
79
- * Append new logs to the store's list.
80
- * @param blocks - The blocks for which to add the logs.
81
- * @returns True if the operation is successful.
82
- */
83
- addLogs(blocks: L2Block[]): Promise<boolean>;
84
- deleteLogs(blocks: L2Block[]): Promise<boolean>;
85
- /**
86
- * Append new nullifiers to the store's list.
87
- * @param blocks - The blocks for which to add the nullifiers.
88
- * @returns True if the operation is successful.
89
- */
90
- addNullifiers(blocks: L2Block[]): Promise<boolean>;
91
- deleteNullifiers(blocks: L2Block[]): Promise<boolean>;
92
- findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
93
- getTotalL1ToL2MessageCount(): Promise<bigint>;
94
- /**
95
- * Append L1 to L2 messages to the store.
96
- * @param messages - The L1 to L2 messages to be added to the store and the last processed L1 block.
97
- * @returns True if the operation is successful.
98
- */
99
- addL1ToL2Messages(messages: DataRetrieval<InboxLeaf>): Promise<boolean>;
100
- /**
101
- * Gets the L1 to L2 message index in the L1 to L2 message tree.
102
- * @param l1ToL2Message - The L1 to L2 message.
103
- * @returns The index of the L1 to L2 message in the L1 to L2 message tree (undefined if not found).
104
- */
105
- getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
106
- /**
107
- * Gets L1 to L2 message (to be) included in a given block.
108
- * @param blockNumber - L2 block number to get messages for.
109
- * @returns The L1 to L2 messages/leaves of the messages subtree (throws if not found).
110
- */
111
- getL1ToL2Messages(blockNumber: bigint): Promise<Fr[]>;
112
- /**
113
- * Retrieves all private logs from up to `limit` blocks, starting from the block number `from`.
114
- * @param from - The block number from which to begin retrieving logs.
115
- * @param limit - The maximum number of blocks to retrieve logs from.
116
- * @returns An array of private logs from the specified range of blocks.
117
- */
118
- getPrivateLogs(from: number, limit: number): Promise<PrivateLog[]>;
119
- /**
120
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
121
- * @param tags - The tags to filter the logs by.
122
- * @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
123
- * that tag.
124
- */
125
- getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
126
- /**
127
- * Gets public logs based on the provided filter.
128
- * @param filter - The filter to apply to the logs.
129
- * @returns The requested logs.
130
- */
131
- getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
132
- /**
133
- * Gets contract class logs based on the provided filter.
134
- * @param filter - The filter to apply to the logs.
135
- * @returns The requested logs.
136
- */
137
- getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
138
- /**
139
- * Gets the number of the latest L2 block processed.
140
- * @returns The number of the latest L2 block processed.
141
- */
142
- getSynchedL2BlockNumber(): Promise<number>;
143
- getProvenL2BlockNumber(): Promise<number>;
144
- setProvenL2BlockNumber(blockNumber: number): Promise<void>;
145
- setBlockSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
146
- setMessageSynchedL1BlockNumber(l1BlockNumber: bigint): Promise<void>;
147
- /**
148
- * Gets the last L1 block number processed by the archiver
149
- */
150
- getSynchPoint(): Promise<ArchiverL1SynchPoint>;
151
- estimateSize(): Promise<StoreSize>;
152
- }
153
- //# sourceMappingURL=kv_archiver_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kv_archiver_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/kv_archiver_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,iCAAiC,EACjC,2BAA2B,EAC3B,4CAA4C,EAC5C,wCAAwC,EACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3G,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBA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