diff --git a/beacon-chain/sync/pending_blocks_queue.go b/beacon-chain/sync/pending_blocks_queue.go index d61d16673..3d90882f0 100644 --- a/beacon-chain/sync/pending_blocks_queue.go +++ b/beacon-chain/sync/pending_blocks_queue.go @@ -102,6 +102,7 @@ func (s *Service) processPendingBlocks(ctx context.Context) error { // Remove block from queue. s.pendingQueueLock.Lock() if err := s.deleteBlockFromPendingQueue(slot, b, blkRoot); err != nil { + s.pendingQueueLock.Unlock() return err } s.pendingQueueLock.Unlock() @@ -311,7 +312,7 @@ func (s *Service) deleteBlockFromPendingQueue(slot uint64, b *ethpb.SignedBeacon return nil } - // Decrease exp itme in proportion to how many blocks are still in the cache for slot key. + // Decrease exp time in proportion to how many blocks are still in the cache for slot key. d := pendingBlockExpTime / time.Duration(len(newBlks)) if err := s.slotToPendingBlocks.Replace(slotToCacheKey(slot), newBlks, d); err != nil { return err diff --git a/beacon-chain/sync/validate_beacon_blocks.go b/beacon-chain/sync/validate_beacon_blocks.go index a78d169fb..ecf06e592 100644 --- a/beacon-chain/sync/validate_beacon_blocks.go +++ b/beacon-chain/sync/validate_beacon_blocks.go @@ -123,6 +123,7 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms if !s.db.HasBlock(ctx, bytesutil.ToBytes32(blk.Block.ParentRoot)) { s.pendingQueueLock.Lock() if err := s.insertBlockToPendingQueue(blk.Block.Slot, blk, blockRoot); err != nil { + s.pendingQueueLock.Unlock() log.WithError(err).WithField("blockSlot", blk.Block.Slot).Debug("Ignored block") return pubsub.ValidationIgnore }