@aztec/archiver 0.0.1-commit.b655e406 → 0.0.1-commit.c0b82b2

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 +94 -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 +152 -0
  23. package/dest/l1/calldata_retriever.d.ts +135 -0
  24. package/dest/l1/calldata_retriever.d.ts.map +1 -0
  25. package/dest/l1/calldata_retriever.js +402 -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 +314 -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 +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 +50 -0
  51. package/dest/modules/instrumentation.d.ts.map +1 -0
  52. package/dest/{archiver → modules}/instrumentation.js +49 -62
  53. package/dest/modules/l1_synchronizer.d.ts +71 -0
  54. package/dest/modules/l1_synchronizer.d.ts.map +1 -0
  55. package/dest/modules/l1_synchronizer.js +1117 -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 +195 -0
  88. package/dest/test/fake_l1_state.d.ts.map +1 -0
  89. package/dest/test/fake_l1_state.js +421 -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 +245 -82
  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 +142 -13
  113. package/src/index.ts +11 -3
  114. package/src/interfaces.ts +9 -0
  115. package/src/l1/README.md +55 -0
  116. package/src/l1/bin/retrieve-calldata.ts +194 -0
  117. package/src/l1/calldata_retriever.ts +511 -0
  118. package/src/l1/data_retrieval.ts +493 -0
  119. package/src/l1/debug_tx.ts +99 -0
  120. package/src/l1/spire_proposer.ts +152 -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 +61 -64
  127. package/src/modules/l1_synchronizer.ts +933 -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 +657 -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 +299 -92
  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 -79
  164. package/dest/archiver/data_retrieval.d.ts.map +0 -1
  165. package/dest/archiver/data_retrieval.js +0 -362
  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 -1263
  203. package/src/archiver/data_retrieval.ts +0 -545
  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
