mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Custody backfill sync only penalize peers once per batch (#9340)
During custody backfill sync if a peer fails to serve columns for a batch don't penalize them more than once per batch Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
@@ -593,7 +593,7 @@ impl<T: BeaconChainTypes> CustodyBackFillSync<T> {
|
|||||||
Err(err) => {
|
Err(err) => {
|
||||||
debug!(batch_epoch = %batch_id, error = ?err, "Batch download failed");
|
debug!(batch_epoch = %batch_id, error = ?err, "Batch download failed");
|
||||||
|
|
||||||
// If there are any coupling errors, penalize the appropriate peers
|
// If there are any coupling errors, penalize the appropriate peers.
|
||||||
if let RpcResponseError::BlockComponentCouplingError(coupling_error) = err
|
if let RpcResponseError::BlockComponentCouplingError(coupling_error) = err
|
||||||
&& let CouplingError::DataColumnPeerFailure {
|
&& let CouplingError::DataColumnPeerFailure {
|
||||||
error,
|
error,
|
||||||
@@ -601,15 +601,19 @@ impl<T: BeaconChainTypes> CustodyBackFillSync<T> {
|
|||||||
exceeded_retries: _,
|
exceeded_retries: _,
|
||||||
} = coupling_error
|
} = coupling_error
|
||||||
{
|
{
|
||||||
|
let mut failed_peers = HashSet::new();
|
||||||
for (column_index, faulty_peer) in faulty_peers {
|
for (column_index, faulty_peer) in faulty_peers {
|
||||||
debug!(
|
debug!(
|
||||||
?error,
|
?error,
|
||||||
?column_index,
|
?column_index,
|
||||||
?faulty_peer,
|
?faulty_peer,
|
||||||
"Custody backfill sync penalizing peer"
|
"Custody backfill sync: peer failed to serve column"
|
||||||
);
|
);
|
||||||
|
failed_peers.insert(faulty_peer);
|
||||||
|
}
|
||||||
|
for peer in failed_peers {
|
||||||
network.report_peer(
|
network.report_peer(
|
||||||
faulty_peer,
|
peer,
|
||||||
PeerAction::LowToleranceError,
|
PeerAction::LowToleranceError,
|
||||||
"Peer failed to serve column",
|
"Peer failed to serve column",
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user