mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-04 13:24:39 +00:00
Increase penalty for old block gossip spam (#6050)
* Increase penalty for old block gossip spam
This commit is contained in:
@@ -1012,11 +1012,12 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
|
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
Err(e @ BlockError::FutureSlot { .. })
|
Err(e @ BlockError::FutureSlot { .. }) => {
|
||||||
| Err(e @ BlockError::WouldRevertFinalizedSlot { .. })
|
debug!(
|
||||||
| Err(e @ BlockError::NotFinalizedDescendant { .. }) => {
|
self.log,
|
||||||
debug!(self.log, "Could not verify block for gossip. Ignoring the block";
|
"Could not verify block for gossip. Ignoring the block";
|
||||||
"error" => %e);
|
"error" => %e
|
||||||
|
);
|
||||||
// Prevent recurring behaviour by penalizing the peer slightly.
|
// Prevent recurring behaviour by penalizing the peer slightly.
|
||||||
self.gossip_penalize_peer(
|
self.gossip_penalize_peer(
|
||||||
peer_id,
|
peer_id,
|
||||||
@@ -1026,6 +1027,25 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
|
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
Err(e @ BlockError::WouldRevertFinalizedSlot { .. })
|
||||||
|
| Err(e @ BlockError::NotFinalizedDescendant { .. }) => {
|
||||||
|
debug!(
|
||||||
|
self.log,
|
||||||
|
"Could not verify block for gossip. Ignoring the block";
|
||||||
|
"error" => %e
|
||||||
|
);
|
||||||
|
// The spec says we must IGNORE these blocks but there's no reason for an honest
|
||||||
|
// and non-buggy client to be gossiping blocks that blatantly conflict with
|
||||||
|
// finalization. Old versions of Erigon/Caplin are known to gossip pre-finalization
|
||||||
|
// blocks and we want to isolate them to encourage an update.
|
||||||
|
self.gossip_penalize_peer(
|
||||||
|
peer_id,
|
||||||
|
PeerAction::LowToleranceError,
|
||||||
|
"gossip_block_low",
|
||||||
|
);
|
||||||
|
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
Err(ref e @ BlockError::ExecutionPayloadError(ref epe)) if !epe.penalize_peer() => {
|
Err(ref e @ BlockError::ExecutionPayloadError(ref epe)) if !epe.penalize_peer() => {
|
||||||
debug!(self.log, "Could not verify block for gossip. Ignoring the block";
|
debug!(self.log, "Could not verify block for gossip. Ignoring the block";
|
||||||
"error" => %e);
|
"error" => %e);
|
||||||
|
|||||||
Reference in New Issue
Block a user