@@ -74,9 +74,9 @@ export class ArchiverDataStoreUpdater {
7474 this . addContractDataToDb ( block ) ,
7575 ] ) ;
7676
77+ await this . l2TipsCache ?. refresh ( ) ;
7778 return opResults . every ( Boolean ) ;
7879 } ) ;
79- await this . l2TipsCache ?. refresh ( ) ;
8080 return result ;
8181 }
8282
@@ -144,17 +144,18 @@ export class ArchiverDataStoreUpdater {
144144 : undefined ,
145145 ] ) ;
146146
147+ await this . l2TipsCache ?. refresh ( ) ;
147148 return { prunedBlocks, lastAlreadyInsertedBlockNumber } ;
148149 } ) ;
149- await this . l2TipsCache ?. refresh ( ) ;
150150 return result ;
151151 }
152152
153153 public async addProposedCheckpoint ( proposedCheckpoint : ProposedCheckpointInput ) {
154154 const result = await this . stores . db . transactionAsync ( async ( ) => {
155155 await this . stores . blocks . addProposedCheckpoint ( proposedCheckpoint ) ;
156+ await this . l2TipsCache ?. refresh ( ) ;
156157 } ) ;
157- await this . l2TipsCache ?. refresh ( ) ;
158+
158159 return result ;
159160 }
160161
@@ -255,9 +256,9 @@ export class ArchiverDataStoreUpdater {
255256 // Clear all pending proposed checkpoints since their blocks have been pruned
256257 await this . stores . blocks . deleteProposedCheckpoints ( ) ;
257258
259+ await this . l2TipsCache ?. refresh ( ) ;
258260 return result ;
259261 } ) ;
260- await this . l2TipsCache ?. refresh ( ) ;
261262 return result ;
262263 }
263264
@@ -288,7 +289,7 @@ export class ArchiverDataStoreUpdater {
288289 * @returns True if the operation is successful.
289290 */
290291 public async removeCheckpointsAfter ( checkpointNumber : CheckpointNumber ) : Promise < boolean > {
291- const result = await this . stores . db . transactionAsync ( async ( ) => {
292+ return await this . stores . db . transactionAsync ( async ( ) => {
292293 const { blocksRemoved = [ ] } = await this . stores . blocks . removeCheckpointsAfter ( checkpointNumber ) ;
293294
294295 const opResults = await Promise . all ( [
@@ -299,10 +300,9 @@ export class ArchiverDataStoreUpdater {
299300 this . stores . logs . deleteLogs ( blocksRemoved ) ,
300301 ] ) ;
301302
303+ await this . l2TipsCache ?. refresh ( ) ;
302304 return opResults . every ( Boolean ) ;
303305 } ) ;
304- await this . l2TipsCache ?. refresh ( ) ;
305- return result ;
306306 }
307307
308308 /**
@@ -312,8 +312,8 @@ export class ArchiverDataStoreUpdater {
312312 public async setProvenCheckpointNumber ( checkpointNumber : CheckpointNumber ) : Promise < void > {
313313 await this . stores . db . transactionAsync ( async ( ) => {
314314 await this . stores . blocks . setProvenCheckpointNumber ( checkpointNumber ) ;
315+ await this . l2TipsCache ?. refresh ( ) ;
315316 } ) ;
316- await this . l2TipsCache ?. refresh ( ) ;
317317 }
318318
319319 /**
@@ -323,8 +323,8 @@ export class ArchiverDataStoreUpdater {
323323 public async setFinalizedCheckpointNumber ( checkpointNumber : CheckpointNumber ) : Promise < void > {
324324 await this . stores . db . transactionAsync ( async ( ) => {
325325 await this . stores . blocks . setFinalizedCheckpointNumber ( checkpointNumber ) ;
326+ await this . l2TipsCache ?. refresh ( ) ;
326327 } ) ;
327- await this . l2TipsCache ?. refresh ( ) ;
328328 }
329329
330330 /** Extracts and stores contract data from a single block. */
0 commit comments