Skip to content

Commit 7c89b97

Browse files
Handle attestation validation errors (#7382)
Partly addresses: - #7379 Handle attestation validation errors from `get_attesting_indices` to prevent an error log, downscore the peer, and reject the message.
1 parent e6ef644 commit 7c89b97

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

beacon_node/network/src/network_beacon_processor/gossip_methods.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,6 +2775,26 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
27752775
MessageAcceptance::Ignore,
27762776
);
27772777
}
2778+
BeaconChainError::AttestationValidationError(e) => {
2779+
// Failures from `get_attesting_indices` end up here.
2780+
debug!(
2781+
%peer_id,
2782+
block_root = ?beacon_block_root,
2783+
attestation_slot = %failed_att.attestation_data().slot,
2784+
error = ?e,
2785+
"Rejecting attestation that failed validation"
2786+
);
2787+
self.propagate_validation_result(
2788+
message_id,
2789+
peer_id,
2790+
MessageAcceptance::Reject,
2791+
);
2792+
self.gossip_penalize_peer(
2793+
peer_id,
2794+
PeerAction::MidToleranceError,
2795+
"attn_validation_error",
2796+
);
2797+
}
27782798
_ => {
27792799
/*
27802800
* Lighthouse hit an unexpected error whilst processing the attestation. It

0 commit comments

Comments
 (0)