@@ -363,7 +363,7 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
363
363
BatchState :: Poisoned => unreachable ! ( "Poisoned batch" ) ,
364
364
BatchState :: Failed | BatchState :: AwaitingDownload | BatchState :: Processing ( _) => {
365
365
// these are all inconsistent states:
366
- // - Failed -> non recoverable batch. Chain should have beee removed
366
+ // - Failed -> non recoverable batch. Chain should have been removed
367
367
// - AwaitingDownload -> A recoverable failed batch should have been
368
368
// re-requested.
369
369
// - Processing -> `self.current_processing_batch` is None
@@ -395,11 +395,15 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
395
395
// return an error.
396
396
return Ok ( KeepChain ) ;
397
397
} else {
398
- return Err ( RemoveChain :: WrongChainState ( format ! (
399
- "Batch not found for current processing target {}" ,
400
- self . processing_target
401
- ) ) ) ;
398
+ // NOTE: It is possible that the batch doesn't exist for the processing id. This can happen
399
+ // when we complete a batch and attempt to download a new batch but there are:
400
+ // 1. No idle peers to download from
401
+ // 2. No good peers on sampling subnets
402
+ //
403
+ // In these cases, a batch will not yet exist.
404
+ debug ! ( batch = %self . processing_target, "The processing batch has not been scheduled for download yet. Awaiting progress" ) ;
402
405
}
406
+
403
407
Ok ( KeepChain )
404
408
}
405
409
@@ -511,7 +515,7 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
511
515
imported_blocks,
512
516
penalty,
513
517
} => {
514
- // Penalize the peer appropiately .
518
+ // Penalize the peer appropriately .
515
519
network. report_peer ( peer, * penalty, "faulty_batch" ) ;
516
520
517
521
// Check if this batch is allowed to continue
@@ -553,7 +557,8 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
553
557
}
554
558
BatchProcessResult :: NonFaultyFailure => {
555
559
batch. processing_completed ( BatchProcessingResult :: NonFaultyFailure ) ?;
556
- // Simply redownload the batch.
560
+
561
+ // Simply re-download the batch.
557
562
self . send_batch ( network, batch_id)
558
563
}
559
564
}
0 commit comments