Skip to content

Commit

Permalink
unwind one more block when detecting a re-sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott committed Oct 23, 2024
1 parent 030f6c5 commit a0eb773
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zk/stages/stage_batches_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ func (p *BatchesProcessor) processFullBlock(blockEntry *types.FullL2Block) (rest
// unwind if we already have this block - could be a re-sequence event
if blockEntry.L2BlockNumber < p.lastBlockHeight+1 {
log.Warn(fmt.Sprintf("[%s] Skipping block %d, already processed, triggering unwind...", p.logPrefix, blockEntry.L2BlockNumber))
if err = p.unwindFn(blockEntry.L2BlockNumber); err != nil {
if err = p.unwindFn(blockEntry.L2BlockNumber - 1); err != nil {
return 0, false, false, err
}
return blockEntry.L2BlockNumber, false, true, nil
return blockEntry.L2BlockNumber - 1, false, true, nil
}

// check for sequential block numbers
Expand Down

0 comments on commit a0eb773

Please sign in to comment.