Remove penalty for attesting to unknown head (#2903)

## Issue Addressed

- Resolves https://github.com/sigp/lighthouse/issues/2902

## Proposed Changes

As documented in https://github.com/sigp/lighthouse/issues/2902, there are some cases where we will score peers very harshly for sending attestations to an unknown head.

This PR removes the penalty when an attestation for an unknown head is received, queued for block look-up, then popped from the queue without the head block being known. This prevents peers from being penalized for an unknown block when that peer was never actually asked for the block.

Peer penalties should still be applied to the peers who *do* get the request for the block and fail to respond with a valid block. As such, peers who send us attestations to non-existent heads should eventually be booted.

## Additional Info

- [ ] Need to confirm that a timeout for a bbroot request will incur a penalty.
This commit is contained in:
Paul Hauner 2022-01-13 03:08:38 +00:00
parent f13e9c3d10
commit 2ce2ec9b62

View File

@ -1532,12 +1532,9 @@ impl<T: BeaconChainTypes> Worker<T> {
} }
} else { } else {
// We shouldn't make any further attempts to process this attestation. // We shouldn't make any further attempts to process this attestation.
// Downscore the peer. //
self.gossip_penalize_peer( // Don't downscore the peer since it's not clear if we requested this head
peer_id, // block from them or not.
PeerAction::LowToleranceError,
"attn_unknown_head",
);
self.propagate_validation_result( self.propagate_validation_result(
message_id, message_id,
peer_id, peer_id,