Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase penalty for old block gossip spam #6050

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1010,11 +1010,12 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
return None;
}
Err(e @ BlockError::FutureSlot { .. })
| Err(e @ BlockError::WouldRevertFinalizedSlot { .. })
| Err(e @ BlockError::NotFinalizedDescendant { .. }) => {
debug!(self.log, "Could not verify block for gossip. Ignoring the block";
"error" => %e);
Err(e @ BlockError::FutureSlot { .. }) => {
debug!(
self.log,
"Could not verify block for gossip. Ignoring the block";
"error" => %e
);
// Prevent recurring behaviour by penalizing the peer slightly.
self.gossip_penalize_peer(
peer_id,
Expand All @@ -1024,6 +1025,25 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
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() => {
debug!(self.log, "Could not verify block for gossip. Ignoring the block";
"error" => %e);
Expand Down
Loading