@aztec/archiver 0.0.0-test.1 → 0.0.1-commit.017a351

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 (252) hide show
  1. package/README.md +172 -9
  2. package/dest/archiver.d.ts +176 -0
  3. package/dest/archiver.d.ts.map +1 -0
  4. package/dest/archiver.js +905 -0
  5. package/dest/config.d.ts +33 -0
  6. package/dest/config.d.ts.map +1 -0
  7. package/dest/config.js +78 -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 +19 -17
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +125 -61
  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 +136 -0
  24. package/dest/l1/calldata_retriever.d.ts.map +1 -0
  25. package/dest/l1/calldata_retriever.js +412 -0
  26. package/dest/l1/data_retrieval.d.ts +97 -0
  27. package/dest/l1/data_retrieval.d.ts.map +1 -0
  28. package/dest/l1/data_retrieval.js +307 -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 +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 +40 -0
  50. package/dest/modules/data_source_base.d.ts +113 -0
  51. package/dest/modules/data_source_base.d.ts.map +1 -0
  52. package/dest/modules/data_source_base.js +348 -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 +392 -0
  56. package/dest/modules/instrumentation.d.ts +55 -0
  57. package/dest/modules/instrumentation.d.ts.map +1 -0
  58. package/dest/modules/instrumentation.js +145 -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 +1344 -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 +18 -0
  66. package/dest/modules/validation.d.ts.map +1 -0
  67. package/dest/modules/validation.js +104 -0
  68. package/dest/store/block_store.d.ts +294 -0
  69. package/dest/store/block_store.d.ts.map +1 -0
  70. package/dest/store/block_store.js +1188 -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 +80 -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/store/contract_instance_store.js +112 -0
  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 +70 -0
  90. package/dest/store/log_store_codec.d.ts.map +1 -0
  91. package/dest/store/log_store_codec.js +101 -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/store/message_store.js +230 -0
  95. package/dest/structs/data_retrieval.d.ts +27 -0
  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/structs/inbox_message.js +39 -0
  100. package/dest/structs/published.d.ts +2 -0
  101. package/dest/structs/published.d.ts.map +1 -0
  102. package/dest/structs/published.js +1 -0
  103. package/dest/test/fake_l1_state.d.ts +214 -0
  104. package/dest/test/fake_l1_state.d.ts.map +1 -0
  105. package/dest/test/fake_l1_state.js +517 -0
  106. package/dest/test/index.d.ts +2 -1
  107. package/dest/test/index.d.ts.map +1 -1
  108. package/dest/test/index.js +4 -1
  109. package/dest/test/mock_archiver.d.ts +16 -8
  110. package/dest/test/mock_archiver.d.ts.map +1 -1
  111. package/dest/test/mock_archiver.js +19 -14
  112. package/dest/test/mock_l1_to_l2_message_source.d.ts +9 -6
  113. package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
  114. package/dest/test/mock_l1_to_l2_message_source.js +31 -7
  115. package/dest/test/mock_l2_block_source.d.ts +98 -35
  116. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  117. package/dest/test/mock_l2_block_source.js +416 -76
  118. package/dest/test/mock_structs.d.ts +88 -0
  119. package/dest/test/mock_structs.d.ts.map +1 -0
  120. package/dest/test/mock_structs.js +183 -0
  121. package/dest/test/noop_l1_archiver.d.ts +30 -0
  122. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  123. package/dest/test/noop_l1_archiver.js +85 -0
  124. package/package.json +31 -33
  125. package/src/archiver.ts +719 -0
  126. package/src/config.ts +108 -0
  127. package/src/errors.ts +203 -0
  128. package/src/factory.ts +190 -76
  129. package/src/index.ts +27 -3
  130. package/src/interfaces.ts +9 -0
  131. package/src/l1/README.md +55 -0
  132. package/src/l1/bin/retrieve-calldata.ts +194 -0
  133. package/src/l1/calldata_retriever.ts +522 -0
  134. package/src/l1/data_retrieval.ts +484 -0
  135. package/src/l1/debug_tx.ts +99 -0
  136. package/src/l1/spire_proposer.ts +152 -0
  137. package/src/l1/trace_tx.ts +128 -0
  138. package/src/l1/types.ts +13 -0
  139. package/src/l1/validate_historical_logs.ts +140 -0
  140. package/src/l1/validate_trace.ts +229 -0
  141. package/src/modules/contract_data_source_adapter.ts +55 -0
  142. package/src/modules/data_source_base.ts +495 -0
  143. package/src/modules/data_store_updater.ts +518 -0
  144. package/src/modules/instrumentation.ts +204 -0
  145. package/src/modules/l1_synchronizer.ts +1257 -0
  146. package/src/modules/outbox_trees_resolver.ts +199 -0
  147. package/src/modules/validation.ts +130 -0
  148. package/src/store/block_store.ts +1540 -0
  149. package/src/store/contract_class_store.ts +108 -0
  150. package/src/store/contract_instance_store.ts +161 -0
  151. package/src/store/data_stores.ts +104 -0
  152. package/src/store/function_names_cache.ts +37 -0
  153. package/src/store/l2_tips_cache.ts +35 -0
  154. package/src/store/log_store.ts +379 -0
  155. package/src/store/log_store_codec.ts +132 -0
  156. package/src/store/message_store.ts +311 -0
  157. package/src/structs/inbox_message.ts +41 -0
  158. package/src/structs/published.ts +1 -0
  159. package/src/test/fake_l1_state.ts +770 -0
  160. package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
  161. package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
  162. package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
  163. package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
  164. package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
  165. package/src/test/fixtures/trace_transaction-proxied.json +128 -0
  166. package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
  167. package/src/test/index.ts +4 -0
  168. package/src/test/mock_archiver.ts +23 -16
  169. package/src/test/mock_l1_to_l2_message_source.ts +27 -8
  170. package/src/test/mock_l2_block_source.ts +514 -84
  171. package/src/test/mock_structs.ts +325 -0
  172. package/src/test/noop_l1_archiver.ts +148 -0
  173. package/dest/archiver/archiver.d.ts +0 -197
  174. package/dest/archiver/archiver.d.ts.map +0 -1
  175. package/dest/archiver/archiver.js +0 -900
  176. package/dest/archiver/archiver_store.d.ts +0 -220
  177. package/dest/archiver/archiver_store.d.ts.map +0 -1
  178. package/dest/archiver/archiver_store.js +0 -4
  179. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  180. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  181. package/dest/archiver/archiver_store_test_suite.js +0 -794
  182. package/dest/archiver/config.d.ts +0 -37
  183. package/dest/archiver/config.d.ts.map +0 -1
  184. package/dest/archiver/config.js +0 -46
  185. package/dest/archiver/data_retrieval.d.ts +0 -74
  186. package/dest/archiver/data_retrieval.d.ts.map +0 -1
  187. package/dest/archiver/data_retrieval.js +0 -283
  188. package/dest/archiver/errors.d.ts +0 -4
  189. package/dest/archiver/errors.d.ts.map +0 -1
  190. package/dest/archiver/errors.js +0 -5
  191. package/dest/archiver/index.d.ts +0 -8
  192. package/dest/archiver/index.d.ts.map +0 -1
  193. package/dest/archiver/index.js +0 -5
  194. package/dest/archiver/instrumentation.d.ts +0 -29
  195. package/dest/archiver/instrumentation.d.ts.map +0 -1
  196. package/dest/archiver/instrumentation.js +0 -99
  197. package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -87
  198. package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
  199. package/dest/archiver/kv_archiver_store/block_store.js +0 -217
  200. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
  201. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
  202. package/dest/archiver/kv_archiver_store/contract_class_store.js +0 -126
  203. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -21
  204. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  205. package/dest/archiver/kv_archiver_store/contract_instance_store.js +0 -63
  206. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -153
  207. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
  208. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -254
  209. package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -49
  210. package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
  211. package/dest/archiver/kv_archiver_store/log_store.js +0 -364
  212. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -33
  213. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  214. package/dest/archiver/kv_archiver_store/message_store.js +0 -85
  215. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts +0 -12
  216. package/dest/archiver/kv_archiver_store/nullifier_store.d.ts.map +0 -1
  217. package/dest/archiver/kv_archiver_store/nullifier_store.js +0 -73
  218. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts +0 -23
  219. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.d.ts.map +0 -1
  220. package/dest/archiver/memory_archiver_store/l1_to_l2_message_store.js +0 -49
  221. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts +0 -175
  222. package/dest/archiver/memory_archiver_store/memory_archiver_store.d.ts.map +0 -1
  223. package/dest/archiver/memory_archiver_store/memory_archiver_store.js +0 -636
  224. package/dest/archiver/structs/data_retrieval.d.ts +0 -27
  225. package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
  226. package/dest/archiver/structs/published.d.ts +0 -11
  227. package/dest/archiver/structs/published.d.ts.map +0 -1
  228. package/dest/archiver/structs/published.js +0 -1
  229. package/dest/rpc/index.d.ts +0 -10
  230. package/dest/rpc/index.d.ts.map +0 -1
  231. package/dest/rpc/index.js +0 -18
  232. package/src/archiver/archiver.ts +0 -1181
  233. package/src/archiver/archiver_store.ts +0 -263
  234. package/src/archiver/archiver_store_test_suite.ts +0 -810
  235. package/src/archiver/config.ts +0 -92
  236. package/src/archiver/data_retrieval.ts +0 -422
  237. package/src/archiver/errors.ts +0 -5
  238. package/src/archiver/index.ts +0 -7
  239. package/src/archiver/instrumentation.ts +0 -132
  240. package/src/archiver/kv_archiver_store/block_store.ts +0 -283
  241. package/src/archiver/kv_archiver_store/contract_class_store.ts +0 -186
  242. package/src/archiver/kv_archiver_store/contract_instance_store.ts +0 -107
  243. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -358
  244. package/src/archiver/kv_archiver_store/log_store.ts +0 -444
  245. package/src/archiver/kv_archiver_store/message_store.ts +0 -102
  246. package/src/archiver/kv_archiver_store/nullifier_store.ts +0 -97
  247. package/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts +0 -61
  248. package/src/archiver/memory_archiver_store/memory_archiver_store.ts +0 -801
  249. package/src/archiver/structs/published.ts +0 -11
  250. package/src/rpc/index.ts +0 -20
  251. /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
  252. /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
