diff --git a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs index fe6cb573a7..2e5ee5160b 100644 --- a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs @@ -1610,9 +1610,9 @@ impl Worker { 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 Worker { // 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.