@aztec/archiver 0.0.1-commit.96bb3f7 → 0.0.1-commit.993d240

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