package/src/config.ts ADDED
@@ -0,0 +1,108 @@
1
+ import { type BlobClientConfig, blobClientConfigMapping } from '@aztec/blob-client/client/config';
2
+ import { type L1ContractsConfig, l1ContractsConfigMappings } from '@aztec/ethereum/config';
3
+ import { type L1ReaderConfig, l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
4
+ import {
5
+ type ConfigMappingsType,
6
+ booleanConfigHelper,
7
+ getConfigFromMappings,
8
+ numberConfigHelper,
9
+ optionalNumberConfigHelper,
10
+ } from '@aztec/foundation/config';
11
+ import { type ChainConfig, chainConfigMappings } from '@aztec/stdlib/config';
12
+ import type { ArchiverSpecificConfig } from '@aztec/stdlib/interfaces/server';
13
+
14
+ /**
15
+ * The archiver configuration.
16
+ * There are 2 polling intervals used in this configuration. The first is the archiver polling interval, archiverPollingIntervalMS.
17
+ * This is the interval between successive calls to eth_blockNumber via viem.
18
+ * Results of calls to eth_blockNumber are cached by viem with this cache being updated periodically at the interval specified by viemPollingIntervalMS.
19
+ * As a result the maximum observed polling time for new blocks will be viemPollingIntervalMS + archiverPollingIntervalMS.
20
+ */
21
+ export type ArchiverConfig = ArchiverSpecificConfig &
22
+ L1ReaderConfig &
23
+ L1ContractsConfig &
24
+ BlobClientConfig &
25
+ ChainConfig;
26
+
27
+ export const archiverConfigMappings: ConfigMappingsType<ArchiverConfig> = {
28
+ ...blobClientConfigMapping,
29
+ archiverPollingIntervalMS: {
30
+ env: 'ARCHIVER_POLLING_INTERVAL_MS',
31
+ description: 'The polling interval in ms for retrieving new L2 blocks and encrypted logs.',
32
+ ...numberConfigHelper(500),
33
+ },
34
+ archiverBatchSize: {
35
+ env: 'ARCHIVER_BATCH_SIZE',
36
+ description: 'The number of L2 blocks the archiver will attempt to download at a time.',
37
+ ...numberConfigHelper(100),
38
+ },
39
+ archiverStoreMapSizeKb: {
40
+ env: 'ARCHIVER_STORE_MAP_SIZE_KB',
41
+ ...optionalNumberConfigHelper(),
42
+ description: 'The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKb.',
43
+ },
44
+ skipValidateCheckpointAttestations: {
45
+ description: 'Skip validating checkpoint attestations (for testing purposes only)',
46
+ ...booleanConfigHelper(false),
47
+ },
48
+ skipPromoteProposedCheckpointDuringL1Sync: {
49
+ description: 'Skip promoting proposed checkpoints during L1 sync (for testing purposes only)',
50
+ ...booleanConfigHelper(false),
51
+ },
52
+ maxAllowedEthClientDriftSeconds: {
53
+ env: 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS',
54
+ description: 'Maximum allowed drift in seconds between the Ethereum client and current time.',
55
+ ...numberConfigHelper(300),
56
+ },
57
+ ethereumAllowNoDebugHosts: {
58
+ env: 'ETHEREUM_ALLOW_NO_DEBUG_HOSTS',
59
+ description: 'Whether to allow starting the archiver without debug/trace method support on Ethereum hosts',
60
+ ...booleanConfigHelper(true),
61
+ },
62
+ archiverSkipHistoricalLogsCheck: {
63
+ env: 'ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK',
64
+ description:
65
+ 'Skip the startup check that probes the L1 RPC for historical Rollup contract logs. ' +
66
+ 'Set to true to bypass the check when the connected RPC node is known to prune old logs.',
67
+ ...booleanConfigHelper(false),
68
+ },
69
+ orphanProposedBlockPruneGraceSeconds: {
70
+ env: 'ARCHIVER_ORPHAN_PROPOSED_BLOCK_PRUNE_GRACE_SECONDS',
71
+ description:
72
+ 'Grace period in seconds, measured from the end of a proposed block build slot, after which a ' +
73
+ 'proposed block with no matching proposed checkpoint is pruned as an orphan. Defaults from the ' +
74
+ 'sequencer block duration at the node wiring layer when unset.',
75
+ ...optionalNumberConfigHelper(),
76
+ },
77
+ ...chainConfigMappings,
78
+ ...l1ReaderConfigMappings,
79
+ viemPollingIntervalMS: {
80
+ env: 'ARCHIVER_VIEM_POLLING_INTERVAL_MS',
81
+ description: 'The polling interval viem uses in ms',
82
+ ...numberConfigHelper(1000),
83
+ },
84
+ ...l1ContractsConfigMappings,
85
+ };
86
+
87
+ /**
88
+ * Returns the archiver configuration from the environment variables.
89
+ * Note: If an environment variable is not set, the default value is used.
90
+ * @returns The archiver configuration.
91
+ */
92
+ export function getArchiverConfigFromEnv(): ArchiverConfig {
93
+ return getConfigFromMappings<ArchiverConfig>(archiverConfigMappings);
94
+ }
95
+
96
+ /** Extracts the archiver-specific configuration from the full ArchiverConfig */
97
+ export function mapArchiverConfig(config: Partial<ArchiverConfig>) {
98
+ return {
99
+ pollingIntervalMs: config.archiverPollingIntervalMS,
100
+ batchSize: config.archiverBatchSize,
101
+ skipValidateCheckpointAttestations: config.skipValidateCheckpointAttestations,
102
+ skipPromoteProposedCheckpointDuringL1Sync: config.skipPromoteProposedCheckpointDuringL1Sync,
103
+ maxAllowedEthClientDriftSeconds: config.maxAllowedEthClientDriftSeconds,
104
+ ethereumAllowNoDebugHosts: config.ethereumAllowNoDebugHosts,
105
+ skipHistoricalLogsCheck: config.archiverSkipHistoricalLogsCheck,
106
+ orphanProposedBlockPruneGraceSeconds: config.orphanProposedBlockPruneGraceSeconds,
107
+ };
108
+ }
package/src/errors.ts ADDED
@@ -0,0 +1,203 @@
1
+ import type { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
2
+ import type { Fr } from '@aztec/foundation/schemas';
3
+
4
+ export class NoBlobBodiesFoundError extends Error {
5
+ constructor(l2BlockNum: number) {
6
+ super(`No blob bodies found for block ${l2BlockNum}`);
7
+ this.name = 'NoBlobBodiesFoundError';
8
+ }
9
+ }
10
+
11
+ export class BlockNumberNotSequentialError extends Error {
12
+ constructor(newBlockNumber: number, previous: number | undefined) {
13
+ super(`Cannot insert new block ${newBlockNumber} given previous block number is ${previous ?? 'undefined'}`);
14
+ this.name = 'BlockNumberNotSequentialError';
15
+ }
16
+ }
17
+
18
+ export class InitialCheckpointNumberNotSequentialError extends Error {
19
+ constructor(
20
+ public readonly newCheckpointNumber: number,
21
+ public readonly previousCheckpointNumber: number | undefined,
22
+ ) {
23
+ super(
24
+ `Cannot insert new checkpoint ${newCheckpointNumber} given previous checkpoint number in store is ${
25
+ previousCheckpointNumber ?? 'undefined'
26
+ }`,
27
+ );
28
+ this.name = 'InitialCheckpointNumberNotSequentialError';
29
+ }
30
+ }
31
+
32
+ export class CheckpointNumberNotSequentialError extends Error {
33
+ constructor(
34
+ public readonly newCheckpointNumber: CheckpointNumber,
35
+ public readonly previousCheckpointNumber: CheckpointNumber | undefined,
36
+ source?: 'proposed' | 'confirmed',
37
+ ) {
38
+ const qualifier = source ? `${source} ` : '';
39
+ super(
40
+ `Cannot insert new checkpoint ${newCheckpointNumber} given previous ${qualifier}checkpoint number is ${previousCheckpointNumber ?? 'undefined'}`,
41
+ );
42
+ this.name = 'CheckpointNumberNotSequentialError';
43
+ }
44
+ }
45
+
46
+ /** Thrown when a proposed block carries a checkpoint number that does not follow the latest one. */
47
+ export class BlockCheckpointNumberNotSequentialError extends Error {
48
+ constructor(
49
+ blockNumber: BlockNumber,
50
+ blockCheckpointNumber: CheckpointNumber,
51
+ previous: CheckpointNumber | undefined,
52
+ ) {
53
+ super(
54
+ `Cannot insert new block ${blockNumber} for checkpoint ${blockCheckpointNumber} given previous checkpoint number is ${previous ?? 'undefined'}`,
55
+ );
56
+ this.name = 'BlockCheckpointNumberNotSequentialError';
57
+ }
58
+ }
59
+
60
+ export class BlockIndexNotSequentialError extends Error {
61
+ constructor(newBlockIndex: number, previousBlockIndex: number | undefined) {
62
+ super(
63
+ `Cannot insert new block at checkpoint index ${newBlockIndex} given previous block index is ${previousBlockIndex ?? 'undefined'}`,
64
+ );
65
+ this.name = 'BlockIndexNotSequentialError';
66
+ }
67
+ }
68
+
69
+ export class BlockArchiveNotConsistentError extends Error {
70
+ constructor(
71
+ newBlockNumber: number,
72
+ previousBlockNumber: number | undefined,
73
+ newBlockArchive: Fr,
74
+ previousBlockArchive: Fr,
75
+ ) {
76
+ super(
77
+ `Cannot insert new block number ${newBlockNumber} with archive ${newBlockArchive.toString()} previous block number is ${previousBlockNumber ?? 'undefined'}, previous archive is ${previousBlockArchive?.toString() ?? 'undefined'}`,
78
+ );
79
+ this.name = 'BlockArchiveNotConsistentError';
80
+ }
81
+ }
82
+
83
+ export class CheckpointNotFoundError extends Error {
84
+ constructor(checkpointNumber: number) {
85
+ super(`Failed to find expected checkpoint number ${checkpointNumber}`);
86
+ this.name = 'CheckpointNotFoundError';
87
+ }
88
+ }
89
+
90
+ export class BlockNotFoundError extends Error {
91
+ constructor(blockNumber: number) {
92
+ super(`Failed to find expected block number ${blockNumber}`);
93
+ this.name = 'BlockNotFoundError';
94
+ }
95
+ }
96
+
97
+ /** Thrown when a proposed block matches a block that was already checkpointed. This is expected for late proposals. */
98
+ export class BlockAlreadyCheckpointedError extends Error {
99
+ constructor(public readonly blockNumber: number) {
100
+ super(`Block ${blockNumber} has already been checkpointed with the same content`);
101
+ this.name = 'BlockAlreadyCheckpointedError';
102
+ }
103
+ }
104
+
105
+ /** Thrown when L1 to L2 messages are requested for a checkpoint whose message tree hasn't been sealed yet. */
106
+ export class L1ToL2MessagesNotReadyError extends Error {
107
+ constructor(
108
+ public readonly checkpointNumber: number,
109
+ public readonly inboxTreeInProgress: bigint,
110
+ ) {
111
+ super(
112
+ `Cannot get L1 to L2 messages for checkpoint ${checkpointNumber}: ` +
113
+ `inbox tree in progress is ${inboxTreeInProgress}, messages not yet sealed`,
114
+ );
115
+ this.name = 'L1ToL2MessagesNotReadyError';
116
+ }
117
+ }
118
+
119
+ /** Thrown when a proposed checkpoint number is stale (already processed). */
120
+ export class ProposedCheckpointStaleError extends Error {
121
+ constructor(
122
+ public readonly proposedCheckpointNumber: number,
123
+ public readonly currentProposedNumber: number,
124
+ ) {
125
+ super(`Stale proposed checkpoint ${proposedCheckpointNumber}: current proposed is ${currentProposedNumber}`);
126
+ this.name = 'ProposedCheckpointStaleError';
127
+ }
128
+ }
129
+
130
+ /** Thrown when a proposed checkpoint number is not the expected latestTip + 1. */
131
+ export class ProposedCheckpointNotSequentialError extends Error {
132
+ constructor(
133
+ public readonly proposedCheckpointNumber: number,
134
+ public readonly latestTipNumber: number,
135
+ ) {
136
+ super(
137
+ `Proposed checkpoint ${proposedCheckpointNumber} is not sequential: expected ${latestTipNumber + 1} (latest tip + 1, where tip is highest of confirmed or pending)`,
138
+ );
139
+ this.name = 'ProposedCheckpointNotSequentialError';
140
+ }
141
+ }
142
+
143
+ /** Thrown when a proposed checkpoint or block L2 slot has already expired on L1. */
144
+ export class BlockOrCheckpointSlotExpiredError extends Error {
145
+ constructor(
146
+ public readonly slot: number,
147
+ public readonly nextSlotStart: bigint,
148
+ public readonly l1TimestampSynced: bigint | undefined,
149
+ ) {
150
+ super(
151
+ `Checkpoint or block for slot ${slot} is expired: L1 synced to ${l1TimestampSynced} which is past the next slot start ${nextSlotStart}. ` +
152
+ `If the checkpoint still lands via a late L1 tx, the archiver will pick it up via normal L1-sync (not the pending-queue shortcut).`,
153
+ );
154
+ this.name = 'BlockOrCheckpointSlotExpiredError';
155
+ }
156
+ }
157
+
158
+ /** Thrown when attempting to promote a proposed checkpoint but no proposed checkpoint exists in the store. */
159
+ export class NoProposedCheckpointToPromoteError extends Error {
160
+ constructor() {
161
+ super('Cannot promote proposed checkpoint: no proposed checkpoint exists');
162
+ this.name = 'NoProposedCheckpointToPromoteError';
163
+ }
164
+ }
165
+
166
+ /** Thrown when the archive root of the proposed checkpoint does not match the expected one. */
167
+ export class ProposedCheckpointArchiveRootMismatchError extends Error {
168
+ constructor(
169
+ public readonly expectedArchiveRoot: Fr,
170
+ public readonly actualArchiveRoot: Fr,
171
+ ) {
172
+ super(
173
+ `Cannot promote proposed checkpoint: archive root mismatch (expected ${expectedArchiveRoot}, got ${actualArchiveRoot})`,
174
+ );
175
+ this.name = 'ProposedCheckpointArchiveRootMismatchError';
176
+ }
177
+ }
178
+
179
+ /** Thrown when the proposed checkpoint does not directly follow the latest confirmed checkpoint. */
180
+ export class ProposedCheckpointPromotionNotSequentialError extends Error {
181
+ constructor(
182
+ public readonly proposedCheckpointNumber: number,
183
+ public readonly latestCheckpointNumber: number,
184
+ ) {
185
+ super(
186
+ `Cannot promote proposed checkpoint: not sequential (latest ${latestCheckpointNumber}, proposed ${proposedCheckpointNumber})`,
187
+ );
188
+ this.name = 'ProposedCheckpointPromotionNotSequentialError';
189
+ }
190
+ }
191
+
192
+ /** Thrown when a proposed block conflicts with an already checkpointed block (different content). */
193
+ export class CannotOverwriteCheckpointedBlockError extends Error {
194
+ constructor(
195
+ public readonly blockNumber: number,
196
+ public readonly lastCheckpointedBlock: number,
197
+ ) {
198
+ super(
199
+ `Cannot add block ${blockNumber}: would overwrite checkpointed data (checkpointed up to block ${lastCheckpointedBlock})`,
200
+ );
201
+ this.name = 'CannotOverwriteCheckpointedBlockError';
202
+ }
203
+ }
package/src/factory.ts CHANGED
@@ -1,107 +1,221 @@
1
- import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
2
- import { createLogger } from '@aztec/foundation/log';
3
- import type { DataStoreConfig } from '@aztec/kv-store/config';
1
+ import { EpochCache } from '@aztec/epoch-cache';
2
+ import { createEthereumChain } from '@aztec/ethereum/chain';
3
+ import { makeL1HttpTransport } from '@aztec/ethereum/client';
4
+ import { InboxContract, OutboxContract, RollupContract } from '@aztec/ethereum/contracts';
5
+ import { pickL1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
6
+ import type { ViemPublicDebugClient } from '@aztec/ethereum/types';
7
+ import { BlockNumber } from '@aztec/foundation/branded-types';
8
+ import { Buffer32 } from '@aztec/foundation/buffer';
9
+ import { merge } from '@aztec/foundation/collection';
10
+ import { Fr } from '@aztec/foundation/curves/bn254';
11
+ import { DateProvider } from '@aztec/foundation/timer';
4
12
  import { createStore } from '@aztec/kv-store/lmdb-v2';
5
- import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token';
6
- import { TokenBridgeContractArtifact } from '@aztec/noir-contracts.js/TokenBridge';
7
- import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
8
- import { protocolContractNames, protocolContractTreeRoot } from '@aztec/protocol-contracts';
13
+ import { protocolContractNames } from '@aztec/protocol-contracts';
9
14
  import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
10
15
  import { FunctionType, decodeFunctionSignature } from '@aztec/stdlib/abi';
11
- import type { L2BlockSourceEventEmitter } from '@aztec/stdlib/block';
12
- import {
13
- type ContractClassPublic,
14
- computePublicBytecodeCommitment,
15
- getContractClassFromArtifact,
16
- } from '@aztec/stdlib/contract';
17
- import type { ArchiverApi, Service } from '@aztec/stdlib/interfaces/server';
18
- import { getComponentsVersionsFromConfig } from '@aztec/stdlib/versioning';
19
- import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
20
-
21
- import { Archiver } from './archiver/archiver.js';
22
- import type { ArchiverConfig } from './archiver/config.js';
23
- import { KVArchiverDataStore } from './archiver/index.js';
24
- import { createArchiverClient } from './rpc/index.js';
16
+ import type { ArchiverEmitter, BlockHash } from '@aztec/stdlib/block';
17
+ import { type ContractClassPublicWithCommitment, computePublicBytecodeCommitment } from '@aztec/stdlib/contract';
18
+ import type { DataStoreConfig } from '@aztec/stdlib/kv-store';
19
+ import { MIN_EXECUTION_TIME } from '@aztec/stdlib/timetable';
20
+ import type { BlockHeader } from '@aztec/stdlib/tx';
21
+ import { getTelemetryClient } from '@aztec/telemetry-client';
22
+
23
+ import { EventEmitter } from 'events';
24
+ import { createPublicClient } from 'viem';
25
+
26
+ import { Archiver, type ArchiverDeps } from './archiver.js';
27
+ import { type ArchiverConfig, mapArchiverConfig } from './config.js';
28
+ import { ArchiverInstrumentation } from './modules/instrumentation.js';
29
+ import { ArchiverL1Synchronizer } from './modules/l1_synchronizer.js';
30
+ import { ARCHIVER_DB_VERSION, type ArchiverDataStores, createArchiverDataStores } from './store/data_stores.js';
31
+ import { L2TipsCache } from './store/l2_tips_cache.js';
32
+
33
+ export const ARCHIVER_STORE_NAME = 'archiver';
34
+
35
+ /** Creates an archiver store. */
36
+ export async function createArchiverStore(
37
+ userConfig: Pick<ArchiverConfig, 'archiverStoreMapSizeKb'> & DataStoreConfig,
38
+ genesisBlockHash: BlockHash,
39
+ ): Promise<ArchiverDataStores> {
40
+ const config = {
41
+ ...userConfig,
42
+ dataStoreMapSizeKb: userConfig.archiverStoreMapSizeKb ?? userConfig.dataStoreMapSizeKb,
43
+ };
44
+ const store = await createStore(ARCHIVER_STORE_NAME, ARCHIVER_DB_VERSION, config);
45
+ return createArchiverDataStores(store, genesisBlockHash);
46
+ }
25
47
 
26
48
  /**
27
49
  * Creates a local archiver.
28
50
  * @param config - The archiver configuration.
29
- * @param blobSinkClient - The blob sink client.
51
+ * @param deps - The archiver dependencies (blobClient, epochCache, dateProvider, telemetry).
30
52
  * @param opts - The options.
31
- * @param telemetry - The telemetry client.
53
+ * @param initialHeader - The genesis block header from world-state, used to answer block-0 queries.
54
+ * @param initialBlockHash - Precomputed hash of `initialHeader`. Hoisted to the caller so the archiver
55
+ * can expose `getGenesisBlockHash()` synchronously.
32
56
  * @returns The local archiver.
33
57
  */
34
58
  export async function createArchiver(
35
59
  config: ArchiverConfig & DataStoreConfig,
36
- blobSinkClient: BlobSinkClientInterface,
37
- opts: { blockUntilSync: boolean } = { blockUntilSync: true },
38
- telemetry: TelemetryClient = getTelemetryClient(),
39
- ): Promise<ArchiverApi & Service & L2BlockSourceEventEmitter> {
40
- const store = await createStore(
41
- 'archiver',
42
- KVArchiverDataStore.SCHEMA_VERSION,
43
- config,
44
- createLogger('archiver:lmdb'),
45
- );
46
- const archiverStore = new KVArchiverDataStore(store, config.maxLogs);
60
+ deps: ArchiverDeps,
61
+ opts: { blockUntilSync: boolean; enableOrphanProposedBlockPruning?: boolean } = { blockUntilSync: true },
62
+ initialHeader: BlockHeader,
63
+ initialBlockHash: BlockHash,
64
+ ): Promise<Archiver> {
65
+ const archiverStore = await createArchiverStore(config, initialBlockHash);
47
66
  await registerProtocolContracts(archiverStore);
48
- await registerCommonContracts(archiverStore);
49
- return Archiver.createAndSync(config, archiverStore, { telemetry, blobSinkClient }, opts.blockUntilSync);
50
- }
51
67
 
52
- /**
53
- * Creates a remote archiver client.
54
- * @param config - The archiver configuration.
55
- * @returns The remote archiver client.
56
- */
57
- export function createRemoteArchiver(config: ArchiverConfig): ArchiverApi {
58
- if (!config.archiverUrl) {
59
- throw new Error('Archiver URL is required');
60
- }
68
+ // Create Ethereum clients
69
+ const chain = createEthereumChain(config.l1RpcUrls, config.l1ChainId);
70
+ const httpTimeout = config.l1HttpTimeoutMS;
71
+ const publicClient = createPublicClient({
72
+ chain: chain.chainInfo,
73
+ transport: makeL1HttpTransport(config.l1RpcUrls, { timeout: httpTimeout }),
74
+ pollingInterval: config.viemPollingIntervalMS,
75
+ });
76
+
77
+ // Create debug client using debug RPC URLs if available, otherwise fall back to regular RPC URLs
78
+ const debugRpcUrls = config.l1DebugRpcUrls.length > 0 ? config.l1DebugRpcUrls : config.l1RpcUrls;
79
+ const debugClient = createPublicClient({
80
+ chain: chain.chainInfo,
81
+ transport: makeL1HttpTransport(debugRpcUrls, { timeout: httpTimeout }),
82
+ pollingInterval: config.viemPollingIntervalMS,
83
+ }) as ViemPublicDebugClient;
84
+
85
+ // Create L1 contract instances
86
+ const rollup = new RollupContract(publicClient, config.rollupAddress);
87
+ const inbox = new InboxContract(publicClient, config.inboxAddress);
88
+ const outbox = new OutboxContract(publicClient, config.outboxAddress);
89
+
90
+ // Fetch L1 constants from rollup contract
91
+ const [
92
+ l1StartBlock,
93
+ l1GenesisTime,
94
+ proofSubmissionEpochs,
95
+ genesisArchiveRoot,
96
+ slashingProposerAddress,
97
+ targetCommitteeSize,
98
+ rollupManaLimit,
99
+ ] = await Promise.all([
100
+ rollup.getL1StartBlock(),
101
+ rollup.getL1GenesisTime(),
102
+ rollup.getProofSubmissionEpochs(),
103
+ rollup.getGenesisArchiveTreeRoot(),
104
+ rollup.getSlashingProposerAddress(),
105
+ rollup.getTargetCommitteeSize(),
106
+ rollup.getManaLimit(),
107
+ ] as const);
108
+
109
+ const l1StartBlockHash = await publicClient
110
+ .getBlock({ blockNumber: l1StartBlock, includeTransactions: false })
111
+ .then(block => Buffer32.fromString(block.hash));
112
+
113
+ const { aztecEpochDuration: epochDuration, aztecSlotDuration: slotDuration, ethereumSlotDuration } = config;
61
114
 
62
- return createArchiverClient(
63
- config.archiverUrl,
64
- getComponentsVersionsFromConfig(config, protocolContractTreeRoot, getVKTreeRoot()),
115
+ const l1Constants = {
116
+ l1StartBlockHash,
117
+ l1StartBlock,
118
+ l1GenesisTime,
119
+ epochDuration,
120
+ slotDuration,
121
+ ethereumSlotDuration,
122
+ proofSubmissionEpochs: Number(proofSubmissionEpochs),
123
+ targetCommitteeSize,
124
+ genesisArchiveRoot: Fr.fromString(genesisArchiveRoot.toString()),
125
+ rollupManaLimit: Number(rollupManaLimit),
126
+ };
127
+
128
+ const archiverConfig = merge(
129
+ {
130
+ pollingIntervalMs: 10_000,
131
+ batchSize: 100,
132
+ maxAllowedEthClientDriftSeconds: 300,
133
+ ethereumAllowNoDebugHosts: false,
134
+ skipHistoricalLogsCheck: false,
135
+ orphanProposedBlockPruneGraceSeconds: MIN_EXECUTION_TIME,
136
+ enableOrphanProposedBlockPruning: opts.enableOrphanProposedBlockPruning ?? true,
137
+ },
138
+ mapArchiverConfig(config),
139
+ );
140
+
141
+ const epochCache = deps.epochCache ?? (await EpochCache.create(config.rollupAddress, config, deps));
142
+ const telemetry = deps.telemetry ?? getTelemetryClient();
143
+ const instrumentation = await ArchiverInstrumentation.new(telemetry, () => archiverStore.db.estimateSize());
144
+
145
+ // Create the event emitter that will be shared by archiver and synchronizer
146
+ const events = new EventEmitter() as ArchiverEmitter;
147
+
148
+ // Create L2 tips cache shared by archiver and synchronizer. The genesis block hash is dynamic —
149
+ // it depends on the injected initial header (genesisTimestamp + prefilled state). Hoisted to the
150
+ // caller so we can pass the same value to the archiver and expose it via `getGenesisBlockHash()`.
151
+ const l2TipsCache = new L2TipsCache(archiverStore.blocks, initialBlockHash);
152
+
153
+ // Create the L1 synchronizer
154
+ const synchronizer = new ArchiverL1Synchronizer(
155
+ publicClient,
156
+ debugClient,
157
+ rollup,
158
+ inbox,
159
+ archiverStore,
160
+ archiverConfig,
161
+ deps.blobClient,
162
+ epochCache,
163
+ deps.dateProvider ?? new DateProvider(),
164
+ instrumentation,
165
+ l1Constants,
166
+ events,
167
+ instrumentation.tracer,
168
+ l2TipsCache,
169
+ undefined, // log (use default)
170
+ );
171
+
172
+ const archiver = new Archiver(
173
+ publicClient,
174
+ debugClient,
175
+ rollup,
176
+ outbox,
177
+ { ...pickL1ContractAddresses(config), slashingProposerAddress },
178
+ archiverStore,
179
+ archiverConfig,
180
+ deps.blobClient,
181
+ instrumentation,
182
+ l1Constants,
183
+ synchronizer,
184
+ events,
185
+ initialHeader,
186
+ initialBlockHash,
187
+ l2TipsCache,
188
+ deps.dateProvider ?? new DateProvider(),
65
189
  );
190
+
191
+ await archiver.start(opts.blockUntilSync);
192
+ return archiver;
66
193
  }
67
194
 
68
- async function registerProtocolContracts(store: KVArchiverDataStore) {
195
+ /** Registers protocol contracts in the archiver store. Idempotent — skips contracts that already exist (e.g. on node restart). */
196
+ export async function registerProtocolContracts(stores: ArchiverDataStores) {
69
197
  const blockNumber = 0;
70
198
  for (const name of protocolContractNames) {
71
199
  const provider = new BundledProtocolContractsProvider();
72
200
  const contract = await provider.getProtocolContractArtifact(name);
73
- const contractClassPublic: ContractClassPublic = {
201
+
202
+ // Skip if already registered (happens on node restart with a persisted store).
203
+ if (await stores.contractClasses.getContractClass(contract.contractClass.id)) {
204
+ continue;
205
+ }
206
+
207
+ const publicBytecodeCommitment = await computePublicBytecodeCommitment(contract.contractClass.packedBytecode);
208
+ const contractClassPublic: ContractClassPublicWithCommitment = {
74
209
  ...contract.contractClass,
75
- privateFunctions: [],
76
- unconstrainedFunctions: [],
210
+ publicBytecodeCommitment,
77
211
  };
78
212
 
79
213
  const publicFunctionSignatures = contract.artifact.functions
80
214
  .filter(fn => fn.functionType === FunctionType.PUBLIC)
81
215
  .map(fn => decodeFunctionSignature(fn.name, fn.parameters));
82
216
 
83
- await store.registerContractFunctionSignatures(contract.address, publicFunctionSignatures);
84
- const bytecodeCommitment = await computePublicBytecodeCommitment(contractClassPublic.packedBytecode);
85
- await store.addContractClasses([contractClassPublic], [bytecodeCommitment], blockNumber);
86
- await store.addContractInstances([contract.instance], blockNumber);
217
+ await stores.functionNames.register(publicFunctionSignatures);
218
+ await stores.contractClasses.addContractClasses([contractClassPublic], BlockNumber(blockNumber));
219
+ await stores.contractInstances.addContractInstances([contract.instance], BlockNumber(blockNumber));
87
220
  }
88
221
  }
89
-
90
- // TODO(#10007): Remove this method. We are explicitly registering these contracts
91
- // here to ensure they are available to all nodes and all prover nodes, since the PXE
92
- // was tweaked to automatically push contract classes to the node it is registered,
93
- // but other nodes in the network may require the contract classes to be registered as well.
94
- // TODO(#10007): Remove the dependency on noir-contracts.js from this package once we remove this.
95
- async function registerCommonContracts(store: KVArchiverDataStore) {
96
- const blockNumber = 0;
97
- const artifacts = [TokenBridgeContractArtifact, TokenContractArtifact];
98
- const classes = await Promise.all(
99
- artifacts.map(async artifact => ({
100
- ...(await getContractClassFromArtifact(artifact)),
101
- privateFunctions: [],
102
- unconstrainedFunctions: [],
103
- })),
104
- );
105
- const bytecodeCommitments = await Promise.all(classes.map(x => computePublicBytecodeCommitment(x.packedBytecode)));
106
- await store.addContractClasses(classes, bytecodeCommitments, blockNumber);
107
- }
package/src/index.ts CHANGED
@@ -1,5 +1,29 @@
1
- export * from './archiver/index.js';
2
1
  export * from './factory.js';
3
- export * from './rpc/index.js';
2
+ export * from './interfaces.js';
3
+ export * from './archiver.js';
4
+ export * from './modules/data_source_base.js';
5
+ export * from './modules/data_store_updater.js';
6
+ export * from './config.js';
7
+ export * from './errors.js';
4
8
 
5
- export { retrieveBlocksFromRollup, retrieveL2ProofVerifiedEvents } from './archiver/data_retrieval.js';
9
+ export { type L1PublishedData } from './structs/published.js';
10
+ export {
11
+ ARCHIVER_DB_VERSION,
12
+ type ArchiverDataStores,
13
+ type ArchiverL1SynchPoint,
14
+ backupArchiverDataStores,
15
+ createArchiverDataStores,
16
+ createContractDataSource,
17
+ getArchiverSynchPoint,
18
+ } from './store/data_stores.js';
19
+ export { FunctionNamesCache } from './store/function_names_cache.js';
20
+ export { ArchiverContractDataSourceAdapter } from './modules/contract_data_source_adapter.js';
21
+ export { BlockStore } from './store/block_store.js';
22
+ export { LogStore } from './store/log_store.js';
23
+ export { MessageStore } from './store/message_store.js';
24
+ export { ContractClassStore } from './store/contract_class_store.js';
25
+ export { ContractInstanceStore } from './store/contract_instance_store.js';
26
+ export { L2TipsCache } from './store/l2_tips_cache.js';
27
+
28
+ export { retrieveL2ProofVerifiedEvents } from './l1/data_retrieval.js';
29
+ export { CalldataRetriever } from './l1/calldata_retriever.js';
@@ -0,0 +1,9 @@
1
+ import type { L2BlockSource } from '@aztec/stdlib/block';
2
+ import type { ContractDataSource } from '@aztec/stdlib/contract';
3
+ import type { L2LogsSource } from '@aztec/stdlib/interfaces/server';
4
+ import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
5
+
6
+ /**
7
+ * Helper interface to combine all sources this archiver implementation provides.
8
+ */
9
+ export type ArchiverDataSource = L2BlockSource & L2LogsSource & ContractDataSource & L1ToL2MessageSource;