Skip to content

Commit cf46d10

Browse files
committed
Fix issues from review
1 parent c2aa4ae commit cf46d10

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

beacon_node/network/src/sync/backfill_sync/mod.rs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -616,28 +616,29 @@ impl<T: BeaconChainTypes> BackFillSync<T> {
616616
penalty,
617617
faulty_component,
618618
} => {
619-
let Some(batch_peers) = batch.processing_peers() else {
620-
error!(?batch_id, "Responsible peers not found for a failed batch");
621-
return self
622-
.fail_sync(BackFillError::BatchProcessingFailed(batch_id))
623-
.map(|_| ProcessResult::Successful);
624-
};
625-
// Penalize the peer appropriately.
626-
match faulty_component {
627-
Some(FaultyComponent::Blocks) | Some(FaultyComponent::Blobs) => {
628-
network.report_peer(batch_peers.block_and_blob, *penalty, "faulty_batch");
629-
}
630-
// todo(pawan): clean this up
631-
Some(FaultyComponent::Columns(faulty_columns)) => {
632-
for (peer, columns) in batch_peers.data_columns.iter() {
633-
for faulty_column in faulty_columns {
634-
if columns.contains(faulty_column) {
635-
network.report_peer(*peer, *penalty, "faulty_batch");
619+
if let Some(batch_peers) = batch.processing_peers() {
620+
// Penalize the peer appropriately.
621+
match faulty_component {
622+
Some(FaultyComponent::Blocks) | Some(FaultyComponent::Blobs) => {
623+
network.report_peer(
624+
batch_peers.block_and_blob,
625+
*penalty,
626+
"faulty_batch",
627+
);
628+
}
629+
Some(FaultyComponent::Columns(faulty_columns)) => {
630+
for (peer, columns) in batch_peers.data_columns.iter() {
631+
for faulty_column in faulty_columns {
632+
if columns.contains(faulty_column) {
633+
network.report_peer(*peer, *penalty, "faulty_batch");
634+
}
636635
}
637636
}
638637
}
638+
None => {}
639639
}
640-
None => {}
640+
} else {
641+
warn!(?batch_id, "Responsible peers not found for a failed batch");
641642
}
642643
match batch.processing_completed(BatchProcessingResult::FaultyFailure) {
643644
Err(e) => {

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -476,18 +476,10 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
476476
}
477477
};
478478

479-
let peers = batch.processing_peers().cloned().ok_or_else(|| {
480-
RemoveChain::WrongBatchState(format!(
481-
"Processing target is in wrong state: {:?}",
482-
batch.state(),
483-
))
484-
})?;
485-
486479
// Log the process result and the batch for debugging purposes.
487480
debug!(
488481
result = ?result,
489482
batch_epoch = %batch_id,
490-
?peers,
491483
batch_state = ?batch_state,
492484
?batch,
493485
"Batch processing result"
@@ -554,7 +546,7 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
554546
faulty_component,
555547
} => {
556548
let Some(batch_peers) = batch.processing_peers() else {
557-
crit!(
549+
warn!(
558550
current_state = ?batch.state(),
559551
"Inconsistent state, batch must have been in processing state"
560552
);

0 commit comments

Comments
 (0)