Update gossip_methods.rs

This commit is contained in:
realbigsean 2023-01-13 14:59:03 -05:00 committed by GitHub
parent 05c1291d8a
commit 1319683736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1215,9 +1215,20 @@ impl<T: BeaconChainTypes> Worker<T> {
"peer" => %peer_id,
"error" => ?e
);
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Reject);
// We penalize the peer slightly to prevent overuse of invalids.
if !matches!(e, BeaconChainError::BlsToExecutionChangeBadFork(_)) {
// We ignore pre-capella messages without penalizing peers.
if matches!(e, BeaconChainError::BlsToExecutionChangeBadFork(_)) {
self.propagate_validation_result(
message_id,
peer_id,
MessageAcceptance::Ignore,
);
} else {
// We penalize the peer slightly to prevent overuse of invalids.
self.propagate_validation_result(
message_id,
peer_id,
MessageAcceptance::Reject,
);
self.gossip_penalize_peer(
peer_id,
PeerAction::HighToleranceError,