@aztec/archiver 0.0.1-commit.29c6b1a3 → 0.0.1-commit.2c0ee1788
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 +26 -15
- package/dest/archiver.d.ts.map +1 -1
- package/dest/archiver.js +169 -148
- package/dest/config.d.ts +5 -3
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +16 -4
- package/dest/errors.d.ts +61 -10
- package/dest/errors.d.ts.map +1 -1
- package/dest/errors.js +88 -14
- package/dest/factory.d.ts +6 -7
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +41 -34
- package/dest/index.d.ts +11 -3
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +10 -2
- package/dest/l1/bin/retrieve-calldata.js +36 -33
- package/dest/l1/calldata_retriever.d.ts +74 -50
- package/dest/l1/calldata_retriever.d.ts.map +1 -1
- package/dest/l1/calldata_retriever.js +197 -260
- 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/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 +42 -0
- package/dest/modules/data_source_base.d.ts +30 -17
- package/dest/modules/data_source_base.d.ts.map +1 -1
- package/dest/modules/data_source_base.js +98 -125
- package/dest/modules/data_store_updater.d.ts +37 -17
- package/dest/modules/data_store_updater.d.ts.map +1 -1
- package/dest/modules/data_store_updater.js +155 -112
- 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 +13 -11
- package/dest/modules/l1_synchronizer.d.ts.map +1 -1
- package/dest/modules/l1_synchronizer.js +334 -181
- package/dest/modules/validation.d.ts +4 -3
- package/dest/modules/validation.d.ts.map +1 -1
- package/dest/modules/validation.js +6 -6
- package/dest/store/block_store.d.ts +108 -32
- package/dest/store/block_store.d.ts.map +1 -1
- package/dest/store/block_store.js +477 -141
- package/dest/store/contract_class_store.d.ts +17 -4
- package/dest/store/contract_class_store.d.ts.map +1 -1
- package/dest/store/contract_class_store.js +33 -73
- package/dest/store/contract_instance_store.d.ts +28 -1
- package/dest/store/contract_instance_store.d.ts.map +1 -1
- package/dest/store/contract_instance_store.js +37 -2
- 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 +50 -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 +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 +25 -1
- package/dest/test/fake_l1_state.d.ts.map +1 -1
- package/dest/test/fake_l1_state.js +166 -32
- package/dest/test/index.d.ts +1 -2
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +3 -2
- 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 +38 -8
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +183 -90
- 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 +7 -4
- package/dest/test/noop_l1_archiver.d.ts.map +1 -1
- package/dest/test/noop_l1_archiver.js +14 -8
- package/package.json +14 -13
- package/src/archiver.ts +215 -170
- package/src/config.ts +23 -2
- package/src/errors.ts +133 -22
- package/src/factory.ts +54 -32
- package/src/index.ts +18 -2
- package/src/l1/README.md +25 -68
- package/src/l1/bin/retrieve-calldata.ts +46 -39
- package/src/l1/calldata_retriever.ts +261 -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/contract_data_source_adapter.ts +59 -0
- package/src/modules/data_source_base.ts +145 -147
- package/src/modules/data_store_updater.ts +187 -141
- package/src/modules/instrumentation.ts +71 -19
- package/src/modules/l1_synchronizer.ts +419 -219
- package/src/modules/validation.ts +10 -9
- package/src/store/block_store.ts +589 -179
- package/src/store/contract_class_store.ts +39 -107
- package/src/store/contract_instance_store.ts +51 -5
- package/src/store/data_stores.ts +108 -0
- package/src/store/function_names_cache.ts +37 -0
- package/src/store/l2_tips_cache.ts +134 -0
- package/src/store/log_store.ts +222 -64
- package/src/store/message_store.ts +27 -10
- package/src/structs/inbox_message.ts +1 -1
- package/src/test/fake_l1_state.ts +213 -42
- package/src/test/index.ts +3 -1
- 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 +235 -87
- package/src/test/mock_structs.ts +20 -6
- package/src/test/noop_l1_archiver.ts +16 -8
- package/dest/store/kv_archiver_store.d.ts +0 -340
- package/dest/store/kv_archiver_store.d.ts.map +0 -1
- package/dest/store/kv_archiver_store.js +0 -447
- package/src/store/kv_archiver_store.ts +0 -639
package/dest/archiver.js
CHANGED
|
@@ -371,23 +371,25 @@ 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, getTimestampForSlot, 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, BlockOrCheckpointSlotExpiredError, 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 { backupArchiverDataStores, getArchiverSynchPoint } from './store/data_stores.js';
|
|
392
|
+
import { L2TipsCache } from './store/l2_tips_cache.js';
|
|
391
393
|
_dec = trackSpan('Archiver.sync');
|
|
392
394
|
/**
|
|
393
395
|
* Pulls checkpoints in a non-blocking manner and provides interface for their retrieval.
|
|
@@ -398,7 +400,7 @@ _dec = trackSpan('Archiver.sync');
|
|
|
398
400
|
debugClient;
|
|
399
401
|
rollup;
|
|
400
402
|
l1Addresses;
|
|
401
|
-
|
|
403
|
+
dataStores;
|
|
402
404
|
config;
|
|
403
405
|
blobClient;
|
|
404
406
|
l1Constants;
|
|
@@ -417,31 +419,36 @@ _dec = trackSpan('Archiver.sync');
|
|
|
417
419
|
/** L1 synchronizer that handles fetching checkpoints and messages from L1. */ synchronizer;
|
|
418
420
|
initialSyncComplete;
|
|
419
421
|
initialSyncPromise;
|
|
420
|
-
/** Queue of blocks to be added to the store, processed by the sync loop. */
|
|
422
|
+
/** Queue of blocks and checkpoints to be added to the store, processed by the sync loop. */ inboundQueue;
|
|
421
423
|
/** Helper to handle updates to the store */ updater;
|
|
424
|
+
/** In-memory cache for L2 chain tips. */ l2TipsCache;
|
|
422
425
|
tracer;
|
|
426
|
+
instrumentation;
|
|
423
427
|
/**
|
|
424
428
|
* Creates a new instance of the Archiver.
|
|
425
429
|
* @param publicClient - A client for interacting with the Ethereum node.
|
|
426
430
|
* @param debugClient - A client for interacting with the Ethereum node for debug/trace methods.
|
|
427
431
|
* @param rollup - Rollup contract instance.
|
|
428
432
|
* @param inbox - Inbox contract instance.
|
|
429
|
-
* @param l1Addresses - L1 contract addresses (registry, governance proposer,
|
|
430
|
-
* @param
|
|
433
|
+
* @param l1Addresses - L1 contract addresses (registry, governance proposer, slashing proposer).
|
|
434
|
+
* @param dataStores - Archiver substores for storage & retrieval of blocks, encrypted logs & contract data.
|
|
431
435
|
* @param config - Archiver configuration options.
|
|
432
436
|
* @param blobClient - Client for retrieving blob data.
|
|
433
|
-
* @param epochCache - Cache for epoch-related data.
|
|
434
437
|
* @param dateProvider - Provider for current date/time.
|
|
435
438
|
* @param instrumentation - Instrumentation for metrics and tracing.
|
|
436
439
|
* @param l1Constants - L1 rollup constants.
|
|
437
440
|
* @param log - A logger.
|
|
438
|
-
*/ constructor(publicClient, debugClient, rollup, l1Addresses,
|
|
439
|
-
super(
|
|
441
|
+
*/ constructor(publicClient, debugClient, rollup, l1Addresses, dataStores, config, blobClient, instrumentation, l1Constants, synchronizer, events, l2TipsCache, log = createLogger('archiver')){
|
|
442
|
+
super(dataStores, l1Constants), this.publicClient = publicClient, this.debugClient = debugClient, this.rollup = rollup, this.l1Addresses = l1Addresses, this.dataStores = dataStores, this.config = config, this.blobClient = blobClient, this.l1Constants = l1Constants, this.log = log, this.initialSyncComplete = (_initProto(this), false), this.inboundQueue = [];
|
|
440
443
|
this.tracer = instrumentation.tracer;
|
|
444
|
+
this.instrumentation = instrumentation;
|
|
441
445
|
this.initialSyncPromise = promiseWithResolvers();
|
|
442
446
|
this.synchronizer = synchronizer;
|
|
443
447
|
this.events = events;
|
|
444
|
-
this.
|
|
448
|
+
this.l2TipsCache = l2TipsCache ?? new L2TipsCache(this.dataStores.blocks);
|
|
449
|
+
this.updater = new ArchiverDataStoreUpdater(this.dataStores, this.l2TipsCache, {
|
|
450
|
+
rollupManaLimit: l1Constants.rollupManaLimit
|
|
451
|
+
});
|
|
445
452
|
// Running promise starts with a small interval inbetween runs, so all iterations needed for the initial sync
|
|
446
453
|
// are done as fast as possible. This then gets updated once the initial sync completes.
|
|
447
454
|
this.runningPromise = new RunningPromise(()=>this.sync(), this.log, this.config.pollingIntervalMs / 10, makeLoggingErrorHandler(this.log, NoBlobBodiesFoundError, BlockTagTooOldError));
|
|
@@ -459,10 +466,16 @@ _dec = trackSpan('Archiver.sync');
|
|
|
459
466
|
}
|
|
460
467
|
await this.blobClient.testSources();
|
|
461
468
|
await this.synchronizer.testEthereumNodeSynced();
|
|
462
|
-
await validateAndLogTraceAvailability(this.debugClient, this.config.ethereumAllowNoDebugHosts ?? false);
|
|
469
|
+
await validateAndLogTraceAvailability(this.debugClient, this.config.ethereumAllowNoDebugHosts ?? false, this.log.getBindings());
|
|
470
|
+
await validateAndLogHistoricalLogsAvailability(this.publicClient, {
|
|
471
|
+
rollupAddress: this.l1Addresses.rollupAddress,
|
|
472
|
+
inboxAddress: this.l1Addresses.inboxAddress,
|
|
473
|
+
registryAddress: this.l1Addresses.registryAddress,
|
|
474
|
+
governanceProposerAddress: this.l1Addresses.governanceProposerAddress
|
|
475
|
+
}, this.config.skipHistoricalLogsCheck ?? false, this.log.getBindings());
|
|
463
476
|
// Log initial state for the archiver
|
|
464
477
|
const { l1StartBlock } = this.l1Constants;
|
|
465
|
-
const { blocksSynchedTo = l1StartBlock, messagesSynchedTo = l1StartBlock } = await this.
|
|
478
|
+
const { blocksSynchedTo = l1StartBlock, messagesSynchedTo = l1StartBlock } = await getArchiverSynchPoint(this.stores);
|
|
466
479
|
const currentL2Checkpoint = await this.getSynchedCheckpointNumber();
|
|
467
480
|
this.log.info(`Starting archiver sync to rollup contract ${this.rollup.address} from L1 block ${blocksSynchedTo} and L2 checkpoint ${currentL2Checkpoint}`, {
|
|
468
481
|
blocksSynchedTo,
|
|
@@ -478,6 +491,13 @@ _dec = trackSpan('Archiver.sync');
|
|
|
478
491
|
syncImmediate() {
|
|
479
492
|
return this.runningPromise.trigger();
|
|
480
493
|
}
|
|
494
|
+
trySyncImmediate() {
|
|
495
|
+
try {
|
|
496
|
+
return this.syncImmediate();
|
|
497
|
+
} catch (err) {
|
|
498
|
+
this.log.error(`Failed to trigger immediate archiver sync: ${err}`, err);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
481
501
|
/**
|
|
482
502
|
* Queues a block to be added to the archiver store and triggers processing.
|
|
483
503
|
* The block will be processed by the sync loop.
|
|
@@ -485,40 +505,84 @@ _dec = trackSpan('Archiver.sync');
|
|
|
485
505
|
* @param block - The L2 block to add.
|
|
486
506
|
* @returns A promise that resolves when the block has been added to the store, or rejects on error.
|
|
487
507
|
*/ addBlock(block) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
});
|
|
494
|
-
this.log.debug(`Queued block ${block.number} for processing`);
|
|
495
|
-
// Trigger an immediate sync, but don't wait for it - the promise resolves when the block is processed
|
|
496
|
-
this.syncImmediate().catch((err)=>{
|
|
497
|
-
this.log.error(`Sync immediate call failed: ${err}`);
|
|
498
|
-
});
|
|
508
|
+
const promise = promiseWithResolvers();
|
|
509
|
+
this.inboundQueue.push({
|
|
510
|
+
block,
|
|
511
|
+
...promise,
|
|
512
|
+
type: 'block'
|
|
499
513
|
});
|
|
514
|
+
this.log.debug(`Queued block ${block.number} for processing`);
|
|
515
|
+
void this.trySyncImmediate();
|
|
516
|
+
return promise.promise;
|
|
500
517
|
}
|
|
501
518
|
/**
|
|
502
|
-
*
|
|
519
|
+
* Queues a new proposed checkpoint into the archiver store.
|
|
520
|
+
* Checks that the checkpoint is not for an L2 slot already synced from L1.
|
|
521
|
+
* Resolves once the checkpoint has been processed.
|
|
522
|
+
*/ addProposedCheckpoint(pending) {
|
|
523
|
+
const promise = promiseWithResolvers();
|
|
524
|
+
this.inboundQueue.push({
|
|
525
|
+
checkpoint: pending,
|
|
526
|
+
...promise,
|
|
527
|
+
type: 'checkpoint'
|
|
528
|
+
});
|
|
529
|
+
this.log.debug(`Queued checkpoint ${pending.checkpointNumber} for processing`);
|
|
530
|
+
void this.trySyncImmediate();
|
|
531
|
+
return promise.promise;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Processes all queued blocks and checkpoints, adding them to the store.
|
|
503
535
|
* Called at the beginning of each sync iteration.
|
|
504
|
-
*
|
|
505
|
-
*/ async
|
|
506
|
-
if (this.
|
|
536
|
+
* Items are processed in the order they were queued.
|
|
537
|
+
*/ async processInboundQueue() {
|
|
538
|
+
if (this.inboundQueue.length === 0) {
|
|
507
539
|
return;
|
|
508
540
|
}
|
|
509
|
-
// Take all
|
|
510
|
-
const queuedItems = this.
|
|
511
|
-
this.log.debug(`Processing ${queuedItems.length} queued
|
|
512
|
-
//
|
|
513
|
-
|
|
541
|
+
// Take all items from the queue
|
|
542
|
+
const queuedItems = this.inboundQueue.splice(0, this.inboundQueue.length);
|
|
543
|
+
this.log.debug(`Processing ${queuedItems.length} queued inbound items`);
|
|
544
|
+
// Calculate slot threshold for validation
|
|
545
|
+
const l1Timestamp = this.synchronizer.getL1Timestamp();
|
|
546
|
+
const slotAtNextL1Block = l1Timestamp === undefined ? undefined : getSlotAtNextL1Block(l1Timestamp, this.l1Constants);
|
|
547
|
+
// Helpers for manipulating blocks and checkpoints in the queue
|
|
548
|
+
const getSlot = (item)=>item.type === 'block' ? item.block.header.globalVariables.slotNumber : item.checkpoint.header.slotNumber;
|
|
549
|
+
const getNumber = (item)=>item.type === 'block' ? item.block.number : item.checkpoint.checkpointNumber;
|
|
550
|
+
// Process each item individually to properly resolve/reject each promise
|
|
551
|
+
for (const item of queuedItems){
|
|
552
|
+
const { resolve, reject, type } = item;
|
|
553
|
+
const itemSlot = getSlot(item);
|
|
554
|
+
const itemNumber = getNumber(item);
|
|
555
|
+
if (slotAtNextL1Block !== undefined && itemSlot < slotAtNextL1Block) {
|
|
556
|
+
const nextSlotTimestamp = getTimestampForSlot(slotAtNextL1Block, this.l1Constants);
|
|
557
|
+
this.log.warn(`Rejecting proposed ${type} ${itemNumber} for past slot ${itemSlot} (current ${slotAtNextL1Block})`, {
|
|
558
|
+
number: itemNumber,
|
|
559
|
+
type,
|
|
560
|
+
l1Timestamp,
|
|
561
|
+
slotAtNextL1Block,
|
|
562
|
+
nextSlotTimestamp
|
|
563
|
+
});
|
|
564
|
+
reject(new BlockOrCheckpointSlotExpiredError(itemSlot, nextSlotTimestamp, l1Timestamp));
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
514
567
|
try {
|
|
515
|
-
|
|
516
|
-
block
|
|
517
|
-
|
|
518
|
-
|
|
568
|
+
if (type === 'block') {
|
|
569
|
+
const [durationMs] = await elapsed(()=>this.updater.addProposedBlock(item.block));
|
|
570
|
+
this.instrumentation.processNewProposedBlock(durationMs, item.block);
|
|
571
|
+
} else {
|
|
572
|
+
await this.updater.addProposedCheckpoint(item.checkpoint);
|
|
573
|
+
}
|
|
574
|
+
this.log.debug(`Added ${type} ${itemNumber} to store`);
|
|
519
575
|
resolve();
|
|
520
576
|
} catch (err) {
|
|
521
|
-
|
|
577
|
+
if (err instanceof BlockAlreadyCheckpointedError) {
|
|
578
|
+
this.log.debug(`Proposed block ${itemNumber} matches already checkpointed block, ignoring late proposal`);
|
|
579
|
+
resolve();
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
this.log.error(`Failed to add ${type} ${itemNumber} to store: ${err.message}`, err, {
|
|
583
|
+
number: itemNumber,
|
|
584
|
+
type
|
|
585
|
+
});
|
|
522
586
|
reject(err);
|
|
523
587
|
}
|
|
524
588
|
}
|
|
@@ -530,7 +594,7 @@ _dec = trackSpan('Archiver.sync');
|
|
|
530
594
|
* Fetches logs from L1 contracts and processes them.
|
|
531
595
|
*/ async sync() {
|
|
532
596
|
// Process any queued blocks first, before doing L1 sync
|
|
533
|
-
await this.
|
|
597
|
+
await this.processInboundQueue();
|
|
534
598
|
// Now perform L1 sync
|
|
535
599
|
await this.syncFromL1();
|
|
536
600
|
}
|
|
@@ -544,7 +608,7 @@ _dec = trackSpan('Archiver.sync');
|
|
|
544
608
|
if (currentL1BlockNumber + 1n >= l1BlockNumberAtEnd) {
|
|
545
609
|
this.log.info(`Initial archiver sync to L1 block ${currentL1BlockNumber} complete`, {
|
|
546
610
|
l1BlockNumber: currentL1BlockNumber,
|
|
547
|
-
syncPoint: await this.
|
|
611
|
+
syncPoint: await getArchiverSynchPoint(this.stores),
|
|
548
612
|
...await this.getL2Tips()
|
|
549
613
|
});
|
|
550
614
|
this.runningPromise.setPollingIntervalMS(this.config.pollingIntervalMs);
|
|
@@ -570,7 +634,7 @@ _dec = trackSpan('Archiver.sync');
|
|
|
570
634
|
return Promise.resolve();
|
|
571
635
|
}
|
|
572
636
|
backupTo(destPath) {
|
|
573
|
-
return this.
|
|
637
|
+
return backupArchiverDataStores(this.dataStores, destPath);
|
|
574
638
|
}
|
|
575
639
|
getL1Constants() {
|
|
576
640
|
return Promise.resolve(this.l1Constants);
|
|
@@ -592,13 +656,45 @@ _dec = trackSpan('Archiver.sync');
|
|
|
592
656
|
getL1Timestamp() {
|
|
593
657
|
return Promise.resolve(this.synchronizer.getL1Timestamp());
|
|
594
658
|
}
|
|
595
|
-
|
|
659
|
+
async getSyncedL2SlotNumber() {
|
|
660
|
+
// The synced L2 slot is the latest slot for which we have all L1 data,
|
|
661
|
+
// either because we have seen all L1 blocks for that slot, or because
|
|
662
|
+
// we have seen the corresponding checkpoint.
|
|
663
|
+
let slotFromL1Sync;
|
|
596
664
|
const l1Timestamp = this.synchronizer.getL1Timestamp();
|
|
597
|
-
|
|
665
|
+
if (l1Timestamp !== undefined) {
|
|
666
|
+
const nextL1BlockSlot = getSlotAtNextL1Block(l1Timestamp, this.l1Constants);
|
|
667
|
+
if (Number(nextL1BlockSlot) > 0) {
|
|
668
|
+
slotFromL1Sync = SlotNumber.add(nextL1BlockSlot, -1);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
let slotFromCheckpoint;
|
|
672
|
+
const latestCheckpointNumber = await this.stores.blocks.getLatestCheckpointNumber();
|
|
673
|
+
if (latestCheckpointNumber > 0) {
|
|
674
|
+
const checkpointData = await this.stores.blocks.getCheckpointData(latestCheckpointNumber);
|
|
675
|
+
if (checkpointData) {
|
|
676
|
+
slotFromCheckpoint = checkpointData.header.slotNumber;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (slotFromL1Sync === undefined && slotFromCheckpoint === undefined) {
|
|
680
|
+
return undefined;
|
|
681
|
+
}
|
|
682
|
+
return SlotNumber(Math.max(slotFromL1Sync ?? 0, slotFromCheckpoint ?? 0));
|
|
598
683
|
}
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
684
|
+
async getSyncedL2EpochNumber() {
|
|
685
|
+
const syncedSlot = await this.getSyncedL2SlotNumber();
|
|
686
|
+
if (syncedSlot === undefined) {
|
|
687
|
+
return undefined;
|
|
688
|
+
}
|
|
689
|
+
// An epoch is fully synced when all its slots are synced.
|
|
690
|
+
// We check if syncedSlot is the last slot of its epoch; if so, that epoch is fully synced.
|
|
691
|
+
// Otherwise, only the previous epoch is fully synced.
|
|
692
|
+
const epoch = getEpochAtSlot(syncedSlot, this.l1Constants);
|
|
693
|
+
const [, endSlot] = getSlotRangeForEpoch(epoch, this.l1Constants);
|
|
694
|
+
if (syncedSlot >= endSlot) {
|
|
695
|
+
return epoch;
|
|
696
|
+
}
|
|
697
|
+
return Number(epoch) > 0 ? EpochNumber(Number(epoch) - 1) : undefined;
|
|
602
698
|
}
|
|
603
699
|
async isEpochComplete(epochNumber) {
|
|
604
700
|
// The epoch is complete if the current checkpointed L2 block is the last one in the epoch (or later).
|
|
@@ -637,106 +733,31 @@ _dec = trackSpan('Archiver.sync');
|
|
|
637
733
|
await this.updater.addCheckpoints(checkpoints, pendingChainValidationStatus);
|
|
638
734
|
return true;
|
|
639
735
|
}
|
|
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;
|
|
736
|
+
getL2Tips() {
|
|
737
|
+
return this.l2TipsCache.getL2Tips();
|
|
725
738
|
}
|
|
726
739
|
async rollbackTo(targetL2BlockNumber) {
|
|
727
|
-
// TODO(pw/mbps): This still assumes 1 block per checkpoint
|
|
728
740
|
const currentBlocks = await this.getL2Tips();
|
|
729
741
|
const currentL2Block = currentBlocks.proposed.number;
|
|
730
742
|
const currentProvenBlock = currentBlocks.proven.block.number;
|
|
731
743
|
if (targetL2BlockNumber >= currentL2Block) {
|
|
732
744
|
throw new Error(`Target L2 block ${targetL2BlockNumber} must be less than current L2 block ${currentL2Block}`);
|
|
733
745
|
}
|
|
734
|
-
const targetL2Block = await this.
|
|
746
|
+
const targetL2Block = await this.stores.blocks.getCheckpointedBlock(targetL2BlockNumber);
|
|
735
747
|
if (!targetL2Block) {
|
|
736
748
|
throw new Error(`Target L2 block ${targetL2BlockNumber} not found`);
|
|
737
749
|
}
|
|
738
|
-
const targetL1BlockNumber = targetL2Block.l1.blockNumber;
|
|
739
750
|
const targetCheckpointNumber = targetL2Block.checkpointNumber;
|
|
751
|
+
// Rollback operates at checkpoint granularity: the target block must be the last block of its checkpoint.
|
|
752
|
+
const checkpointData = await this.stores.blocks.getCheckpointData(targetCheckpointNumber);
|
|
753
|
+
if (checkpointData) {
|
|
754
|
+
const lastBlockInCheckpoint = BlockNumber(checkpointData.startBlock + checkpointData.blockCount - 1);
|
|
755
|
+
if (targetL2BlockNumber !== lastBlockInCheckpoint) {
|
|
756
|
+
const previousCheckpointBoundary = checkpointData.startBlock > 1 ? BlockNumber(checkpointData.startBlock - 1) : BlockNumber(0);
|
|
757
|
+
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.`);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const targetL1BlockNumber = targetL2Block.l1.blockNumber;
|
|
740
761
|
const targetL1Block = await this.publicClient.getBlock({
|
|
741
762
|
blockNumber: targetL1BlockNumber,
|
|
742
763
|
includeTransactions: false
|
|
@@ -748,21 +769,21 @@ _dec = trackSpan('Archiver.sync');
|
|
|
748
769
|
this.log.info(`Removing checkpoints after checkpoint ${targetCheckpointNumber} (target block ${targetL2BlockNumber})`);
|
|
749
770
|
await this.updater.removeCheckpointsAfter(targetCheckpointNumber);
|
|
750
771
|
this.log.info(`Rolling back L1 to L2 messages to checkpoint ${targetCheckpointNumber}`);
|
|
751
|
-
await this.
|
|
772
|
+
await this.stores.messages.rollbackL1ToL2MessagesToCheckpoint(targetCheckpointNumber);
|
|
752
773
|
this.log.info(`Setting L1 syncpoints to ${targetL1BlockNumber}`);
|
|
753
|
-
await this.
|
|
754
|
-
await this.
|
|
774
|
+
await this.stores.blocks.setSynchedL1BlockNumber(targetL1BlockNumber);
|
|
775
|
+
await this.stores.messages.setMessageSyncState({
|
|
755
776
|
l1BlockNumber: targetL1BlockNumber,
|
|
756
777
|
l1BlockHash: targetL1BlockHash
|
|
757
|
-
});
|
|
778
|
+
}, undefined);
|
|
758
779
|
if (targetL2BlockNumber < currentProvenBlock) {
|
|
759
|
-
this.log.info(`
|
|
760
|
-
await this.
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
780
|
+
this.log.info(`Rolling back proven L2 checkpoint to ${targetCheckpointNumber}`);
|
|
781
|
+
await this.updater.setProvenCheckpointNumber(targetCheckpointNumber);
|
|
782
|
+
}
|
|
783
|
+
const currentFinalizedBlock = currentBlocks.finalized.block.number;
|
|
784
|
+
if (targetL2BlockNumber < currentFinalizedBlock) {
|
|
785
|
+
this.log.info(`Rolling back finalized L2 checkpoint to ${targetCheckpointNumber}`);
|
|
786
|
+
await this.updater.setFinalizedCheckpointNumber(targetCheckpointNumber);
|
|
787
|
+
}
|
|
767
788
|
}
|
|
768
789
|
}
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGdCQUFnQixFQUEyQixNQUFNLGtDQUFrQyxDQUFDO0FBQ2xHLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUE2QixNQUFNLHdCQUF3QixDQUFDO0FBRTNGLE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBMEIsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFLeEIsTUFBTSwwQkFBMEIsQ0FBQztBQUNsQyxPQUFPLEVBQ0wsS0FBSyxXQUFXLEVBQ2hCLEtBQUssY0FBYyxFQUdwQixNQUFNLHNCQUFzQixDQUFDO0FBQzlCLE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFOUU7Ozs7OztHQU1HO0FBQ0gsTUFBTSxNQUFNLGNBQWMsR0FBRyxzQkFBc0IsR0FDakQsY0FBYyxHQUNkLGlCQUFpQixHQUNqQixjQUFjLEdBQ2QsZ0JBQWdCLEdBQ2hCLFdBQVcsQ0FBQztBQUVkLGVBQU8sTUFBTSxzQkFBc0IsRUFBRSxrQkFBa0IsQ0FBQyxjQUFjLENBNERyRSxDQUFDO0FBRUY7Ozs7R0FJRztBQUNILHdCQUFnQix3QkFBd0IsSUFBSSxjQUFjLENBRXpEO0FBRUQsZ0ZBQWdGO0FBQ2hGLHdCQUFnQixpQkFBaUIsQ0FBQyxNQUFNLEVBQUUsT0FBTyxDQUFDLGNBQWMsQ0FBQzs7Ozs7Ozs7RUFVaEUifQ==
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAKxB,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
|
@@ -2,10 +2,11 @@ import { blobClientConfigMapping } from '@aztec/blob-client/client/config';
|
|
|
2
2
|
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
|
-
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
|
|
6
|
-
import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
5
|
+
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, optionalNumberConfigHelper } from '@aztec/foundation/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
|
-
|
|
27
|
+
...optionalNumberConfigHelper(),
|
|
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
|
}
|