Relax late sync committee penalty (#2752)

## 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>
This commit is contained in:
Divma 2021-10-31 22:30:19 +00:00
parent 1790010260
commit e2c0650d16

View File

@ -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.
@ -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.