@aztec/archiver 0.0.1-commit.d1f2d6c → 0.0.1-commit.d20b825a7
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 +12 -6
- package/dest/archiver.d.ts +16 -10
- package/dest/archiver.d.ts.map +1 -1
- package/dest/archiver.js +110 -122
- package/dest/config.d.ts +5 -3
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +15 -3
- package/dest/errors.d.ts +55 -10
- package/dest/errors.d.ts.map +1 -1
- package/dest/errors.js +74 -15
- package/dest/factory.d.ts +5 -4
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +34 -29
- package/dest/index.d.ts +4 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +3 -1
- package/dest/l1/bin/retrieve-calldata.js +36 -33
- package/dest/l1/calldata_retriever.d.ts +73 -50
- package/dest/l1/calldata_retriever.d.ts.map +1 -1
- package/dest/l1/calldata_retriever.js +191 -259
- package/dest/l1/data_retrieval.d.ts +26 -17
- package/dest/l1/data_retrieval.d.ts.map +1 -1
- package/dest/l1/data_retrieval.js +43 -48
- package/dest/l1/spire_proposer.d.ts +5 -5
- package/dest/l1/spire_proposer.d.ts.map +1 -1
- package/dest/l1/spire_proposer.js +9 -17
- 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/l1/validate_trace.d.ts +6 -3
- package/dest/l1/validate_trace.d.ts.map +1 -1
- package/dest/l1/validate_trace.js +13 -9
- package/dest/modules/data_source_base.d.ts +17 -10
- package/dest/modules/data_source_base.d.ts.map +1 -1
- package/dest/modules/data_source_base.js +39 -77
- package/dest/modules/data_store_updater.d.ts +50 -26
- package/dest/modules/data_store_updater.d.ts.map +1 -1
- package/dest/modules/data_store_updater.js +169 -130
- package/dest/modules/instrumentation.d.ts +21 -3
- package/dest/modules/instrumentation.d.ts.map +1 -1
- package/dest/modules/instrumentation.js +58 -18
- package/dest/modules/l1_synchronizer.d.ts +10 -9
- package/dest/modules/l1_synchronizer.d.ts.map +1 -1
- package/dest/modules/l1_synchronizer.js +285 -157
- package/dest/modules/validation.d.ts +1 -1
- package/dest/modules/validation.d.ts.map +1 -1
- package/dest/modules/validation.js +2 -2
- package/dest/store/block_store.d.ts +85 -36
- package/dest/store/block_store.d.ts.map +1 -1
- package/dest/store/block_store.js +433 -162
- package/dest/store/contract_class_store.d.ts +2 -3
- package/dest/store/contract_class_store.d.ts.map +1 -1
- package/dest/store/contract_class_store.js +16 -72
- package/dest/store/contract_instance_store.d.ts +1 -1
- package/dest/store/contract_instance_store.d.ts.map +1 -1
- package/dest/store/contract_instance_store.js +6 -2
- package/dest/store/kv_archiver_store.d.ts +76 -32
- package/dest/store/kv_archiver_store.d.ts.map +1 -1
- package/dest/store/kv_archiver_store.js +92 -37
- package/dest/store/l2_tips_cache.d.ts +20 -0
- package/dest/store/l2_tips_cache.d.ts.map +1 -0
- package/dest/store/l2_tips_cache.js +109 -0
- package/dest/store/log_store.d.ts +6 -3
- package/dest/store/log_store.d.ts.map +1 -1
- package/dest/store/log_store.js +151 -56
- package/dest/store/message_store.d.ts +5 -1
- package/dest/store/message_store.d.ts.map +1 -1
- package/dest/store/message_store.js +21 -9
- package/dest/test/fake_l1_state.d.ts +24 -1
- package/dest/test/fake_l1_state.d.ts.map +1 -1
- package/dest/test/fake_l1_state.js +145 -28
- package/dest/test/index.js +3 -1
- package/dest/test/mock_archiver.d.ts +1 -1
- package/dest/test/mock_archiver.d.ts.map +1 -1
- package/dest/test/mock_archiver.js +3 -2
- 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 +31 -10
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +163 -92
- package/dest/test/mock_structs.d.ts +6 -2
- package/dest/test/mock_structs.d.ts.map +1 -1
- package/dest/test/mock_structs.js +20 -6
- package/dest/test/noop_l1_archiver.d.ts +26 -0
- package/dest/test/noop_l1_archiver.d.ts.map +1 -0
- package/dest/test/noop_l1_archiver.js +74 -0
- package/package.json +14 -13
- package/src/archiver.ts +150 -146
- package/src/config.ts +22 -2
- package/src/errors.ts +116 -26
- package/src/factory.ts +49 -26
- package/src/index.ts +3 -1
- package/src/l1/README.md +25 -68
- package/src/l1/bin/retrieve-calldata.ts +46 -39
- package/src/l1/calldata_retriever.ts +250 -379
- package/src/l1/data_retrieval.ts +59 -70
- package/src/l1/spire_proposer.ts +7 -15
- package/src/l1/validate_historical_logs.ts +140 -0
- package/src/l1/validate_trace.ts +24 -6
- package/src/modules/data_source_base.ts +81 -101
- package/src/modules/data_store_updater.ts +202 -160
- package/src/modules/instrumentation.ts +71 -19
- package/src/modules/l1_synchronizer.ts +365 -197
- package/src/modules/validation.ts +2 -2
- package/src/store/block_store.ts +546 -206
- package/src/store/contract_class_store.ts +16 -110
- package/src/store/contract_instance_store.ts +8 -5
- package/src/store/kv_archiver_store.ts +143 -53
- package/src/store/l2_tips_cache.ts +134 -0
- package/src/store/log_store.ts +225 -67
- package/src/store/message_store.ts +27 -10
- package/src/structs/inbox_message.ts +1 -1
- package/src/test/fake_l1_state.ts +193 -32
- package/src/test/index.ts +3 -0
- package/src/test/mock_archiver.ts +3 -2
- package/src/test/mock_l1_to_l2_message_source.ts +1 -0
- package/src/test/mock_l2_block_source.ts +217 -90
- package/src/test/mock_structs.ts +42 -12
- package/src/test/noop_l1_archiver.ts +117 -0
package/README.md
CHANGED
|
@@ -43,14 +43,18 @@ Two independent syncpoints track progress on L1:
|
|
|
43
43
|
|
|
44
44
|
### L1-to-L2 Messages
|
|
45
45
|
|
|
46
|
-
Messages are synced from the Inbox contract
|
|
46
|
+
Messages are synced from the Inbox contract. The sync compares local state (message count and rolling hash) against the Inbox contract state on L1, downloads any missing messages, and verifies consistency afterwards. On success, the syncpoint advances to the current L1 block. On failure (L1 reorg or inconsistency), the syncpoint rolls back to the last known-good message and the operation retries (up to 3 times within the same sync iteration).
|
|
47
47
|
|
|
48
48
|
1. Query Inbox state at the current L1 block (message count + rolling hash)
|
|
49
|
-
2. Compare local
|
|
50
|
-
3. If they match,
|
|
51
|
-
4. If mismatch,
|
|
52
|
-
- If
|
|
53
|
-
5.
|
|
49
|
+
2. Compare local state against remote
|
|
50
|
+
3. If they match, advance syncpoint and return
|
|
51
|
+
4. If mismatch, fetch `MessageSent` events in batches and store them
|
|
52
|
+
- If storing fails due to a rolling hash mismatch (indicating an L1 reorg changed or removed messages), find the last common message with L1, delete everything after, reset the syncpoint, and retry
|
|
53
|
+
5. After storing, verify local state matches the remote state queried in step 1
|
|
54
|
+
- If still mismatched (e.g., messages missed due to a concurrent L1 reorg), rollback and retry
|
|
55
|
+
6. On success, advance the syncpoint
|
|
56
|
+
|
|
57
|
+
The syncpoint and the `inboxTreeInProgress` marker (which tracks which checkpoint's messages are currently being filled on L1) are updated atomically. The marker is only advanced after messages are stored, so concurrent reads don't see an unsealed checkpoint as readable before its messages are available.
|
|
54
58
|
|
|
55
59
|
### Checkpoints
|
|
56
60
|
|
|
@@ -81,6 +85,8 @@ The `blocksSynchedTo` syncpoint is updated:
|
|
|
81
85
|
|
|
82
86
|
Note that the `blocksSynchedTo` pointer is NOT updated during normal sync when there are no new checkpoints. This protects against small L1 reorgs that could add a checkpoint on an L1 block we have flagged as already synced.
|
|
83
87
|
|
|
88
|
+
The `messagesSynchedTo` pointer is always advanced to the current L1 block on success. If a rolling hash mismatch or post-download inconsistency is detected, the pointer rolls back to the last common message and the operation retries. The rolling hash chain and pre/post-sync consistency checks provide the primary reorg protection.
|
|
89
|
+
|
|
84
90
|
### Block Queue
|
|
85
91
|
|
|
86
92
|
The archiver implements `L2BlockSink`, allowing other subsystems to push blocks before they appear on L1:
|
package/dest/archiver.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ import { Buffer32 } from '@aztec/foundation/buffer';
|
|
|
8
8
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
9
9
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
10
10
|
import { type Logger } from '@aztec/foundation/log';
|
|
11
|
+
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
11
12
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
12
13
|
import { type ArchiverEmitter, L2Block, type L2BlockSink, type L2Tips, type ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
13
|
-
import { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
14
|
+
import { type ProposedCheckpointInput, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
14
15
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
15
16
|
import { type TelemetryClient, type Traceable, type Tracer } from '@aztec/telemetry-client';
|
|
16
17
|
import { type ArchiverConfig } from './config.js';
|
|
@@ -18,6 +19,7 @@ import { ArchiverDataSourceBase } from './modules/data_source_base.js';
|
|
|
18
19
|
import type { ArchiverInstrumentation } from './modules/instrumentation.js';
|
|
19
20
|
import type { ArchiverL1Synchronizer } from './modules/l1_synchronizer.js';
|
|
20
21
|
import type { KVArchiverDataStore } from './store/kv_archiver_store.js';
|
|
22
|
+
import { L2TipsCache } from './store/l2_tips_cache.js';
|
|
21
23
|
/** Export ArchiverEmitter for use in factory and tests. */
|
|
22
24
|
export type { ArchiverEmitter };
|
|
23
25
|
export type ArchiverDeps = {
|
|
@@ -47,7 +49,7 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
47
49
|
/** Event emitter for archiver events (L2BlockProven, L2PruneUnproven, L2PruneUncheckpointed, etc). */
|
|
48
50
|
readonly events: ArchiverEmitter;
|
|
49
51
|
/** A loop in which we will be continually fetching new checkpoints. */
|
|
50
|
-
|
|
52
|
+
protected runningPromise: RunningPromise;
|
|
51
53
|
/** L1 synchronizer that handles fetching checkpoints and messages from L1. */
|
|
52
54
|
private readonly synchronizer;
|
|
53
55
|
private initialSyncComplete;
|
|
@@ -56,24 +58,26 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
56
58
|
private blockQueue;
|
|
57
59
|
/** Helper to handle updates to the store */
|
|
58
60
|
private readonly updater;
|
|
61
|
+
/** In-memory cache for L2 chain tips. */
|
|
62
|
+
private readonly l2TipsCache;
|
|
59
63
|
readonly tracer: Tracer;
|
|
64
|
+
private readonly instrumentation;
|
|
60
65
|
/**
|
|
61
66
|
* Creates a new instance of the Archiver.
|
|
62
67
|
* @param publicClient - A client for interacting with the Ethereum node.
|
|
63
68
|
* @param debugClient - A client for interacting with the Ethereum node for debug/trace methods.
|
|
64
69
|
* @param rollup - Rollup contract instance.
|
|
65
70
|
* @param inbox - Inbox contract instance.
|
|
66
|
-
* @param l1Addresses - L1 contract addresses (registry, governance proposer,
|
|
71
|
+
* @param l1Addresses - L1 contract addresses (registry, governance proposer, slashing proposer).
|
|
67
72
|
* @param dataStore - An archiver data store for storage & retrieval of blocks, encrypted logs & contract data.
|
|
68
73
|
* @param config - Archiver configuration options.
|
|
69
74
|
* @param blobClient - Client for retrieving blob data.
|
|
70
|
-
* @param epochCache - Cache for epoch-related data.
|
|
71
75
|
* @param dateProvider - Provider for current date/time.
|
|
72
76
|
* @param instrumentation - Instrumentation for metrics and tracing.
|
|
73
77
|
* @param l1Constants - L1 rollup constants.
|
|
74
78
|
* @param log - A logger.
|
|
75
79
|
*/
|
|
76
|
-
constructor(publicClient: ViemPublicClient, debugClient: ViemPublicDebugClient, rollup: RollupContract, l1Addresses: Pick<L1ContractAddresses, 'registryAddress' | '
|
|
80
|
+
constructor(publicClient: ViemPublicClient, debugClient: ViemPublicDebugClient, rollup: RollupContract, l1Addresses: Pick<L1ContractAddresses, 'rollupAddress' | 'registryAddress' | 'inboxAddress' | 'governanceProposerAddress'> & {
|
|
77
81
|
slashingProposerAddress: EthAddress;
|
|
78
82
|
}, dataStore: KVArchiverDataStore, config: {
|
|
79
83
|
pollingIntervalMs: number;
|
|
@@ -81,10 +85,11 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
81
85
|
skipValidateCheckpointAttestations?: boolean;
|
|
82
86
|
maxAllowedEthClientDriftSeconds: number;
|
|
83
87
|
ethereumAllowNoDebugHosts?: boolean;
|
|
88
|
+
skipHistoricalLogsCheck?: boolean;
|
|
84
89
|
}, blobClient: BlobClientInterface, instrumentation: ArchiverInstrumentation, l1Constants: L1RollupConstants & {
|
|
85
90
|
l1StartBlockHash: Buffer32;
|
|
86
91
|
genesisArchiveRoot: Fr;
|
|
87
|
-
}, synchronizer: ArchiverL1Synchronizer, events: ArchiverEmitter, log?: Logger);
|
|
92
|
+
}, synchronizer: ArchiverL1Synchronizer, events: ArchiverEmitter, l2TipsCache?: L2TipsCache, log?: Logger);
|
|
88
93
|
/** Updates archiver config */
|
|
89
94
|
updateConfig(newConfig: Partial<ArchiverConfig>): void;
|
|
90
95
|
/**
|
|
@@ -101,6 +106,7 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
101
106
|
* @returns A promise that resolves when the block has been added to the store, or rejects on error.
|
|
102
107
|
*/
|
|
103
108
|
addBlock(block: L2Block): Promise<void>;
|
|
109
|
+
setProposedCheckpoint(pending: ProposedCheckpointInput): Promise<void>;
|
|
104
110
|
private processQueuedBlocks;
|
|
105
111
|
waitForInitialSync(): Promise<void>;
|
|
106
112
|
private sync;
|
|
@@ -121,15 +127,15 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
121
127
|
getRegistryAddress(): Promise<EthAddress>;
|
|
122
128
|
getL1BlockNumber(): bigint | undefined;
|
|
123
129
|
getL1Timestamp(): Promise<bigint | undefined>;
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
getSyncedL2SlotNumber(): Promise<SlotNumber | undefined>;
|
|
131
|
+
getSyncedL2EpochNumber(): Promise<EpochNumber | undefined>;
|
|
126
132
|
isEpochComplete(epochNumber: EpochNumber): Promise<boolean>;
|
|
127
133
|
/** Returns whether the archiver has completed an initial sync run successfully. */
|
|
128
134
|
isInitialSyncComplete(): boolean;
|
|
129
|
-
|
|
135
|
+
removeCheckpointsAfter(checkpointNumber: CheckpointNumber): Promise<boolean>;
|
|
130
136
|
/** Used by TXE to add checkpoints directly without syncing from L1. */
|
|
131
137
|
addCheckpoints(checkpoints: PublishedCheckpoint[], pendingChainValidationStatus?: ValidateCheckpointResult): Promise<boolean>;
|
|
132
138
|
getL2Tips(): Promise<L2Tips>;
|
|
133
139
|
rollbackTo(targetL2BlockNumber: BlockNumber): Promise<void>;
|
|
134
140
|
}
|
|
135
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
141
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJjaGl2ZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9hcmNoaXZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3JFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNoRCxPQUFPLEVBQXVCLGNBQWMsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ2hGLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sdUNBQXVDLENBQUM7QUFDakYsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUNyRixPQUFPLEVBQUUsV0FBVyxFQUFFLGdCQUFnQixFQUFFLFdBQVcsRUFBRSxVQUFVLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUN6RyxPQUFPLEVBQUUsUUFBUSxFQUFFLE1B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IAEY,UAAU,CAAC,mBAAmB,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4DvE;CACF"}
|
package/dest/archiver.js
CHANGED
|
@@ -371,23 +371,24 @@ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
|
371
371
|
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
372
372
|
}
|
|
373
373
|
var _dec, _initProto;
|
|
374
|
-
import { GENESIS_BLOCK_HEADER_HASH, INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
375
374
|
import { BlockTagTooOldError } from '@aztec/ethereum/contracts';
|
|
376
|
-
import { BlockNumber,
|
|
375
|
+
import { BlockNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
377
376
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
378
377
|
import { merge } from '@aztec/foundation/collection';
|
|
379
378
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
380
379
|
import { createLogger } from '@aztec/foundation/log';
|
|
381
380
|
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
382
381
|
import { RunningPromise, makeLoggingErrorHandler } from '@aztec/foundation/running-promise';
|
|
383
|
-
import {
|
|
384
|
-
import {
|
|
382
|
+
import { elapsed } from '@aztec/foundation/timer';
|
|
383
|
+
import { getEpochAtSlot, getSlotAtNextL1Block, getSlotRangeForEpoch, getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
|
|
385
384
|
import { trackSpan } from '@aztec/telemetry-client';
|
|
386
385
|
import { mapArchiverConfig } from './config.js';
|
|
387
|
-
import { NoBlobBodiesFoundError } from './errors.js';
|
|
386
|
+
import { BlockAlreadyCheckpointedError, NoBlobBodiesFoundError } from './errors.js';
|
|
387
|
+
import { validateAndLogHistoricalLogsAvailability } from './l1/validate_historical_logs.js';
|
|
388
388
|
import { validateAndLogTraceAvailability } from './l1/validate_trace.js';
|
|
389
389
|
import { ArchiverDataSourceBase } from './modules/data_source_base.js';
|
|
390
390
|
import { ArchiverDataStoreUpdater } from './modules/data_store_updater.js';
|
|
391
|
+
import { L2TipsCache } from './store/l2_tips_cache.js';
|
|
391
392
|
_dec = trackSpan('Archiver.sync');
|
|
392
393
|
/**
|
|
393
394
|
* Pulls checkpoints in a non-blocking manner and provides interface for their retrieval.
|
|
@@ -419,29 +420,34 @@ _dec = trackSpan('Archiver.sync');
|
|
|
419
420
|
initialSyncPromise;
|
|
420
421
|
/** Queue of blocks to be added to the store, processed by the sync loop. */ blockQueue;
|
|
421
422
|
/** Helper to handle updates to the store */ updater;
|
|
423
|
+
/** In-memory cache for L2 chain tips. */ l2TipsCache;
|
|
422
424
|
tracer;
|
|
425
|
+
instrumentation;
|
|
423
426
|
/**
|
|
424
427
|
* Creates a new instance of the Archiver.
|
|
425
428
|
* @param publicClient - A client for interacting with the Ethereum node.
|
|
426
429
|
* @param debugClient - A client for interacting with the Ethereum node for debug/trace methods.
|
|
427
430
|
* @param rollup - Rollup contract instance.
|
|
428
431
|
* @param inbox - Inbox contract instance.
|
|
429
|
-
* @param l1Addresses - L1 contract addresses (registry, governance proposer,
|
|
432
|
+
* @param l1Addresses - L1 contract addresses (registry, governance proposer, slashing proposer).
|
|
430
433
|
* @param dataStore - An archiver data store for storage & retrieval of blocks, encrypted logs & contract data.
|
|
431
434
|
* @param config - Archiver configuration options.
|
|
432
435
|
* @param blobClient - Client for retrieving blob data.
|
|
433
|
-
* @param epochCache - Cache for epoch-related data.
|
|
434
436
|
* @param dateProvider - Provider for current date/time.
|
|
435
437
|
* @param instrumentation - Instrumentation for metrics and tracing.
|
|
436
438
|
* @param l1Constants - L1 rollup constants.
|
|
437
439
|
* @param log - A logger.
|
|
438
|
-
*/ constructor(publicClient, debugClient, rollup, l1Addresses, dataStore, config, blobClient, instrumentation, l1Constants, synchronizer, events, log = createLogger('archiver')){
|
|
440
|
+
*/ constructor(publicClient, debugClient, rollup, l1Addresses, dataStore, config, blobClient, instrumentation, l1Constants, synchronizer, events, l2TipsCache, log = createLogger('archiver')){
|
|
439
441
|
super(dataStore, l1Constants), this.publicClient = publicClient, this.debugClient = debugClient, this.rollup = rollup, this.l1Addresses = l1Addresses, this.dataStore = dataStore, this.config = config, this.blobClient = blobClient, this.l1Constants = l1Constants, this.log = log, this.initialSyncComplete = (_initProto(this), false), this.blockQueue = [];
|
|
440
442
|
this.tracer = instrumentation.tracer;
|
|
443
|
+
this.instrumentation = instrumentation;
|
|
441
444
|
this.initialSyncPromise = promiseWithResolvers();
|
|
442
445
|
this.synchronizer = synchronizer;
|
|
443
446
|
this.events = events;
|
|
444
|
-
this.
|
|
447
|
+
this.l2TipsCache = l2TipsCache ?? new L2TipsCache(this.dataStore.blockStore);
|
|
448
|
+
this.updater = new ArchiverDataStoreUpdater(this.dataStore, this.l2TipsCache, {
|
|
449
|
+
rollupManaLimit: l1Constants.rollupManaLimit
|
|
450
|
+
});
|
|
445
451
|
// Running promise starts with a small interval inbetween runs, so all iterations needed for the initial sync
|
|
446
452
|
// are done as fast as possible. This then gets updated once the initial sync completes.
|
|
447
453
|
this.runningPromise = new RunningPromise(()=>this.sync(), this.log, this.config.pollingIntervalMs / 10, makeLoggingErrorHandler(this.log, NoBlobBodiesFoundError, BlockTagTooOldError));
|
|
@@ -459,7 +465,13 @@ _dec = trackSpan('Archiver.sync');
|
|
|
459
465
|
}
|
|
460
466
|
await this.blobClient.testSources();
|
|
461
467
|
await this.synchronizer.testEthereumNodeSynced();
|
|
462
|
-
await validateAndLogTraceAvailability(this.debugClient, this.config.ethereumAllowNoDebugHosts ?? false);
|
|
468
|
+
await validateAndLogTraceAvailability(this.debugClient, this.config.ethereumAllowNoDebugHosts ?? false, this.log.getBindings());
|
|
469
|
+
await validateAndLogHistoricalLogsAvailability(this.publicClient, {
|
|
470
|
+
rollupAddress: this.l1Addresses.rollupAddress,
|
|
471
|
+
inboxAddress: this.l1Addresses.inboxAddress,
|
|
472
|
+
registryAddress: this.l1Addresses.registryAddress,
|
|
473
|
+
governanceProposerAddress: this.l1Addresses.governanceProposerAddress
|
|
474
|
+
}, this.config.skipHistoricalLogsCheck ?? false, this.log.getBindings());
|
|
463
475
|
// Log initial state for the archiver
|
|
464
476
|
const { l1StartBlock } = this.l1Constants;
|
|
465
477
|
const { blocksSynchedTo = l1StartBlock, messagesSynchedTo = l1StartBlock } = await this.store.getSynchPoint();
|
|
@@ -498,6 +510,9 @@ _dec = trackSpan('Archiver.sync');
|
|
|
498
510
|
});
|
|
499
511
|
});
|
|
500
512
|
}
|
|
513
|
+
async setProposedCheckpoint(pending) {
|
|
514
|
+
await this.updater.setProposedCheckpoint(pending);
|
|
515
|
+
}
|
|
501
516
|
/**
|
|
502
517
|
* Processes all queued blocks, adding them to the store.
|
|
503
518
|
* Called at the beginning of each sync iteration.
|
|
@@ -509,15 +524,32 @@ _dec = trackSpan('Archiver.sync');
|
|
|
509
524
|
// Take all blocks from the queue
|
|
510
525
|
const queuedItems = this.blockQueue.splice(0, this.blockQueue.length);
|
|
511
526
|
this.log.debug(`Processing ${queuedItems.length} queued block(s)`);
|
|
527
|
+
// Calculate slot threshold for validation
|
|
528
|
+
const l1Timestamp = this.synchronizer.getL1Timestamp();
|
|
529
|
+
const slotAtNextL1Block = l1Timestamp === undefined ? undefined : getSlotAtNextL1Block(l1Timestamp, this.l1Constants);
|
|
512
530
|
// Process each block individually to properly resolve/reject each promise
|
|
513
531
|
for (const { block, resolve, reject } of queuedItems){
|
|
532
|
+
const blockSlot = block.header.globalVariables.slotNumber;
|
|
533
|
+
if (slotAtNextL1Block !== undefined && blockSlot < slotAtNextL1Block) {
|
|
534
|
+
this.log.warn(`Rejecting proposed block ${block.number} for past slot ${blockSlot} (current is ${slotAtNextL1Block})`, {
|
|
535
|
+
block: block.toBlockInfo(),
|
|
536
|
+
l1Timestamp,
|
|
537
|
+
slotAtNextL1Block
|
|
538
|
+
});
|
|
539
|
+
reject(new Error(`Block ${block.number} is for past slot ${blockSlot} (current is ${slotAtNextL1Block})`));
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
514
542
|
try {
|
|
515
|
-
await this.updater.
|
|
516
|
-
|
|
517
|
-
]);
|
|
543
|
+
const [durationMs] = await elapsed(()=>this.updater.addProposedBlock(block));
|
|
544
|
+
this.instrumentation.processNewProposedBlock(durationMs, block);
|
|
518
545
|
this.log.debug(`Added block ${block.number} to store`);
|
|
519
546
|
resolve();
|
|
520
547
|
} catch (err) {
|
|
548
|
+
if (err instanceof BlockAlreadyCheckpointedError) {
|
|
549
|
+
this.log.debug(`Proposed block ${block.number} matches already checkpointed block, ignoring late proposal`);
|
|
550
|
+
resolve();
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
521
553
|
this.log.error(`Failed to add block ${block.number} to store: ${err.message}`);
|
|
522
554
|
reject(err);
|
|
523
555
|
}
|
|
@@ -592,13 +624,45 @@ _dec = trackSpan('Archiver.sync');
|
|
|
592
624
|
getL1Timestamp() {
|
|
593
625
|
return Promise.resolve(this.synchronizer.getL1Timestamp());
|
|
594
626
|
}
|
|
595
|
-
|
|
627
|
+
async getSyncedL2SlotNumber() {
|
|
628
|
+
// The synced L2 slot is the latest slot for which we have all L1 data,
|
|
629
|
+
// either because we have seen all L1 blocks for that slot, or because
|
|
630
|
+
// we have seen the corresponding checkpoint.
|
|
631
|
+
let slotFromL1Sync;
|
|
596
632
|
const l1Timestamp = this.synchronizer.getL1Timestamp();
|
|
597
|
-
|
|
633
|
+
if (l1Timestamp !== undefined) {
|
|
634
|
+
const nextL1BlockSlot = getSlotAtNextL1Block(l1Timestamp, this.l1Constants);
|
|
635
|
+
if (Number(nextL1BlockSlot) > 0) {
|
|
636
|
+
slotFromL1Sync = SlotNumber.add(nextL1BlockSlot, -1);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
let slotFromCheckpoint;
|
|
640
|
+
const latestCheckpointNumber = await this.store.getSynchedCheckpointNumber();
|
|
641
|
+
if (latestCheckpointNumber > 0) {
|
|
642
|
+
const checkpointData = await this.store.getCheckpointData(latestCheckpointNumber);
|
|
643
|
+
if (checkpointData) {
|
|
644
|
+
slotFromCheckpoint = checkpointData.header.slotNumber;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (slotFromL1Sync === undefined && slotFromCheckpoint === undefined) {
|
|
648
|
+
return undefined;
|
|
649
|
+
}
|
|
650
|
+
return SlotNumber(Math.max(slotFromL1Sync ?? 0, slotFromCheckpoint ?? 0));
|
|
598
651
|
}
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
652
|
+
async getSyncedL2EpochNumber() {
|
|
653
|
+
const syncedSlot = await this.getSyncedL2SlotNumber();
|
|
654
|
+
if (syncedSlot === undefined) {
|
|
655
|
+
return undefined;
|
|
656
|
+
}
|
|
657
|
+
// An epoch is fully synced when all its slots are synced.
|
|
658
|
+
// We check if syncedSlot is the last slot of its epoch; if so, that epoch is fully synced.
|
|
659
|
+
// Otherwise, only the previous epoch is fully synced.
|
|
660
|
+
const epoch = getEpochAtSlot(syncedSlot, this.l1Constants);
|
|
661
|
+
const [, endSlot] = getSlotRangeForEpoch(epoch, this.l1Constants);
|
|
662
|
+
if (syncedSlot >= endSlot) {
|
|
663
|
+
return epoch;
|
|
664
|
+
}
|
|
665
|
+
return Number(epoch) > 0 ? EpochNumber(Number(epoch) - 1) : undefined;
|
|
602
666
|
}
|
|
603
667
|
async isEpochComplete(epochNumber) {
|
|
604
668
|
// The epoch is complete if the current checkpointed L2 block is the last one in the epoch (or later).
|
|
@@ -630,114 +694,38 @@ _dec = trackSpan('Archiver.sync');
|
|
|
630
694
|
/** Returns whether the archiver has completed an initial sync run successfully. */ isInitialSyncComplete() {
|
|
631
695
|
return this.initialSyncComplete;
|
|
632
696
|
}
|
|
633
|
-
|
|
634
|
-
return this.updater.
|
|
697
|
+
removeCheckpointsAfter(checkpointNumber) {
|
|
698
|
+
return this.updater.removeCheckpointsAfter(checkpointNumber);
|
|
635
699
|
}
|
|
636
700
|
/** Used by TXE to add checkpoints directly without syncing from L1. */ async addCheckpoints(checkpoints, pendingChainValidationStatus) {
|
|
637
|
-
await this.updater.
|
|
701
|
+
await this.updater.addCheckpoints(checkpoints, pendingChainValidationStatus);
|
|
638
702
|
return true;
|
|
639
703
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
this.getBlockNumber(),
|
|
643
|
-
this.getProvenBlockNumber(),
|
|
644
|
-
this.getCheckpointedL2BlockNumber(),
|
|
645
|
-
this.getFinalizedL2BlockNumber()
|
|
646
|
-
]);
|
|
647
|
-
const beforeInitialblockNumber = BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
|
|
648
|
-
// Get the latest block header and checkpointed blocks for proven, finalised and checkpointed blocks
|
|
649
|
-
const [latestBlockHeader, provenCheckpointedBlock, finalizedCheckpointedBlock, checkpointedBlock] = await Promise.all([
|
|
650
|
-
latestBlockNumber > beforeInitialblockNumber ? this.getBlockHeader(latestBlockNumber) : undefined,
|
|
651
|
-
provenBlockNumber > beforeInitialblockNumber ? this.getCheckpointedBlock(provenBlockNumber) : undefined,
|
|
652
|
-
finalizedBlockNumber > beforeInitialblockNumber ? this.getCheckpointedBlock(finalizedBlockNumber) : undefined,
|
|
653
|
-
checkpointedBlockNumber > beforeInitialblockNumber ? this.getCheckpointedBlock(checkpointedBlockNumber) : undefined
|
|
654
|
-
]);
|
|
655
|
-
if (latestBlockNumber > beforeInitialblockNumber && !latestBlockHeader) {
|
|
656
|
-
throw new Error(`Failed to retrieve latest block header for block ${latestBlockNumber}`);
|
|
657
|
-
}
|
|
658
|
-
// Checkpointed blocks must exist for proven, finalized and checkpointed tips if they are beyond the initial block number.
|
|
659
|
-
if (checkpointedBlockNumber > beforeInitialblockNumber && !checkpointedBlock?.block.header) {
|
|
660
|
-
throw new Error(`Failed to retrieve checkpointed block header for block ${checkpointedBlockNumber} (latest block is ${latestBlockNumber})`);
|
|
661
|
-
}
|
|
662
|
-
if (provenBlockNumber > beforeInitialblockNumber && !provenCheckpointedBlock?.block.header) {
|
|
663
|
-
throw new Error(`Failed to retrieve proven checkpointed for block ${provenBlockNumber} (latest block is ${latestBlockNumber})`);
|
|
664
|
-
}
|
|
665
|
-
if (finalizedBlockNumber > beforeInitialblockNumber && !finalizedCheckpointedBlock?.block.header) {
|
|
666
|
-
throw new Error(`Failed to retrieve finalized block header for block ${finalizedBlockNumber} (latest block is ${latestBlockNumber})`);
|
|
667
|
-
}
|
|
668
|
-
const latestBlockHeaderHash = await latestBlockHeader?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
669
|
-
const provenBlockHeaderHash = await provenCheckpointedBlock?.block.header?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
670
|
-
const finalizedBlockHeaderHash = await finalizedCheckpointedBlock?.block.header?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
671
|
-
const checkpointedBlockHeaderHash = await checkpointedBlock?.block.header?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
672
|
-
// Now attempt to retrieve checkpoints for proven, finalised and checkpointed blocks
|
|
673
|
-
const [[provenBlockCheckpoint], [finalizedBlockCheckpoint], [checkpointedBlockCheckpoint]] = await Promise.all([
|
|
674
|
-
provenCheckpointedBlock !== undefined ? await this.getCheckpoints(provenCheckpointedBlock?.checkpointNumber, 1) : [
|
|
675
|
-
undefined
|
|
676
|
-
],
|
|
677
|
-
finalizedCheckpointedBlock !== undefined ? await this.getCheckpoints(finalizedCheckpointedBlock?.checkpointNumber, 1) : [
|
|
678
|
-
undefined
|
|
679
|
-
],
|
|
680
|
-
checkpointedBlock !== undefined ? await this.getCheckpoints(checkpointedBlock?.checkpointNumber, 1) : [
|
|
681
|
-
undefined
|
|
682
|
-
]
|
|
683
|
-
]);
|
|
684
|
-
const initialcheckpointId = {
|
|
685
|
-
number: CheckpointNumber.ZERO,
|
|
686
|
-
hash: GENESIS_CHECKPOINT_HEADER_HASH.toString()
|
|
687
|
-
};
|
|
688
|
-
const makeCheckpointId = (checkpoint)=>{
|
|
689
|
-
if (checkpoint === undefined) {
|
|
690
|
-
return initialcheckpointId;
|
|
691
|
-
}
|
|
692
|
-
return {
|
|
693
|
-
number: checkpoint.checkpoint.number,
|
|
694
|
-
hash: checkpoint.checkpoint.hash().toString()
|
|
695
|
-
};
|
|
696
|
-
};
|
|
697
|
-
const l2Tips = {
|
|
698
|
-
proposed: {
|
|
699
|
-
number: latestBlockNumber,
|
|
700
|
-
hash: latestBlockHeaderHash.toString()
|
|
701
|
-
},
|
|
702
|
-
proven: {
|
|
703
|
-
block: {
|
|
704
|
-
number: provenBlockNumber,
|
|
705
|
-
hash: provenBlockHeaderHash.toString()
|
|
706
|
-
},
|
|
707
|
-
checkpoint: makeCheckpointId(provenBlockCheckpoint)
|
|
708
|
-
},
|
|
709
|
-
finalized: {
|
|
710
|
-
block: {
|
|
711
|
-
number: finalizedBlockNumber,
|
|
712
|
-
hash: finalizedBlockHeaderHash.toString()
|
|
713
|
-
},
|
|
714
|
-
checkpoint: makeCheckpointId(finalizedBlockCheckpoint)
|
|
715
|
-
},
|
|
716
|
-
checkpointed: {
|
|
717
|
-
block: {
|
|
718
|
-
number: checkpointedBlockNumber,
|
|
719
|
-
hash: checkpointedBlockHeaderHash.toString()
|
|
720
|
-
},
|
|
721
|
-
checkpoint: makeCheckpointId(checkpointedBlockCheckpoint)
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
|
-
return l2Tips;
|
|
704
|
+
getL2Tips() {
|
|
705
|
+
return this.l2TipsCache.getL2Tips();
|
|
725
706
|
}
|
|
726
707
|
async rollbackTo(targetL2BlockNumber) {
|
|
727
|
-
// TODO(pw/mbps): This still assumes 1 block per checkpoint
|
|
728
708
|
const currentBlocks = await this.getL2Tips();
|
|
729
709
|
const currentL2Block = currentBlocks.proposed.number;
|
|
730
710
|
const currentProvenBlock = currentBlocks.proven.block.number;
|
|
731
711
|
if (targetL2BlockNumber >= currentL2Block) {
|
|
732
712
|
throw new Error(`Target L2 block ${targetL2BlockNumber} must be less than current L2 block ${currentL2Block}`);
|
|
733
713
|
}
|
|
734
|
-
const blocksToUnwind = currentL2Block - targetL2BlockNumber;
|
|
735
714
|
const targetL2Block = await this.store.getCheckpointedBlock(targetL2BlockNumber);
|
|
736
715
|
if (!targetL2Block) {
|
|
737
716
|
throw new Error(`Target L2 block ${targetL2BlockNumber} not found`);
|
|
738
717
|
}
|
|
718
|
+
const targetCheckpointNumber = targetL2Block.checkpointNumber;
|
|
719
|
+
// Rollback operates at checkpoint granularity: the target block must be the last block of its checkpoint.
|
|
720
|
+
const checkpointData = await this.store.getCheckpointData(targetCheckpointNumber);
|
|
721
|
+
if (checkpointData) {
|
|
722
|
+
const lastBlockInCheckpoint = BlockNumber(checkpointData.startBlock + checkpointData.blockCount - 1);
|
|
723
|
+
if (targetL2BlockNumber !== lastBlockInCheckpoint) {
|
|
724
|
+
const previousCheckpointBoundary = checkpointData.startBlock > 1 ? BlockNumber(checkpointData.startBlock - 1) : BlockNumber(0);
|
|
725
|
+
throw new Error(`Target L2 block ${targetL2BlockNumber} is not at a checkpoint boundary. ` + `Checkpoint ${targetCheckpointNumber} spans blocks ${checkpointData.startBlock} to ${lastBlockInCheckpoint}. ` + `Use block ${lastBlockInCheckpoint} to roll back to this checkpoint, ` + `or block ${previousCheckpointBoundary} to roll back to the previous one.`);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
739
728
|
const targetL1BlockNumber = targetL2Block.l1.blockNumber;
|
|
740
|
-
const targetCheckpointNumber = CheckpointNumber.fromBlockNumber(targetL2BlockNumber);
|
|
741
729
|
const targetL1Block = await this.publicClient.getBlock({
|
|
742
730
|
blockNumber: targetL1BlockNumber,
|
|
743
731
|
includeTransactions: false
|
|
@@ -746,24 +734,24 @@ _dec = trackSpan('Archiver.sync');
|
|
|
746
734
|
throw new Error(`Missing L1 block ${targetL1BlockNumber}`);
|
|
747
735
|
}
|
|
748
736
|
const targetL1BlockHash = Buffer32.fromString(targetL1Block.hash);
|
|
749
|
-
this.log.info(`
|
|
750
|
-
await this.updater.
|
|
751
|
-
this.log.info(`
|
|
737
|
+
this.log.info(`Removing checkpoints after checkpoint ${targetCheckpointNumber} (target block ${targetL2BlockNumber})`);
|
|
738
|
+
await this.updater.removeCheckpointsAfter(targetCheckpointNumber);
|
|
739
|
+
this.log.info(`Rolling back L1 to L2 messages to checkpoint ${targetCheckpointNumber}`);
|
|
752
740
|
await this.store.rollbackL1ToL2MessagesToCheckpoint(targetCheckpointNumber);
|
|
753
741
|
this.log.info(`Setting L1 syncpoints to ${targetL1BlockNumber}`);
|
|
754
742
|
await this.store.setCheckpointSynchedL1BlockNumber(targetL1BlockNumber);
|
|
755
|
-
await this.store.
|
|
743
|
+
await this.store.setMessageSyncState({
|
|
756
744
|
l1BlockNumber: targetL1BlockNumber,
|
|
757
745
|
l1BlockHash: targetL1BlockHash
|
|
758
|
-
});
|
|
746
|
+
}, undefined);
|
|
759
747
|
if (targetL2BlockNumber < currentProvenBlock) {
|
|
760
|
-
this.log.info(`
|
|
761
|
-
await this.
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
748
|
+
this.log.info(`Rolling back proven L2 checkpoint to ${targetCheckpointNumber}`);
|
|
749
|
+
await this.updater.setProvenCheckpointNumber(targetCheckpointNumber);
|
|
750
|
+
}
|
|
751
|
+
const currentFinalizedBlock = currentBlocks.finalized.block.number;
|
|
752
|
+
if (targetL2BlockNumber < currentFinalizedBlock) {
|
|
753
|
+
this.log.info(`Rolling back finalized L2 checkpoint to ${targetCheckpointNumber}`);
|
|
754
|
+
await this.updater.setFinalizedCheckpointNumber(targetCheckpointNumber);
|
|
755
|
+
}
|
|
768
756
|
}
|
|
769
757
|
}
|
package/dest/config.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type BlobClientConfig } from '@aztec/blob-client/client/config';
|
|
|
2
2
|
import { type L1ContractsConfig } from '@aztec/ethereum/config';
|
|
3
3
|
import { type L1ReaderConfig } from '@aztec/ethereum/l1-reader';
|
|
4
4
|
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
5
|
-
import { type ChainConfig } from '@aztec/stdlib/config';
|
|
5
|
+
import { type ChainConfig, type PipelineConfig } from '@aztec/stdlib/config';
|
|
6
6
|
import type { ArchiverSpecificConfig } from '@aztec/stdlib/interfaces/server';
|
|
7
7
|
/**
|
|
8
8
|
* The archiver configuration.
|
|
@@ -11,7 +11,7 @@ import type { ArchiverSpecificConfig } from '@aztec/stdlib/interfaces/server';
|
|
|
11
11
|
* Results of calls to eth_blockNumber are cached by viem with this cache being updated periodically at the interval specified by viemPollingIntervalMS.
|
|
12
12
|
* As a result the maximum observed polling time for new blocks will be viemPollingIntervalMS + archiverPollingIntervalMS.
|
|
13
13
|
*/
|
|
14
|
-
export type ArchiverConfig = ArchiverSpecificConfig & L1ReaderConfig & L1ContractsConfig & BlobClientConfig & ChainConfig;
|
|
14
|
+
export type ArchiverConfig = ArchiverSpecificConfig & L1ReaderConfig & L1ContractsConfig & PipelineConfig & BlobClientConfig & ChainConfig;
|
|
15
15
|
export declare const archiverConfigMappings: ConfigMappingsType<ArchiverConfig>;
|
|
16
16
|
/**
|
|
17
17
|
* Returns the archiver configuration from the environment variables.
|
|
@@ -24,7 +24,9 @@ export declare function mapArchiverConfig(config: Partial<ArchiverConfig>): {
|
|
|
24
24
|
pollingIntervalMs: number | undefined;
|
|
25
25
|
batchSize: number | undefined;
|
|
26
26
|
skipValidateCheckpointAttestations: boolean | undefined;
|
|
27
|
+
skipPromoteProposedCheckpointDuringL1Sync: boolean | undefined;
|
|
27
28
|
maxAllowedEthClientDriftSeconds: number | undefined;
|
|
28
29
|
ethereumAllowNoDebugHosts: boolean | undefined;
|
|
30
|
+
skipHistoricalLogsCheck: boolean | undefined;
|
|
29
31
|
};
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudH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gB,EAA2B,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,wBAAwB,CAAC;AAE3F,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACxF,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,wBAAwB,CAAC;AAE3F,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACxF,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,sBAAsB,GACjD,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,WAAW,CAAC;AAEd,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,CA4DrE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;;;;;;;;EAUhE"}
|
package/dest/config.js
CHANGED
|
@@ -3,9 +3,10 @@ import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
|
3
3
|
import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
4
4
|
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
5
5
|
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
|
|
6
|
-
import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
6
|
+
import { chainConfigMappings, pipelineConfigMappings } from '@aztec/stdlib/config';
|
|
7
7
|
export const archiverConfigMappings = {
|
|
8
8
|
...blobClientConfigMapping,
|
|
9
|
+
...pipelineConfigMappings,
|
|
9
10
|
archiverPollingIntervalMS: {
|
|
10
11
|
env: 'ARCHIVER_POLLING_INTERVAL_MS',
|
|
11
12
|
description: 'The polling interval in ms for retrieving new L2 blocks and encrypted logs.',
|
|
@@ -23,13 +24,17 @@ export const archiverConfigMappings = {
|
|
|
23
24
|
},
|
|
24
25
|
archiverStoreMapSizeKb: {
|
|
25
26
|
env: 'ARCHIVER_STORE_MAP_SIZE_KB',
|
|
26
|
-
parseEnv: (val)
|
|
27
|
+
parseEnv: (val)=>+val,
|
|
27
28
|
description: 'The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKb.'
|
|
28
29
|
},
|
|
29
30
|
skipValidateCheckpointAttestations: {
|
|
30
31
|
description: 'Skip validating checkpoint attestations (for testing purposes only)',
|
|
31
32
|
...booleanConfigHelper(false)
|
|
32
33
|
},
|
|
34
|
+
skipPromoteProposedCheckpointDuringL1Sync: {
|
|
35
|
+
description: 'Skip promoting proposed checkpoints during L1 sync (for testing purposes only)',
|
|
36
|
+
...booleanConfigHelper(false)
|
|
37
|
+
},
|
|
33
38
|
maxAllowedEthClientDriftSeconds: {
|
|
34
39
|
env: 'MAX_ALLOWED_ETH_CLIENT_DRIFT_SECONDS',
|
|
35
40
|
description: 'Maximum allowed drift in seconds between the Ethereum client and current time.',
|
|
@@ -40,6 +45,11 @@ export const archiverConfigMappings = {
|
|
|
40
45
|
description: 'Whether to allow starting the archiver without debug/trace method support on Ethereum hosts',
|
|
41
46
|
...booleanConfigHelper(true)
|
|
42
47
|
},
|
|
48
|
+
archiverSkipHistoricalLogsCheck: {
|
|
49
|
+
env: 'ARCHIVER_SKIP_HISTORICAL_LOGS_CHECK',
|
|
50
|
+
description: 'Skip the startup check that probes the L1 RPC for historical Rollup contract logs. ' + 'Set to true to bypass the check when the connected RPC node is known to prune old logs.',
|
|
51
|
+
...booleanConfigHelper(false)
|
|
52
|
+
},
|
|
43
53
|
...chainConfigMappings,
|
|
44
54
|
...l1ReaderConfigMappings,
|
|
45
55
|
viemPollingIntervalMS: {
|
|
@@ -65,7 +75,9 @@ export const archiverConfigMappings = {
|
|
|
65
75
|
pollingIntervalMs: config.archiverPollingIntervalMS,
|
|
66
76
|
batchSize: config.archiverBatchSize,
|
|
67
77
|
skipValidateCheckpointAttestations: config.skipValidateCheckpointAttestations,
|
|
78
|
+
skipPromoteProposedCheckpointDuringL1Sync: config.skipPromoteProposedCheckpointDuringL1Sync,
|
|
68
79
|
maxAllowedEthClientDriftSeconds: config.maxAllowedEthClientDriftSeconds,
|
|
69
|
-
ethereumAllowNoDebugHosts: config.ethereumAllowNoDebugHosts
|
|
80
|
+
ethereumAllowNoDebugHosts: config.ethereumAllowNoDebugHosts,
|
|
81
|
+
skipHistoricalLogsCheck: config.archiverSkipHistoricalLogsCheck
|
|
70
82
|
};
|
|
71
83
|
}
|