Fix backfill stalling (#5192)

* Prevent early short circuit in `peer_disconnected`

* lint
This commit is contained in:
Pawan Dhananjay 2024-02-08 08:10:51 +05:30 committed by GitHub
parent 4db84de563
commit 0b59d10ab6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -332,7 +332,16 @@ impl<T: BeaconChainTypes> BackFillSync<T> {
}
// If we have run out of peers in which to retry this batch, the backfill state
// transitions to a paused state.
self.retry_batch_download(network, id)?;
// We still need to reset the state for all the affected batches, so we should not
// short circuit early
if self.retry_batch_download(network, id).is_err() {
debug!(
self.log,
"Batch could not be retried";
"batch_id" => id,
"error" => "no synced peers"
);
}
} else {
debug!(self.log, "Batch not found while removing peer";
"peer" => %peer_id, "batch" => id)