Handle attestation validation errors (#7382)

Partly addresses:

- https://github.com/sigp/lighthouse/issues/7379


  Handle attestation validation errors from `get_attesting_indices` to prevent an error log, downscore the peer, and reject the message.
This commit is contained in:
Michael Sproul
2025-05-27 11:55:17 +10:00
committed by GitHub
parent e6ef644db4
commit 7c89b970af

View File

@@ -2775,6 +2775,26 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
MessageAcceptance::Ignore,
);
}
BeaconChainError::AttestationValidationError(e) => {
// Failures from `get_attesting_indices` end up here.
debug!(
%peer_id,
block_root = ?beacon_block_root,
attestation_slot = %failed_att.attestation_data().slot,
error = ?e,
"Rejecting attestation that failed validation"
);
self.propagate_validation_result(
message_id,
peer_id,
MessageAcceptance::Reject,
);
self.gossip_penalize_peer(
peer_id,
PeerAction::MidToleranceError,
"attn_validation_error",
);
}
_ => {
/*
* Lighthouse hit an unexpected error whilst processing the attestation. It