@aztec/archiver 0.0.1-commit.aada20e3 → 0.0.1-commit.b2a5d0dd1
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 +13 -8
- package/dest/archiver.d.ts.map +1 -1
- package/dest/archiver.js +90 -114
- 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 +50 -10
- package/dest/errors.d.ts.map +1 -1
- package/dest/errors.js +67 -16
- package/dest/factory.d.ts +4 -5
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +33 -27
- 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 +42 -47
- 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/modules/data_source_base.d.ts +14 -7
- 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 +35 -15
- package/dest/modules/data_store_updater.d.ts.map +1 -1
- package/dest/modules/data_store_updater.js +137 -96
- package/dest/modules/instrumentation.d.ts +21 -3
- package/dest/modules/instrumentation.d.ts.map +1 -1
- package/dest/modules/instrumentation.js +41 -8
- 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 +279 -150
- 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 +73 -28
- package/dest/store/block_store.d.ts.map +1 -1
- package/dest/store/block_store.js +395 -136
- 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 +7 -67
- 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 +67 -24
- package/dest/store/kv_archiver_store.d.ts.map +1 -1
- package/dest/store/kv_archiver_store.js +82 -27
- 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 +150 -55
- 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/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 +26 -5
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +160 -89
- package/dest/test/mock_structs.d.ts +4 -1
- package/dest/test/mock_structs.d.ts.map +1 -1
- package/dest/test/mock_structs.js +13 -1
- package/dest/test/noop_l1_archiver.d.ts +4 -1
- package/dest/test/noop_l1_archiver.d.ts.map +1 -1
- package/dest/test/noop_l1_archiver.js +9 -3
- package/package.json +13 -13
- package/src/archiver.ts +120 -137
- package/src/config.ts +22 -2
- package/src/errors.ts +104 -26
- package/src/factory.ts +47 -24
- 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 +58 -69
- package/src/l1/spire_proposer.ts +7 -15
- package/src/l1/validate_historical_logs.ts +140 -0
- package/src/modules/data_source_base.ts +78 -98
- package/src/modules/data_store_updater.ts +164 -126
- package/src/modules/instrumentation.ts +56 -9
- package/src/modules/l1_synchronizer.ts +357 -188
- package/src/modules/validation.ts +2 -2
- package/src/store/block_store.ts +503 -172
- package/src/store/contract_class_store.ts +8 -106
- package/src/store/contract_instance_store.ts +8 -5
- package/src/store/kv_archiver_store.ts +130 -41
- package/src/store/l2_tips_cache.ts +134 -0
- package/src/store/log_store.ts +221 -63
- 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/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 +209 -82
- package/src/test/mock_structs.ts +20 -6
- package/src/test/noop_l1_archiver.ts +10 -2
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
|
@@ -11,7 +11,7 @@ import { type Logger } from '@aztec/foundation/log';
|
|
|
11
11
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
12
12
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
13
13
|
import { type ArchiverEmitter, L2Block, type L2BlockSink, type L2Tips, type ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
14
|
-
import { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
14
|
+
import { type ProposedCheckpointInput, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
15
15
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
16
16
|
import { type TelemetryClient, type Traceable, type Tracer } from '@aztec/telemetry-client';
|
|
17
17
|
import { type ArchiverConfig } from './config.js';
|
|
@@ -19,6 +19,7 @@ import { ArchiverDataSourceBase } from './modules/data_source_base.js';
|
|
|
19
19
|
import type { ArchiverInstrumentation } from './modules/instrumentation.js';
|
|
20
20
|
import type { ArchiverL1Synchronizer } from './modules/l1_synchronizer.js';
|
|
21
21
|
import type { KVArchiverDataStore } from './store/kv_archiver_store.js';
|
|
22
|
+
import { L2TipsCache } from './store/l2_tips_cache.js';
|
|
22
23
|
/** Export ArchiverEmitter for use in factory and tests. */
|
|
23
24
|
export type { ArchiverEmitter };
|
|
24
25
|
export type ArchiverDeps = {
|
|
@@ -57,24 +58,26 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
57
58
|
private blockQueue;
|
|
58
59
|
/** Helper to handle updates to the store */
|
|
59
60
|
private readonly updater;
|
|
61
|
+
/** In-memory cache for L2 chain tips. */
|
|
62
|
+
private readonly l2TipsCache;
|
|
60
63
|
readonly tracer: Tracer;
|
|
64
|
+
private readonly instrumentation;
|
|
61
65
|
/**
|
|
62
66
|
* Creates a new instance of the Archiver.
|
|
63
67
|
* @param publicClient - A client for interacting with the Ethereum node.
|
|
64
68
|
* @param debugClient - A client for interacting with the Ethereum node for debug/trace methods.
|
|
65
69
|
* @param rollup - Rollup contract instance.
|
|
66
70
|
* @param inbox - Inbox contract instance.
|
|
67
|
-
* @param l1Addresses - L1 contract addresses (registry, governance proposer,
|
|
71
|
+
* @param l1Addresses - L1 contract addresses (registry, governance proposer, slashing proposer).
|
|
68
72
|
* @param dataStore - An archiver data store for storage & retrieval of blocks, encrypted logs & contract data.
|
|
69
73
|
* @param config - Archiver configuration options.
|
|
70
74
|
* @param blobClient - Client for retrieving blob data.
|
|
71
|
-
* @param epochCache - Cache for epoch-related data.
|
|
72
75
|
* @param dateProvider - Provider for current date/time.
|
|
73
76
|
* @param instrumentation - Instrumentation for metrics and tracing.
|
|
74
77
|
* @param l1Constants - L1 rollup constants.
|
|
75
78
|
* @param log - A logger.
|
|
76
79
|
*/
|
|
77
|
-
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'> & {
|
|
78
81
|
slashingProposerAddress: EthAddress;
|
|
79
82
|
}, dataStore: KVArchiverDataStore, config: {
|
|
80
83
|
pollingIntervalMs: number;
|
|
@@ -82,10 +85,11 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
82
85
|
skipValidateCheckpointAttestations?: boolean;
|
|
83
86
|
maxAllowedEthClientDriftSeconds: number;
|
|
84
87
|
ethereumAllowNoDebugHosts?: boolean;
|
|
88
|
+
skipHistoricalLogsCheck?: boolean;
|
|
85
89
|
}, blobClient: BlobClientInterface, instrumentation: ArchiverInstrumentation, l1Constants: L1RollupConstants & {
|
|
86
90
|
l1StartBlockHash: Buffer32;
|
|
87
91
|
genesisArchiveRoot: Fr;
|
|
88
|
-
}, synchronizer: ArchiverL1Synchronizer, events: ArchiverEmitter, log?: Logger);
|
|
92
|
+
}, synchronizer: ArchiverL1Synchronizer, events: ArchiverEmitter, l2TipsCache?: L2TipsCache, log?: Logger);
|
|
89
93
|
/** Updates archiver config */
|
|
90
94
|
updateConfig(newConfig: Partial<ArchiverConfig>): void;
|
|
91
95
|
/**
|
|
@@ -102,6 +106,7 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
102
106
|
* @returns A promise that resolves when the block has been added to the store, or rejects on error.
|
|
103
107
|
*/
|
|
104
108
|
addBlock(block: L2Block): Promise<void>;
|
|
109
|
+
setProposedCheckpoint(pending: ProposedCheckpointInput): Promise<void>;
|
|
105
110
|
private processQueuedBlocks;
|
|
106
111
|
waitForInitialSync(): Promise<void>;
|
|
107
112
|
private sync;
|
|
@@ -122,8 +127,8 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
122
127
|
getRegistryAddress(): Promise<EthAddress>;
|
|
123
128
|
getL1BlockNumber(): bigint | undefined;
|
|
124
129
|
getL1Timestamp(): Promise<bigint | undefined>;
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
getSyncedL2SlotNumber(): Promise<SlotNumber | undefined>;
|
|
131
|
+
getSyncedL2EpochNumber(): Promise<EpochNumber | undefined>;
|
|
127
132
|
isEpochComplete(epochNumber: EpochNumber): Promise<boolean>;
|
|
128
133
|
/** Returns whether the archiver has completed an initial sync run successfully. */
|
|
129
134
|
isInitialSyncComplete(): boolean;
|
|
@@ -133,4 +138,4 @@ export declare class Archiver extends ArchiverDataSourceBase implements L2BlockS
|
|
|
133
138
|
getL2Tips(): Promise<L2Tips>;
|
|
134
139
|
rollbackTo(targetL2BlockNumber: BlockNumber): Promise<void>;
|
|
135
140
|
}
|
|
136
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
141
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJjaGl2ZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9hcmNoaXZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3JFLE9BQ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xFQUFFLG1CQUFtQixFQUFFLEVBQ2xDLDRCQUE0QixDQUFDLEVBQUUsd0JBQXdCLEdBQ3RELE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FHbEI7SUFFTSxTQUFTLElBQUksT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUVsQztJQUVZLFVBQVUsQ0FBQyxtQkFBbUIsRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQTREdkU7Q0FDRiJ9
|
package/dest/archiver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../src/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../src/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAuB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACzG,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAE,cAAc,EAA2B,MAAM,mCAAmC,CAAC;AAC5F,OAAO,EAA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G,SAAS,CAAC,CA2BpE;IAEY,sBAAsB,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CActE;IAEY,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CA6BvE;IAED,mFAAmF;IAC5E,qBAAqB,IAAI,OAAO,CAEtC;IAEM,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAElF;IAED,uEAAuE;IAC1D,cAAc,CACzB,WAAW,EAAE,mBAAmB,EAAE,EAClC,4BAA4B,CAAC,EAAE,wBAAwB,GACtD,OAAO,CAAC,OAAO,CAAC,CAGlB;IAEM,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;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));
|
|
@@ -460,6 +466,12 @@ _dec = trackSpan('Archiver.sync');
|
|
|
460
466
|
await this.blobClient.testSources();
|
|
461
467
|
await this.synchronizer.testEthereumNodeSynced();
|
|
462
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.
|
|
@@ -525,12 +540,16 @@ _dec = trackSpan('Archiver.sync');
|
|
|
525
540
|
continue;
|
|
526
541
|
}
|
|
527
542
|
try {
|
|
528
|
-
await this.updater.
|
|
529
|
-
|
|
530
|
-
]);
|
|
543
|
+
const [durationMs] = await elapsed(()=>this.updater.addProposedBlock(block));
|
|
544
|
+
this.instrumentation.processNewProposedBlock(durationMs, block);
|
|
531
545
|
this.log.debug(`Added block ${block.number} to store`);
|
|
532
546
|
resolve();
|
|
533
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
|
+
}
|
|
534
553
|
this.log.error(`Failed to add block ${block.number} to store: ${err.message}`);
|
|
535
554
|
reject(err);
|
|
536
555
|
}
|
|
@@ -605,13 +624,45 @@ _dec = trackSpan('Archiver.sync');
|
|
|
605
624
|
getL1Timestamp() {
|
|
606
625
|
return Promise.resolve(this.synchronizer.getL1Timestamp());
|
|
607
626
|
}
|
|
608
|
-
|
|
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;
|
|
609
632
|
const l1Timestamp = this.synchronizer.getL1Timestamp();
|
|
610
|
-
|
|
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));
|
|
611
651
|
}
|
|
612
|
-
|
|
613
|
-
const
|
|
614
|
-
|
|
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;
|
|
615
666
|
}
|
|
616
667
|
async isEpochComplete(epochNumber) {
|
|
617
668
|
// The epoch is complete if the current checkpointed L2 block is the last one in the epoch (or later).
|
|
@@ -650,94 +701,10 @@ _dec = trackSpan('Archiver.sync');
|
|
|
650
701
|
await this.updater.addCheckpoints(checkpoints, pendingChainValidationStatus);
|
|
651
702
|
return true;
|
|
652
703
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
this.getBlockNumber(),
|
|
656
|
-
this.getProvenBlockNumber(),
|
|
657
|
-
this.getCheckpointedL2BlockNumber(),
|
|
658
|
-
this.getFinalizedL2BlockNumber()
|
|
659
|
-
]);
|
|
660
|
-
const beforeInitialblockNumber = BlockNumber(INITIAL_L2_BLOCK_NUM - 1);
|
|
661
|
-
// Get the latest block header and checkpointed blocks for proven, finalised and checkpointed blocks
|
|
662
|
-
const [latestBlockHeader, provenCheckpointedBlock, finalizedCheckpointedBlock, checkpointedBlock] = await Promise.all([
|
|
663
|
-
latestBlockNumber > beforeInitialblockNumber ? this.getBlockHeader(latestBlockNumber) : undefined,
|
|
664
|
-
provenBlockNumber > beforeInitialblockNumber ? this.getCheckpointedBlock(provenBlockNumber) : undefined,
|
|
665
|
-
finalizedBlockNumber > beforeInitialblockNumber ? this.getCheckpointedBlock(finalizedBlockNumber) : undefined,
|
|
666
|
-
checkpointedBlockNumber > beforeInitialblockNumber ? this.getCheckpointedBlock(checkpointedBlockNumber) : undefined
|
|
667
|
-
]);
|
|
668
|
-
if (latestBlockNumber > beforeInitialblockNumber && !latestBlockHeader) {
|
|
669
|
-
throw new Error(`Failed to retrieve latest block header for block ${latestBlockNumber}`);
|
|
670
|
-
}
|
|
671
|
-
// Checkpointed blocks must exist for proven, finalized and checkpointed tips if they are beyond the initial block number.
|
|
672
|
-
if (checkpointedBlockNumber > beforeInitialblockNumber && !checkpointedBlock?.block.header) {
|
|
673
|
-
throw new Error(`Failed to retrieve checkpointed block header for block ${checkpointedBlockNumber} (latest block is ${latestBlockNumber})`);
|
|
674
|
-
}
|
|
675
|
-
if (provenBlockNumber > beforeInitialblockNumber && !provenCheckpointedBlock?.block.header) {
|
|
676
|
-
throw new Error(`Failed to retrieve proven checkpointed for block ${provenBlockNumber} (latest block is ${latestBlockNumber})`);
|
|
677
|
-
}
|
|
678
|
-
if (finalizedBlockNumber > beforeInitialblockNumber && !finalizedCheckpointedBlock?.block.header) {
|
|
679
|
-
throw new Error(`Failed to retrieve finalized block header for block ${finalizedBlockNumber} (latest block is ${latestBlockNumber})`);
|
|
680
|
-
}
|
|
681
|
-
const latestBlockHeaderHash = await latestBlockHeader?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
682
|
-
const provenBlockHeaderHash = await provenCheckpointedBlock?.block.header?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
683
|
-
const finalizedBlockHeaderHash = await finalizedCheckpointedBlock?.block.header?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
684
|
-
const checkpointedBlockHeaderHash = await checkpointedBlock?.block.header?.hash() ?? GENESIS_BLOCK_HEADER_HASH;
|
|
685
|
-
// Now attempt to retrieve checkpoints for proven, finalised and checkpointed blocks
|
|
686
|
-
const [[provenBlockCheckpoint], [finalizedBlockCheckpoint], [checkpointedBlockCheckpoint]] = await Promise.all([
|
|
687
|
-
provenCheckpointedBlock !== undefined ? await this.getCheckpoints(provenCheckpointedBlock?.checkpointNumber, 1) : [
|
|
688
|
-
undefined
|
|
689
|
-
],
|
|
690
|
-
finalizedCheckpointedBlock !== undefined ? await this.getCheckpoints(finalizedCheckpointedBlock?.checkpointNumber, 1) : [
|
|
691
|
-
undefined
|
|
692
|
-
],
|
|
693
|
-
checkpointedBlock !== undefined ? await this.getCheckpoints(checkpointedBlock?.checkpointNumber, 1) : [
|
|
694
|
-
undefined
|
|
695
|
-
]
|
|
696
|
-
]);
|
|
697
|
-
const initialcheckpointId = {
|
|
698
|
-
number: CheckpointNumber.ZERO,
|
|
699
|
-
hash: GENESIS_CHECKPOINT_HEADER_HASH.toString()
|
|
700
|
-
};
|
|
701
|
-
const makeCheckpointId = (checkpoint)=>{
|
|
702
|
-
if (checkpoint === undefined) {
|
|
703
|
-
return initialcheckpointId;
|
|
704
|
-
}
|
|
705
|
-
return {
|
|
706
|
-
number: checkpoint.checkpoint.number,
|
|
707
|
-
hash: checkpoint.checkpoint.hash().toString()
|
|
708
|
-
};
|
|
709
|
-
};
|
|
710
|
-
const l2Tips = {
|
|
711
|
-
proposed: {
|
|
712
|
-
number: latestBlockNumber,
|
|
713
|
-
hash: latestBlockHeaderHash.toString()
|
|
714
|
-
},
|
|
715
|
-
proven: {
|
|
716
|
-
block: {
|
|
717
|
-
number: provenBlockNumber,
|
|
718
|
-
hash: provenBlockHeaderHash.toString()
|
|
719
|
-
},
|
|
720
|
-
checkpoint: makeCheckpointId(provenBlockCheckpoint)
|
|
721
|
-
},
|
|
722
|
-
finalized: {
|
|
723
|
-
block: {
|
|
724
|
-
number: finalizedBlockNumber,
|
|
725
|
-
hash: finalizedBlockHeaderHash.toString()
|
|
726
|
-
},
|
|
727
|
-
checkpoint: makeCheckpointId(finalizedBlockCheckpoint)
|
|
728
|
-
},
|
|
729
|
-
checkpointed: {
|
|
730
|
-
block: {
|
|
731
|
-
number: checkpointedBlockNumber,
|
|
732
|
-
hash: checkpointedBlockHeaderHash.toString()
|
|
733
|
-
},
|
|
734
|
-
checkpoint: makeCheckpointId(checkpointedBlockCheckpoint)
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
return l2Tips;
|
|
704
|
+
getL2Tips() {
|
|
705
|
+
return this.l2TipsCache.getL2Tips();
|
|
738
706
|
}
|
|
739
707
|
async rollbackTo(targetL2BlockNumber) {
|
|
740
|
-
// TODO(pw/mbps): This still assumes 1 block per checkpoint
|
|
741
708
|
const currentBlocks = await this.getL2Tips();
|
|
742
709
|
const currentL2Block = currentBlocks.proposed.number;
|
|
743
710
|
const currentProvenBlock = currentBlocks.proven.block.number;
|
|
@@ -748,8 +715,17 @@ _dec = trackSpan('Archiver.sync');
|
|
|
748
715
|
if (!targetL2Block) {
|
|
749
716
|
throw new Error(`Target L2 block ${targetL2BlockNumber} not found`);
|
|
750
717
|
}
|
|
751
|
-
const targetL1BlockNumber = targetL2Block.l1.blockNumber;
|
|
752
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
|
+
}
|
|
728
|
+
const targetL1BlockNumber = targetL2Block.l1.blockNumber;
|
|
753
729
|
const targetL1Block = await this.publicClient.getBlock({
|
|
754
730
|
blockNumber: targetL1BlockNumber,
|
|
755
731
|
includeTransactions: false
|
|
@@ -764,18 +740,18 @@ _dec = trackSpan('Archiver.sync');
|
|
|
764
740
|
await this.store.rollbackL1ToL2MessagesToCheckpoint(targetCheckpointNumber);
|
|
765
741
|
this.log.info(`Setting L1 syncpoints to ${targetL1BlockNumber}`);
|
|
766
742
|
await this.store.setCheckpointSynchedL1BlockNumber(targetL1BlockNumber);
|
|
767
|
-
await this.store.
|
|
743
|
+
await this.store.setMessageSyncState({
|
|
768
744
|
l1BlockNumber: targetL1BlockNumber,
|
|
769
745
|
l1BlockHash: targetL1BlockHash
|
|
770
|
-
});
|
|
746
|
+
}, undefined);
|
|
771
747
|
if (targetL2BlockNumber < currentProvenBlock) {
|
|
772
|
-
this.log.info(`
|
|
773
|
-
await this.
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
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
|
+
}
|
|
780
756
|
}
|
|
781
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,eyJ2ZXJz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],"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,
|
|
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
|
}
|