Don't ban blocks for context deadlines (#7040)

* Don't ban blocks for context deadlines
* Don't ban blocks for context deadlines
* Add test
* Merge branch 'master' into dont-ban-ctx-deadline2
* fmt
This commit is contained in:
Preston Van Loon
2020-08-17 18:21:10 -07:00
committed by GitHub
parent 9caa92cae4
commit 4d463c4a85
6 changed files with 26 additions and 10 deletions

View File

@@ -90,7 +90,7 @@ func (s *Service) processPendingBlocks(ctx context.Context) error {
if parentIsBad || blockIsBad {
// Set block as bad if its parent block is bad too.
if parentIsBad {
s.setBadBlock(blkRoot)
s.setBadBlock(ctx, blkRoot)
}
// Remove block from queue.
s.pendingQueueLock.Lock()
@@ -142,7 +142,7 @@ func (s *Service) processPendingBlocks(ctx context.Context) error {
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(blkRoot)
s.setBadBlock(ctx, blkRoot)
traceutil.AnnotateError(span, err)
}