Skip to content

Commit

Permalink
Relax late sync committee penalty (#2752)
Browse files Browse the repository at this point in the history
## Issue Addressed

Getting too many peers kicked due to slightly late sync committee messages as tested on.. under-performant hardware.

## Proposed Changes

Only penalize if the message is more than one slot late. Still ignore the message-

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
  • Loading branch information
divagant-martian and divagant-martian committed Oct 31, 2021
1 parent 1790010 commit e2c0650
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions beacon_node/network/src/beacon_processor/worker/gossip_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1610,9 +1610,9 @@ impl<T: BeaconChainTypes> Worker<T> {
metrics::register_sync_committee_error(&error);

match &error {
SyncCommitteeError::FutureSlot { .. } | SyncCommitteeError::PastSlot { .. } => {
SyncCommitteeError::FutureSlot { .. } => {
/*
* These errors can be triggered by a mismatch between our slot and the peer.
* This error can be triggered by a mismatch between our slot and the peer.
*
*
* The peer has published an invalid consensus message, _only_ if we trust our own clock.
Expand All @@ -1631,6 +1631,31 @@ impl<T: BeaconChainTypes> Worker<T> {
// Do not propagate these messages.
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
}
SyncCommitteeError::PastSlot {
message_slot,
earliest_permissible_slot,
} => {
/*
* This error can be triggered by a mismatch between our slot and the peer.
*
*
* The peer has published an invalid consensus message, _only_ if we trust our own clock.
*/
trace!(
self.log,
"Sync committee message is not within the last MAXIMUM_GOSSIP_CLOCK_DISPARITY slots";
"peer_id" => %peer_id,
"type" => ?message_type,
);

// We tolerate messages that were just one slot late.
if *message_slot + 1 < *earliest_permissible_slot {
self.gossip_penalize_peer(peer_id, PeerAction::HighToleranceError);
}

// Do not propagate these messages.
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
}
SyncCommitteeError::EmptyAggregationBitfield => {
/*
* The aggregate had no signatures and is therefore worthless.
Expand Down

0 comments on commit e2c0650

Please sign in to comment.