Skip to content

Commit 3b662de

Browse files
committed
Send parent blocks one by one
1 parent 4c8143f commit 3b662de

File tree

7 files changed

+419
-394
lines changed

7 files changed

+419
-394
lines changed

beacon_node/beacon_chain/src/data_availability_checker/child_components.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,11 @@ impl<E: EthSpec> ChildComponents<E> {
6666
pub fn clear_blobs(&mut self) {
6767
self.downloaded_blobs = FixedBlobSidecarList::default();
6868
}
69+
70+
pub fn downloaded_blobs_count(&self) -> usize {
71+
self.downloaded_blobs
72+
.iter()
73+
.filter(|blob| blob.is_some())
74+
.count()
75+
}
6976
}

beacon_node/network/src/network_beacon_processor/sync_methods.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ pub enum ChainSegmentProcessId {
3333
RangeBatchId(ChainId, Epoch),
3434
/// Processing ID for a backfill syncing batch.
3535
BackSyncBatchId(Epoch),
36-
/// Processing Id of the parent lookup of a block.
37-
ParentLookup(Hash256),
3836
}
3937

4038
/// Returned when a chain segment import fails.
@@ -396,41 +394,6 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
396394
}
397395
}
398396
}
399-
// this is a parent lookup request from the sync manager
400-
ChainSegmentProcessId::ParentLookup(chain_head) => {
401-
debug!(
402-
self.log, "Processing parent lookup";
403-
"chain_hash" => %chain_head,
404-
"blocks" => downloaded_blocks.len()
405-
);
406-
// parent blocks are ordered from highest slot to lowest, so we need to process in
407-
// reverse
408-
match self
409-
.process_blocks(downloaded_blocks.iter().rev(), notify_execution_layer)
410-
.await
411-
{
412-
(imported_blocks, Err(e)) => {
413-
debug!(self.log, "Parent lookup failed"; "error" => %e.message);
414-
match e.peer_action {
415-
Some(penalty) => BatchProcessResult::FaultyFailure {
416-
imported_blocks: imported_blocks > 0,
417-
penalty,
418-
},
419-
None => BatchProcessResult::NonFaultyFailure,
420-
}
421-
}
422-
(imported_blocks, Ok(_)) => {
423-
debug!(
424-
self.log, "Parent lookup processed successfully";
425-
"chain_hash" => %chain_head,
426-
"imported_blocks" => imported_blocks
427-
);
428-
BatchProcessResult::Success {
429-
was_non_empty: imported_blocks > 0,
430-
}
431-
}
432-
}
433-
}
434397
};
435398

436399
self.send_sync_message(SyncMessage::BatchProcessed { sync_type, result });

0 commit comments

Comments
 (0)