@aztec/archiver 0.0.1-fake-ceab37513c → 0.0.6-commit.a2d1860fe9

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 (214) hide show
  1. package/README.md +156 -22
  2. package/dest/archiver.d.ts +139 -0
  3. package/dest/archiver.d.ts.map +1 -0
  4. package/dest/archiver.js +699 -0
  5. package/dest/config.d.ts +30 -0
  6. package/dest/config.d.ts.map +1 -0
  7. package/dest/{archiver/config.js → config.js} +26 -5
  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 +9 -7
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +97 -13
  14. package/dest/index.d.ts +11 -4
  15. package/dest/index.d.ts.map +1 -1
  16. package/dest/index.js +9 -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 +148 -0
  23. package/dest/l1/calldata_retriever.d.ts +118 -0
  24. package/dest/l1/calldata_retriever.d.ts.map +1 -0
  25. package/dest/l1/calldata_retriever.js +484 -0
  26. package/dest/l1/data_retrieval.d.ts +89 -0
  27. package/dest/l1/data_retrieval.d.ts.map +1 -0
  28. package/dest/l1/data_retrieval.js +313 -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 +89 -0
  45. package/dest/modules/data_source_base.d.ts.map +1 -0
  46. package/dest/modules/data_source_base.js +216 -0
  47. package/dest/modules/data_store_updater.d.ts +80 -0
  48. package/dest/modules/data_store_updater.d.ts.map +1 -0
  49. package/dest/modules/data_store_updater.js +323 -0
  50. package/dest/modules/instrumentation.d.ts +39 -0
  51. package/dest/modules/instrumentation.d.ts.map +1 -0
  52. package/dest/{archiver → modules}/instrumentation.js +42 -62
  53. package/dest/modules/l1_synchronizer.d.ts +76 -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/{archiver → modules}/validation.js +35 -21
  59. package/dest/store/block_store.d.ts +196 -0
  60. package/dest/store/block_store.d.ts.map +1 -0
  61. package/dest/store/block_store.js +773 -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 +13 -9
  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/{archiver/kv_archiver_store → store}/contract_instance_store.js +1 -1
  68. package/dest/store/kv_archiver_store.d.ts +354 -0
  69. package/dest/store/kv_archiver_store.d.ts.map +1 -0
  70. package/dest/store/kv_archiver_store.js +464 -0
  71. package/dest/store/l2_tips_cache.d.ts +19 -0
  72. package/dest/store/l2_tips_cache.d.ts.map +1 -0
  73. package/dest/store/l2_tips_cache.js +89 -0
  74. package/dest/store/log_store.d.ts +54 -0
  75. package/dest/store/log_store.d.ts.map +1 -0
  76. package/dest/store/log_store.js +456 -0
  77. package/dest/store/message_store.d.ts +40 -0
  78. package/dest/store/message_store.d.ts.map +1 -0
  79. package/dest/{archiver/kv_archiver_store → store}/message_store.js +15 -14
  80. package/dest/structs/data_retrieval.d.ts +27 -0
  81. package/dest/structs/data_retrieval.d.ts.map +1 -0
  82. package/dest/structs/inbox_message.d.ts +15 -0
  83. package/dest/structs/inbox_message.d.ts.map +1 -0
  84. package/dest/{archiver/structs → structs}/inbox_message.js +6 -5
  85. package/dest/structs/published.d.ts +2 -0
  86. package/dest/structs/published.d.ts.map +1 -0
  87. package/dest/test/fake_l1_state.d.ts +193 -0
  88. package/dest/test/fake_l1_state.d.ts.map +1 -0
  89. package/dest/test/fake_l1_state.js +389 -0
  90. package/dest/test/index.d.ts +2 -1
  91. package/dest/test/index.d.ts.map +1 -1
  92. package/dest/test/index.js +4 -1
  93. package/dest/test/mock_archiver.d.ts +16 -8
  94. package/dest/test/mock_archiver.d.ts.map +1 -1
  95. package/dest/test/mock_archiver.js +19 -14
  96. package/dest/test/mock_l1_to_l2_message_source.d.ts +7 -6
  97. package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
  98. package/dest/test/mock_l1_to_l2_message_source.js +21 -11
  99. package/dest/test/mock_l2_block_source.d.ts +54 -20
  100. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  101. package/dest/test/mock_l2_block_source.js +241 -77
  102. package/dest/test/mock_structs.d.ts +80 -4
  103. package/dest/test/mock_structs.d.ts.map +1 -1
  104. package/dest/test/mock_structs.js +145 -11
  105. package/dest/test/noop_l1_archiver.d.ts +23 -0
  106. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  107. package/dest/test/noop_l1_archiver.js +68 -0
  108. package/package.json +20 -20
  109. package/src/archiver.ts +443 -0
  110. package/src/{archiver/config.ts → config.ts} +33 -12
  111. package/src/errors.ts +102 -0
  112. package/src/factory.ts +143 -13
  113. package/src/index.ts +11 -3
  114. package/src/interfaces.ts +9 -0
  115. package/src/l1/README.md +98 -0
  116. package/src/l1/bin/retrieve-calldata.ts +181 -0
  117. package/src/l1/calldata_retriever.ts +663 -0
  118. package/src/l1/data_retrieval.ts +498 -0
  119. package/src/l1/debug_tx.ts +99 -0
  120. package/src/l1/spire_proposer.ts +160 -0
  121. package/src/l1/trace_tx.ts +128 -0
  122. package/src/l1/types.ts +13 -0
  123. package/src/l1/validate_trace.ts +229 -0
  124. package/src/modules/data_source_base.ts +328 -0
  125. package/src/modules/data_store_updater.ts +448 -0
  126. package/src/{archiver → modules}/instrumentation.ts +44 -64
  127. package/src/modules/l1_synchronizer.ts +932 -0
  128. package/src/modules/validation.ts +129 -0
  129. package/src/store/block_store.ts +1015 -0
  130. package/src/{archiver/kv_archiver_store → store}/contract_class_store.ts +13 -9
  131. package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +2 -2
  132. package/src/store/kv_archiver_store.ts +671 -0
  133. package/src/store/l2_tips_cache.ts +89 -0
  134. package/src/store/log_store.ts +637 -0
  135. package/src/{archiver/kv_archiver_store → store}/message_store.ts +21 -18
  136. package/src/{archiver/structs → structs}/inbox_message.ts +8 -8
  137. package/src/structs/published.ts +1 -0
  138. package/src/test/fake_l1_state.ts +607 -0
  139. package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
  140. package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
  141. package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
  142. package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
  143. package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
  144. package/src/test/fixtures/trace_transaction-proxied.json +128 -0
  145. package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
  146. package/src/test/index.ts +4 -0
  147. package/src/test/mock_archiver.ts +23 -16
  148. package/src/test/mock_l1_to_l2_message_source.ts +18 -11
  149. package/src/test/mock_l2_block_source.ts +296 -88
  150. package/src/test/mock_structs.ts +275 -13
  151. package/src/test/noop_l1_archiver.ts +109 -0
  152. package/dest/archiver/archiver.d.ts +0 -277
  153. package/dest/archiver/archiver.d.ts.map +0 -1
  154. package/dest/archiver/archiver.js +0 -1322
  155. package/dest/archiver/archiver_store.d.ts +0 -255
  156. package/dest/archiver/archiver_store.d.ts.map +0 -1
  157. package/dest/archiver/archiver_store.js +0 -4
  158. package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
  159. package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
  160. package/dest/archiver/archiver_store_test_suite.js +0 -1288
  161. package/dest/archiver/config.d.ts +0 -21
  162. package/dest/archiver/config.d.ts.map +0 -1
  163. package/dest/archiver/data_retrieval.d.ts +0 -78
  164. package/dest/archiver/data_retrieval.d.ts.map +0 -1
  165. package/dest/archiver/data_retrieval.js +0 -369
  166. package/dest/archiver/errors.d.ts +0 -12
  167. package/dest/archiver/errors.d.ts.map +0 -1
  168. package/dest/archiver/errors.js +0 -17
  169. package/dest/archiver/index.d.ts +0 -7
  170. package/dest/archiver/index.d.ts.map +0 -1
  171. package/dest/archiver/index.js +0 -4
  172. package/dest/archiver/instrumentation.d.ts +0 -35
  173. package/dest/archiver/instrumentation.d.ts.map +0 -1
  174. package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -124
  175. package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
  176. package/dest/archiver/kv_archiver_store/block_store.js +0 -370
  177. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
  178. package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
  179. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -24
  180. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  181. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -168
  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 -296
  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 -336
  187. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -39
  188. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  189. package/dest/archiver/structs/data_retrieval.d.ts +0 -27
  190. package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
  191. package/dest/archiver/structs/inbox_message.d.ts +0 -15
  192. package/dest/archiver/structs/inbox_message.d.ts.map +0 -1
  193. package/dest/archiver/structs/published.d.ts +0 -2
  194. package/dest/archiver/structs/published.d.ts.map +0 -1
  195. package/dest/archiver/validation.d.ts +0 -11
  196. package/dest/archiver/validation.d.ts.map +0 -1
  197. package/dest/rpc/index.d.ts +0 -9
  198. package/dest/rpc/index.d.ts.map +0 -1
  199. package/dest/rpc/index.js +0 -15
  200. package/src/archiver/archiver.ts +0 -1722
  201. package/src/archiver/archiver_store.ts +0 -305
  202. package/src/archiver/archiver_store_test_suite.ts +0 -1264
  203. package/src/archiver/data_retrieval.ts +0 -556
  204. package/src/archiver/errors.ts +0 -26
  205. package/src/archiver/index.ts +0 -6
  206. package/src/archiver/kv_archiver_store/block_store.ts +0 -481
  207. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -422
  208. package/src/archiver/kv_archiver_store/log_store.ts +0 -406
  209. package/src/archiver/structs/published.ts +0 -1
  210. package/src/archiver/validation.ts +0 -99
  211. package/src/rpc/index.ts +0 -16
  212. /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
  213. /package/dest/{archiver/structs → structs}/published.js +0 -0
  214. /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
