|
1 |
| -use beacon_chain::block_verification_types::{AsBlock, RpcBlock}; |
| 1 | +use beacon_chain::block_verification_types::RpcBlock; |
2 | 2 | use lighthouse_network::rpc::methods::BlocksByRangeRequest;
|
3 | 3 | use lighthouse_network::service::api_types::Id;
|
4 | 4 | use lighthouse_network::PeerId;
|
@@ -277,36 +277,6 @@ impl<E: EthSpec, B: BatchConfig> BatchInfo<E, B> {
|
277 | 277 | > {
|
278 | 278 | match self.state.poison() {
|
279 | 279 | 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 |
| - |
310 | 280 | let received = blocks.len();
|
311 | 281 | self.state = BatchState::AwaitingProcessing(peer, blocks, Instant::now());
|
312 | 282 | Ok(received)
|
|
0 commit comments