Skip to content

Commit

Permalink
Exit aggregation step early if no validator is aggregator (sigp#4774)
Browse files Browse the repository at this point in the history
## Issue Addressed

Closes sigp#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 ChainSafe/lodestar#5553
  • Loading branch information
nflaig authored and Woodpile37 committed Jan 6, 2024
1 parent 68eece8 commit b4b512e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions validator_client/src/attestation_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b4b512e

Please sign in to comment.