@@ -1,21 +0,0 @@
1
- import { type BlobSinkConfig } from '@aztec/blob-sink/client';
2
- import { type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum';
3
- import { type ConfigMappingsType } from '@aztec/foundation/config';
4
- import { type ChainConfig } from '@aztec/stdlib/config';
5
- import type { ArchiverSpecificConfig } from '@aztec/stdlib/interfaces/server';
6
- /**
7
- * The archiver configuration.
8
- * There are 2 polling intervals used in this configuration. The first is the archiver polling interval, archiverPollingIntervalMS.
9
- * This is the interval between successive calls to eth_blockNumber via viem.
10
- * Results of calls to eth_blockNumber are cached by viem with this cache being updated periodically at the interval specified by viemPollingIntervalMS.
11
- * As a result the maximum observed polling time for new blocks will be viemPollingIntervalMS + archiverPollingIntervalMS.
12
- */
13
- export type ArchiverConfig = ArchiverSpecificConfig & L1ReaderConfig & L1ContractsConfig & BlobSinkConfig & ChainConfig;
14
- export declare const archiverConfigMappings: ConfigMappingsType<ArchiverConfig>;
15
- /**
16
- * Returns the archiver configuration from the environment variables.
17
- * Note: If an environment variable is not set, the default value is used.
18
- * @returns The archiver configuration.
19
- */
20
- export declare function getArchiverConfigFromEnv(): ArchiverConfig;
21
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/archiver/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,cAAc,GAAG,iBAAiB,GAAG,cAAc,GAAG,WAAW,CAAC;AAExH,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,CAsCrE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD"}
@@ -1,78 +0,0 @@
1
- import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
2
- import type { ViemClient, ViemPublicClient } from '@aztec/ethereum';
3
- import type { EthAddress } from '@aztec/foundation/eth-address';
4
- import { Fr } from '@aztec/foundation/fields';
5
- import { type Logger } from '@aztec/foundation/log';
6
- import { type InboxAbi, RollupAbi } from '@aztec/l1-artifacts';
7
- import { Body, CommitteeAttestation, PublishedL2Block } from '@aztec/stdlib/block';
8
- import { Proof } from '@aztec/stdlib/proofs';
9
- import { ProposedBlockHeader, StateReference } from '@aztec/stdlib/tx';
10
- import { type GetContractReturnType, type Hex } from 'viem';
11
- import type { DataRetrieval } from './structs/data_retrieval.js';
12
- import type { InboxMessage } from './structs/inbox_message.js';
13
- import type { L1PublishedData } from './structs/published.js';
14
- export type RetrievedL2Block = {
15
- l2BlockNumber: number;
16
- archiveRoot: Fr;
17
- stateReference: StateReference;
18
- header: ProposedBlockHeader;
19
- body: Body;
20
- l1: L1PublishedData;
21
- chainId: Fr;
22
- version: Fr;
23
- attestations: CommitteeAttestation[];
24
- };
25
- export declare function retrievedBlockToPublishedL2Block(retrievedBlock: RetrievedL2Block): PublishedL2Block;
26
- /**
27
- * Fetches new L2 blocks.
28
- * @param publicClient - The viem public client to use for transaction retrieval.
29
- * @param rollupAddress - The address of the rollup contract.
30
- * @param searchStartBlock - The block number to use for starting the search.
31
- * @param searchEndBlock - The highest block number that we should search up to.
32
- * @param expectedNextL2BlockNum - The next L2 block number that we expect to find.
33
- * @returns An array of block; as well as the next eth block to search from.
34
- */
35
- export declare function retrieveBlocksFromRollup(rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>, publicClient: ViemPublicClient, blobSinkClient: BlobSinkClientInterface, searchStartBlock: bigint, searchEndBlock: bigint, logger?: Logger): Promise<RetrievedL2Block[]>;
36
- export declare function getL1BlockTime(publicClient: ViemPublicClient, blockNumber: bigint): Promise<bigint>;
37
- /** Given an L1 to L2 message, retrieves its corresponding event from the Inbox within a specific block range. */
38
- export declare function retrieveL1ToL2Message(inbox: GetContractReturnType<typeof InboxAbi, ViemClient>, leaf: Fr, fromBlock: bigint, toBlock: bigint): Promise<InboxMessage | undefined>;
39
- /**
40
- * Fetch L1 to L2 messages.
41
- * @param publicClient - The viem public client to use for transaction retrieval.
42
- * @param inboxAddress - The address of the inbox contract to fetch messages from.
43
- * @param blockUntilSynced - If true, blocks until the archiver has fully synced.
44
- * @param searchStartBlock - The block number to use for starting the search.
45
- * @param searchEndBlock - The highest block number that we should search up to.
46
- * @returns An array of InboxLeaf and next eth block to search from.
47
- */
48
- export declare function retrieveL1ToL2Messages(inbox: GetContractReturnType<typeof InboxAbi, ViemClient>, searchStartBlock: bigint, searchEndBlock: bigint): Promise<InboxMessage[]>;
49
- /** Retrieves L2ProofVerified events from the rollup contract. */
50
- export declare function retrieveL2ProofVerifiedEvents(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<{
51
- l1BlockNumber: bigint;
52
- l2BlockNumber: number;
53
- proverId: Fr;
54
- txHash: Hex;
55
- }[]>;
56
- /** Retrieve submitted proofs from the rollup contract */
57
- export declare function retrieveL2ProofsFromRollup(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<DataRetrieval<{
58
- proof: Proof;
59
- proverId: Fr;
60
- l2BlockNumber: number;
61
- txHash: `0x${string}`;
62
- }>>;
63
- export type SubmitBlockProof = {
64
- archiveRoot: Fr;
65
- proverId: Fr;
66
- proof: Proof;
67
- };
68
- /**
69
- * Gets block metadata (header and archive snapshot) from the calldata of an L1 transaction.
70
- * Assumes that the block was published from an EOA.
71
- * TODO: Add retries and error management.
72
- * @param publicClient - The viem public client to use for transaction retrieval.
73
- * @param txHash - Hash of the tx that published it.
74
- * @param l2BlockNum - L2 block number.
75
- * @returns L2 block metadata (header and archive) from the calldata, deserialized
76
- */
77
- export declare function getProofFromSubmitProofTx(publicClient: ViemPublicClient, txHash: `0x${string}`, expectedProverId: Fr): Promise<SubmitBlockProof>;
78
- //# sourceMappingURL=data_retrieval.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data_retrieval.d.ts","sourceRoot":"","sources":["../../src/archiver/data_retrieval.ts"],"names":[],"mappings":"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"}
@@ -1,369 +0,0 @@
1
- import { Blob, BlobDeserializationError, EMPTY_BLOB_VERSIONED_HASH } from '@aztec/blob-lib';
2
- import { asyncPool } from '@aztec/foundation/async-pool';
3
- import { Buffer16, Buffer32 } from '@aztec/foundation/buffer';
4
- import { Fr } from '@aztec/foundation/fields';
5
- import { createLogger } from '@aztec/foundation/log';
6
- import { bufferToHex } from '@aztec/foundation/string';
7
- import { RollupAbi } from '@aztec/l1-artifacts';
8
- import { Body, CommitteeAttestation, L2Block, PublishedL2Block } from '@aztec/stdlib/block';
9
- import { Proof } from '@aztec/stdlib/proofs';
10
- import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
11
- import { BlockHeader, GlobalVariables, ProposedBlockHeader, StateReference } from '@aztec/stdlib/tx';
12
- import { decodeFunctionData, getAbiItem, hexToBytes, multicall3Abi } from 'viem';
13
- import { NoBlobBodiesFoundError } from './errors.js';
14
- export function retrievedBlockToPublishedL2Block(retrievedBlock) {
15
- const { l2BlockNumber, archiveRoot, stateReference, header: proposedHeader, body, l1, chainId, version, attestations } = retrievedBlock;
16
- const archive = new AppendOnlyTreeSnapshot(archiveRoot, l2BlockNumber + 1);
17
- const globalVariables = GlobalVariables.from({
18
- chainId,
19
- version,
20
- blockNumber: l2BlockNumber,
21
- slotNumber: proposedHeader.slotNumber,
22
- timestamp: proposedHeader.timestamp,
23
- coinbase: proposedHeader.coinbase,
24
- feeRecipient: proposedHeader.feeRecipient,
25
- gasFees: proposedHeader.gasFees
26
- });
27
- const header = BlockHeader.from({
28
- lastArchive: new AppendOnlyTreeSnapshot(proposedHeader.lastArchiveRoot, l2BlockNumber),
29
- contentCommitment: proposedHeader.contentCommitment,
30
- state: stateReference,
31
- globalVariables,
32
- totalFees: body.txEffects.reduce((accum, txEffect)=>accum.add(txEffect.transactionFee), Fr.ZERO),
33
- totalManaUsed: proposedHeader.totalManaUsed
34
- });
35
- const block = new L2Block(archive, header, body);
36
- return PublishedL2Block.fromFields({
37
- block,
38
- l1,
39
- attestations
40
- });
41
- }
42
- /**
43
- * Fetches new L2 blocks.
44
- * @param publicClient - The viem public client to use for transaction retrieval.
45
- * @param rollupAddress - The address of the rollup contract.
46
- * @param searchStartBlock - The block number to use for starting the search.
47
- * @param searchEndBlock - The highest block number that we should search up to.
48
- * @param expectedNextL2BlockNum - The next L2 block number that we expect to find.
49
- * @returns An array of block; as well as the next eth block to search from.
50
- */ export async function retrieveBlocksFromRollup(rollup, publicClient, blobSinkClient, searchStartBlock, searchEndBlock, logger = createLogger('archiver')) {
51
- const retrievedBlocks = [];
52
- let rollupConstants;
53
- do {
54
- if (searchStartBlock > searchEndBlock) {
55
- break;
56
- }
57
- const l2BlockProposedLogs = (await rollup.getEvents.L2BlockProposed({}, {
58
- fromBlock: searchStartBlock,
59
- toBlock: searchEndBlock
60
- })).filter((log)=>log.blockNumber >= searchStartBlock && log.blockNumber <= searchEndBlock);
61
- if (l2BlockProposedLogs.length === 0) {
62
- break;
63
- }
64
- const lastLog = l2BlockProposedLogs[l2BlockProposedLogs.length - 1];
65
- logger.debug(`Got ${l2BlockProposedLogs.length} L2 block processed logs for L2 blocks ${l2BlockProposedLogs[0].args.blockNumber}-${lastLog.args.blockNumber} between L1 blocks ${searchStartBlock}-${searchEndBlock}`);
66
- if (rollupConstants === undefined) {
67
- const [chainId, version, targetCommitteeSize] = await Promise.all([
68
- publicClient.getChainId(),
69
- rollup.read.getVersion(),
70
- rollup.read.getTargetCommitteeSize()
71
- ]);
72
- rollupConstants = {
73
- chainId: new Fr(chainId),
74
- version: new Fr(version),
75
- targetCommitteeSize: Number(targetCommitteeSize)
76
- };
77
- }
78
- const newBlocks = await processL2BlockProposedLogs(rollup, publicClient, blobSinkClient, l2BlockProposedLogs, rollupConstants, logger);
79
- retrievedBlocks.push(...newBlocks);
80
- searchStartBlock = lastLog.blockNumber + 1n;
81
- }while (searchStartBlock <= searchEndBlock)
82
- // The asyncpool from processL2BlockProposedLogs will not necessarily return the blocks in order, so we sort them before returning.
83
- return retrievedBlocks.sort((a, b)=>Number(a.l1.blockNumber - b.l1.blockNumber));
84
- }
85
- /**
86
- * Processes newly received L2BlockProposed logs.
87
- * @param rollup - The rollup contract
88
- * @param publicClient - The viem public client to use for transaction retrieval.
89
- * @param logs - L2BlockProposed logs.
90
- * @returns - An array blocks.
91
- */ async function processL2BlockProposedLogs(rollup, publicClient, blobSinkClient, logs, { chainId, version, targetCommitteeSize }, logger) {
92
- const retrievedBlocks = [];
93
- await asyncPool(10, logs, async (log)=>{
94
- const l2BlockNumber = Number(log.args.blockNumber);
95
- const archive = log.args.archive;
96
- const archiveFromChain = await rollup.read.archiveAt([
97
- BigInt(l2BlockNumber)
98
- ]);
99
- const blobHashes = log.args.versionedBlobHashes.map((blobHash)=>Buffer.from(blobHash.slice(2), 'hex'));
100
- // The value from the event and contract will match only if the block is in the chain.
101
- if (archive === archiveFromChain) {
102
- const block = await getBlockFromRollupTx(publicClient, blobSinkClient, log.transactionHash, blobHashes, l2BlockNumber, rollup.address, targetCommitteeSize, logger);
103
- const l1 = {
104
- blockNumber: log.blockNumber,
105
- blockHash: log.blockHash,
106
- timestamp: await getL1BlockTime(publicClient, log.blockNumber)
107
- };
108
- retrievedBlocks.push({
109
- ...block,
110
- l1,
111
- chainId,
112
- version
113
- });
114
- logger.trace(`Retrieved L2 block ${l2BlockNumber} from L1 tx ${log.transactionHash}`, {
115
- l1BlockNumber: log.blockNumber,
116
- l2BlockNumber,
117
- archive: archive.toString(),
118
- attestations: block.attestations
119
- });
120
- } else {
121
- logger.warn(`Ignoring L2 block ${l2BlockNumber} due to archive root mismatch`, {
122
- actual: archive,
123
- expected: archiveFromChain
124
- });
125
- }
126
- });
127
- return retrievedBlocks;
128
- }
129
- export async function getL1BlockTime(publicClient, blockNumber) {
130
- const block = await publicClient.getBlock({
131
- blockNumber,
132
- includeTransactions: false
133
- });
134
- return block.timestamp;
135
- }
136
- /**
137
- * Extracts the first 'propose' method calldata from a multicall3 transaction's data.
138
- * @param multicall3Data - The multicall3 transaction input data
139
- * @param rollupAddress - The address of the rollup contract
140
- * @returns The calldata for the first 'propose' method call to the rollup contract
141
- */ function extractRollupProposeCalldata(multicall3Data, rollupAddress) {
142
- const { functionName: multicall3FunctionName, args: multicall3Args } = decodeFunctionData({
143
- abi: multicall3Abi,
144
- data: multicall3Data
145
- });
146
- if (multicall3FunctionName !== 'aggregate3') {
147
- throw new Error(`Unexpected multicall3 method called ${multicall3FunctionName}`);
148
- }
149
- if (multicall3Args.length !== 1) {
150
- throw new Error(`Unexpected number of arguments for multicall3`);
151
- }
152
- const [calls] = multicall3Args;
153
- // Find all rollup calls
154
- const rollupAddressLower = rollupAddress.toLowerCase();
155
- for(let i = 0; i < calls.length; i++){
156
- const addr = calls[i].target;
157
- if (addr.toLowerCase() !== rollupAddressLower) {
158
- continue;
159
- }
160
- const callData = calls[i].callData;
161
- try {
162
- const { functionName: rollupFunctionName } = decodeFunctionData({
163
- abi: RollupAbi,
164
- data: callData
165
- });
166
- if (rollupFunctionName === 'propose') {
167
- return callData;
168
- }
169
- } catch {
170
- continue;
171
- }
172
- }
173
- throw new Error(`Rollup address not found in multicall3 args`);
174
- }
175
- /**
176
- * Gets block from the calldata of an L1 transaction.
177
- * Assumes that the block was published from an EOA.
178
- * TODO: Add retries and error management.
179
- * @param publicClient - The viem public client to use for transaction retrieval.
180
- * @param txHash - Hash of the tx that published it.
181
- * @param l2BlockNumber - L2 block number.
182
- * @returns L2 block from the calldata, deserialized
183
- */ async function getBlockFromRollupTx(publicClient, blobSinkClient, txHash, blobHashes, l2BlockNumber, rollupAddress, targetCommitteeSize, logger) {
184
- const { input: forwarderData, blockHash } = await publicClient.getTransaction({
185
- hash: txHash
186
- });
187
- const rollupData = extractRollupProposeCalldata(forwarderData, rollupAddress);
188
- const { functionName: rollupFunctionName, args: rollupArgs } = decodeFunctionData({
189
- abi: RollupAbi,
190
- data: rollupData
191
- });
192
- if (rollupFunctionName !== 'propose') {
193
- throw new Error(`Unexpected rollup method called ${rollupFunctionName}`);
194
- }
195
- const [decodedArgs, packedAttestations, _signers, _blobInput] = rollupArgs;
196
- const attestations = CommitteeAttestation.fromPacked(packedAttestations, targetCommitteeSize);
197
- logger.trace(`Recovered propose calldata from tx ${txHash}`, {
198
- l2BlockNumber,
199
- archive: decodedArgs.archive,
200
- stateReference: decodedArgs.stateReference,
201
- header: decodedArgs.header,
202
- blobHashes,
203
- attestations,
204
- packedAttestations,
205
- targetCommitteeSize
206
- });
207
- // TODO(md): why is the proposed block header different to the actual block header?
208
- // This is likely going to be a footgun
209
- const header = ProposedBlockHeader.fromViem(decodedArgs.header);
210
- const body = await getBlockBodyFromBlobs(blobSinkClient, blockHash, blobHashes, l2BlockNumber, logger);
211
- const archiveRoot = new Fr(Buffer.from(hexToBytes(decodedArgs.archive)));
212
- const stateReference = StateReference.fromViem(decodedArgs.stateReference);
213
- return {
214
- l2BlockNumber,
215
- archiveRoot,
216
- stateReference,
217
- header,
218
- body,
219
- attestations
220
- };
221
- }
222
- async function getBlockBodyFromBlobs(blobSinkClient, blockHash, blobHashes, l2BlockNumber, logger) {
223
- const blobBodies = await blobSinkClient.getBlobSidecar(blockHash, blobHashes);
224
- logger.trace(`Fetched ${blobBodies.length} blob bodies for L2 block ${l2BlockNumber}`, {
225
- blobHashes: blobHashes.map(bufferToHex),
226
- l2BlockNumber
227
- });
228
- if (blobBodies.length !== blobHashes.length) {
229
- // If there is exactly one blob hash and it is the empty blob hash, we are fine with not downloading it
230
- // and just defaulting to an empty block body.
231
- if (blobHashes.length === 1 && blobBodies.length === 0 && blobHashes[0].equals(EMPTY_BLOB_VERSIONED_HASH)) {
232
- logger.verbose(`Ignoring error fetching blob body for block ${l2BlockNumber} as it is empty`);
233
- return Body.empty();
234
- } else {
235
- throw new NoBlobBodiesFoundError(l2BlockNumber, blobBodies.length, blobHashes.length);
236
- }
237
- }
238
- let blockFields;
239
- try {
240
- blockFields = Blob.toEncodedFields(blobBodies.map((b)=>b.blob));
241
- } catch (err) {
242
- if (err instanceof BlobDeserializationError) {
243
- logger.error(err.message);
244
- } else {
245
- logger.error('Unable to sync: failed to decode fetched blob, this blob was likely not created by us');
246
- }
247
- throw err;
248
- }
249
- // The blob source gives us blockFields, and we must construct the body from them:
250
- return Body.fromBlobFields(blockFields);
251
- }
252
- /** Given an L1 to L2 message, retrieves its corresponding event from the Inbox within a specific block range. */ export async function retrieveL1ToL2Message(inbox, leaf, fromBlock, toBlock) {
253
- const logs = await inbox.getEvents.MessageSent({
254
- hash: leaf.toString()
255
- }, {
256
- fromBlock,
257
- toBlock
258
- });
259
- const messages = mapLogsInboxMessage(logs);
260
- return messages.length > 0 ? messages[0] : undefined;
261
- }
262
- /**
263
- * Fetch L1 to L2 messages.
264
- * @param publicClient - The viem public client to use for transaction retrieval.
265
- * @param inboxAddress - The address of the inbox contract to fetch messages from.
266
- * @param blockUntilSynced - If true, blocks until the archiver has fully synced.
267
- * @param searchStartBlock - The block number to use for starting the search.
268
- * @param searchEndBlock - The highest block number that we should search up to.
269
- * @returns An array of InboxLeaf and next eth block to search from.
270
- */ export async function retrieveL1ToL2Messages(inbox, searchStartBlock, searchEndBlock) {
271
- const retrievedL1ToL2Messages = [];
272
- while(searchStartBlock <= searchEndBlock){
273
- const messageSentLogs = (await inbox.getEvents.MessageSent({}, {
274
- fromBlock: searchStartBlock,
275
- toBlock: searchEndBlock
276
- })).filter((log)=>log.blockNumber >= searchStartBlock && log.blockNumber <= searchEndBlock);
277
- if (messageSentLogs.length === 0) {
278
- break;
279
- }
280
- retrievedL1ToL2Messages.push(...mapLogsInboxMessage(messageSentLogs));
281
- searchStartBlock = messageSentLogs.at(-1).blockNumber + 1n;
282
- }
283
- return retrievedL1ToL2Messages;
284
- }
285
- function mapLogsInboxMessage(logs) {
286
- return logs.map((log)=>{
287
- const { index, hash, l2BlockNumber, rollingHash } = log.args;
288
- return {
289
- index: index,
290
- leaf: Fr.fromHexString(hash),
291
- l1BlockNumber: log.blockNumber,
292
- l1BlockHash: Buffer32.fromString(log.blockHash),
293
- l2BlockNumber: Number(l2BlockNumber),
294
- rollingHash: Buffer16.fromString(rollingHash)
295
- };
296
- });
297
- }
298
- /** Retrieves L2ProofVerified events from the rollup contract. */ export async function retrieveL2ProofVerifiedEvents(publicClient, rollupAddress, searchStartBlock, searchEndBlock) {
299
- const logs = await publicClient.getLogs({
300
- address: rollupAddress.toString(),
301
- fromBlock: searchStartBlock,
302
- toBlock: searchEndBlock ? searchEndBlock : undefined,
303
- strict: true,
304
- event: getAbiItem({
305
- abi: RollupAbi,
306
- name: 'L2ProofVerified'
307
- })
308
- });
309
- return logs.map((log)=>({
310
- l1BlockNumber: log.blockNumber,
311
- l2BlockNumber: Number(log.args.blockNumber),
312
- proverId: Fr.fromHexString(log.args.proverId),
313
- txHash: log.transactionHash
314
- }));
315
- }
316
- /** Retrieve submitted proofs from the rollup contract */ export async function retrieveL2ProofsFromRollup(publicClient, rollupAddress, searchStartBlock, searchEndBlock) {
317
- const logs = await retrieveL2ProofVerifiedEvents(publicClient, rollupAddress, searchStartBlock, searchEndBlock);
318
- const retrievedData = [];
319
- const lastProcessedL1BlockNumber = logs.length > 0 ? logs.at(-1).l1BlockNumber : searchStartBlock - 1n;
320
- for (const { txHash, proverId, l2BlockNumber } of logs){
321
- const proofData = await getProofFromSubmitProofTx(publicClient, txHash, proverId);
322
- retrievedData.push({
323
- proof: proofData.proof,
324
- proverId: proofData.proverId,
325
- l2BlockNumber,
326
- txHash
327
- });
328
- }
329
- return {
330
- retrievedData,
331
- lastProcessedL1BlockNumber
332
- };
333
- }
334
- /**
335
- * Gets block metadata (header and archive snapshot) from the calldata of an L1 transaction.
336
- * Assumes that the block was published from an EOA.
337
- * TODO: Add retries and error management.
338
- * @param publicClient - The viem public client to use for transaction retrieval.
339
- * @param txHash - Hash of the tx that published it.
340
- * @param l2BlockNum - L2 block number.
341
- * @returns L2 block metadata (header and archive) from the calldata, deserialized
342
- */ export async function getProofFromSubmitProofTx(publicClient, txHash, expectedProverId) {
343
- const { input: data } = await publicClient.getTransaction({
344
- hash: txHash
345
- });
346
- const { functionName, args } = decodeFunctionData({
347
- abi: RollupAbi,
348
- data
349
- });
350
- let proverId;
351
- let archiveRoot;
352
- let proof;
353
- if (functionName === 'submitEpochRootProof') {
354
- const [decodedArgs] = args;
355
- proverId = Fr.fromHexString(decodedArgs.args.proverId);
356
- archiveRoot = Fr.fromHexString(decodedArgs.args.endArchive);
357
- proof = Proof.fromBuffer(Buffer.from(hexToBytes(decodedArgs.proof)));
358
- } else {
359
- throw new Error(`Unexpected proof method called ${functionName}`);
360
- }
361
- if (!proverId.equals(expectedProverId)) {
362
- throw new Error(`Prover ID mismatch: expected ${expectedProverId} but got ${proverId}`);
363
- }
364
- return {
365
- proverId,
366
- archiveRoot,
367
- proof
368
- };
369
- }
@@ -1,12 +0,0 @@
1
- export declare class NoBlobBodiesFoundError extends Error {
2
- constructor(l2BlockNum: number, found: number, expected: number);
3
- }
4
- export declare class InitialBlockNumberNotSequentialError extends Error {
5
- readonly newBlockNumber: number;
6
- readonly previousBlockNumber: number | undefined;
7
- constructor(newBlockNumber: number, previousBlockNumber: number | undefined);
8
- }
9
- export declare class BlockNumberNotSequentialError extends Error {
10
- constructor(newBlockNumber: number, previous: number | undefined);
11
- }
12
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/archiver/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,KAAK;gBACnC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAGhE;AAED,qBAAa,oCAAqC,SAAQ,KAAK;aAE3C,cAAc,EAAE,MAAM;aACtB,mBAAmB,EAAE,MAAM,GAAG,SAAS;gBADvC,cAAc,EAAE,MAAM,EACtB,mBAAmB,EAAE,MAAM,GAAG,SAAS;CAQ1D;AAED,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS;CAKjE"}
@@ -1,17 +0,0 @@
1
- export class NoBlobBodiesFoundError extends Error {
2
- constructor(l2BlockNum, found, expected){
3
- super(`No blob bodies found for block ${l2BlockNum} (expected ${expected} but found ${found})`);
4
- }
5
- }
6
- export class InitialBlockNumberNotSequentialError extends Error {
7
- newBlockNumber;
8
- previousBlockNumber;
9
- constructor(newBlockNumber, previousBlockNumber){
10
- super(`Cannot insert new block ${newBlockNumber} given previous block number in store is ${previousBlockNumber ?? 'undefined'}`), this.newBlockNumber = newBlockNumber, this.previousBlockNumber = previousBlockNumber;
11
- }
12
- }
13
- export class BlockNumberNotSequentialError extends Error {
14
- constructor(newBlockNumber, previous){
15
- super(`Cannot insert new block ${newBlockNumber} given previous block number in batch is ${previous ?? 'undefined'}`);
16
- }
17
- }
@@ -1,7 +0,0 @@
1
- export * from './archiver.js';
2
- export * from './config.js';
3
- export { type PublishedL2Block, type L1PublishedData } from './structs/published.js';
4
- export type { ArchiverDataStore } from './archiver_store.js';
5
- export { KVArchiverDataStore, ARCHIVER_DB_VERSION } from './kv_archiver_store/kv_archiver_store.js';
6
- export { ContractInstanceStore } from './kv_archiver_store/contract_instance_store.js';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/archiver/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrF,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './archiver.js';
2
- export * from './config.js';
3
- export { KVArchiverDataStore, ARCHIVER_DB_VERSION } from './kv_archiver_store/kv_archiver_store.js';
4
- export { ContractInstanceStore } from './kv_archiver_store/contract_instance_store.js';
@@ -1,35 +0,0 @@
1
- import type { L2Block } from '@aztec/stdlib/block';
2
- import { type LmdbStatsCallback, type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
3
- export declare class ArchiverInstrumentation {
4
- private telemetry;
5
- readonly tracer: Tracer;
6
- private blockHeight;
7
- private txCount;
8
- private l1BlockHeight;
9
- private proofsSubmittedDelay;
10
- private proofsSubmittedCount;
11
- private dbMetrics;
12
- private pruneDuration;
13
- private pruneCount;
14
- private syncDurationPerBlock;
15
- private syncBlockCount;
16
- private manaPerBlock;
17
- private txsPerBlock;
18
- private syncDurationPerMessage;
19
- private syncMessageCount;
20
- private log;
21
- private constructor();
22
- static new(telemetry: TelemetryClient, lmdbStats?: LmdbStatsCallback): Promise<ArchiverInstrumentation>;
23
- isEnabled(): boolean;
24
- processNewBlocks(syncTimePerBlock: number, blocks: L2Block[]): void;
25
- processNewMessages(count: number, syncPerMessageMs: number): void;
26
- processPrune(duration: number): void;
27
- updateLastProvenBlock(blockNumber: number): void;
28
- processProofsVerified(logs: {
29
- proverId: string;
30
- l2BlockNumber: bigint;
31
- delay: bigint;
32
- }[]): void;
33
- updateL1BlockHeight(blockNumber: bigint): void;
34
- }
35
- //# sourceMappingURL=instrumentation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/archiver/instrumentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAKL,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACpB,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,uBAAuB;IAwBhC,OAAO,CAAC,SAAS;IAvBnB,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,oBAAoB,CAAY;IACxC,OAAO,CAAC,oBAAoB,CAAgB;IAC5C,OAAO,CAAC,SAAS,CAAc;IAE/B,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,UAAU,CAAgB;IAElC,OAAO,CAAC,oBAAoB,CAAY;IACxC,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,YAAY,CAAY;IAChC,OAAO,CAAC,WAAW,CAAY;IAE/B,OAAO,CAAC,sBAAsB,CAAY;IAC1C,OAAO,CAAC,gBAAgB,CAAgB;IAExC,OAAO,CAAC,GAAG,CAA4C;IAEvD,OAAO;WAuFa,GAAG,CAAC,SAAS,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,iBAAiB;IAY1E,SAAS,IAAI,OAAO;IAIpB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;IAY5D,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM;IAK1D,YAAY,CAAC,QAAQ,EAAE,MAAM;IAK7B,qBAAqB,CAAC,WAAW,EAAE,MAAM;IAIzC,qBAAqB,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE;IAaxF,mBAAmB,CAAC,WAAW,EAAE,MAAM;CAG/C"}