Skip to content

Commit 7e688e8

Browse files
author
colinlyguo
committed
add more comments
1 parent 6e7bc38 commit 7e688e8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rollup/internal/controller/watcher/chunk_proposer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ func (p *ChunkProposer) tryProposeEuclidTransitionChunk(blocks []*encoding.Block
454454
}
455455

456456
prevBlocks, err := p.l2BlockOrm.GetL2BlocksGEHeight(p.ctx, blocks[0].Header.Number.Uint64()-1, 1)
457+
// If we are in replay mode, we don't need to check the parent block.
458+
// This is a corner case when StartL2Block is set as 0, it needs to get genesis block, but in mainnet db there is no genesis block.
459+
// So we need to bypass this check.
457460
if !p.replayMode && (err != nil || len(prevBlocks) == 0 || prevBlocks[0].Header.Hash() != blocks[0].Header.ParentHash) {
458461
return false, fmt.Errorf("failed to get parent block: %w", err)
459462
}

0 commit comments

Comments
 (0)