Skip to content

Commit b0774e0

Browse files
committed
Remove unnecessary range checks
1 parent d72b61d commit b0774e0

File tree

1 file changed

+0
-30
lines changed
  • beacon_node/network/src/sync/range_sync

1 file changed

+0
-30
lines changed

beacon_node/network/src/sync/range_sync/batch.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -277,36 +277,6 @@ impl<E: EthSpec, B: BatchConfig> BatchInfo<E, B> {
277277
> {
278278
match self.state.poison() {
279279
BatchState::Downloading(peer, _request_id) => {
280-
// verify that blocks are in range
281-
if let Some(last_slot) = blocks.last().map(|b| b.slot()) {
282-
// the batch is non-empty
283-
let first_slot = blocks[0].slot();
284-
285-
let failed_range = if first_slot < self.start_slot {
286-
Some((self.start_slot, first_slot))
287-
} else if self.end_slot < last_slot {
288-
Some((self.end_slot, last_slot))
289-
} else {
290-
None
291-
};
292-
293-
if let Some((expected, received)) = failed_range {
294-
// this is a failed download, register the attempt and check if the batch
295-
// can be tried again
296-
self.failed_download_attempts.push(peer);
297-
self.state = if self.failed_download_attempts.len()
298-
>= B::max_batch_download_attempts() as usize
299-
{
300-
BatchState::Failed
301-
} else {
302-
// drop the blocks
303-
BatchState::AwaitingDownload
304-
};
305-
306-
return Err(Ok((expected, received, self.outcome())));
307-
}
308-
}
309-
310280
let received = blocks.len();
311281
self.state = BatchState::AwaitingProcessing(peer, blocks, Instant::now());
312282
Ok(received)

0 commit comments

Comments
 (0)