Exit aggregation step early if no validator is aggregator (#4774)

## Issue Addressed

Closes https://github.com/sigp/lighthouse/issues/4712

## Proposed Changes

Exit aggregation step early if no validator is aggregator. This avoids an unnecessary request to the beacon node and more importantly fixes noisy errors if Lighthouse VC is used with other clients such as Lodestar and Prysm.

## Additional Info

Related issue https://github.com/ChainSafe/lodestar/issues/5553
This commit is contained in:
Nico Flaig 2023-10-05 02:14:55 +00:00
parent 7d537214b7
commit 4b619c63d7

View File

@ -491,6 +491,14 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
) -> Result<(), String> {
let log = self.context.log();
if !validator_duties
.iter()
.any(|duty_and_proof| duty_and_proof.selection_proof.is_some())
{
// Exit early if no validator is aggregator
return Ok(());
}
let aggregated_attestation = &self
.beacon_nodes
.first_success(