mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Exit Pending Queue Properly (#7927)
* exit properly * terence's review * Update beacon-chain/sync/pending_blocks_queue.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * Update beacon-chain/sync/pending_blocks_queue.go Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * fix tests Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
This commit is contained in:
@@ -134,12 +134,20 @@ func (s *Service) processPendingBlocks(ctx context.Context) error {
|
||||
log.Debugf("Could not validate block from slot %d: %v", b.Block.Slot, err)
|
||||
s.setBadBlock(ctx, blkRoot)
|
||||
traceutil.AnnotateError(span, err)
|
||||
// In the next iteration of the queue, this block will be removed from
|
||||
// the pending queue as it has been marked as a 'bad' block.
|
||||
span.End()
|
||||
continue
|
||||
}
|
||||
|
||||
if err := s.chain.ReceiveBlock(ctx, b, blkRoot); err != nil {
|
||||
log.Debugf("Could not process block from slot %d: %v", b.Block.Slot, err)
|
||||
s.setBadBlock(ctx, blkRoot)
|
||||
traceutil.AnnotateError(span, err)
|
||||
// In the next iteration of the queue, this block will be removed from
|
||||
// the pending queue as it has been marked as a 'bad' block.
|
||||
span.End()
|
||||
continue
|
||||
}
|
||||
|
||||
s.setSeenBlockIndexSlot(b.Block.Slot, b.Block.ProposerIndex)
|
||||
|
||||
Reference in New Issue
Block a user