@aztec/archiver 0.0.1-commit.f5d02921e → 0.0.1-commit.f7ea82942
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 +5 -3
- package/dest/archiver.d.ts.map +1 -1
- package/dest/archiver.js +15 -4
- package/dest/config.d.ts +3 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +13 -2
- package/dest/errors.d.ts +17 -1
- package/dest/errors.d.ts.map +1 -1
- package/dest/errors.js +22 -0
- package/dest/factory.d.ts +1 -1
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +2 -1
- package/dest/index.d.ts +3 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +2 -1
- package/dest/l1/data_retrieval.d.ts +19 -10
- package/dest/l1/data_retrieval.d.ts.map +1 -1
- package/dest/l1/data_retrieval.js +25 -32
- 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_store_updater.d.ts +12 -5
- package/dest/modules/data_store_updater.d.ts.map +1 -1
- package/dest/modules/data_store_updater.js +13 -3
- package/dest/modules/instrumentation.d.ts +7 -2
- package/dest/modules/instrumentation.d.ts.map +1 -1
- package/dest/modules/instrumentation.js +22 -6
- package/dest/modules/l1_synchronizer.d.ts +6 -2
- package/dest/modules/l1_synchronizer.d.ts.map +1 -1
- package/dest/modules/l1_synchronizer.js +213 -124
- package/dest/store/block_store.d.ts +11 -3
- package/dest/store/block_store.d.ts.map +1 -1
- package/dest/store/block_store.js +88 -6
- package/dest/store/kv_archiver_store.d.ts +11 -9
- package/dest/store/kv_archiver_store.d.ts.map +1 -1
- package/dest/store/kv_archiver_store.js +9 -7
- package/dest/store/l2_tips_cache.d.ts +1 -1
- package/dest/store/l2_tips_cache.d.ts.map +1 -1
- package/dest/store/l2_tips_cache.js +2 -2
- package/dest/store/log_store.d.ts +1 -1
- package/dest/store/log_store.d.ts.map +1 -1
- package/dest/store/log_store.js +2 -4
- package/dest/store/message_store.d.ts +3 -3
- package/dest/store/message_store.d.ts.map +1 -1
- package/dest/store/message_store.js +9 -10
- package/dest/test/fake_l1_state.d.ts +14 -3
- package/dest/test/fake_l1_state.d.ts.map +1 -1
- package/dest/test/fake_l1_state.js +55 -10
- package/dest/test/noop_l1_archiver.d.ts +1 -1
- package/dest/test/noop_l1_archiver.d.ts.map +1 -1
- package/dest/test/noop_l1_archiver.js +4 -2
- package/package.json +13 -13
- package/src/archiver.ts +28 -6
- package/src/config.ts +14 -1
- package/src/errors.ts +34 -0
- package/src/factory.ts +1 -0
- package/src/index.ts +2 -1
- package/src/l1/data_retrieval.ts +36 -45
- package/src/l1/validate_historical_logs.ts +140 -0
- package/src/modules/data_store_updater.ts +27 -3
- package/src/modules/instrumentation.ts +27 -7
- package/src/modules/l1_synchronizer.ts +274 -148
- package/src/store/block_store.ts +112 -4
- package/src/store/kv_archiver_store.ts +18 -10
- package/src/store/l2_tips_cache.ts +8 -2
- package/src/store/log_store.ts +2 -5
- package/src/store/message_store.ts +10 -12
- package/src/structs/inbox_message.ts +1 -1
- package/src/test/fake_l1_state.ts +75 -13
- package/src/test/noop_l1_archiver.ts +3 -1
|
@@ -371,21 +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, _dec1, _dec2, _dec3, _initProto;
|
|
374
|
+
import { getFinalizedL1Block } from '@aztec/ethereum/queries';
|
|
374
375
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
375
376
|
import { maxBigint } from '@aztec/foundation/bigint';
|
|
376
377
|
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
377
378
|
import { Buffer16, Buffer32 } from '@aztec/foundation/buffer';
|
|
378
|
-
import { pick } from '@aztec/foundation/collection';
|
|
379
|
+
import { partition, pick } from '@aztec/foundation/collection';
|
|
379
380
|
import { createLogger } from '@aztec/foundation/log';
|
|
381
|
+
import { retryTimes } from '@aztec/foundation/retry';
|
|
380
382
|
import { count } from '@aztec/foundation/string';
|
|
381
383
|
import { Timer, elapsed } from '@aztec/foundation/timer';
|
|
382
|
-
import { isDefined } from '@aztec/foundation/types';
|
|
384
|
+
import { isDefined, isErrorClass } from '@aztec/foundation/types';
|
|
383
385
|
import { L2BlockSourceEvents } from '@aztec/stdlib/block';
|
|
386
|
+
import { Checkpoint, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
384
387
|
import { getEpochAtSlot, getSlotAtNextL1Block } from '@aztec/stdlib/epoch-helpers';
|
|
385
388
|
import { computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
|
|
386
389
|
import { execInSpan, trackSpan } from '@aztec/telemetry-client';
|
|
387
390
|
import { InitialCheckpointNumberNotSequentialError } from '../errors.js';
|
|
388
|
-
import {
|
|
391
|
+
import { getCheckpointBlobDataFromBlobs, retrieveCheckpointCalldataFromRollup, retrieveL1ToL2Message, retrieveL1ToL2Messages, retrievedToPublishedCheckpoint } from '../l1/data_retrieval.js';
|
|
392
|
+
import { MessageStoreError } from '../store/message_store.js';
|
|
389
393
|
import { ArchiverDataStoreUpdater } from './data_store_updater.js';
|
|
390
394
|
import { validateCheckpointAttestations } from './validation.js';
|
|
391
395
|
_dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpochPrune'), _dec2 = trackSpan('Archiver.handleL1ToL2Messages'), _dec3 = trackSpan('Archiver.handleCheckpoints');
|
|
@@ -478,12 +482,20 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
478
482
|
}
|
|
479
483
|
}
|
|
480
484
|
async syncFromL1(initialSyncComplete) {
|
|
485
|
+
// In between the various calls to L1, the block number can move meaning some of the following
|
|
486
|
+
// calls will return data for blocks that were not present during earlier calls. To combat this
|
|
487
|
+
// we ensure that all data retrieval methods only retrieve data up to the currentBlockNumber
|
|
488
|
+
// captured at the top of this function.
|
|
481
489
|
const currentL1Block = await this.publicClient.getBlock({
|
|
482
490
|
includeTransactions: false
|
|
483
491
|
});
|
|
484
492
|
const currentL1BlockNumber = currentL1Block.number;
|
|
485
493
|
const currentL1BlockHash = Buffer32.fromString(currentL1Block.hash);
|
|
486
494
|
const currentL1Timestamp = currentL1Block.timestamp;
|
|
495
|
+
const currentL1BlockData = {
|
|
496
|
+
l1BlockNumber: currentL1BlockNumber,
|
|
497
|
+
l1BlockHash: currentL1BlockHash
|
|
498
|
+
};
|
|
487
499
|
if (this.l1BlockHash && currentL1BlockHash.equals(this.l1BlockHash)) {
|
|
488
500
|
this.log.trace(`No new L1 blocks since last sync at L1 block ${this.l1BlockNumber}`);
|
|
489
501
|
return;
|
|
@@ -499,36 +511,16 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
499
511
|
maxAllowedDelay
|
|
500
512
|
});
|
|
501
513
|
}
|
|
502
|
-
// Load sync point for blocks
|
|
503
|
-
const { blocksSynchedTo = this.l1Constants.l1StartBlock
|
|
504
|
-
l1BlockNumber: this.l1Constants.l1StartBlock,
|
|
505
|
-
l1BlockHash: this.l1Constants.l1StartBlockHash
|
|
506
|
-
} } = await this.store.getSynchPoint();
|
|
514
|
+
// Load sync point for blocks defaulting to start block
|
|
515
|
+
const { blocksSynchedTo = this.l1Constants.l1StartBlock } = await this.store.getSynchPoint();
|
|
507
516
|
this.log.debug(`Starting new archiver sync iteration`, {
|
|
508
517
|
blocksSynchedTo,
|
|
509
|
-
|
|
510
|
-
currentL1BlockNumber,
|
|
511
|
-
currentL1BlockHash
|
|
518
|
+
currentL1BlockData
|
|
512
519
|
});
|
|
513
|
-
//
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
* to ensure that data is read exactly once.
|
|
518
|
-
*
|
|
519
|
-
* The first is the problem of eventually consistent ETH service providers like Infura.
|
|
520
|
-
* Each L1 read operation will query data from the last L1 block that it saw emit its kind of data.
|
|
521
|
-
* (so pending L1 to L2 messages will read from the last L1 block that emitted a message and so on)
|
|
522
|
-
* This will mean the archiver will lag behind L1 and will only advance when there's L2-relevant activity on the chain.
|
|
523
|
-
*
|
|
524
|
-
* The second is that in between the various calls to L1, the block number can move meaning some
|
|
525
|
-
* of the following calls will return data for blocks that were not present during earlier calls.
|
|
526
|
-
* To combat this for the time being we simply ensure that all data retrieval methods only retrieve
|
|
527
|
-
* data up to the currentBlockNumber captured at the top of this function. We might want to improve on this
|
|
528
|
-
* in future but for the time being it should give us the guarantees that we need
|
|
529
|
-
*/ // ********** Events that are processed per L1 block **********
|
|
530
|
-
await this.handleL1ToL2Messages(messagesSynchedTo, currentL1BlockNumber);
|
|
531
|
-
// ********** Events that are processed per checkpoint **********
|
|
520
|
+
// Sync L1 to L2 messages. We retry this a few times since there are error conditions that reset the sync point, requiring a new iteration.
|
|
521
|
+
// Note that we cannot just wait for the l1 synchronizer to loop again, since the synchronizer would report as synced up to the current L1
|
|
522
|
+
// block, when that wouldn't be the case, since L1 to L2 messages would need another iteration.
|
|
523
|
+
await retryTimes(()=>this.handleL1ToL2Messages(currentL1BlockData), 'Handling L1 to L2 messages', 3, 0.1);
|
|
532
524
|
if (currentL1BlockNumber > blocksSynchedTo) {
|
|
533
525
|
// First we retrieve new checkpoints and L2 blocks and store them in the DB. This will also update the
|
|
534
526
|
// pending chain validation status, proven checkpoint number, and synched L1 block number.
|
|
@@ -573,10 +565,11 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
573
565
|
}
|
|
574
566
|
/** Query L1 for its finalized block and update the finalized checkpoint accordingly. */ async updateFinalizedCheckpoint() {
|
|
575
567
|
try {
|
|
576
|
-
const finalizedL1Block = await this.publicClient
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
568
|
+
const finalizedL1Block = await getFinalizedL1Block(this.publicClient);
|
|
569
|
+
if (!finalizedL1Block) {
|
|
570
|
+
this.log.trace(`Skipping finalized checkpoint update: L1 has no finalized block yet.`);
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
580
573
|
const finalizedL1BlockNumber = finalizedL1Block.number;
|
|
581
574
|
const finalizedCheckpointNumber = await this.rollup.getProvenCheckpointNumber({
|
|
582
575
|
blockNumber: finalizedL1BlockNumber
|
|
@@ -699,56 +692,75 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
699
692
|
nextEnd
|
|
700
693
|
];
|
|
701
694
|
}
|
|
702
|
-
async handleL1ToL2Messages(
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
695
|
+
async handleL1ToL2Messages(currentL1Block) {
|
|
696
|
+
// Load the syncpoint, which may have been updated in a previous iteration
|
|
697
|
+
const { messagesSynchedTo = {
|
|
698
|
+
l1BlockNumber: this.l1Constants.l1StartBlock,
|
|
699
|
+
l1BlockHash: this.l1Constants.l1StartBlockHash
|
|
700
|
+
} } = await this.store.getSynchPoint();
|
|
701
|
+
// Nothing to do if L1 block number has not moved forward
|
|
702
|
+
const currentL1BlockNumber = currentL1Block.l1BlockNumber;
|
|
703
|
+
if (currentL1BlockNumber <= messagesSynchedTo.l1BlockNumber) {
|
|
704
|
+
return true;
|
|
706
705
|
}
|
|
707
|
-
//
|
|
708
|
-
const localMessagesInserted = await this.store.getTotalL1ToL2MessageCount();
|
|
709
|
-
const localLastMessage = await this.store.getLastL1ToL2Message();
|
|
706
|
+
// Compare local message store state with the remote. If they match, we just advance the match pointer.
|
|
710
707
|
const remoteMessagesState = await this.inbox.getState({
|
|
711
708
|
blockNumber: currentL1BlockNumber
|
|
712
709
|
});
|
|
713
|
-
await this.store.
|
|
714
|
-
this.
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
});
|
|
719
|
-
// Compare message count and rolling hash. If they match, no need to retrieve anything.
|
|
720
|
-
if (remoteMessagesState.totalMessagesInserted === localMessagesInserted && remoteMessagesState.messagesRollingHash.equals(localLastMessage?.rollingHash ?? Buffer16.ZERO)) {
|
|
721
|
-
this.log.trace(`No L1 to L2 messages to query between L1 blocks ${messagesSyncPoint.l1BlockNumber} and ${currentL1BlockNumber}.`);
|
|
722
|
-
return;
|
|
710
|
+
const localLastMessage = await this.store.getLastL1ToL2Message();
|
|
711
|
+
if (await this.localStateMatches(localLastMessage, remoteMessagesState)) {
|
|
712
|
+
this.log.trace(`Local L1 to L2 messages are already in sync with remote at L1 block ${currentL1BlockNumber}`);
|
|
713
|
+
await this.store.setMessageSyncState(currentL1Block, remoteMessagesState.treeInProgress);
|
|
714
|
+
return true;
|
|
723
715
|
}
|
|
724
|
-
//
|
|
725
|
-
//
|
|
726
|
-
//
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
this.
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
this.log.warn(`Rolling back L1 to L2 messages due to hash mismatch or msg not found.`, {
|
|
735
|
-
remoteLastMessage,
|
|
736
|
-
messagesSyncPoint,
|
|
737
|
-
localLastMessage
|
|
738
|
-
});
|
|
739
|
-
messagesSyncPoint = await this.rollbackL1ToL2Messages(localLastMessage, messagesSyncPoint);
|
|
740
|
-
this.log.debug(`Rolled back L1 to L2 messages to L1 block ${messagesSyncPoint.l1BlockNumber}.`, {
|
|
741
|
-
messagesSyncPoint
|
|
716
|
+
// If not, then we are out of sync. Most likely there are new messages on the inbox, so we try retrieving them.
|
|
717
|
+
// However, it could also be the case that there was an L1 reorg and our syncpoint is no longer valid.
|
|
718
|
+
// If that's the case, we'd get an exception out of the message store since the rolling hash of the first message
|
|
719
|
+
// we try to insert would not match the one in the db, in which case we rollback to the last common message with L1.
|
|
720
|
+
try {
|
|
721
|
+
await this.retrieveAndStoreMessages(messagesSynchedTo.l1BlockNumber, currentL1BlockNumber);
|
|
722
|
+
} catch (error) {
|
|
723
|
+
if (isErrorClass(error, MessageStoreError)) {
|
|
724
|
+
this.log.warn(`Failed to store L1 to L2 messages retrieved from L1: ${error.message}. Rolling back syncpoint to retry.`, {
|
|
725
|
+
inboxMessage: error.inboxMessage
|
|
742
726
|
});
|
|
727
|
+
await this.rollbackL1ToL2Messages(remoteMessagesState);
|
|
728
|
+
return false;
|
|
743
729
|
}
|
|
730
|
+
throw error;
|
|
731
|
+
}
|
|
732
|
+
// Note that, if there are no new messages to insert, but there was an L1 reorg that pruned out last messages,
|
|
733
|
+
// we'd notice by comparing our local state with the remote one again, and seeing they don't match even after
|
|
734
|
+
// our sync attempt. In this case, we also rollback our syncpoint, and trigger a retry.
|
|
735
|
+
const localLastMessageAfterSync = await this.store.getLastL1ToL2Message();
|
|
736
|
+
if (!await this.localStateMatches(localLastMessageAfterSync, remoteMessagesState)) {
|
|
737
|
+
this.log.warn(`Local L1 to L2 messages state does not match remote after sync attempt. Rolling back syncpoint to retry.`, {
|
|
738
|
+
localLastMessageAfterSync,
|
|
739
|
+
remoteMessagesState
|
|
740
|
+
});
|
|
741
|
+
await this.rollbackL1ToL2Messages(remoteMessagesState);
|
|
742
|
+
return false;
|
|
744
743
|
}
|
|
745
|
-
//
|
|
744
|
+
// Advance the syncpoint after a successful sync
|
|
745
|
+
await this.store.setMessageSyncState(currentL1Block, remoteMessagesState.treeInProgress);
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
/** Checks if the local rolling hash and message count matches the remote state */ async localStateMatches(localLastMessage, remoteState) {
|
|
749
|
+
const localMessageCount = await this.store.getTotalL1ToL2MessageCount();
|
|
750
|
+
this.log.trace(`Comparing local and remote inbox state`, {
|
|
751
|
+
localMessageCount,
|
|
752
|
+
localLastMessage,
|
|
753
|
+
remoteState
|
|
754
|
+
});
|
|
755
|
+
return remoteState.totalMessagesInserted === localMessageCount && remoteState.messagesRollingHash.equals(localLastMessage?.rollingHash ?? Buffer16.ZERO);
|
|
756
|
+
}
|
|
757
|
+
/** Retrieves L1 to L2 messages from L1 in batches and stores them. */ async retrieveAndStoreMessages(fromL1Block, toL1Block) {
|
|
746
758
|
let searchStartBlock = 0n;
|
|
747
|
-
let searchEndBlock =
|
|
759
|
+
let searchEndBlock = fromL1Block;
|
|
748
760
|
let lastMessage;
|
|
749
761
|
let messageCount = 0;
|
|
750
762
|
do {
|
|
751
|
-
[searchStartBlock, searchEndBlock] = this.nextRange(searchEndBlock,
|
|
763
|
+
[searchStartBlock, searchEndBlock] = this.nextRange(searchEndBlock, toL1Block);
|
|
752
764
|
this.log.trace(`Retrieving L1 to L2 messages in L1 blocks ${searchStartBlock}-${searchEndBlock}`);
|
|
753
765
|
const messages = await retrieveL1ToL2Messages(this.inbox, searchStartBlock, searchEndBlock);
|
|
754
766
|
const timer = new Timer();
|
|
@@ -763,74 +775,81 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
763
775
|
lastMessage = msg;
|
|
764
776
|
messageCount++;
|
|
765
777
|
}
|
|
766
|
-
}while (searchEndBlock <
|
|
767
|
-
// Log stats for messages retrieved (if any).
|
|
778
|
+
}while (searchEndBlock < toL1Block)
|
|
768
779
|
if (messageCount > 0) {
|
|
769
780
|
this.log.info(`Retrieved ${messageCount} new L1 to L2 messages up to message with index ${lastMessage?.index} for checkpoint ${lastMessage?.checkpointNumber}`, {
|
|
770
781
|
lastMessage,
|
|
771
782
|
messageCount
|
|
772
783
|
});
|
|
773
784
|
}
|
|
774
|
-
// Warn if the resulting rolling hash does not match the remote state we had retrieved.
|
|
775
|
-
if (lastMessage && !lastMessage.rollingHash.equals(remoteMessagesState.messagesRollingHash)) {
|
|
776
|
-
this.log.warn(`Last message retrieved rolling hash does not match remote state.`, {
|
|
777
|
-
lastMessage,
|
|
778
|
-
remoteMessagesState
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
async retrieveL1ToL2Message(leaf) {
|
|
783
|
-
const currentL1BlockNumber = await this.publicClient.getBlockNumber();
|
|
784
|
-
let searchStartBlock = 0n;
|
|
785
|
-
let searchEndBlock = this.l1Constants.l1StartBlock - 1n;
|
|
786
|
-
do {
|
|
787
|
-
[searchStartBlock, searchEndBlock] = this.nextRange(searchEndBlock, currentL1BlockNumber);
|
|
788
|
-
const message = await retrieveL1ToL2Message(this.inbox, leaf, searchStartBlock, searchEndBlock);
|
|
789
|
-
if (message) {
|
|
790
|
-
return message;
|
|
791
|
-
}
|
|
792
|
-
}while (searchEndBlock < currentL1BlockNumber)
|
|
793
|
-
return undefined;
|
|
794
785
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
786
|
+
/**
|
|
787
|
+
* Rolls back local L1 to L2 messages to the last common message with L1, and updates the syncpoint to the L1 block of that message.
|
|
788
|
+
* If no common message is found, rolls back all messages and sets the syncpoint to the start block.
|
|
789
|
+
*/ async rollbackL1ToL2Messages(remoteMessagesState) {
|
|
790
|
+
const { treeInProgress: remoteTreeInProgress, messagesRollingHash: remoteRollingHash } = remoteMessagesState;
|
|
791
|
+
// Slowly go back through our messages until we find the last common message. We could query the logs in
|
|
792
|
+
// batch as an optimization, but the depth of the reorg should not be deep, and this is a very rare case,
|
|
793
|
+
// so it's fine to query one log at a time.
|
|
799
794
|
let commonMsg;
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
795
|
+
let messagesToDelete = 0;
|
|
796
|
+
this.log.verbose(`Searching most recent common L1 to L2 message`);
|
|
797
|
+
for await (const localMsg of this.store.iterateL1ToL2Messages({
|
|
798
|
+
reverse: true
|
|
804
799
|
})){
|
|
805
|
-
const remoteMsg = await this.retrieveL1ToL2Message(msg.leaf);
|
|
806
800
|
const logCtx = {
|
|
807
|
-
remoteMsg,
|
|
808
|
-
localMsg
|
|
801
|
+
remoteMsg: undefined,
|
|
802
|
+
localMsg,
|
|
803
|
+
remoteMessagesState
|
|
809
804
|
};
|
|
810
|
-
if
|
|
811
|
-
|
|
805
|
+
// First check if the local message rolling hash matches the current rolling hash of the inbox contract,
|
|
806
|
+
// which means we just need to rollback some local messages and we should be back in sync. This means there
|
|
807
|
+
// was an L1 reorg that removed some of the messages we had, but no new messages were added compared.
|
|
808
|
+
if (localMsg.rollingHash.equals(remoteRollingHash)) {
|
|
809
|
+
this.log.info(`Found common L1 to L2 message at index ${localMsg.index} on L1 block ${localMsg.l1BlockNumber} matching current remote state`, logCtx);
|
|
810
|
+
commonMsg = localMsg;
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
// If there's no match with the current remote state, check if the message exists on the inbox contract at all
|
|
814
|
+
// by looking at the inbox events. If the L1 reorg *added* new messages in addition to deleting existing ones,
|
|
815
|
+
// then the current remote state's rolling hash will not match anything we have locally, so we need to check existence
|
|
816
|
+
// of individual messages via logs. Note we use logs and not historical queries so we don't have to depend on
|
|
817
|
+
// an archival rpc node, since the message could be from a long time ago if we're catching up with syncing.
|
|
818
|
+
const remoteMsg = await retrieveL1ToL2Message(this.inbox, localMsg);
|
|
819
|
+
logCtx.remoteMsg = remoteMsg;
|
|
820
|
+
if (remoteMsg && remoteMsg.rollingHash.equals(localMsg.rollingHash)) {
|
|
821
|
+
this.log.info(`Found most recent common L1 to L2 message at index ${localMsg.index} on L1 block ${localMsg.l1BlockNumber}`, logCtx);
|
|
812
822
|
commonMsg = remoteMsg;
|
|
813
823
|
break;
|
|
814
824
|
} else if (remoteMsg) {
|
|
815
|
-
this.log.debug(`Local L1 to L2 message with index ${
|
|
825
|
+
this.log.debug(`Local L1 to L2 message with index ${localMsg.index} has different rolling hash`, logCtx);
|
|
826
|
+
messagesToDelete++;
|
|
816
827
|
} else {
|
|
817
|
-
this.log.debug(`Local L1 to L2 message with index ${
|
|
828
|
+
this.log.debug(`Local L1 to L2 message with index ${localMsg.index} not found on L1`, logCtx);
|
|
829
|
+
messagesToDelete++;
|
|
818
830
|
}
|
|
819
831
|
}
|
|
820
|
-
// Delete everything after the common message we found.
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
832
|
+
// Delete everything after the common message we found, if anything needs to be deleted.
|
|
833
|
+
// Do not exit early if there are no messages to delete, we still want to update the syncpoint.
|
|
834
|
+
if (messagesToDelete > 0) {
|
|
835
|
+
const lastGoodIndex = commonMsg?.index;
|
|
836
|
+
this.log.warn(`Rolling back all local L1 to L2 messages after index ${lastGoodIndex ?? 'initial'}`);
|
|
837
|
+
await this.store.removeL1ToL2Messages(lastGoodIndex !== undefined ? lastGoodIndex + 1n : 0n);
|
|
838
|
+
}
|
|
824
839
|
// Update the syncpoint so the loop below reprocesses the changed messages. We go to the block before
|
|
825
840
|
// the last common one, so we force reprocessing it, in case new messages were added on that same L1 block
|
|
826
841
|
// after the last common message.
|
|
827
842
|
const syncPointL1BlockNumber = commonMsg ? commonMsg.l1BlockNumber - 1n : this.l1Constants.l1StartBlock;
|
|
828
843
|
const syncPointL1BlockHash = await this.getL1BlockHash(syncPointL1BlockNumber);
|
|
829
|
-
messagesSyncPoint = {
|
|
844
|
+
const messagesSyncPoint = {
|
|
830
845
|
l1BlockNumber: syncPointL1BlockNumber,
|
|
831
846
|
l1BlockHash: syncPointL1BlockHash
|
|
832
847
|
};
|
|
833
|
-
await this.store.
|
|
848
|
+
await this.store.setMessageSyncState(messagesSyncPoint, remoteTreeInProgress);
|
|
849
|
+
this.log.verbose(`Updated messages syncpoint to L1 block ${syncPointL1BlockNumber}`, {
|
|
850
|
+
...messagesSyncPoint,
|
|
851
|
+
remoteTreeInProgress
|
|
852
|
+
});
|
|
834
853
|
return messagesSyncPoint;
|
|
835
854
|
}
|
|
836
855
|
async getL1BlockHash(l1BlockNumber) {
|
|
@@ -977,21 +996,37 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
977
996
|
do {
|
|
978
997
|
[searchStartBlock, searchEndBlock] = this.nextRange(searchEndBlock, currentL1BlockNumber);
|
|
979
998
|
this.log.trace(`Retrieving checkpoints from L1 block ${searchStartBlock} to ${searchEndBlock}`);
|
|
980
|
-
//
|
|
981
|
-
const
|
|
982
|
-
if (
|
|
999
|
+
// First fetch calldata only, no blobs yet, since we may be able to just get that data out of the proposed chain
|
|
1000
|
+
const calldataCheckpoints = await execInSpan(this.tracer, 'Archiver.retrieveCheckpointCalldataFromRollup', ()=>retrieveCheckpointCalldataFromRollup(this.rollup, this.publicClient, this.debugClient, searchStartBlock, searchEndBlock, this.instrumentation, this.log));
|
|
1001
|
+
if (calldataCheckpoints.length === 0) {
|
|
983
1002
|
// We are not calling `setBlockSynchedL1BlockNumber` because it may cause sync issues if based off infura.
|
|
984
1003
|
// See further details in earlier comments.
|
|
985
1004
|
this.log.trace(`Retrieved no new checkpoints from L1 block ${searchStartBlock} to ${searchEndBlock}`);
|
|
986
1005
|
continue;
|
|
987
1006
|
}
|
|
988
|
-
this.log.debug(`Retrieved ${
|
|
989
|
-
lastProcessedCheckpoint:
|
|
1007
|
+
this.log.debug(`Retrieved ${calldataCheckpoints.length} new checkpoint calldata between L1 blocks ${searchStartBlock} and ${searchEndBlock}`, {
|
|
1008
|
+
lastProcessedCheckpoint: calldataCheckpoints[calldataCheckpoints.length - 1].l1,
|
|
990
1009
|
searchStartBlock,
|
|
991
1010
|
searchEndBlock
|
|
992
1011
|
});
|
|
993
|
-
|
|
1012
|
+
// Check if the last checkpoint matches the proposed one (so we can skip blob fetch).
|
|
1013
|
+
// We only check the last one because the proposed checkpoint is always the most recent one,
|
|
1014
|
+
// and if it's in a multi-checkpoint batch it will always be last (sorted by L1 block number).
|
|
1015
|
+
const lastCalldataCheckpoint = calldataCheckpoints[calldataCheckpoints.length - 1];
|
|
1016
|
+
const checkpointToPromote = await this.tryBuildPublishedCheckpointFromProposed(lastCalldataCheckpoint);
|
|
1017
|
+
// Then fetch blobs in parallel and build the full published checkpoints
|
|
1018
|
+
const toFetchBlobs = checkpointToPromote ? calldataCheckpoints.slice(0, -1) : calldataCheckpoints;
|
|
1019
|
+
const blobFetched = await asyncPool(10, toFetchBlobs, async (checkpoint)=>retrievedToPublishedCheckpoint({
|
|
1020
|
+
...checkpoint,
|
|
1021
|
+
checkpointBlobData: await getCheckpointBlobDataFromBlobs(this.blobClient, checkpoint.l1.blockHash, checkpoint.blobHashes, checkpoint.checkpointNumber, this.log, !initialSyncComplete, checkpoint.parentBeaconBlockRoot, checkpoint.l1.timestamp)
|
|
1022
|
+
}));
|
|
1023
|
+
// And add the promoted checkpoint to the list of all checkpoints
|
|
1024
|
+
const publishedCheckpoints = checkpointToPromote ? [
|
|
1025
|
+
...blobFetched,
|
|
1026
|
+
checkpointToPromote
|
|
1027
|
+
] : blobFetched;
|
|
994
1028
|
const validCheckpoints = [];
|
|
1029
|
+
// Now loop through all checkpoints and validate their attestations
|
|
995
1030
|
for (const published of publishedCheckpoints){
|
|
996
1031
|
const validationResult = this.config.skipValidateCheckpointAttestations ? {
|
|
997
1032
|
valid: true
|
|
@@ -1050,8 +1085,17 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
1050
1085
|
}
|
|
1051
1086
|
try {
|
|
1052
1087
|
const updatedValidationResult = rollupStatus.validationResult === initialValidationResult ? undefined : rollupStatus.validationResult;
|
|
1053
|
-
|
|
1054
|
-
|
|
1088
|
+
// Split valid checkpoints: the promoted one (if any) is persisted via the proposed-promotion path,
|
|
1089
|
+
// the rest via addCheckpoints. Both paths run within the same store transaction for atomicity.
|
|
1090
|
+
const [[maybeValidCheckpointToPromote], checkpointsToAdd] = partition(validCheckpoints, (c)=>c.checkpoint.number === checkpointToPromote?.checkpoint.number);
|
|
1091
|
+
const [processDuration, result] = await elapsed(()=>execInSpan(this.tracer, 'Archiver.addCheckpoints', ()=>this.updater.addCheckpoints(checkpointsToAdd, updatedValidationResult, maybeValidCheckpointToPromote && {
|
|
1092
|
+
l1: lastCalldataCheckpoint.l1,
|
|
1093
|
+
attestations: lastCalldataCheckpoint.attestations,
|
|
1094
|
+
checkpoint: maybeValidCheckpointToPromote
|
|
1095
|
+
})));
|
|
1096
|
+
if (checkpointsToAdd.length > 0) {
|
|
1097
|
+
this.instrumentation.processNewCheckpointedBlocks(processDuration / checkpointsToAdd.length, checkpointsToAdd.flatMap((c)=>c.checkpoint.blocks));
|
|
1098
|
+
}
|
|
1055
1099
|
// If blocks were pruned due to conflict with L1 checkpoints, emit event
|
|
1056
1100
|
if (result.prunedBlocks && result.prunedBlocks.length > 0) {
|
|
1057
1101
|
const prunedCheckpointNumber = result.prunedBlocks[0].checkpointNumber;
|
|
@@ -1096,7 +1140,7 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
1096
1140
|
});
|
|
1097
1141
|
}
|
|
1098
1142
|
lastRetrievedCheckpoint = validCheckpoints.at(-1) ?? lastRetrievedCheckpoint;
|
|
1099
|
-
lastL1BlockWithCheckpoint =
|
|
1143
|
+
lastL1BlockWithCheckpoint = calldataCheckpoints.at(-1)?.l1.blockNumber ?? lastL1BlockWithCheckpoint;
|
|
1100
1144
|
}while (searchEndBlock < currentL1BlockNumber)
|
|
1101
1145
|
// Important that we update AFTER inserting the blocks.
|
|
1102
1146
|
await updateProvenCheckpoint();
|
|
@@ -1106,6 +1150,51 @@ _dec = trackSpan('Archiver.syncFromL1'), _dec1 = trackSpan('Archiver.handleEpoch
|
|
|
1106
1150
|
lastL1BlockWithCheckpoint
|
|
1107
1151
|
};
|
|
1108
1152
|
}
|
|
1153
|
+
/** Checks if this checkpoint matches the local proposed one, and if so, loads local data to build a synthetic published checkpoint. */ async tryBuildPublishedCheckpointFromProposed(calldataCheckpoint) {
|
|
1154
|
+
const proposed = await this.store.getProposedCheckpointOnly();
|
|
1155
|
+
if (this.config.skipPromoteProposedCheckpointDuringL1Sync || !proposed || !calldataCheckpoint || proposed.checkpointNumber !== calldataCheckpoint.checkpointNumber) {
|
|
1156
|
+
return undefined;
|
|
1157
|
+
}
|
|
1158
|
+
if (!proposed.header.equals(calldataCheckpoint.header) || !proposed.archive.root.equals(calldataCheckpoint.archiveRoot)) {
|
|
1159
|
+
this.log.warn(`Local proposed checkpoint ${proposed.checkpointNumber} does not match checkpoint retrieved from L1, overriding with L1 data`, {
|
|
1160
|
+
proposedCheckpointNumber: proposed.checkpointNumber,
|
|
1161
|
+
proposedHeader: proposed.header.toInspect(),
|
|
1162
|
+
proposedArchiveRoot: proposed.archive.root.toString(),
|
|
1163
|
+
calldataCheckpointNumber: calldataCheckpoint.checkpointNumber,
|
|
1164
|
+
calldataHeader: calldataCheckpoint.header.toInspect(),
|
|
1165
|
+
calldataArchiveRoot: calldataCheckpoint.archiveRoot.toString()
|
|
1166
|
+
});
|
|
1167
|
+
return undefined;
|
|
1168
|
+
}
|
|
1169
|
+
this.log.debug(`Building published checkpoint from proposed ${calldataCheckpoint.checkpointNumber} (skipping blob fetch)`, {
|
|
1170
|
+
proposedHeader: proposed.header.toInspect(),
|
|
1171
|
+
proposedArchiveRoot: proposed.archive.root.toString()
|
|
1172
|
+
});
|
|
1173
|
+
const blocks = await this.store.getBlocks(BlockNumber(proposed.startBlock), proposed.blockCount);
|
|
1174
|
+
if (blocks.length !== proposed.blockCount) {
|
|
1175
|
+
this.log.warn(`Local proposed checkpoint ${proposed.checkpointNumber} has wrong block count (expected ${proposed.blockCount} blocks starting at ${proposed.startBlock} but got ${blocks.length})`, {
|
|
1176
|
+
proposedCheckpointNumber: proposed.checkpointNumber,
|
|
1177
|
+
proposedStartBlock: proposed.startBlock,
|
|
1178
|
+
proposedBlockCount: proposed.blockCount,
|
|
1179
|
+
retrievedBlocks: blocks.map((b)=>b.number)
|
|
1180
|
+
});
|
|
1181
|
+
return undefined;
|
|
1182
|
+
}
|
|
1183
|
+
const checkpoint = Checkpoint.from({
|
|
1184
|
+
archive: proposed.archive,
|
|
1185
|
+
header: proposed.header,
|
|
1186
|
+
blocks,
|
|
1187
|
+
number: proposed.checkpointNumber,
|
|
1188
|
+
feeAssetPriceModifier: proposed.feeAssetPriceModifier
|
|
1189
|
+
});
|
|
1190
|
+
const promotedCheckpoint = PublishedCheckpoint.from({
|
|
1191
|
+
checkpoint,
|
|
1192
|
+
l1: calldataCheckpoint.l1,
|
|
1193
|
+
attestations: calldataCheckpoint.attestations
|
|
1194
|
+
});
|
|
1195
|
+
this.instrumentation.processCheckpointPromoted();
|
|
1196
|
+
return promotedCheckpoint;
|
|
1197
|
+
}
|
|
1109
1198
|
async checkForNewCheckpointsBeforeL1SyncPoint(status, blocksSynchedTo, currentL1BlockNumber) {
|
|
1110
1199
|
const { lastRetrievedCheckpoint, pendingCheckpointNumber } = status;
|
|
1111
1200
|
// Compare the last checkpoint we have (either retrieved in this round or loaded from store) with what the
|
|
@@ -2,8 +2,8 @@ import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/bra
|
|
|
2
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
4
4
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import { type BlockData, BlockHash, CheckpointedL2Block, L2Block, type ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
6
|
-
import { type CheckpointData, type CommonCheckpointData, type ProposedCheckpointData, type ProposedCheckpointInput, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
5
|
+
import { type BlockData, BlockHash, CheckpointedL2Block, CommitteeAttestation, L2Block, type ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
6
|
+
import { type CheckpointData, type CommonCheckpointData, L1PublishedData, type ProposedCheckpointData, type ProposedCheckpointInput, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
7
7
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
8
8
|
import { BlockHeader, type IndexedTxEffect, TxHash, TxReceipt } from '@aztec/stdlib/tx';
|
|
9
9
|
export { TxReceipt, type TxEffect, type TxHash } from '@aztec/stdlib/tx';
|
|
@@ -41,6 +41,7 @@ export declare class BlockStore {
|
|
|
41
41
|
addCheckpoints(checkpoints: PublishedCheckpoint[], opts?: {
|
|
42
42
|
force?: boolean;
|
|
43
43
|
}): Promise<boolean>;
|
|
44
|
+
private skipOrUpdateAlreadyStoredCheckpoints;
|
|
44
45
|
private getPreviousCheckpointBlock;
|
|
45
46
|
/**
|
|
46
47
|
* Validates that blocks are sequential, have correct indexes, and chain via archive roots.
|
|
@@ -81,6 +82,13 @@ export declare class BlockStore {
|
|
|
81
82
|
hasProposedCheckpoint(): Promise<boolean>;
|
|
82
83
|
/** Deletes the proposed checkpoint from storage. */
|
|
83
84
|
deleteProposedCheckpoint(): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Promotes the proposed checkpoint singleton to a confirmed checkpoint entry.
|
|
87
|
+
* This persists the checkpoint to the store, clears the proposed singleton, and updates the L1 sync point.
|
|
88
|
+
* Should only be called after the checkpoint has been validated.
|
|
89
|
+
* @param expectedArchiveRoot - The archive root to match against the proposed checkpoint, to guard against races.
|
|
90
|
+
*/
|
|
91
|
+
promoteProposedToCheckpointed(l1: L1PublishedData, attestations: CommitteeAttestation[], expectedArchiveRoot: Fr): Promise<void>;
|
|
84
92
|
/** Clears the proposed checkpoint if the given confirmed checkpoint number supersedes it. */
|
|
85
93
|
clearProposedCheckpointIfSuperseded(confirmedCheckpointNumber: CheckpointNumber): Promise<void>;
|
|
86
94
|
/** Returns the proposed checkpoint data, or undefined if no proposed checkpoint exists. No fallback to confirmed. */
|
|
@@ -226,4 +234,4 @@ export declare class BlockStore {
|
|
|
226
234
|
*/
|
|
227
235
|
setPendingChainValidationStatus(status: ValidateCheckpointResult | undefined): Promise<void>;
|
|
228
236
|
}
|
|
229
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
237
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfc3RvcmUuZC50cyIsInNv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QStCLElBQUksT0FBTyxDQUFDLHdCQUF3QixHQUFHLFNBQVMsQ0FBQyxDQU1yRjtJQUVEOzs7T0FHRztJQUNHLCtCQUErQixDQUFDLE1BQU0sRUFBRSx3QkFBd0IsR0FBRyxTQUFTLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU9qRztDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_store.d.ts","sourceRoot":"","sources":["../../src/store/block_store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAyB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAMpD,OAAO,KAAK,EAAE,iBAAiB,EAA6C,MAAM,iBAAiB,CAAC;AACpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,SAAS,EACd,SAAS,EAET,mBAAmB,
|
|
1
|
+
{"version":3,"file":"block_store.d.ts","sourceRoot":"","sources":["../../src/store/block_store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAyB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAMpD,OAAO,KAAK,EAAE,iBAAiB,EAA6C,MAAM,iBAAiB,CAAC;AACpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EACL,KAAK,SAAS,EACd,SAAS,EAET,mBAAmB,EACnB,oBAAoB,EACpB,OAAO,EACP,KAAK,wBAAwB,EAG9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,E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