diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index 049e87733226..f3ad39ed2b82 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -271,7 +271,10 @@ export class Archiver implements ArchiveSource, Traceable { } if (initialRun) { - this.log.info(`Initial archiver sync to L1 block ${currentL1BlockNumber} complete.`); + this.log.info(`Initial archiver sync to L1 block ${currentL1BlockNumber} complete.`, { + l1BlockNumber: currentL1BlockNumber, + ...(await this.getL2Tips()), + }); } } @@ -361,6 +364,16 @@ export class Archiver implements ArchiveSource, Traceable { const updateProvenBlock = async () => { const localBlockForDestinationProvenBlockNumber = await this.getBlock(Number(provenBlockNumber)); + + // Sanity check. I've hit what seems to be a state where the proven block is set to a value greater than the latest + // synched block when requesting L2Tips from the archiver. This is the only place where the proven block is set. + const synched = await this.store.getSynchedL2BlockNumber(); + if (localBlockForDestinationProvenBlockNumber && synched < localBlockForDestinationProvenBlockNumber?.number) { + this.log.error( + `Hit local block greater than last synched block: ${localBlockForDestinationProvenBlockNumber.number} > ${synched}`, + ); + } + if ( localBlockForDestinationProvenBlockNumber && provenArchive === localBlockForDestinationProvenBlockNumber.archive.root.toString() @@ -795,11 +808,13 @@ export class Archiver implements ArchiveSource, Traceable { ] as const); if (latestBlockNumber > 0 && !latestBlockHeader) { - throw new Error('Failed to retrieve latest block header'); + throw new Error(`Failed to retrieve latest block header for block ${latestBlockNumber}`); } if (provenBlockNumber > 0 && !provenBlockHeader) { - throw new Error('Failed to retrieve proven block header'); + throw new Error( + `Failed to retrieve proven block header for block ${provenBlockNumber} (latest block is ${latestBlockNumber})`, + ); } return {