mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Patch Initial Sync For Non Finalized Blocks (#9452)
* fix for now * off by 1 * preston's review
This commit is contained in:
@@ -304,7 +304,15 @@ func (s *Service) isProcessedBlock(ctx context.Context, blk block.SignedBeaconBl
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if blk.Block().Slot() <= finalizedSlot || (s.cfg.DB.HasBlock(ctx, blkRoot) || s.cfg.Chain.HasInitSyncBlock(blkRoot)) {
|
||||
// If block is before our finalized checkpoint
|
||||
// we do not process it.
|
||||
if blk.Block().Slot() <= finalizedSlot {
|
||||
return true
|
||||
}
|
||||
blockExistsInDB := s.cfg.DB.HasBlock(ctx, blkRoot) || s.cfg.Chain.HasInitSyncBlock(blkRoot)
|
||||
// If block exists in our db and is before or equal to our current head
|
||||
// we ignore it.
|
||||
if blockExistsInDB && s.cfg.Chain.HeadSlot() >= blk.Block().Slot() {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user