@@ -0,0 +1,135 @@
1
+ import type { ViemPublicClient, ViemPublicDebugClient } from '@aztec/ethereum/types';
2
+ import { CheckpointNumber } from '@aztec/foundation/branded-types';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { EthAddress } from '@aztec/foundation/eth-address';
5
+ import type { Logger } from '@aztec/foundation/log';
6
+ import { CommitteeAttestation } from '@aztec/stdlib/block';
7
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
8
+ import { type Hex, type Transaction } from 'viem';
9
+ import type { ArchiverInstrumentation } from '../modules/instrumentation.js';
10
+ /** Decoded checkpoint data from a propose calldata. */
11
+ type CheckpointData = {
12
+ checkpointNumber: CheckpointNumber;
13
+ archiveRoot: Fr;
14
+ header: CheckpointHeader;
15
+ attestations: CommitteeAttestation[];
16
+ blockHash: string;
17
+ feeAssetPriceModifier: bigint;
18
+ };
19
+ /**
20
+ * Extracts calldata to the `propose` method of the rollup contract from an L1 transaction
21
+ * in order to reconstruct an L2 block header. Uses hash matching against expected hashes
22
+ * from the CheckpointProposed event to verify the correct propose calldata.
23
+ */
24
+ export declare class CalldataRetriever {
25
+ private readonly publicClient;
26
+ private readonly debugClient;
27
+ private readonly targetCommitteeSize;
28
+ private readonly instrumentation;
29
+ private readonly logger;
30
+ private readonly rollupAddress;
31
+ /** Tx hashes we've already logged for trace+debug failure (log once per tx per process). */
32
+ private static readonly traceFailureWarnedTxHashes;
33
+ /** Clears the trace-failure warned set. For testing only. */
34
+ static resetTraceFailureWarnedForTesting(): void;
35
+ constructor(publicClient: ViemPublicClient, debugClient: ViemPublicDebugClient, targetCommitteeSize: number, instrumentation: ArchiverInstrumentation | undefined, logger: Logger, rollupAddress: EthAddress);
36
+ /**
37
+ * Gets checkpoint header and metadata from the calldata of an L1 transaction.
38
+ * Tries multicall3 decoding, falls back to trace-based extraction.
39
+ * @param txHash - Hash of the tx that published it.
40
+ * @param blobHashes - Blob hashes for the checkpoint.
41
+ * @param checkpointNumber - Checkpoint number.
42
+ * @param expectedHashes - Expected hashes from the CheckpointProposed event for validation
43
+ * @returns Checkpoint header and metadata from the calldata, deserialized
44
+ */
45
+ getCheckpointFromRollupTx(txHash: `0x${string}`, _blobHashes: Buffer[], checkpointNumber: CheckpointNumber, expectedHashes: {
46
+ attestationsHash: Hex;
47
+ payloadDigest: Hex;
48
+ }): Promise<CheckpointData>;
49
+ /** Gets checkpoint data from a transaction by trying decode strategies then falling back to trace. */
50
+ protected getCheckpointFromTx(tx: Transaction, checkpointNumber: CheckpointNumber, expectedHashes: {
51
+ attestationsHash: Hex;
52
+ payloadDigest: Hex;
53
+ }): Promise<CheckpointData>;
54
+ /**
55
+ * Attempts to decode a transaction as a Spire Proposer multicall wrapper.
56
+ * If successful, iterates all wrapped calls and validates each as either multicall3
57
+ * or direct propose, verifying against expected hashes.
58
+ * @param tx - The transaction to decode
59
+ * @param expectedHashes - Expected hashes for hash-verified matching
60
+ * @param checkpointNumber - The checkpoint number
61
+ * @param blockHash - The L1 block hash
62
+ * @returns The checkpoint data if successfully decoded and validated, undefined otherwise
63
+ */
64
+ protected tryDecodeSpireProposer(tx: Transaction, expectedHashes: {
65
+ attestationsHash: Hex;
66
+ payloadDigest: Hex;
67
+ }, checkpointNumber: CheckpointNumber, blockHash: Hex): Promise<CheckpointData | undefined>;
68
+ /**
69
+ * Attempts to decode transaction input as multicall3 and extract propose calldata.
70
+ * Finds all calls matching the rollup address and propose selector, then decodes
71
+ * and verifies each candidate against expected hashes from the CheckpointProposed event.
72
+ * @param tx - The transaction-like object with to, input, and hash
73
+ * @param expectedHashes - Expected hashes from CheckpointProposed event
74
+ * @param checkpointNumber - The checkpoint number
75
+ * @param blockHash - The L1 block hash
76
+ * @returns The checkpoint data if successfully validated, undefined otherwise
77
+ */
78
+ protected tryDecodeMulticall3(tx: {
79
+ to: Hex | null | undefined;
80
+ input: Hex;
81
+ hash: Hex;
82
+ }, expectedHashes: {
83
+ attestationsHash: Hex;
84
+ payloadDigest: Hex;
85
+ }, checkpointNumber: CheckpointNumber, blockHash: Hex): CheckpointData | undefined;
86
+ /**
87
+ * Attempts to decode transaction as a direct propose call to the rollup contract.
88
+ * Decodes, verifies hashes, and builds checkpoint data in a single pass.
89
+ * @param tx - The transaction-like object with to, input, and hash
90
+ * @param expectedHashes - Expected hashes from CheckpointProposed event
91
+ * @param checkpointNumber - The checkpoint number
92
+ * @param blockHash - The L1 block hash
93
+ * @returns The checkpoint data if successfully validated, undefined otherwise
94
+ */
95
+ protected tryDecodeDirectPropose(tx: {
96
+ to: Hex | null | undefined;
97
+ input: Hex;
98
+ hash: Hex;
99
+ }, expectedHashes: {
100
+ attestationsHash: Hex;
101
+ payloadDigest: Hex;
102
+ }, checkpointNumber: CheckpointNumber, blockHash: Hex): CheckpointData | undefined;
103
+ /**
104
+ * Uses debug/trace RPC to extract the actual calldata from the successful propose call.
105
+ * This is the definitive fallback that works for any transaction pattern.
106
+ * Tries trace_transaction first, then falls back to debug_traceTransaction.
107
+ * @param txHash - The transaction hash to trace
108
+ * @returns The propose calldata from the successful call
109
+ */
110
+ protected extractCalldataViaTrace(txHash: Hex): Promise<Hex>;
111
+ /**
112
+ * Decodes propose calldata, verifies against expected hashes, and builds checkpoint data.
113
+ * Returns undefined on decode errors or hash mismatches (soft failure for try-based callers).
114
+ * @param proposeCalldata - The propose function calldata
115
+ * @param expectedHashes - Expected hashes from the CheckpointProposed event
116
+ * @param checkpointNumber - The checkpoint number
117
+ * @param blockHash - The L1 block hash
118
+ * @returns The decoded checkpoint data, or undefined on failure
119
+ */
120
+ protected tryDecodeAndVerifyPropose(proposeCalldata: Hex, expectedHashes: {
121
+ attestationsHash: Hex;
122
+ payloadDigest: Hex;
123
+ }, checkpointNumber: CheckpointNumber, blockHash: Hex): CheckpointData | undefined;
124
+ /** Computes the keccak256 hash of ABI-encoded CommitteeAttestations. */
125
+ private computeAttestationsHash;
126
+ /** Computes the keccak256 payload digest from the checkpoint header, archive root, and fee asset price modifier. */
127
+ private computePayloadDigest;
128
+ /**
129
+ * Extracts the CommitteeAttestations struct definition from RollupAbi.
130
+ * Finds the _attestations parameter by name in the propose function.
131
+ */
132
+ private getCommitteeAttestationsStructDef;
133
+ }
134
+ export {};
135
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJ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QAAC,aAAa,EAAE,GAAG,CAAA;KAAE,EAC7D,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,GAAG,GACb,cAAc,GAAG,SAAS,CAwB5B;IAED;;;;;;OAMG;IACH,UAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAmDjE;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,yBAAyB,CACjC,eAAe,EAAE,GAAG,EACpB,cAAc,EAAE;QAAE,gBAAgB,EAAE,GAAG,CAAC;QAAC,aAAa,EAAE,GAAG,CAAA;KAAE,EAC7D,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,GAAG,GACb,cAAc,GAAG,SAAS,CAiE5B;IAED,wEAAwE;IACxE,OAAO,CAAC,uBAAuB;IAI/B,oHAAoH;IACpH,OAAO,CAAC,oBAAoB;IAM5B;;;OAGG;IACH,OAAO,CAAC,iCAAiC;CA+B1C"}
@@ -0,0 +1,402 @@
1
+ import { MULTI_CALL_3_ADDRESS } from '@aztec/ethereum/contracts';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { EthAddress } from '@aztec/foundation/eth-address';
4
+ import { RollupAbi } from '@aztec/l1-artifacts';
5
+ import { CommitteeAttestation } from '@aztec/stdlib/block';
6
+ import { ConsensusPayload, SignatureDomainSeparator } from '@aztec/stdlib/p2p';
7
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
8
+ import { decodeFunctionData, encodeAbiParameters, hexToBytes, keccak256, multicall3Abi, toFunctionSelector } from 'viem';
9
+ import { getSuccessfulCallsFromDebug } from './debug_tx.js';
10
+ import { getCallsFromSpireProposer } from './spire_proposer.js';
11
+ import { getSuccessfulCallsFromTrace } from './trace_tx.js';
12
+ /**
13
+ * Extracts calldata to the `propose` method of the rollup contract from an L1 transaction
14
+ * in order to reconstruct an L2 block header. Uses hash matching against expected hashes
15
+ * from the CheckpointProposed event to verify the correct propose calldata.
16
+ */ export class CalldataRetriever {
17
+ publicClient;
18
+ debugClient;
19
+ targetCommitteeSize;
20
+ instrumentation;
21
+ logger;
22
+ rollupAddress;
23
+ /** Tx hashes we've already logged for trace+debug failure (log once per tx per process). */ static traceFailureWarnedTxHashes = new Set();
24
+ /** Clears the trace-failure warned set. For testing only. */ static resetTraceFailureWarnedForTesting() {
25
+ CalldataRetriever.traceFailureWarnedTxHashes.clear();
26
+ }
27
+ constructor(publicClient, debugClient, targetCommitteeSize, instrumentation, logger, rollupAddress){
28
+ this.publicClient = publicClient;
29
+ this.debugClient = debugClient;
30
+ this.targetCommitteeSize = targetCommitteeSize;
31
+ this.instrumentation = instrumentation;
32
+ this.logger = logger;
33
+ this.rollupAddress = rollupAddress;
34
+ }
35
+ /**
36
+ * Gets checkpoint header and metadata from the calldata of an L1 transaction.
37
+ * Tries multicall3 decoding, falls back to trace-based extraction.
38
+ * @param txHash - Hash of the tx that published it.
39
+ * @param blobHashes - Blob hashes for the checkpoint.
40
+ * @param checkpointNumber - Checkpoint number.
41
+ * @param expectedHashes - Expected hashes from the CheckpointProposed event for validation
42
+ * @returns Checkpoint header and metadata from the calldata, deserialized
43
+ */ async getCheckpointFromRollupTx(txHash, _blobHashes, checkpointNumber, expectedHashes) {
44
+ this.logger.trace(`Fetching checkpoint ${checkpointNumber} from rollup tx ${txHash}`);
45
+ const tx = await this.publicClient.getTransaction({
46
+ hash: txHash
47
+ });
48
+ return this.getCheckpointFromTx(tx, checkpointNumber, expectedHashes);
49
+ }
50
+ /** Gets checkpoint data from a transaction by trying decode strategies then falling back to trace. */ async getCheckpointFromTx(tx, checkpointNumber, expectedHashes) {
51
+ // Try to decode as multicall3 with hash-verified matching
52
+ const multicall3Result = this.tryDecodeMulticall3(tx, expectedHashes, checkpointNumber, tx.blockHash);
53
+ if (multicall3Result) {
54
+ this.logger.trace(`Decoded propose calldata from multicall3 for tx ${tx.hash}`);
55
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to, false);
56
+ return multicall3Result;
57
+ }
58
+ // Try to decode as direct propose call
59
+ const directResult = this.tryDecodeDirectPropose(tx, expectedHashes, checkpointNumber, tx.blockHash);
60
+ if (directResult) {
61
+ this.logger.trace(`Decoded propose calldata from direct call for tx ${tx.hash}`);
62
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to, false);
63
+ return directResult;
64
+ }
65
+ // Try to decode as Spire Proposer multicall wrapper
66
+ const spireResult = await this.tryDecodeSpireProposer(tx, expectedHashes, checkpointNumber, tx.blockHash);
67
+ if (spireResult) {
68
+ this.logger.trace(`Decoded propose calldata from Spire Proposer for tx ${tx.hash}`);
69
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to, false);
70
+ return spireResult;
71
+ }
72
+ // Fall back to trace-based extraction
73
+ this.logger.warn(`Failed to decode multicall3, direct propose, or Spire proposer for L1 tx ${tx.hash}, falling back to trace for checkpoint ${checkpointNumber}`);
74
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to ?? EthAddress.ZERO.toString(), true);
75
+ const tracedCalldata = await this.extractCalldataViaTrace(tx.hash);
76
+ const tracedResult = this.tryDecodeAndVerifyPropose(tracedCalldata, expectedHashes, checkpointNumber, tx.blockHash);
77
+ if (!tracedResult) {
78
+ throw new Error(`Hash mismatch for traced propose calldata in tx ${tx.hash} for checkpoint ${checkpointNumber}`);
79
+ }
80
+ return tracedResult;
81
+ }
82
+ /**
83
+ * Attempts to decode a transaction as a Spire Proposer multicall wrapper.
84
+ * If successful, iterates all wrapped calls and validates each as either multicall3
85
+ * or direct propose, verifying against expected hashes.
86
+ * @param tx - The transaction to decode
87
+ * @param expectedHashes - Expected hashes for hash-verified matching
88
+ * @param checkpointNumber - The checkpoint number
89
+ * @param blockHash - The L1 block hash
90
+ * @returns The checkpoint data if successfully decoded and validated, undefined otherwise
91
+ */ async tryDecodeSpireProposer(tx, expectedHashes, checkpointNumber, blockHash) {
92
+ // Try to decode as Spire Proposer multicall (extracts all wrapped calls)
93
+ const spireWrappedCalls = await getCallsFromSpireProposer(tx, this.publicClient, this.logger);
94
+ if (!spireWrappedCalls) {
95
+ return undefined;
96
+ }
97
+ this.logger.trace(`Decoded Spire Proposer wrapping for tx ${tx.hash}, ${spireWrappedCalls.length} inner call(s)`);
98
+ // Try each wrapped call as either multicall3 or direct propose
99
+ for (const spireWrappedCall of spireWrappedCalls){
100
+ const wrappedTx = {
101
+ to: spireWrappedCall.to,
102
+ input: spireWrappedCall.data,
103
+ hash: tx.hash
104
+ };
105
+ const multicall3Result = this.tryDecodeMulticall3(wrappedTx, expectedHashes, checkpointNumber, blockHash);
106
+ if (multicall3Result) {
107
+ this.logger.trace(`Decoded propose calldata from Spire Proposer to multicall3 for tx ${tx.hash}`);
108
+ return multicall3Result;
109
+ }
110
+ const directResult = this.tryDecodeDirectPropose(wrappedTx, expectedHashes, checkpointNumber, blockHash);
111
+ if (directResult) {
112
+ this.logger.trace(`Decoded propose calldata from Spire Proposer to direct propose for tx ${tx.hash}`);
113
+ return directResult;
114
+ }
115
+ }
116
+ this.logger.warn(`Spire Proposer wrapped calls could not be decoded as multicall3 or direct propose for tx ${tx.hash}`);
117
+ return undefined;
118
+ }
119
+ /**
120
+ * Attempts to decode transaction input as multicall3 and extract propose calldata.
121
+ * Finds all calls matching the rollup address and propose selector, then decodes
122
+ * and verifies each candidate against expected hashes from the CheckpointProposed event.
123
+ * @param tx - The transaction-like object with to, input, and hash
124
+ * @param expectedHashes - Expected hashes from CheckpointProposed event
125
+ * @param checkpointNumber - The checkpoint number
126
+ * @param blockHash - The L1 block hash
127
+ * @returns The checkpoint data if successfully validated, undefined otherwise
128
+ */ tryDecodeMulticall3(tx, expectedHashes, checkpointNumber, blockHash) {
129
+ const txHash = tx.hash;
130
+ try {
131
+ // Check if transaction is to Multicall3 address
132
+ if (!tx.to || !EthAddress.areEqual(tx.to, MULTI_CALL_3_ADDRESS)) {
133
+ this.logger.debug(`Transaction is not to Multicall3 address (to: ${tx.to})`, {
134
+ txHash,
135
+ to: tx.to
136
+ });
137
+ return undefined;
138
+ }
139
+ // Try to decode as multicall3 aggregate3 call
140
+ const { functionName: multicall3Fn, args: multicall3Args } = decodeFunctionData({
141
+ abi: multicall3Abi,
142
+ data: tx.input
143
+ });
144
+ // If not aggregate3, return undefined (not a multicall3 transaction)
145
+ if (multicall3Fn !== 'aggregate3') {
146
+ this.logger.warn(`Transaction is not multicall3 aggregate3 (got ${multicall3Fn})`, {
147
+ txHash
148
+ });
149
+ return undefined;
150
+ }
151
+ if (multicall3Args.length !== 1) {
152
+ this.logger.warn(`Unexpected number of arguments for multicall3 (got ${multicall3Args.length})`, {
153
+ txHash
154
+ });
155
+ return undefined;
156
+ }
157
+ const [calls] = multicall3Args;
158
+ // Find all calls matching rollup address + propose selector
159
+ const rollupAddressLower = this.rollupAddress.toString().toLowerCase();
160
+ const proposeSelectorLower = PROPOSE_SELECTOR.toLowerCase();
161
+ const candidates = [];
162
+ for (const call of calls){
163
+ const addr = call.target.toLowerCase();
164
+ const callData = call.callData;
165
+ if (callData.length < 10) {
166
+ continue;
167
+ }
168
+ const selector = callData.slice(0, 10).toLowerCase();
169
+ if (addr === rollupAddressLower && selector === proposeSelectorLower) {
170
+ candidates.push(callData);
171
+ }
172
+ }
173
+ if (candidates.length === 0) {
174
+ this.logger.debug(`No propose candidates found in multicall3`, {
175
+ txHash
176
+ });
177
+ return undefined;
178
+ }
179
+ // Decode, verify, and build for each candidate
180
+ const verified = [];
181
+ for (const candidate of candidates){
182
+ const result = this.tryDecodeAndVerifyPropose(candidate, expectedHashes, checkpointNumber, blockHash);
183
+ if (result) {
184
+ verified.push(result);
185
+ }
186
+ }
187
+ if (verified.length === 1) {
188
+ this.logger.trace(`Verified single propose candidate via hash matching`, {
189
+ txHash
190
+ });
191
+ return verified[0];
192
+ }
193
+ if (verified.length > 1) {
194
+ this.logger.warn(`Multiple propose candidates verified (${verified.length}), returning first (identical data)`, {
195
+ txHash
196
+ });
197
+ return verified[0];
198
+ }
199
+ this.logger.debug(`No candidates verified against expected hashes`, {
200
+ txHash
201
+ });
202
+ return undefined;
203
+ } catch (err) {
204
+ // Any decoding error triggers fallback to trace
205
+ this.logger.warn(`Failed to decode multicall3: ${err}`, {
206
+ txHash
207
+ });
208
+ return undefined;
209
+ }
210
+ }
211
+ /**
212
+ * Attempts to decode transaction as a direct propose call to the rollup contract.
213
+ * Decodes, verifies hashes, and builds checkpoint data in a single pass.
214
+ * @param tx - The transaction-like object with to, input, and hash
215
+ * @param expectedHashes - Expected hashes from CheckpointProposed event
216
+ * @param checkpointNumber - The checkpoint number
217
+ * @param blockHash - The L1 block hash
218
+ * @returns The checkpoint data if successfully validated, undefined otherwise
219
+ */ tryDecodeDirectPropose(tx, expectedHashes, checkpointNumber, blockHash) {
220
+ const txHash = tx.hash;
221
+ try {
222
+ // Check if transaction is to the rollup address
223
+ if (!tx.to || !EthAddress.areEqual(tx.to, this.rollupAddress)) {
224
+ this.logger.debug(`Transaction is not to rollup address (to: ${tx.to})`, {
225
+ txHash
226
+ });
227
+ return undefined;
228
+ }
229
+ // Validate it's a propose call before full decode+verify
230
+ const { functionName } = decodeFunctionData({
231
+ abi: RollupAbi,
232
+ data: tx.input
233
+ });
234
+ if (functionName !== 'propose') {
235
+ this.logger.warn(`Transaction to rollup is not propose (got ${functionName})`, {
236
+ txHash
237
+ });
238
+ return undefined;
239
+ }
240
+ // Decode, verify hashes, and build checkpoint data
241
+ this.logger.trace(`Validated direct propose call to rollup`, {
242
+ txHash
243
+ });
244
+ return this.tryDecodeAndVerifyPropose(tx.input, expectedHashes, checkpointNumber, blockHash);
245
+ } catch (err) {
246
+ // Any decoding error means it's not a valid propose call
247
+ this.logger.warn(`Failed to decode as direct propose: ${err}`, {
248
+ txHash
249
+ });
250
+ return undefined;
251
+ }
252
+ }
253
+ /**
254
+ * Uses debug/trace RPC to extract the actual calldata from the successful propose call.
255
+ * This is the definitive fallback that works for any transaction pattern.
256
+ * Tries trace_transaction first, then falls back to debug_traceTransaction.
257
+ * @param txHash - The transaction hash to trace
258
+ * @returns The propose calldata from the successful call
259
+ */ async extractCalldataViaTrace(txHash) {
260
+ const rollupAddress = this.rollupAddress;
261
+ const selector = PROPOSE_SELECTOR;
262
+ let calls;
263
+ try {
264
+ // Try trace_transaction first (using Parity/OpenEthereum/Erigon RPC)
265
+ this.logger.debug(`Attempting to trace transaction ${txHash} using trace_transaction`);
266
+ calls = await getSuccessfulCallsFromTrace(this.debugClient, txHash, rollupAddress, selector, this.logger);
267
+ this.logger.debug(`Successfully traced using trace_transaction, found ${calls.length} calls`);
268
+ } catch (err) {
269
+ const traceError = err instanceof Error ? err : new Error(String(err));
270
+ this.logger.verbose(`Failed trace_transaction for ${txHash}: ${traceError.message}`);
271
+ this.logger.debug(`Trace failure details for ${txHash}`, {
272
+ traceError
273
+ });
274
+ try {
275
+ // Fall back to debug_traceTransaction (Geth RPC)
276
+ this.logger.debug(`Attempting to trace transaction ${txHash} using debug_traceTransaction`);
277
+ calls = await getSuccessfulCallsFromDebug(this.debugClient, txHash, rollupAddress, selector, this.logger);
278
+ this.logger.debug(`Successfully traced using debug_traceTransaction, found ${calls.length} calls`);
279
+ } catch (debugErr) {
280
+ const debugError = debugErr instanceof Error ? debugErr : new Error(String(debugErr));
281
+ // Log once per tx so we don't spam on every sync cycle when sync point doesn't advance
282
+ if (!CalldataRetriever.traceFailureWarnedTxHashes.has(txHash)) {
283
+ CalldataRetriever.traceFailureWarnedTxHashes.add(txHash);
284
+ this.logger.warn(`Cannot decode L1 tx ${txHash}: trace and debug RPC failed or unavailable. ` + `trace_transaction: ${traceError.message}; debug_traceTransaction: ${debugError.message}`);
285
+ }
286
+ // Full error objects can be very long; keep at debug only
287
+ this.logger.debug(`Trace/debug failure details for tx ${txHash}`, {
288
+ traceError,
289
+ debugError,
290
+ txHash
291
+ });
292
+ throw new Error(`Failed to trace transaction ${txHash} to extract propose calldata`);
293
+ }
294
+ }
295
+ // Validate exactly ONE successful propose call
296
+ if (calls.length === 0) {
297
+ throw new Error(`No successful propose calls found in transaction ${txHash}`);
298
+ }
299
+ if (calls.length > 1) {
300
+ throw new Error(`Multiple successful propose calls found in transaction ${txHash} (${calls.length})`);
301
+ }
302
+ // Return the calldata from the single successful propose call
303
+ return calls[0].input;
304
+ }
305
+ /**
306
+ * Decodes propose calldata, verifies against expected hashes, and builds checkpoint data.
307
+ * Returns undefined on decode errors or hash mismatches (soft failure for try-based callers).
308
+ * @param proposeCalldata - The propose function calldata
309
+ * @param expectedHashes - Expected hashes from the CheckpointProposed event
310
+ * @param checkpointNumber - The checkpoint number
311
+ * @param blockHash - The L1 block hash
312
+ * @returns The decoded checkpoint data, or undefined on failure
313
+ */ tryDecodeAndVerifyPropose(proposeCalldata, expectedHashes, checkpointNumber, blockHash) {
314
+ try {
315
+ const { functionName, args } = decodeFunctionData({
316
+ abi: RollupAbi,
317
+ data: proposeCalldata
318
+ });
319
+ if (functionName !== 'propose') {
320
+ return undefined;
321
+ }
322
+ const [decodedArgs, packedAttestations] = args;
323
+ // Verify attestationsHash
324
+ const computedAttestationsHash = this.computeAttestationsHash(packedAttestations);
325
+ if (!Buffer.from(hexToBytes(computedAttestationsHash)).equals(Buffer.from(hexToBytes(expectedHashes.attestationsHash)))) {
326
+ this.logger.warn(`Attestations hash mismatch during verification`, {
327
+ computed: computedAttestationsHash,
328
+ expected: expectedHashes.attestationsHash
329
+ });
330
+ return undefined;
331
+ }
332
+ // Verify payloadDigest
333
+ const header = CheckpointHeader.fromViem(decodedArgs.header);
334
+ const archiveRoot = new Fr(Buffer.from(hexToBytes(decodedArgs.archive)));
335
+ const feeAssetPriceModifier = decodedArgs.oracleInput.feeAssetPriceModifier;
336
+ const computedPayloadDigest = this.computePayloadDigest(header, archiveRoot, feeAssetPriceModifier);
337
+ if (!Buffer.from(hexToBytes(computedPayloadDigest)).equals(Buffer.from(hexToBytes(expectedHashes.payloadDigest)))) {
338
+ this.logger.warn(`Payload digest mismatch during verification`, {
339
+ computed: computedPayloadDigest,
340
+ expected: expectedHashes.payloadDigest
341
+ });
342
+ return undefined;
343
+ }
344
+ const attestations = CommitteeAttestation.fromPacked(packedAttestations, this.targetCommitteeSize);
345
+ this.logger.trace(`Validated and decoded propose calldata for checkpoint ${checkpointNumber}`, {
346
+ checkpointNumber,
347
+ archive: decodedArgs.archive,
348
+ header: decodedArgs.header,
349
+ l1BlockHash: blockHash,
350
+ attestations,
351
+ packedAttestations,
352
+ targetCommitteeSize: this.targetCommitteeSize
353
+ });
354
+ return {
355
+ checkpointNumber,
356
+ archiveRoot,
357
+ header,
358
+ attestations,
359
+ blockHash,
360
+ feeAssetPriceModifier
361
+ };
362
+ } catch {
363
+ return undefined;
364
+ }
365
+ }
366
+ /** Computes the keccak256 hash of ABI-encoded CommitteeAttestations. */ computeAttestationsHash(packedAttestations) {
367
+ return keccak256(encodeAbiParameters([
368
+ this.getCommitteeAttestationsStructDef()
369
+ ], [
370
+ packedAttestations
371
+ ]));
372
+ }
373
+ /** Computes the keccak256 payload digest from the checkpoint header, archive root, and fee asset price modifier. */ computePayloadDigest(header, archiveRoot, feeAssetPriceModifier) {
374
+ const consensusPayload = new ConsensusPayload(header, archiveRoot, feeAssetPriceModifier);
375
+ const payloadToSign = consensusPayload.getPayloadToSign(SignatureDomainSeparator.checkpointAttestation);
376
+ return keccak256(payloadToSign);
377
+ }
378
+ /**
379
+ * Extracts the CommitteeAttestations struct definition from RollupAbi.
380
+ * Finds the _attestations parameter by name in the propose function.
381
+ */ getCommitteeAttestationsStructDef() {
382
+ const proposeFunction = RollupAbi.find((item)=>item.type === 'function' && item.name === 'propose');
383
+ if (!proposeFunction) {
384
+ throw new Error('propose function not found in RollupAbi');
385
+ }
386
+ // Find the _attestations parameter by name, not by index
387
+ const attestationsParam = proposeFunction.inputs.find((param)=>param.name === '_attestations');
388
+ if (!attestationsParam) {
389
+ throw new Error('_attestations parameter not found in propose function');
390
+ }
391
+ if (attestationsParam.type !== 'tuple') {
392
+ throw new Error(`Expected _attestations parameter to be a tuple, got ${attestationsParam.type}`);
393
+ }
394
+ // Extract the tuple components (struct fields)
395
+ const tupleParam = attestationsParam;
396
+ return {
397
+ type: 'tuple',
398
+ components: tupleParam.components || []
399
+ };
400
+ }
401
+ }
402
+ /** Function selector for the `propose` method of the rollup contract. */ const PROPOSE_SELECTOR = toFunctionSelector(RollupAbi.find((x)=>x.type === 'function' && x.name === 'propose'));
@@ -0,0 +1,88 @@
1
+ import type { BlobClientInterface } from '@aztec/blob-client/client';
2
+ import { type CheckpointBlobData } from '@aztec/blob-lib';
3
+ import type { InboxContract, RollupContract } from '@aztec/ethereum/contracts';
4
+ import type { ViemPublicClient, ViemPublicDebugClient } from '@aztec/ethereum/types';
5
+ import { CheckpointNumber } from '@aztec/foundation/branded-types';
6
+ import { Fr } from '@aztec/foundation/curves/bn254';
7
+ import { EthAddress } from '@aztec/foundation/eth-address';
8
+ import { type Logger } from '@aztec/foundation/log';
9
+ import { CommitteeAttestation } from '@aztec/stdlib/block';
10
+ import { L1PublishedData, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
11
+ import { Proof } from '@aztec/stdlib/proofs';
12
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
13
+ import { type Hex } from 'viem';
14
+ import type { ArchiverInstrumentation } from '../modules/instrumentation.js';
15
+ import type { DataRetrieval } from '../structs/data_retrieval.js';
16
+ import type { InboxMessage } from '../structs/inbox_message.js';
17
+ export type RetrievedCheckpoint = {
18
+ checkpointNumber: CheckpointNumber;
19
+ archiveRoot: Fr;
20
+ feeAssetPriceModifier: bigint;
21
+ header: CheckpointHeader;
22
+ checkpointBlobData: CheckpointBlobData;
23
+ l1: L1PublishedData;
24
+ chainId: Fr;
25
+ version: Fr;
26
+ attestations: CommitteeAttestation[];
27
+ };
28
+ export declare function retrievedToPublishedCheckpoint({ checkpointNumber, archiveRoot, feeAssetPriceModifier, header: checkpointHeader, checkpointBlobData, l1, chainId, version, attestations }: RetrievedCheckpoint): Promise<PublishedCheckpoint>;
29
+ /**
30
+ * Fetches new checkpoints.
31
+ * @param rollup - The rollup contract wrapper.
32
+ * @param publicClient - The viem public client to use for transaction retrieval.
33
+ * @param debugClient - The viem debug client to use for trace/debug RPC methods (optional).
34
+ * @param blobClient - The blob client client for fetching blob data.
35
+ * @param searchStartBlock - The block number to use for starting the search.
36
+ * @param searchEndBlock - The highest block number that we should search up to.
37
+ * @param contractAddresses - The contract addresses (governanceProposerAddress, slashFactoryAddress, slashingProposerAddress).
38
+ * @param instrumentation - The archiver instrumentation instance.
39
+ * @param logger - The logger instance.
40
+ * @param isHistoricalSync - Whether this is a historical sync.
41
+ * @returns An array of retrieved checkpoints.
42
+ */
43
+ export declare function retrieveCheckpointsFromRollup(rollup: RollupContract, publicClient: ViemPublicClient, debugClient: ViemPublicDebugClient, blobClient: BlobClientInterface, searchStartBlock: bigint, searchEndBlock: bigint, instrumentation: ArchiverInstrumentation, logger?: Logger, isHistoricalSync?: boolean): Promise<RetrievedCheckpoint[]>;
44
+ export declare function getL1Block(publicClient: ViemPublicClient, blockNumber: bigint): Promise<{
45
+ timestamp: bigint;
46
+ parentBeaconBlockRoot: string | undefined;
47
+ }>;
48
+ export declare function getCheckpointBlobDataFromBlobs(blobClient: BlobClientInterface, blockHash: string, blobHashes: Buffer<ArrayBufferLike>[], checkpointNumber: CheckpointNumber, logger: Logger, isHistoricalSync: boolean, parentBeaconBlockRoot?: string, l1BlockTimestamp?: bigint): Promise<CheckpointBlobData>;
49
+ /** Given an L1 to L2 message, retrieves its corresponding event from the Inbox within a specific block range. */
50
+ export declare function retrieveL1ToL2Message(inbox: InboxContract, leaf: Fr, fromBlock: bigint, toBlock: bigint): Promise<InboxMessage | undefined>;
51
+ /**
52
+ * Fetch L1 to L2 messages.
53
+ * @param inbox - The inbox contract wrapper.
54
+ * @param searchStartBlock - The block number to use for starting the search.
55
+ * @param searchEndBlock - The highest block number that we should search up to.
56
+ * @returns An array of InboxLeaf and next eth block to search from.
57
+ */
58
+ export declare function retrieveL1ToL2Messages(inbox: InboxContract, searchStartBlock: bigint, searchEndBlock: bigint): Promise<InboxMessage[]>;
59
+ /** Retrieves L2ProofVerified events from the rollup contract. */
60
+ export declare function retrieveL2ProofVerifiedEvents(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<{
61
+ l1BlockNumber: bigint;
62
+ checkpointNumber: CheckpointNumber;
63
+ proverId: Fr;
64
+ txHash: Hex;
65
+ }[]>;
66
+ /** Retrieve submitted proofs from the rollup contract */
67
+ export declare function retrieveL2ProofsFromRollup(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<DataRetrieval<{
68
+ proof: Proof;
69
+ proverId: Fr;
70
+ checkpointNumber: number;
71
+ txHash: `0x${string}`;
72
+ }>>;
73
+ export type SubmitEpochProof = {
74
+ archiveRoot: Fr;
75
+ proverId: Fr;
76
+ proof: Proof;
77
+ };
78
+ /**
79
+ * Gets epoch proof metadata (archive root and proof) from the calldata of an L1 transaction.
80
+ * Assumes that the block was published from an EOA.
81
+ * TODO: Add retries and error management.
82
+ * @param publicClient - The viem public client to use for transaction retrieval.
83
+ * @param txHash - Hash of the tx that published it.
84
+ * @param expectedProverId - Expected prover ID.
85
+ * @returns Epoch proof metadata from the calldata, deserialized.
86
+ */
87
+ export declare function getProofFromSubmitProofTx(publicClient: ViemPublicClient, txHash: `0x${string}`, expectedProverId: Fr): Promise<SubmitEpochProof>;
88
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YV9yZXRyaWV2YWwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMS9kYXRhX3JldHJpZXZhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3JFLE9BQU8sRUFFTCxLQUFLLGtCQUFrQixFQUl4QixNQUF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