@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.
- package/README.md +164 -22
- package/dest/archiver.d.ts +158 -0
- package/dest/archiver.d.ts.map +1 -0
- package/dest/archiver.js +881 -0
- package/dest/config.d.ts +33 -0
- package/dest/config.d.ts.map +1 -0
- package/dest/{archiver/config.js → config.js} +31 -14
- package/dest/errors.d.ts +87 -0
- package/dest/errors.d.ts.map +1 -0
- package/dest/errors.js +129 -0
- package/dest/factory.d.ts +16 -10
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +112 -20
- package/dest/index.d.ts +19 -4
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +17 -3
- package/dest/interfaces.d.ts +9 -0
- package/dest/interfaces.d.ts.map +1 -0
- package/dest/interfaces.js +3 -0
- package/dest/{archiver/l1 → l1}/bin/retrieve-calldata.d.ts +1 -1
- package/dest/l1/bin/retrieve-calldata.d.ts.map +1 -0
- package/dest/{archiver/l1 → l1}/bin/retrieve-calldata.js +35 -32
- package/dest/l1/calldata_retriever.d.ts +136 -0
- package/dest/l1/calldata_retriever.d.ts.map +1 -0
- package/dest/l1/calldata_retriever.js +412 -0
- package/dest/l1/data_retrieval.d.ts +97 -0
- package/dest/l1/data_retrieval.d.ts.map +1 -0
- package/dest/{archiver/l1 → l1}/data_retrieval.js +65 -89
- package/dest/{archiver/l1 → l1}/debug_tx.d.ts +1 -1
- package/dest/l1/debug_tx.d.ts.map +1 -0
- package/dest/{archiver/l1 → l1}/spire_proposer.d.ts +5 -5
- package/dest/l1/spire_proposer.d.ts.map +1 -0
- package/dest/{archiver/l1 → l1}/spire_proposer.js +9 -17
- package/dest/l1/trace_tx.d.ts +43 -0
- package/dest/l1/trace_tx.d.ts.map +1 -0
- package/dest/l1/types.d.ts +12 -0
- package/dest/l1/types.d.ts.map +1 -0
- package/dest/l1/validate_historical_logs.d.ts +23 -0
- package/dest/l1/validate_historical_logs.d.ts.map +1 -0
- package/dest/l1/validate_historical_logs.js +108 -0
- package/dest/{archiver/l1 → l1}/validate_trace.d.ts +6 -3
- package/dest/l1/validate_trace.d.ts.map +1 -0
- package/dest/{archiver/l1 → l1}/validate_trace.js +13 -9
- package/dest/modules/contract_data_source_adapter.d.ts +25 -0
- package/dest/modules/contract_data_source_adapter.d.ts.map +1 -0
- package/dest/modules/contract_data_source_adapter.js +40 -0
- package/dest/modules/data_source_base.d.ts +113 -0
- package/dest/modules/data_source_base.d.ts.map +1 -0
- package/dest/modules/data_source_base.js +351 -0
- package/dest/modules/data_store_updater.d.ts +105 -0
- package/dest/modules/data_store_updater.d.ts.map +1 -0
- package/dest/modules/data_store_updater.js +392 -0
- package/dest/modules/instrumentation.d.ts +55 -0
- package/dest/modules/instrumentation.d.ts.map +1 -0
- package/dest/{archiver → modules}/instrumentation.js +61 -19
- package/dest/modules/l1_synchronizer.d.ts +77 -0
- package/dest/modules/l1_synchronizer.d.ts.map +1 -0
- package/dest/modules/l1_synchronizer.js +1344 -0
- package/dest/modules/validation.d.ts +18 -0
- package/dest/modules/validation.d.ts.map +1 -0
- package/dest/{archiver → modules}/validation.js +12 -6
- package/dest/store/block_store.d.ts +300 -0
- package/dest/store/block_store.d.ts.map +1 -0
- package/dest/store/block_store.js +1219 -0
- package/dest/store/contract_class_store.d.ts +31 -0
- package/dest/store/contract_class_store.d.ts.map +1 -0
- package/dest/store/contract_class_store.js +80 -0
- package/dest/store/contract_instance_store.d.ts +51 -0
- package/dest/store/contract_instance_store.d.ts.map +1 -0
- package/dest/{archiver/kv_archiver_store → store}/contract_instance_store.js +38 -3
- package/dest/store/data_stores.d.ts +68 -0
- package/dest/store/data_stores.d.ts.map +1 -0
- package/dest/store/data_stores.js +54 -0
- package/dest/store/function_names_cache.d.ts +17 -0
- package/dest/store/function_names_cache.d.ts.map +1 -0
- package/dest/store/function_names_cache.js +30 -0
- package/dest/store/l2_tips_cache.d.ts +25 -0
- package/dest/store/l2_tips_cache.d.ts.map +1 -0
- package/dest/store/l2_tips_cache.js +26 -0
- package/dest/store/log_store.d.ts +59 -0
- package/dest/store/log_store.d.ts.map +1 -0
- package/dest/store/log_store.js +310 -0
- package/dest/store/log_store_codec.d.ts +70 -0
- package/dest/store/log_store_codec.d.ts.map +1 -0
- package/dest/store/log_store_codec.js +101 -0
- package/dest/store/message_store.d.ts +50 -0
- package/dest/store/message_store.d.ts.map +1 -0
- package/dest/{archiver/kv_archiver_store → store}/message_store.js +51 -9
- package/dest/{archiver/structs → structs}/data_retrieval.d.ts +1 -1
- package/dest/structs/data_retrieval.d.ts.map +1 -0
- package/dest/structs/inbox_message.d.ts +15 -0
- package/dest/structs/inbox_message.d.ts.map +1 -0
- package/dest/{archiver/structs → structs}/published.d.ts +1 -1
- package/dest/structs/published.d.ts.map +1 -0
- package/dest/test/fake_l1_state.d.ts +214 -0
- package/dest/test/fake_l1_state.d.ts.map +1 -0
- package/dest/test/fake_l1_state.js +517 -0
- package/dest/test/index.d.ts +2 -1
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +4 -1
- package/dest/test/mock_archiver.d.ts +2 -2
- package/dest/test/mock_archiver.d.ts.map +1 -1
- package/dest/test/mock_archiver.js +3 -3
- package/dest/test/mock_l1_to_l2_message_source.d.ts +1 -1
- package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/test/mock_l1_to_l2_message_source.js +2 -1
- package/dest/test/mock_l2_block_source.d.ts +65 -41
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +330 -151
- package/dest/test/mock_structs.d.ts +81 -3
- package/dest/test/mock_structs.d.ts.map +1 -1
- package/dest/test/mock_structs.js +152 -7
- package/dest/test/noop_l1_archiver.d.ts +29 -0
- package/dest/test/noop_l1_archiver.d.ts.map +1 -0
- package/dest/test/noop_l1_archiver.js +85 -0
- package/package.json +17 -18
- package/src/archiver.ts +681 -0
- package/src/{archiver/config.ts → config.ts} +43 -12
- package/src/errors.ts +203 -0
- package/src/factory.ts +175 -22
- package/src/index.ts +27 -3
- package/src/interfaces.ts +9 -0
- package/src/l1/README.md +55 -0
- package/src/{archiver/l1 → l1}/bin/retrieve-calldata.ts +45 -33
- package/src/l1/calldata_retriever.ts +522 -0
- package/src/{archiver/l1 → l1}/data_retrieval.ts +106 -134
- package/src/{archiver/l1 → l1}/spire_proposer.ts +7 -15
- package/src/l1/validate_historical_logs.ts +140 -0
- package/src/{archiver/l1 → l1}/validate_trace.ts +24 -6
- package/src/modules/contract_data_source_adapter.ts +55 -0
- package/src/modules/data_source_base.ts +493 -0
- package/src/modules/data_store_updater.ts +518 -0
- package/src/{archiver → modules}/instrumentation.ts +72 -20
- package/src/modules/l1_synchronizer.ts +1257 -0
- package/src/{archiver → modules}/validation.ts +15 -9
- package/src/store/block_store.ts +1590 -0
- package/src/store/contract_class_store.ts +108 -0
- package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +52 -6
- package/src/store/data_stores.ts +104 -0
- package/src/store/function_names_cache.ts +37 -0
- package/src/store/l2_tips_cache.ts +35 -0
- package/src/store/log_store.ts +379 -0
- package/src/store/log_store_codec.ts +132 -0
- package/src/{archiver/kv_archiver_store → store}/message_store.ts +60 -10
- package/src/{archiver/structs → structs}/inbox_message.ts +1 -1
- package/src/test/fake_l1_state.ts +770 -0
- package/src/test/index.ts +4 -0
- package/src/test/mock_archiver.ts +4 -3
- package/src/test/mock_l1_to_l2_message_source.ts +1 -0
- package/src/test/mock_l2_block_source.ts +403 -171
- package/src/test/mock_structs.ts +283 -8
- package/src/test/noop_l1_archiver.ts +139 -0
- package/dest/archiver/archiver.d.ts +0 -307
- package/dest/archiver/archiver.d.ts.map +0 -1
- package/dest/archiver/archiver.js +0 -2102
- package/dest/archiver/archiver_store.d.ts +0 -315
- package/dest/archiver/archiver_store.d.ts.map +0 -1
- package/dest/archiver/archiver_store.js +0 -4
- package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
- package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
- package/dest/archiver/archiver_store_test_suite.js +0 -2770
- package/dest/archiver/config.d.ts +0 -22
- package/dest/archiver/config.d.ts.map +0 -1
- package/dest/archiver/errors.d.ts +0 -36
- package/dest/archiver/errors.d.ts.map +0 -1
- package/dest/archiver/errors.js +0 -54
- package/dest/archiver/index.d.ts +0 -7
- package/dest/archiver/index.d.ts.map +0 -1
- package/dest/archiver/index.js +0 -4
- package/dest/archiver/instrumentation.d.ts +0 -37
- package/dest/archiver/instrumentation.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -164
- package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/block_store.js +0 -626
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/contract_class_store.js +0 -120
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -24
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -159
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -316
- package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -45
- package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/log_store.js +0 -401
- package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -40
- package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
- package/dest/archiver/l1/bin/retrieve-calldata.d.ts.map +0 -1
- package/dest/archiver/l1/calldata_retriever.d.ts +0 -112
- package/dest/archiver/l1/calldata_retriever.d.ts.map +0 -1
- package/dest/archiver/l1/calldata_retriever.js +0 -471
- package/dest/archiver/l1/data_retrieval.d.ts +0 -90
- package/dest/archiver/l1/data_retrieval.d.ts.map +0 -1
- package/dest/archiver/l1/debug_tx.d.ts.map +0 -1
- package/dest/archiver/l1/spire_proposer.d.ts.map +0 -1
- package/dest/archiver/l1/trace_tx.d.ts +0 -97
- package/dest/archiver/l1/trace_tx.d.ts.map +0 -1
- package/dest/archiver/l1/types.d.ts +0 -12
- package/dest/archiver/l1/types.d.ts.map +0 -1
- package/dest/archiver/l1/validate_trace.d.ts.map +0 -1
- package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
- package/dest/archiver/structs/inbox_message.d.ts +0 -15
- package/dest/archiver/structs/inbox_message.d.ts.map +0 -1
- package/dest/archiver/structs/published.d.ts.map +0 -1
- package/dest/archiver/validation.d.ts +0 -17
- package/dest/archiver/validation.d.ts.map +0 -1
- package/dest/rpc/index.d.ts +0 -9
- package/dest/rpc/index.d.ts.map +0 -1
- package/dest/rpc/index.js +0 -15
- package/src/archiver/archiver.ts +0 -2265
- package/src/archiver/archiver_store.ts +0 -380
- package/src/archiver/archiver_store_test_suite.ts +0 -2842
- package/src/archiver/errors.ts +0 -90
- package/src/archiver/index.ts +0 -6
- package/src/archiver/kv_archiver_store/block_store.ts +0 -850
- package/src/archiver/kv_archiver_store/contract_class_store.ts +0 -176
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -442
- package/src/archiver/kv_archiver_store/log_store.ts +0 -516
- package/src/archiver/l1/README.md +0 -98
- package/src/archiver/l1/calldata_retriever.ts +0 -641
- package/src/rpc/index.ts +0 -16
- /package/dest/{archiver/l1 → l1}/debug_tx.js +0 -0
- /package/dest/{archiver/l1 → l1}/trace_tx.js +0 -0
- /package/dest/{archiver/l1 → l1}/types.js +0 -0
- /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
- /package/dest/{archiver/structs → structs}/inbox_message.js +0 -0
- /package/dest/{archiver/structs → structs}/published.js +0 -0
- /package/src/{archiver/l1 → l1}/debug_tx.ts +0 -0
- /package/src/{archiver/l1 → l1}/trace_tx.ts +0 -0
- /package/src/{archiver/l1 → l1}/types.ts +0 -0
- /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
- /package/src/{archiver/structs → structs}/published.ts +0 -0
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { BlobDeserializationError, SpongeBlob, decodeCheckpointBlobDataFromBlobs, encodeBlockBlobData } from '@aztec/blob-lib';
|
|
2
2
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
3
|
-
import { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
4
|
-
import { Buffer16, Buffer32 } from '@aztec/foundation/buffer';
|
|
3
|
+
import { CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
5
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
6
|
import { createLogger } from '@aztec/foundation/log';
|
|
8
7
|
import { RollupAbi } from '@aztec/l1-artifacts';
|
|
9
|
-
import { Body,
|
|
8
|
+
import { Body, L2Block } from '@aztec/stdlib/block';
|
|
10
9
|
import { Checkpoint, L1PublishedData, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
11
10
|
import { Proof } from '@aztec/stdlib/proofs';
|
|
12
11
|
import { AppendOnlyTreeSnapshot } from '@aztec/stdlib/trees';
|
|
@@ -14,7 +13,7 @@ import { BlockHeader, GlobalVariables, PartialStateReference, StateReference } f
|
|
|
14
13
|
import { decodeFunctionData, getAbiItem, hexToBytes } from 'viem';
|
|
15
14
|
import { NoBlobBodiesFoundError } from '../errors.js';
|
|
16
15
|
import { CalldataRetriever } from './calldata_retriever.js';
|
|
17
|
-
export async function retrievedToPublishedCheckpoint({ checkpointNumber, archiveRoot, header: checkpointHeader, checkpointBlobData, l1, chainId, version, attestations }) {
|
|
16
|
+
export async function retrievedToPublishedCheckpoint({ checkpointNumber, archiveRoot, feeAssetPriceModifier, header: checkpointHeader, checkpointBlobData, l1, chainId, version, attestations }) {
|
|
18
17
|
const { blocks: blocksBlobData } = checkpointBlobData;
|
|
19
18
|
// The lastArchiveRoot of a block is the new archive for the previous block.
|
|
20
19
|
const newArchiveRoots = blocksBlobData.map((b)=>b.lastArchiveRoot).slice(1).concat([
|
|
@@ -47,7 +46,7 @@ export async function retrievedToPublishedCheckpoint({ checkpointNumber, archive
|
|
|
47
46
|
publicDataTree: new AppendOnlyTreeSnapshot(publicDataRoot, blockEndStateField.publicDataNextAvailableLeafIndex)
|
|
48
47
|
})
|
|
49
48
|
});
|
|
50
|
-
const body = Body.fromTxBlobData(
|
|
49
|
+
const body = Body.fromTxBlobData(blockBlobData.txs);
|
|
51
50
|
const blobFields = encodeBlockBlobData(blockBlobData);
|
|
52
51
|
await spongeBlob.absorb(blobFields);
|
|
53
52
|
const clonedSpongeBlob = spongeBlob.clone();
|
|
@@ -61,14 +60,15 @@ export async function retrievedToPublishedCheckpoint({ checkpointNumber, archive
|
|
|
61
60
|
totalManaUsed: new Fr(blockEndStateField.totalManaUsed)
|
|
62
61
|
});
|
|
63
62
|
const newArchive = new AppendOnlyTreeSnapshot(newArchiveRoots[i], l2BlockNumber + 1);
|
|
64
|
-
l2Blocks.push(new
|
|
63
|
+
l2Blocks.push(new L2Block(newArchive, header, body, checkpointNumber, IndexWithinCheckpoint(i)));
|
|
65
64
|
}
|
|
66
65
|
const lastBlock = l2Blocks.at(-1);
|
|
67
66
|
const checkpoint = Checkpoint.from({
|
|
68
67
|
archive: new AppendOnlyTreeSnapshot(archiveRoot, lastBlock.number + 1),
|
|
69
68
|
header: checkpointHeader,
|
|
70
69
|
blocks: l2Blocks,
|
|
71
|
-
number: checkpointNumber
|
|
70
|
+
number: checkpointNumber,
|
|
71
|
+
feeAssetPriceModifier: feeAssetPriceModifier
|
|
72
72
|
});
|
|
73
73
|
return PublishedCheckpoint.from({
|
|
74
74
|
checkpoint,
|
|
@@ -77,121 +77,111 @@ export async function retrievedToPublishedCheckpoint({ checkpointNumber, archive
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* Fetches
|
|
81
|
-
*
|
|
80
|
+
* Fetches checkpoint calldata from the rollup contract without fetching blob data.
|
|
81
|
+
* Returns RetrievedCheckpointFromCalldata objects that preserve the information needed for deferred blob fetching.
|
|
82
|
+
* @param rollup - The rollup contract wrapper.
|
|
82
83
|
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
83
84
|
* @param debugClient - The viem debug client to use for trace/debug RPC methods (optional).
|
|
84
|
-
* @param blobClient - The blob client client for fetching blob data.
|
|
85
85
|
* @param searchStartBlock - The block number to use for starting the search.
|
|
86
86
|
* @param searchEndBlock - The highest block number that we should search up to.
|
|
87
|
-
* @param contractAddresses - The contract addresses (governanceProposerAddress, slashFactoryAddress, slashingProposerAddress).
|
|
88
87
|
* @param instrumentation - The archiver instrumentation instance.
|
|
89
88
|
* @param logger - The logger instance.
|
|
90
|
-
* @
|
|
91
|
-
|
|
92
|
-
*/ export async function retrieveCheckpointsFromRollup(rollup, publicClient, debugClient, blobClient, searchStartBlock, searchEndBlock, contractAddresses, instrumentation, logger = createLogger('archiver'), isHistoricalSync = false) {
|
|
89
|
+
* @returns An array of calldata-only checkpoints.
|
|
90
|
+
*/ export async function retrieveCheckpointCalldataFromRollup(rollup, publicClient, debugClient, searchStartBlock, searchEndBlock, instrumentation, logger = createLogger('archiver')) {
|
|
93
91
|
const retrievedCheckpoints = [];
|
|
94
92
|
let rollupConstants;
|
|
95
93
|
do {
|
|
96
94
|
if (searchStartBlock > searchEndBlock) {
|
|
97
95
|
break;
|
|
98
96
|
}
|
|
99
|
-
const checkpointProposedLogs =
|
|
100
|
-
fromBlock: searchStartBlock,
|
|
101
|
-
toBlock: searchEndBlock
|
|
102
|
-
})).filter((log)=>log.blockNumber >= searchStartBlock && log.blockNumber <= searchEndBlock);
|
|
97
|
+
const checkpointProposedLogs = await rollup.getCheckpointProposedEvents(searchStartBlock, searchEndBlock);
|
|
103
98
|
if (checkpointProposedLogs.length === 0) {
|
|
104
99
|
break;
|
|
105
100
|
}
|
|
106
101
|
const lastLog = checkpointProposedLogs.at(-1);
|
|
107
|
-
logger.debug(`Got ${checkpointProposedLogs.length} processed logs for checkpoints
|
|
102
|
+
logger.debug(`Got ${checkpointProposedLogs.length} processed logs for checkpoints ${checkpointProposedLogs[0].args.checkpointNumber}-${lastLog.args.checkpointNumber} between L1 blocks ${searchStartBlock}-${searchEndBlock}`);
|
|
108
103
|
if (rollupConstants === undefined) {
|
|
109
104
|
const [chainId, version, targetCommitteeSize] = await Promise.all([
|
|
110
105
|
publicClient.getChainId(),
|
|
111
|
-
rollup.
|
|
112
|
-
rollup.
|
|
106
|
+
rollup.getVersion(),
|
|
107
|
+
rollup.getTargetCommitteeSize()
|
|
113
108
|
]);
|
|
114
109
|
rollupConstants = {
|
|
115
110
|
chainId: new Fr(chainId),
|
|
116
111
|
version: new Fr(version),
|
|
117
|
-
targetCommitteeSize
|
|
112
|
+
targetCommitteeSize
|
|
118
113
|
};
|
|
119
114
|
}
|
|
120
|
-
const newCheckpoints = await processCheckpointProposedLogs(rollup, publicClient, debugClient,
|
|
115
|
+
const newCheckpoints = await processCheckpointProposedLogs(rollup, publicClient, debugClient, checkpointProposedLogs, rollupConstants, instrumentation, logger);
|
|
121
116
|
retrievedCheckpoints.push(...newCheckpoints);
|
|
122
|
-
searchStartBlock = lastLog.
|
|
117
|
+
searchStartBlock = lastLog.l1BlockNumber + 1n;
|
|
123
118
|
}while (searchStartBlock <= searchEndBlock)
|
|
124
|
-
// The asyncPool from processCheckpointProposedLogs will not necessarily return the checkpoints in order, so we sort them before returning.
|
|
125
119
|
return retrievedCheckpoints.sort((a, b)=>Number(a.l1.blockNumber - b.l1.blockNumber));
|
|
126
120
|
}
|
|
127
121
|
/**
|
|
128
|
-
* Processes
|
|
129
|
-
* @param rollup - The rollup contract
|
|
122
|
+
* Processes CheckpointProposed logs, fetching only calldata (no blobs).
|
|
123
|
+
* @param rollup - The rollup contract wrapper.
|
|
130
124
|
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
131
125
|
* @param debugClient - The viem debug client to use for trace/debug RPC methods (optional).
|
|
132
|
-
* @param blobClient - The blob client client for fetching blob data.
|
|
133
126
|
* @param logs - CheckpointProposed logs.
|
|
134
127
|
* @param rollupConstants - The rollup constants (chainId, version, targetCommitteeSize).
|
|
135
|
-
* @param contractAddresses - The contract addresses (governanceProposerAddress, slashFactoryAddress, slashingProposerAddress).
|
|
136
128
|
* @param instrumentation - The archiver instrumentation instance.
|
|
137
129
|
* @param logger - The logger instance.
|
|
138
|
-
* @
|
|
139
|
-
|
|
140
|
-
*/ async function processCheckpointProposedLogs(rollup, publicClient, debugClient, blobClient, logs, { chainId, version, targetCommitteeSize }, contractAddresses, instrumentation, logger, isHistoricalSync) {
|
|
130
|
+
* @returns An array of calldata-only checkpoints.
|
|
131
|
+
*/ async function processCheckpointProposedLogs(rollup, publicClient, debugClient, logs, { chainId, version, targetCommitteeSize }, instrumentation, logger) {
|
|
141
132
|
const retrievedCheckpoints = [];
|
|
142
|
-
const calldataRetriever = new CalldataRetriever(publicClient, debugClient, targetCommitteeSize, instrumentation, logger,
|
|
143
|
-
...contractAddresses,
|
|
144
|
-
rollupAddress: EthAddress.fromString(rollup.address)
|
|
145
|
-
});
|
|
133
|
+
const calldataRetriever = new CalldataRetriever(publicClient, debugClient, targetCommitteeSize, instrumentation, logger, EthAddress.fromString(rollup.address));
|
|
146
134
|
await asyncPool(10, logs, async (log)=>{
|
|
147
|
-
const checkpointNumber =
|
|
135
|
+
const checkpointNumber = log.args.checkpointNumber;
|
|
148
136
|
const archive = log.args.archive;
|
|
149
|
-
const archiveFromChain = await rollup.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const blobHashes = log.args.versionedBlobHashes.map((blobHash)=>Buffer.from(blobHash.slice(2), 'hex'));
|
|
153
|
-
// The value from the event and contract will match only if the checkpoint is in the chain.
|
|
154
|
-
if (archive === archiveFromChain) {
|
|
155
|
-
// Build expected hashes object (fields may be undefined for backwards compatibility with older events)
|
|
137
|
+
const archiveFromChain = await rollup.archiveAt(checkpointNumber);
|
|
138
|
+
const blobHashes = log.args.versionedBlobHashes;
|
|
139
|
+
if (archive.equals(archiveFromChain)) {
|
|
156
140
|
const expectedHashes = {
|
|
157
|
-
attestationsHash: log.args.attestationsHash,
|
|
158
|
-
payloadDigest: log.args.payloadDigest
|
|
141
|
+
attestationsHash: log.args.attestationsHash.toString(),
|
|
142
|
+
payloadDigest: log.args.payloadDigest.toString()
|
|
159
143
|
};
|
|
160
|
-
const checkpoint = await calldataRetriever.getCheckpointFromRollupTx(log.
|
|
161
|
-
const
|
|
162
|
-
const l1 = new L1PublishedData(log.
|
|
144
|
+
const checkpoint = await calldataRetriever.getCheckpointFromRollupTx(log.l1TransactionHash, blobHashes, checkpointNumber, expectedHashes);
|
|
145
|
+
const { timestamp, parentBeaconBlockRoot } = await getL1Block(publicClient, log.l1BlockNumber);
|
|
146
|
+
const l1 = new L1PublishedData(log.l1BlockNumber, timestamp, log.l1BlockHash.toString());
|
|
163
147
|
retrievedCheckpoints.push({
|
|
164
148
|
...checkpoint,
|
|
165
|
-
checkpointBlobData,
|
|
166
149
|
l1,
|
|
167
150
|
chainId,
|
|
168
|
-
version
|
|
151
|
+
version,
|
|
152
|
+
blobHashes,
|
|
153
|
+
parentBeaconBlockRoot
|
|
169
154
|
});
|
|
170
|
-
logger.trace(`Retrieved checkpoint ${checkpointNumber} from L1 tx ${log.
|
|
171
|
-
l1BlockNumber: log.
|
|
155
|
+
logger.trace(`Retrieved checkpoint calldata ${checkpointNumber} from L1 tx ${log.l1TransactionHash}`, {
|
|
156
|
+
l1BlockNumber: log.l1BlockNumber,
|
|
172
157
|
checkpointNumber,
|
|
173
158
|
archive: archive.toString(),
|
|
174
159
|
attestations: checkpoint.attestations
|
|
175
160
|
});
|
|
176
161
|
} else {
|
|
177
162
|
logger.warn(`Ignoring checkpoint ${checkpointNumber} due to archive root mismatch`, {
|
|
178
|
-
actual: archive,
|
|
179
|
-
expected: archiveFromChain
|
|
163
|
+
actual: archive.toString(),
|
|
164
|
+
expected: archiveFromChain.toString()
|
|
180
165
|
});
|
|
181
166
|
}
|
|
182
167
|
});
|
|
183
168
|
return retrievedCheckpoints;
|
|
184
169
|
}
|
|
185
|
-
export async function
|
|
170
|
+
export async function getL1Block(publicClient, blockNumber) {
|
|
186
171
|
const block = await publicClient.getBlock({
|
|
187
172
|
blockNumber,
|
|
188
173
|
includeTransactions: false
|
|
189
174
|
});
|
|
190
|
-
return
|
|
175
|
+
return {
|
|
176
|
+
timestamp: block.timestamp,
|
|
177
|
+
parentBeaconBlockRoot: block.parentBeaconBlockRoot
|
|
178
|
+
};
|
|
191
179
|
}
|
|
192
|
-
export async function getCheckpointBlobDataFromBlobs(blobClient, blockHash, blobHashes, checkpointNumber, logger, isHistoricalSync) {
|
|
180
|
+
export async function getCheckpointBlobDataFromBlobs(blobClient, blockHash, blobHashes, checkpointNumber, logger, isHistoricalSync, parentBeaconBlockRoot, l1BlockTimestamp) {
|
|
193
181
|
const blobBodies = await blobClient.getBlobSidecar(blockHash, blobHashes, {
|
|
194
|
-
isHistoricalSync
|
|
182
|
+
isHistoricalSync,
|
|
183
|
+
parentBeaconBlockRoot,
|
|
184
|
+
l1BlockTimestamp
|
|
195
185
|
});
|
|
196
186
|
if (blobBodies.length === 0) {
|
|
197
187
|
throw new NoBlobBodiesFoundError(checkpointNumber);
|
|
@@ -211,51 +201,37 @@ export async function getCheckpointBlobDataFromBlobs(blobClient, blockHash, blob
|
|
|
211
201
|
}
|
|
212
202
|
return checkpointBlobData;
|
|
213
203
|
}
|
|
214
|
-
/** Given an L1 to L2 message, retrieves its corresponding event from the Inbox within a specific block range. */ export async function retrieveL1ToL2Message(inbox,
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
}, {
|
|
218
|
-
fromBlock,
|
|
219
|
-
toBlock
|
|
220
|
-
});
|
|
221
|
-
const messages = mapLogsInboxMessage(logs);
|
|
222
|
-
return messages.length > 0 ? messages[0] : undefined;
|
|
204
|
+
/** Given an L1 to L2 message, retrieves its corresponding event from the Inbox within a specific block range. */ export async function retrieveL1ToL2Message(inbox, message) {
|
|
205
|
+
const log = await inbox.getMessageSentEventByHash(message.leaf.toString(), message.l1BlockNumber);
|
|
206
|
+
return log && mapLogInboxMessage(log);
|
|
223
207
|
}
|
|
224
208
|
/**
|
|
225
209
|
* Fetch L1 to L2 messages.
|
|
226
|
-
* @param
|
|
227
|
-
* @param inboxAddress - The address of the inbox contract to fetch messages from.
|
|
228
|
-
* @param blockUntilSynced - If true, blocks until the archiver has fully synced.
|
|
210
|
+
* @param inbox - The inbox contract wrapper.
|
|
229
211
|
* @param searchStartBlock - The block number to use for starting the search.
|
|
230
212
|
* @param searchEndBlock - The highest block number that we should search up to.
|
|
231
213
|
* @returns An array of InboxLeaf and next eth block to search from.
|
|
232
214
|
*/ export async function retrieveL1ToL2Messages(inbox, searchStartBlock, searchEndBlock) {
|
|
233
215
|
const retrievedL1ToL2Messages = [];
|
|
234
216
|
while(searchStartBlock <= searchEndBlock){
|
|
235
|
-
const messageSentLogs =
|
|
236
|
-
fromBlock: searchStartBlock,
|
|
237
|
-
toBlock: searchEndBlock
|
|
238
|
-
})).filter((log)=>log.blockNumber >= searchStartBlock && log.blockNumber <= searchEndBlock);
|
|
217
|
+
const messageSentLogs = await inbox.getMessageSentEvents(searchStartBlock, searchEndBlock);
|
|
239
218
|
if (messageSentLogs.length === 0) {
|
|
240
219
|
break;
|
|
241
220
|
}
|
|
242
|
-
retrievedL1ToL2Messages.push(...
|
|
243
|
-
searchStartBlock = messageSentLogs.at(-1).
|
|
221
|
+
retrievedL1ToL2Messages.push(...messageSentLogs.map(mapLogInboxMessage));
|
|
222
|
+
searchStartBlock = messageSentLogs.at(-1).l1BlockNumber + 1n;
|
|
244
223
|
}
|
|
245
224
|
return retrievedL1ToL2Messages;
|
|
246
225
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
rollingHash: Buffer16.fromString(rollingHash)
|
|
257
|
-
};
|
|
258
|
-
});
|
|
226
|
+
function mapLogInboxMessage(log) {
|
|
227
|
+
return {
|
|
228
|
+
index: log.args.index,
|
|
229
|
+
leaf: log.args.leaf,
|
|
230
|
+
l1BlockNumber: log.l1BlockNumber,
|
|
231
|
+
l1BlockHash: log.l1BlockHash,
|
|
232
|
+
checkpointNumber: log.args.checkpointNumber,
|
|
233
|
+
rollingHash: log.args.rollingHash
|
|
234
|
+
};
|
|
259
235
|
}
|
|
260
236
|
/** Retrieves L2ProofVerified events from the rollup contract. */ export async function retrieveL2ProofVerifiedEvents(publicClient, rollupAddress, searchStartBlock, searchEndBlock) {
|
|
261
237
|
const logs = await publicClient.getLogs({
|
|
@@ -16,4 +16,4 @@ export declare const callTraceSchema: ZodFor<DebugCallTrace>;
|
|
|
16
16
|
* @returns Array of CallInfo objects containing from, gasUsed, input, and value for matching calls
|
|
17
17
|
*/
|
|
18
18
|
export declare function getSuccessfulCallsFromDebug(client: ViemPublicDebugClient, txHash: Hex, targetAddress: EthAddress, functionSelector: string, logger?: Logger): Promise<CallInfo[]>;
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVidWdfdHguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMS9kZWJ1Z190eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUNuRixPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDM0QsT0FBTyxLQUFLLEVBQUUsTUF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B,2BAA2B,CAC/C,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,GAAG,EACX,aAAa,EAAE,UAAU,EACzB,gBAAgB,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,QAAQ,EAAE,CAAC,CAwDrB"}
|
|
@@ -52,13 +52,13 @@ export declare function verifyProxyImplementation(publicClient: {
|
|
|
52
52
|
/**
|
|
53
53
|
* Attempts to decode transaction as a Spire Proposer Multicall.
|
|
54
54
|
* Spire Proposer is a proxy contract that wraps multiple calls.
|
|
55
|
-
* Returns
|
|
55
|
+
* Returns all wrapped calls if validation succeeds (caller handles hash matching to find the propose call).
|
|
56
56
|
* @param tx - The transaction to decode
|
|
57
57
|
* @param publicClient - The viem public client for proxy verification
|
|
58
58
|
* @param logger - Logger instance
|
|
59
|
-
* @returns
|
|
59
|
+
* @returns Array of wrapped calls with 'to' and 'data', or undefined if not a valid Spire Proposer tx
|
|
60
60
|
*/
|
|
61
|
-
export declare function
|
|
61
|
+
export declare function getCallsFromSpireProposer(tx: Transaction, publicClient: {
|
|
62
62
|
getStorageAt: (params: {
|
|
63
63
|
address: Hex;
|
|
64
64
|
slot: Hex;
|
|
@@ -66,5 +66,5 @@ export declare function getCallFromSpireProposer(tx: Transaction, publicClient:
|
|
|
66
66
|
}, logger: Logger): Promise<{
|
|
67
67
|
to: Hex;
|
|
68
68
|
data: Hex;
|
|
69
|
-
} | undefined>;
|
|
70
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
69
|
+
}[] | undefined>;
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BpcmVfcHJvcG9zZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMS9zcGlyZV9wcm9wb3Nlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxNQUFNLE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,EAAE,GAAG,CAAA;CAAE,EAAE,GAAG,SAAS,CAAC,CAoD/C"}
|
|
@@ -88,12 +88,12 @@ export const SpireProposerAbi = [
|
|
|
88
88
|
/**
|
|
89
89
|
* Attempts to decode transaction as a Spire Proposer Multicall.
|
|
90
90
|
* Spire Proposer is a proxy contract that wraps multiple calls.
|
|
91
|
-
* Returns
|
|
91
|
+
* Returns all wrapped calls if validation succeeds (caller handles hash matching to find the propose call).
|
|
92
92
|
* @param tx - The transaction to decode
|
|
93
93
|
* @param publicClient - The viem public client for proxy verification
|
|
94
94
|
* @param logger - Logger instance
|
|
95
|
-
* @returns
|
|
96
|
-
*/ export async function
|
|
95
|
+
* @returns Array of wrapped calls with 'to' and 'data', or undefined if not a valid Spire Proposer tx
|
|
96
|
+
*/ export async function getCallsFromSpireProposer(tx, publicClient, logger) {
|
|
97
97
|
const txHash = tx.hash;
|
|
98
98
|
try {
|
|
99
99
|
// Check if transaction is to the Spire Proposer address
|
|
@@ -131,22 +131,14 @@ export const SpireProposerAbi = [
|
|
|
131
131
|
return undefined;
|
|
132
132
|
}
|
|
133
133
|
const [calls] = spireArgs;
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
logger.warn(`Spire Proposer multicall must contain exactly one call (got ${calls.length})`, {
|
|
137
|
-
txHash
|
|
138
|
-
});
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
141
|
-
const call = calls[0];
|
|
142
|
-
// Successfully extracted the single wrapped call
|
|
143
|
-
logger.trace(`Decoded Spire Proposer with single call to ${call.target}`, {
|
|
134
|
+
// Return all wrapped calls (hash matching in the caller determines which is the propose call)
|
|
135
|
+
logger.trace(`Decoded Spire Proposer with ${calls.length} call(s)`, {
|
|
144
136
|
txHash
|
|
145
137
|
});
|
|
146
|
-
return {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
138
|
+
return calls.map((call)=>({
|
|
139
|
+
to: call.target,
|
|
140
|
+
data: call.data
|
|
141
|
+
}));
|
|
150
142
|
} catch (err) {
|
|
151
143
|
// Any decoding error triggers fallback to trace
|
|
152
144
|
logger.warn(`Failed to decode Spire Proposer: ${err}`, {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ViemPublicDebugClient } from '@aztec/ethereum/types';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
4
|
+
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
5
|
+
import type { Hex } from 'viem';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import type { CallInfo } from './types.js';
|
|
8
|
+
/** Zod schema for a single trace from trace_transaction */
|
|
9
|
+
export declare const traceSchema: z.ZodObject<{
|
|
10
|
+
action: z.ZodObject<{
|
|
11
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
12
|
+
to: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
13
|
+
callType: z.ZodString;
|
|
14
|
+
gas: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
15
|
+
input: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
16
|
+
value: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
gasUsed: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
20
|
+
output: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
error: z.ZodOptional<z.ZodString>;
|
|
23
|
+
subtraces: z.ZodNumber;
|
|
24
|
+
traceAddress: z.ZodArray<z.ZodNumber>;
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/** Type for trace_transaction response */
|
|
28
|
+
type TraceTransaction = z.infer<typeof traceSchema>;
|
|
29
|
+
/** Zod schema for the full trace_transaction response (array of traces) */
|
|
30
|
+
export declare const traceTransactionResponseSchema: ZodFor<TraceTransaction[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Traces a transaction and extracts all CALL operations to a specific contract and function selector.
|
|
33
|
+
* Uses the trace_transaction RPC method which returns a flat array of traces.
|
|
34
|
+
*
|
|
35
|
+
* @param client - The Viem public debug client
|
|
36
|
+
* @param txHash - The transaction hash to trace
|
|
37
|
+
* @param targetAddress - The contract address to filter for
|
|
38
|
+
* @param functionSelector - The 4-byte function selector to filter for (with or without 0x prefix)
|
|
39
|
+
* @returns Array of CallInfo objects containing from, gasUsed, input, and value for matching calls
|
|
40
|
+
*/
|
|
41
|
+
export declare function getSuccessfulCallsFromTrace(client: ViemPublicDebugClient, txHash: Hex, targetAddress: EthAddress, functionSelector: string, logger?: Logger): Promise<CallInfo[]>;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhY2VfdHguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMS90cmFjZV90eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ25FLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUMzRCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUNwRCxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQVcsTUFBTSwyQkFBMkIsQ0FBQztBQUdqRSxPQUFPLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSxNQUFNLENBQUM7Q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AAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkB3C,2DAA2D;AAC3D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;iBAOtB,CAAC;AAEH,0CAA0C;AAC1C,KAAK,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEpD,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAwB,CAAC;AAE/F;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,GAAG,EACX,aAAa,EAAE,UAAU,EACzB,gBAAgB,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,QAAQ,EAAE,CAAC,CAoErB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import type { Hex } from 'viem';
|
|
3
|
+
/**
|
|
4
|
+
* Information about a matching CALL
|
|
5
|
+
*/
|
|
6
|
+
export interface CallInfo {
|
|
7
|
+
from: EthAddress;
|
|
8
|
+
gasUsed?: bigint;
|
|
9
|
+
input: Hex;
|
|
10
|
+
value: bigint;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMS90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFM0QsT0FBTyxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRWhDOztHQUVHO0FBQ0gsTUFBTSxXQUFXLFFBQVE7SUFDdkIsSUFBSSxFQUFFLFVBQVUsQ0FBQztJQUNqQixPQUFPLENBQUMsRUFBRSxNQUFNLENBQUM7SUFDakIsS0FBSyxFQUFFLEdBQUcsQ0FBQztJQUNYLEtBQUssRUFBRSxNQUFNLENBQUM7Q0FDZiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/l1/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
2
|
+
import type { ViemPublicClient } from '@aztec/ethereum/types';
|
|
3
|
+
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
4
|
+
/** Subset of L1 contract addresses whose historical logs the Aztec node relies on. */
|
|
5
|
+
export type HistoricalLogsContractAddresses = Pick<L1ContractAddresses, 'rollupAddress' | 'inboxAddress' | 'registryAddress' | 'governanceProposerAddress'>;
|
|
6
|
+
/**
|
|
7
|
+
* Validates that every configured L1 RPC URL returns historical logs for the Rollup contract.
|
|
8
|
+
*
|
|
9
|
+
* Some RPC providers prune old logs, which would cause L1 syncing to silently fail. To detect this,
|
|
10
|
+
* we query for the `OwnershipTransferred` event which every Rollup emits in its constructor (via
|
|
11
|
+
* Ownable) on the block it was deployed (`l1StartBlock`). The `client` is typically a viem fallback
|
|
12
|
+
* transport over several user-configured RPC URLs — checking only the first URL would miss a bad
|
|
13
|
+
* secondary, so we probe each URL independently. The first URL that fails aborts startup, unless
|
|
14
|
+
* the operator has explicitly opted out.
|
|
15
|
+
*
|
|
16
|
+
* @param client - The L1 public client built from the user-configured RPC URLs.
|
|
17
|
+
* @param addresses - The subset of L1 contract addresses we rely on for historical log retrieval.
|
|
18
|
+
* @param skipCheck - If true, log warnings instead of throwing.
|
|
19
|
+
* @param bindings - Optional logger bindings for context.
|
|
20
|
+
* @throws Error if any URL fails the probe and skipCheck is false.
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateAndLogHistoricalLogsAvailability(client: ViemPublicClient, addresses: HistoricalLogsContractAddresses, skipCheck: boolean, bindings?: LoggerBindings): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGVfaGlzdG9yaWNhbF9sb2dzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbDEvdmFsaWRhdGVfaGlzdG9yaWNhbF9sb2dzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sdUNBQXVDLENBQUM7QUFDakYsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUM5RCxPQUFPLEVBQWUsS0FBSyxjQUFjLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFFdkYsc0ZBQXNGO0FBQ3RGLE1BQU0sTUFBTSwrQkFBK0IsR0FBRyxJQUFJLENBQ2hELG1CQUFtQixFQUNuQixlQUFlLEdBQUcsY0FBYyxHQUFHLGlCQUFpQixHQUFHLDJCQUEyQixDQUNuRixDQUFDO0FBS0Y7Ozs7Ozs7Ozs7Ozs7OztHQWVHO0FBQ0gsd0JBQXNCLHdDQUF3QyxDQUM1RCxNQUFNLEVBQUUsZ0JBQWdCLEVBQ3hCLFNBQVMsRUFBRSwrQkFBK0IsRUFDMUMsU0FBUyxFQUFFLE9BQU8sRUFDbEIsUUFBUSxDQUFDLEVBQUUsY0FBYyxHQUN4QixPQUFPLENBQUMsSUFBSSxDQUFDLENBbUNmIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate_historical_logs.d.ts","sourceRoot":"","sources":["../../src/l1/validate_historical_logs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAEvF,sFAAsF;AACtF,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAChD,mBAAmB,EACnB,eAAe,GAAG,cAAc,GAAG,iBAAiB,GAAG,2BAA2B,CACnF,CAAC;AAKF;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,wCAAwC,CAC5D,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,+BAA+B,EAC1C,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,IAAI,CAAC,CAmCf"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { getPublicClient, getRpcUrlsFromClient } from '@aztec/ethereum/client';
|
|
2
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
3
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
+
/**
|
|
5
|
+
* Validates that every configured L1 RPC URL returns historical logs for the Rollup contract.
|
|
6
|
+
*
|
|
7
|
+
* Some RPC providers prune old logs, which would cause L1 syncing to silently fail. To detect this,
|
|
8
|
+
* we query for the `OwnershipTransferred` event which every Rollup emits in its constructor (via
|
|
9
|
+
* Ownable) on the block it was deployed (`l1StartBlock`). The `client` is typically a viem fallback
|
|
10
|
+
* transport over several user-configured RPC URLs — checking only the first URL would miss a bad
|
|
11
|
+
* secondary, so we probe each URL independently. The first URL that fails aborts startup, unless
|
|
12
|
+
* the operator has explicitly opted out.
|
|
13
|
+
*
|
|
14
|
+
* @param client - The L1 public client built from the user-configured RPC URLs.
|
|
15
|
+
* @param addresses - The subset of L1 contract addresses we rely on for historical log retrieval.
|
|
16
|
+
* @param skipCheck - If true, log warnings instead of throwing.
|
|
17
|
+
* @param bindings - Optional logger bindings for context.
|
|
18
|
+
* @throws Error if any URL fails the probe and skipCheck is false.
|
|
19
|
+
*/ export async function validateAndLogHistoricalLogsAvailability(client, addresses, skipCheck, bindings) {
|
|
20
|
+
const logger = createLogger('archiver:validate_historical_logs', bindings);
|
|
21
|
+
logger.debug('Validating historical log availability on L1 RPCs');
|
|
22
|
+
const urls = getRpcUrlsFromClient(client);
|
|
23
|
+
if (urls.length === 0) {
|
|
24
|
+
logger.warn('Could not determine L1 RPC URLs from the public client; skipping historical logs check.');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const chainId = client.chain?.id;
|
|
28
|
+
if (chainId === undefined) {
|
|
29
|
+
logger.warn('Could not determine L1 chain ID from the public client; skipping historical logs check.');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (const url of urls){
|
|
33
|
+
const probeClient = getPublicClient({
|
|
34
|
+
l1RpcUrls: [
|
|
35
|
+
url
|
|
36
|
+
],
|
|
37
|
+
l1ChainId: chainId
|
|
38
|
+
});
|
|
39
|
+
const rollup = new RollupContract(probeClient, addresses.rollupAddress.toString());
|
|
40
|
+
const result = await probeRpcUrl(rollup, probeClient, logger);
|
|
41
|
+
if (result.ok) {
|
|
42
|
+
logger.debug(`L1 RPC ${url} returned historical OwnershipTransferred log for the Rollup contract.`);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const errorMessage = buildErrorMessage(url, result, addresses);
|
|
46
|
+
if (skipCheck) {
|
|
47
|
+
logger.warn(`${errorMessage}\nContinuing because ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK is true.`);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
logger.error(errorMessage);
|
|
51
|
+
throw new Error(errorMessage);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** Runs the OwnershipTransferred probe against a single RPC and queries its client version. */ async function probeRpcUrl(rollup, client, logger) {
|
|
55
|
+
let queryError;
|
|
56
|
+
try {
|
|
57
|
+
const logs = await rollup.getOwnershipTransferredEventsAtDeploy();
|
|
58
|
+
if (logs.length > 0) {
|
|
59
|
+
return {
|
|
60
|
+
ok: true
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
} catch (err) {
|
|
64
|
+
queryError = err;
|
|
65
|
+
}
|
|
66
|
+
const clientVersion = await getClientVersion(client, logger);
|
|
67
|
+
let reason;
|
|
68
|
+
if (queryError instanceof Error) {
|
|
69
|
+
reason = `Query for historical logs failed: ${queryError.message}`;
|
|
70
|
+
} else if (queryError !== undefined) {
|
|
71
|
+
reason = 'Query for historical logs failed with a non-Error value.';
|
|
72
|
+
} else {
|
|
73
|
+
reason = 'No OwnershipTransferred event was returned by the L1 RPC for the Rollup deploy block.';
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
reason,
|
|
78
|
+
clientVersion
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** Builds the operator-facing error message for a failing RPC URL. */ function buildErrorMessage(url, result, addresses) {
|
|
82
|
+
return [
|
|
83
|
+
`L1 RPC at ${url} does not return historical logs for the Rollup contract. ${result.reason}`,
|
|
84
|
+
`This likely means this Ethereum RPC node prunes old logs, which would cause the archiver ` + `to silently miss data during L1 sync.`,
|
|
85
|
+
result.clientVersion ? `Detected L1 client version for ${url}: ${result.clientVersion}.` : `Could not determine L1 client version for ${url}.`,
|
|
86
|
+
`The following L1 contract addresses must have their historical logs retained by the RPC node:`,
|
|
87
|
+
` - Rollup: ${addresses.rollupAddress.toString()}`,
|
|
88
|
+
` - Inbox: ${addresses.inboxAddress.toString()}`,
|
|
89
|
+
` - Registry: ${addresses.registryAddress.toString()}`,
|
|
90
|
+
` - GovernanceProposer: ${addresses.governanceProposerAddress.toString()}`,
|
|
91
|
+
isReth(result.clientVersion) ? `To retain logs for these contracts, configure reth with a ` + `prune.segments.receipts_log_filter entry for each address above ` + `so reth does not prune their receipts/logs. See https://reth.rs/run/pruning.html for details.` : `Point this RPC endpoint at a node that retains full log history for the addresses above.`,
|
|
92
|
+
`Set ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK=true to bypass this check at your own risk.`
|
|
93
|
+
].join('\n');
|
|
94
|
+
}
|
|
95
|
+
/** Queries `web3_clientVersion` on the L1 RPC. Returns undefined if the call fails or returns a non-string. */ async function getClientVersion(client, logger) {
|
|
96
|
+
try {
|
|
97
|
+
const result = await client.request({
|
|
98
|
+
method: 'web3_clientVersion'
|
|
99
|
+
});
|
|
100
|
+
return typeof result === 'string' ? result : undefined;
|
|
101
|
+
} catch (err) {
|
|
102
|
+
logger.debug(`Failed to query web3_clientVersion: ${err instanceof Error ? err.message : err}`);
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/** Heuristic check for reth based on the web3_clientVersion string (reth returns e.g. "reth/v1.0.0-..."). */ function isReth(clientVersion) {
|
|
107
|
+
return !!clientVersion && /reth/i.test(clientVersion);
|
|
108
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ViemPublicDebugClient } from '@aztec/ethereum/types';
|
|
2
|
+
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
2
3
|
/** Result of trace availability checks */
|
|
3
4
|
export interface TraceAvailability {
|
|
4
5
|
/** Whether debug_traceTransaction works for recent blocks */
|
|
@@ -14,16 +15,18 @@ export interface TraceAvailability {
|
|
|
14
15
|
* Validates the availability of debug/trace methods on the Ethereum client.
|
|
15
16
|
*
|
|
16
17
|
* @param client - The Viem public debug client
|
|
18
|
+
* @param bindings - Optional logger bindings for context
|
|
17
19
|
* @returns Object indicating which trace methods are available for recent and old blocks
|
|
18
20
|
*/
|
|
19
|
-
export declare function validateTraceAvailability(client: ViemPublicDebugClient): Promise<TraceAvailability>;
|
|
21
|
+
export declare function validateTraceAvailability(client: ViemPublicDebugClient, bindings?: LoggerBindings): Promise<TraceAvailability>;
|
|
20
22
|
/**
|
|
21
23
|
* Validates trace availability and logs appropriate messages based on the results.
|
|
22
24
|
* Optionally throws an error if no trace methods are available and ethereumAllowNoDebugHosts is false.
|
|
23
25
|
*
|
|
24
26
|
* @param client - The Viem public debug client
|
|
25
27
|
* @param ethereumAllowNoDebugHosts - If false, throws an error when no trace methods are available
|
|
28
|
+
* @param bindings - Optional logger bindings for context
|
|
26
29
|
* @throws Error if ethereumAllowNoDebugHosts is false and no trace methods are available
|
|
27
30
|
*/
|
|
28
|
-
export declare function validateAndLogTraceAvailability(client: ViemPublicDebugClient, ethereumAllowNoDebugHosts: boolean): Promise<void>;
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
export declare function validateAndLogTraceAvailability(client: ViemPublicDebugClient, ethereumAllowNoDebugHosts: boolean, bindings?: LoggerBindings): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGVfdHJhY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sMS92YWxpZGF0ZV90cmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ25FLE9BQU8sRUFBZSxLQUFLLGNBQWMsRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQTRDdkYsMENBQTBDO0FBQzFDLE1BQU0sV0FBVyxpQkFBaUI7SUFDaEMsNkRBQTZEO0lBQzdELGdCQUFnQixFQUFFLE9BQU8sQ0FBQztJQUMxQix3REFBd0Q7SUFDeEQsc0JBQXNCLEVBQUUsT0FBTyxDQUFDO0lBQ2hDL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