@aztec/archiver 0.0.1-commit.9b94fc1 → 0.0.1-commit.9badcec54

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 (213) hide show
  1. package/README.md +162 -22
  2. package/dest/archiver.d.ts +140 -0
  3. package/dest/archiver.d.ts.map +1 -0
  4. package/dest/archiver.js +750 -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} +24 -7
  8. package/dest/errors.d.ts +65 -0
  9. package/dest/errors.d.ts.map +1 -0
  10. package/dest/errors.js +91 -0
  11. package/dest/factory.d.ts +8 -7
  12. package/dest/factory.d.ts.map +1 -1
  13. package/dest/factory.js +99 -15
  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 +403 -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/{archiver → l1}/data_retrieval.js +87 -160
  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 +91 -0
  45. package/dest/modules/data_source_base.d.ts.map +1 -0
  46. package/dest/modules/data_source_base.js +222 -0
  47. package/dest/modules/data_store_updater.d.ts +86 -0
  48. package/dest/modules/data_store_updater.d.ts.map +1 -0
  49. package/dest/modules/data_store_updater.js +333 -0
  50. package/dest/modules/instrumentation.d.ts +52 -0
  51. package/dest/modules/instrumentation.d.ts.map +1 -0
  52. package/dest/modules/instrumentation.js +138 -0
  53. package/dest/modules/l1_synchronizer.d.ts +73 -0
  54. package/dest/modules/l1_synchronizer.d.ts.map +1 -0
  55. package/dest/modules/l1_synchronizer.js +1154 -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 +9 -3
  59. package/dest/store/block_store.d.ts +230 -0
  60. package/dest/store/block_store.d.ts.map +1 -0
  61. package/dest/store/block_store.js +942 -0
  62. package/dest/store/contract_class_store.d.ts +17 -0
  63. package/dest/store/contract_class_store.d.ts.map +1 -0
  64. package/dest/store/contract_class_store.js +64 -0
  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 +7 -3
  68. package/dest/store/kv_archiver_store.d.ts +377 -0
  69. package/dest/store/kv_archiver_store.d.ts.map +1 -0
  70. package/dest/store/kv_archiver_store.js +494 -0
  71. package/dest/store/l2_tips_cache.d.ts +20 -0
  72. package/dest/store/l2_tips_cache.d.ts.map +1 -0
  73. package/dest/store/l2_tips_cache.js +109 -0
  74. package/dest/store/log_store.d.ts +57 -0
  75. package/dest/store/log_store.d.ts.map +1 -0
  76. package/dest/store/log_store.js +531 -0
  77. package/dest/store/message_store.d.ts +44 -0
  78. package/dest/store/message_store.d.ts.map +1 -0
  79. package/dest/{archiver/kv_archiver_store → store}/message_store.js +36 -23
  80. package/dest/{archiver/structs → structs}/data_retrieval.d.ts +1 -1
  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 +210 -0
  88. package/dest/test/fake_l1_state.d.ts.map +1 -0
  89. package/dest/test/fake_l1_state.js +490 -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 +23 -12
  99. package/dest/test/mock_l2_block_source.d.ts +59 -20
  100. package/dest/test/mock_l2_block_source.d.ts.map +1 -1
  101. package/dest/test/mock_l2_block_source.js +276 -85
  102. package/dest/test/mock_structs.d.ts +83 -4
  103. package/dest/test/mock_structs.d.ts.map +1 -1
  104. package/dest/test/mock_structs.js +157 -11
  105. package/dest/test/noop_l1_archiver.d.ts +26 -0
  106. package/dest/test/noop_l1_archiver.d.ts.map +1 -0
  107. package/dest/test/noop_l1_archiver.js +71 -0
  108. package/package.json +20 -20
  109. package/src/archiver.ts +510 -0
  110. package/src/{archiver/config.ts → config.ts} +37 -14
  111. package/src/errors.ts +146 -0
  112. package/src/factory.ts +154 -17
  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 +512 -0
  118. package/src/{archiver → l1}/data_retrieval.ts +146 -233
  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 +347 -0
  125. package/src/modules/data_store_updater.ts +437 -0
  126. package/src/modules/instrumentation.ts +196 -0
  127. package/src/modules/l1_synchronizer.ts +961 -0
  128. package/src/{archiver → modules}/validation.ts +13 -8
  129. package/src/store/block_store.ts +1245 -0
  130. package/src/store/contract_class_store.ts +82 -0
  131. package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +10 -7
  132. package/src/store/kv_archiver_store.ts +713 -0
  133. package/src/store/l2_tips_cache.ts +134 -0
  134. package/src/store/log_store.ts +733 -0
  135. package/src/{archiver/kv_archiver_store → store}/message_store.ts +48 -28
  136. package/src/{archiver/structs → structs}/inbox_message.ts +7 -7
  137. package/src/{archiver/structs → structs}/published.ts +0 -1
  138. package/src/test/fake_l1_state.ts +747 -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 +19 -11
  149. package/src/test/mock_l2_block_source.ts +346 -93
  150. package/src/test/mock_structs.ts +289 -13
  151. package/src/test/noop_l1_archiver.ts +114 -0
  152. package/dest/archiver/archiver.d.ts +0 -287
  153. package/dest/archiver/archiver.d.ts.map +0 -1
  154. package/dest/archiver/archiver.js +0 -1408
  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 -1289
  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/errors.d.ts +0 -12
  166. package/dest/archiver/errors.d.ts.map +0 -1
  167. package/dest/archiver/errors.js +0 -17
  168. package/dest/archiver/index.d.ts +0 -7
  169. package/dest/archiver/index.d.ts.map +0 -1
  170. package/dest/archiver/index.js +0 -4
  171. package/dest/archiver/instrumentation.d.ts +0 -35
  172. package/dest/archiver/instrumentation.d.ts.map +0 -1
  173. package/dest/archiver/instrumentation.js +0 -140
  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_class_store.js +0 -120
  180. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -24
  181. package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
  182. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -168
  183. package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
  184. package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -296
  185. package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -49
  186. package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
  187. package/dest/archiver/kv_archiver_store/log_store.js +0 -336
  188. package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -39
  189. package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
  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 -3
  194. package/dest/archiver/structs/published.d.ts.map +0 -1
  195. package/dest/archiver/validation.d.ts +0 -17
  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 -1858
  201. package/src/archiver/archiver_store.ts +0 -305
  202. package/src/archiver/archiver_store_test_suite.ts +0 -1264
  203. package/src/archiver/errors.ts +0 -26
  204. package/src/archiver/index.ts +0 -6
  205. package/src/archiver/instrumentation.ts +0 -187
  206. package/src/archiver/kv_archiver_store/block_store.ts +0 -481
  207. package/src/archiver/kv_archiver_store/contract_class_store.ts +0 -176
  208. package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -422
  209. package/src/archiver/kv_archiver_store/log_store.ts +0 -406
  210. package/src/rpc/index.ts +0 -16
  211. /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
  212. /package/dest/{archiver/structs → structs}/published.js +0 -0
  213. /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
