components:: sync:: BLOCK_DOWNLOAD_RETRY_LIMIT
const BLOCK_DOWNLOAD_RETRY_LIMIT: usize = 5;
Controls how many times we will retry each block download.
If all the retries fail, then the syncer will reset, and start downloading blocks from the verified tip in the state, including blocks which previously downloaded successfully.
But if a node is on a slow or unreliable network, sync restarts can result in a flood of download requests, making future syncs more likely to fail. So it's much faster to retry each block multiple times.
When we implement a peer reputation system, we can reduce the number of retries, because we will be more likely to choose a good peer.