@@ -0,0 +1,403 @@
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 { ConsensusPayload, SignatureDomainSeparator } from '@aztec/stdlib/p2p';
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
+ /**
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
+ */ async getCheckpointFromRollupTx(txHash, _blobHashes, checkpointNumber, expectedHashes) {
45
+ this.logger.trace(`Fetching checkpoint ${checkpointNumber} from rollup tx ${txHash}`);
46
+ const tx = await this.publicClient.getTransaction({
47
+ hash: txHash
48
+ });
49
+ return this.getCheckpointFromTx(tx, checkpointNumber, expectedHashes);
50
+ }
51
+ /** Gets checkpoint data from a transaction by trying decode strategies then falling back to trace. */ async getCheckpointFromTx(tx, checkpointNumber, expectedHashes) {
52
+ // Try to decode as multicall3 with hash-verified matching
53
+ const multicall3Result = this.tryDecodeMulticall3(tx, expectedHashes, checkpointNumber, tx.blockHash);
54
+ if (multicall3Result) {
55
+ this.logger.trace(`Decoded propose calldata from multicall3 for tx ${tx.hash}`);
56
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to, false);
57
+ return multicall3Result;
58
+ }
59
+ // Try to decode as direct propose call
60
+ const directResult = this.tryDecodeDirectPropose(tx, expectedHashes, checkpointNumber, tx.blockHash);
61
+ if (directResult) {
62
+ this.logger.trace(`Decoded propose calldata from direct call for tx ${tx.hash}`);
63
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to, false);
64
+ return directResult;
65
+ }
66
+ // Try to decode as Spire Proposer multicall wrapper
67
+ const spireResult = await this.tryDecodeSpireProposer(tx, expectedHashes, checkpointNumber, tx.blockHash);
68
+ if (spireResult) {
69
+ this.logger.trace(`Decoded propose calldata from Spire Proposer for tx ${tx.hash}`);
70
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to, false);
71
+ return spireResult;
72
+ }
73
+ // Fall back to trace-based extraction
74
+ this.logger.warn(`Failed to decode multicall3, direct propose, or Spire proposer for L1 tx ${tx.hash}, falling back to trace for checkpoint ${checkpointNumber}`);
75
+ this.instrumentation?.recordBlockProposalTxTarget(tx.to ?? EthAddress.ZERO.toString(), true);
76
+ const tracedCalldata = await this.extractCalldataViaTrace(tx.hash);
77
+ const tracedResult = this.tryDecodeAndVerifyPropose(tracedCalldata, expectedHashes, checkpointNumber, tx.blockHash);
78
+ if (!tracedResult) {
79
+ throw new Error(`Hash mismatch for traced propose calldata in tx ${tx.hash} for checkpoint ${checkpointNumber}`);
80
+ }
81
+ return tracedResult;
82
+ }
83
+ /**
84
+ * Attempts to decode a transaction as a Spire Proposer multicall wrapper.
85
+ * If successful, iterates all wrapped calls and validates each as either multicall3
86
+ * or direct propose, verifying against expected hashes.
87
+ * @param tx - The transaction to decode
88
+ * @param expectedHashes - Expected hashes for hash-verified matching
89
+ * @param checkpointNumber - The checkpoint number
90
+ * @param blockHash - The L1 block hash
91
+ * @returns The checkpoint data if successfully decoded and validated, undefined otherwise
92
+ */ async tryDecodeSpireProposer(tx, expectedHashes, checkpointNumber, blockHash) {
93
+ // Try to decode as Spire Proposer multicall (extracts all wrapped calls)
94
+ const spireWrappedCalls = await getCallsFromSpireProposer(tx, this.publicClient, this.logger);
95
+ if (!spireWrappedCalls) {
96
+ return undefined;
97
+ }
98
+ this.logger.trace(`Decoded Spire Proposer wrapping for tx ${tx.hash}, ${spireWrappedCalls.length} inner call(s)`);
99
+ // Try each wrapped call as either multicall3 or direct propose
100
+ for (const spireWrappedCall of spireWrappedCalls){
101
+ const wrappedTx = {
102
+ to: spireWrappedCall.to,
103
+ input: spireWrappedCall.data,
104
+ hash: tx.hash
105
+ };
106
+ const multicall3Result = this.tryDecodeMulticall3(wrappedTx, expectedHashes, checkpointNumber, blockHash);
107
+ if (multicall3Result) {
108
+ this.logger.trace(`Decoded propose calldata from Spire Proposer to multicall3 for tx ${tx.hash}`);
109
+ return multicall3Result;
110
+ }
111
+ const directResult = this.tryDecodeDirectPropose(wrappedTx, expectedHashes, checkpointNumber, blockHash);
112
+ if (directResult) {
113
+ this.logger.trace(`Decoded propose calldata from Spire Proposer to direct propose for tx ${tx.hash}`);
114
+ return directResult;
115
+ }
116
+ }
117
+ this.logger.warn(`Spire Proposer wrapped calls could not be decoded as multicall3 or direct propose for tx ${tx.hash}`);
118
+ return undefined;
119
+ }
120
+ /**
121
+ * Attempts to decode transaction input as multicall3 and extract propose calldata.
122
+ * Finds all calls matching the rollup address and propose selector, then decodes
123
+ * and verifies each candidate against expected hashes from the CheckpointProposed event.
124
+ * @param tx - The transaction-like object with to, input, and hash
125
+ * @param expectedHashes - Expected hashes from CheckpointProposed event
126
+ * @param checkpointNumber - The checkpoint number
127
+ * @param blockHash - The L1 block hash
128
+ * @returns The checkpoint data if successfully validated, undefined otherwise
129
+ */ tryDecodeMulticall3(tx, expectedHashes, checkpointNumber, blockHash) {
130
+ const txHash = tx.hash;
131
+ try {
132
+ // Check if transaction is to Multicall3 address
133
+ if (!tx.to || !EthAddress.areEqual(tx.to, MULTI_CALL_3_ADDRESS)) {
134
+ this.logger.debug(`Transaction is not to Multicall3 address (to: ${tx.to})`, {
135
+ txHash,
136
+ to: tx.to
137
+ });
138
+ return undefined;
139
+ }
140
+ // Try to decode as multicall3 aggregate3 call
141
+ const { functionName: multicall3Fn, args: multicall3Args } = decodeFunctionData({
142
+ abi: multicall3Abi,
143
+ data: tx.input
144
+ });
145
+ // If not aggregate3, return undefined (not a multicall3 transaction)
146
+ if (multicall3Fn !== 'aggregate3') {
147
+ this.logger.warn(`Transaction is not multicall3 aggregate3 (got ${multicall3Fn})`, {
148
+ txHash
149
+ });
150
+ return undefined;
151
+ }
152
+ if (multicall3Args.length !== 1) {
153
+ this.logger.warn(`Unexpected number of arguments for multicall3 (got ${multicall3Args.length})`, {
154
+ txHash
155
+ });
156
+ return undefined;
157
+ }
158
+ const [calls] = multicall3Args;
159
+ // Find all calls matching rollup address + propose selector
160
+ const rollupAddressLower = this.rollupAddress.toString().toLowerCase();
161
+ const proposeSelectorLower = PROPOSE_SELECTOR.toLowerCase();
162
+ const candidates = [];
163
+ for (const call of calls){
164
+ const addr = call.target.toLowerCase();
165
+ const callData = call.callData;
166
+ if (callData.length < 10) {
167
+ continue;
168
+ }
169
+ const selector = callData.slice(0, 10).toLowerCase();
170
+ if (addr === rollupAddressLower && selector === proposeSelectorLower) {
171
+ candidates.push(callData);
172
+ }
173
+ }
174
+ if (candidates.length === 0) {
175
+ this.logger.debug(`No propose candidates found in multicall3`, {
176
+ txHash
177
+ });
178
+ return undefined;
179
+ }
180
+ // Decode, verify, and build for each candidate
181
+ const verified = [];
182
+ for (const candidate of candidates){
183
+ const result = this.tryDecodeAndVerifyPropose(candidate, expectedHashes, checkpointNumber, blockHash);
184
+ if (result) {
185
+ verified.push(result);
186
+ }
187
+ }
188
+ if (verified.length === 1) {
189
+ this.logger.trace(`Verified single propose candidate via hash matching`, {
190
+ txHash
191
+ });
192
+ return verified[0];
193
+ }
194
+ if (verified.length > 1) {
195
+ this.logger.warn(`Multiple propose candidates verified (${verified.length}), returning first (identical data)`, {
196
+ txHash
197
+ });
198
+ return verified[0];
199
+ }
200
+ this.logger.debug(`No candidates verified against expected hashes`, {
201
+ txHash
202
+ });
203
+ return undefined;
204
+ } catch (err) {
205
+ // Any decoding error triggers fallback to trace
206
+ this.logger.warn(`Failed to decode multicall3: ${err}`, {
207
+ txHash
208
+ });
209
+ return undefined;
210
+ }
211
+ }
212
+ /**
213
+ * Attempts to decode transaction as a direct propose call to the rollup contract.
214
+ * Decodes, verifies hashes, and builds checkpoint data in a single pass.
215
+ * @param tx - The transaction-like object with to, input, and hash
216
+ * @param expectedHashes - Expected hashes from CheckpointProposed event
217
+ * @param checkpointNumber - The checkpoint number
218
+ * @param blockHash - The L1 block hash
219
+ * @returns The checkpoint data if successfully validated, undefined otherwise
220
+ */ tryDecodeDirectPropose(tx, expectedHashes, checkpointNumber, blockHash) {
221
+ const txHash = tx.hash;
222
+ try {
223
+ // Check if transaction is to the rollup address
224
+ if (!tx.to || !EthAddress.areEqual(tx.to, this.rollupAddress)) {
225
+ this.logger.debug(`Transaction is not to rollup address (to: ${tx.to})`, {
226
+ txHash
227
+ });
228
+ return undefined;
229
+ }
230
+ // Validate it's a propose call before full decode+verify
231
+ const { functionName } = decodeFunctionData({
232
+ abi: RollupAbi,
233
+ data: tx.input
234
+ });
235
+ if (functionName !== 'propose') {
236
+ this.logger.warn(`Transaction to rollup is not propose (got ${functionName})`, {
237
+ txHash
238
+ });
239
+ return undefined;
240
+ }
241
+ // Decode, verify hashes, and build checkpoint data
242
+ this.logger.trace(`Validated direct propose call to rollup`, {
243
+ txHash
244
+ });
245
+ return this.tryDecodeAndVerifyPropose(tx.input, expectedHashes, checkpointNumber, blockHash);
246
+ } catch (err) {
247
+ // Any decoding error means it's not a valid propose call
248
+ this.logger.warn(`Failed to decode as direct propose: ${err}`, {
249
+ txHash
250
+ });
251
+ return undefined;
252
+ }
253
+ }
254
+ /**
255
+ * Uses debug/trace RPC to extract the actual calldata from the successful propose call.
256
+ * This is the definitive fallback that works for any transaction pattern.
257
+ * Tries trace_transaction first, then falls back to debug_traceTransaction.
258
+ * @param txHash - The transaction hash to trace
259
+ * @returns The propose calldata from the successful call
260
+ */ async extractCalldataViaTrace(txHash) {
261
+ const rollupAddress = this.rollupAddress;
262
+ const selector = PROPOSE_SELECTOR;
263
+ let calls;
264
+ try {
265
+ // Try trace_transaction first (using Parity/OpenEthereum/Erigon RPC)
266
+ this.logger.debug(`Attempting to trace transaction ${txHash} using trace_transaction`);
267
+ calls = await getSuccessfulCallsFromTrace(this.debugClient, txHash, rollupAddress, selector, this.logger);
268
+ this.logger.debug(`Successfully traced using trace_transaction, found ${calls.length} calls`);
269
+ } catch (err) {
270
+ const traceError = err instanceof Error ? err : new Error(String(err));
271
+ this.logger.verbose(`Failed trace_transaction for ${txHash}: ${traceError.message}`);
272
+ this.logger.debug(`Trace failure details for ${txHash}`, {
273
+ traceError
274
+ });
275
+ try {
276
+ // Fall back to debug_traceTransaction (Geth RPC)
277
+ this.logger.debug(`Attempting to trace transaction ${txHash} using debug_traceTransaction`);
278
+ calls = await getSuccessfulCallsFromDebug(this.debugClient, txHash, rollupAddress, selector, this.logger);
279
+ this.logger.debug(`Successfully traced using debug_traceTransaction, found ${calls.length} calls`);
280
+ } catch (debugErr) {
281
+ const debugError = debugErr instanceof Error ? debugErr : new Error(String(debugErr));
282
+ // Log once per tx so we don't spam on every sync cycle when sync point doesn't advance
283
+ if (!CalldataRetriever.traceFailureWarnedTxHashes.has(txHash)) {
284
+ CalldataRetriever.traceFailureWarnedTxHashes.add(txHash);
285
+ this.logger.warn(`Cannot decode L1 tx ${txHash}: trace and debug RPC failed or unavailable. ` + `trace_transaction: ${traceError.message}; debug_traceTransaction: ${debugError.message}`);
286
+ }
287
+ // Full error objects can be very long; keep at debug only
288
+ this.logger.debug(`Trace/debug failure details for tx ${txHash}`, {
289
+ traceError,
290
+ debugError,
291
+ txHash
292
+ });
293
+ throw new Error(`Failed to trace transaction ${txHash} to extract propose calldata`);
294
+ }
295
+ }
296
+ // Validate exactly ONE successful propose call
297
+ if (calls.length === 0) {
298
+ throw new Error(`No successful propose calls found in transaction ${txHash}`);
299
+ }
300
+ if (calls.length > 1) {
301
+ throw new Error(`Multiple successful propose calls found in transaction ${txHash} (${calls.length})`);
302
+ }
303
+ // Return the calldata from the single successful propose call
304
+ return calls[0].input;
305
+ }
306
+ /**
307
+ * Decodes propose calldata, verifies against expected hashes, and builds checkpoint data.
308
+ * Returns undefined on decode errors or hash mismatches (soft failure for try-based callers).
309
+ * @param proposeCalldata - The propose function calldata
310
+ * @param expectedHashes - Expected hashes from the CheckpointProposed event
311
+ * @param checkpointNumber - The checkpoint number
312
+ * @param blockHash - The L1 block hash
313
+ * @returns The decoded checkpoint data, or undefined on failure
314
+ */ tryDecodeAndVerifyPropose(proposeCalldata, expectedHashes, checkpointNumber, blockHash) {
315
+ try {
316
+ const { functionName, args } = decodeFunctionData({
317
+ abi: RollupAbi,
318
+ data: proposeCalldata
319
+ });
320
+ if (functionName !== 'propose') {
321
+ return undefined;
322
+ }
323
+ const [decodedArgs, packedAttestations] = args;
324
+ // Verify attestationsHash
325
+ const computedAttestationsHash = this.computeAttestationsHash(packedAttestations);
326
+ if (!Buffer.from(hexToBytes(computedAttestationsHash)).equals(Buffer.from(hexToBytes(expectedHashes.attestationsHash)))) {
327
+ this.logger.warn(`Attestations hash mismatch during verification`, {
328
+ computed: computedAttestationsHash,
329
+ expected: expectedHashes.attestationsHash
330
+ });
331
+ return undefined;
332
+ }
333
+ // Verify payloadDigest
334
+ const header = CheckpointHeader.fromViem(decodedArgs.header);
335
+ const archiveRoot = new Fr(Buffer.from(hexToBytes(decodedArgs.archive)));
336
+ const feeAssetPriceModifier = decodedArgs.oracleInput.feeAssetPriceModifier;
337
+ const computedPayloadDigest = this.computePayloadDigest(header, archiveRoot, feeAssetPriceModifier);
338
+ if (!Buffer.from(hexToBytes(computedPayloadDigest)).equals(Buffer.from(hexToBytes(expectedHashes.payloadDigest)))) {
339
+ this.logger.warn(`Payload digest mismatch during verification`, {
340
+ computed: computedPayloadDigest,
341
+ expected: expectedHashes.payloadDigest
342
+ });
343
+ return undefined;
344
+ }
345
+ const attestations = CommitteeAttestation.fromPacked(packedAttestations, this.targetCommitteeSize);
346
+ this.logger.trace(`Validated and decoded propose calldata for checkpoint ${checkpointNumber}`, {
347
+ checkpointNumber,
348
+ archive: decodedArgs.archive,
349
+ header: decodedArgs.header,
350
+ l1BlockHash: blockHash,
351
+ attestations,
352
+ packedAttestations,
353
+ targetCommitteeSize: this.targetCommitteeSize
354
+ });
355
+ return {
356
+ checkpointNumber,
357
+ archiveRoot,
358
+ header,
359
+ attestations,
360
+ blockHash,
361
+ feeAssetPriceModifier
362
+ };
363
+ } catch {
364
+ return undefined;
365
+ }
366
+ }
367
+ /** Computes the keccak256 hash of ABI-encoded CommitteeAttestations. */ computeAttestationsHash(packedAttestations) {
368
+ return keccak256(encodeAbiParameters([
369
+ this.getCommitteeAttestationsStructDef()
370
+ ], [
371
+ packedAttestations
372
+ ]));
373
+ }
374
+ /** Computes the keccak256 payload digest from the checkpoint header, archive root, and fee asset price modifier. */ computePayloadDigest(header, archiveRoot, feeAssetPriceModifier) {
375
+ const consensusPayload = new ConsensusPayload(header, archiveRoot, feeAssetPriceModifier);
376
+ const payloadToSign = consensusPayload.getPayloadToSign(SignatureDomainSeparator.checkpointAttestation);
377
+ return keccak256(payloadToSign);
378
+ }
379
+ /**
380
+ * Extracts the CommitteeAttestations struct definition from RollupAbi.
381
+ * Finds the _attestations parameter by name in the propose function.
382
+ */ getCommitteeAttestationsStructDef() {
383
+ const proposeFunction = RollupAbi.find((item)=>item.type === 'function' && item.name === 'propose');
384
+ if (!proposeFunction) {
385
+ throw new Error('propose function not found in RollupAbi');
386
+ }
387
+ // Find the _attestations parameter by name, not by index
388
+ const attestationsParam = proposeFunction.inputs.find((param)=>param.name === '_attestations');
389
+ if (!attestationsParam) {
390
+ throw new Error('_attestations parameter not found in propose function');
391
+ }
392
+ if (attestationsParam.type !== 'tuple') {
393
+ throw new Error(`Expected _attestations parameter to be a tuple, got ${attestationsParam.type}`);
394
+ }
395
+ // Extract the tuple components (struct fields)
396
+ const tupleParam = attestationsParam;
397
+ return {
398
+ type: 'tuple',
399
+ components: tupleParam.components || []
400
+ };
401
+ }
402
+ }
403
+ /** 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, 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, message: InboxMessage): 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YV9yZXRyaWV2YWwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMS9kYXRhX3JldHJpZXZhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3JFLE9BQU8sRUFFTCxLQUFLLGtCQUFrQixFQUl4QixNQUFNLGlCQUFpQixDQUFDO0FBQ3pCLE9BQU8sS0FBSyxFQUdWLGFBQWEsRUFFYixjQUFjLEVBQ2YsTUFBTSwyQkFBMkIsQ0FBQztBQUNuQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRXJGLE9BQU8sRUFBRSxnQkFBZ0IsRUFBeUIsTUFBTSxpQ0FBaUMsQ0FBQztBQUMxRixPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQzNELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUVsRSxPQUFPLEVBQVEsb0JBQW9CLEVBQVcsTUFBTSxxQkFBcUIsQ0FBQztBQUMxRSxPQUFPLEVBQWMsZUFBZSxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDNUYsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxnQkFBZ0IsRUF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