Skip to content

Commit

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

Closes #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 committed Oct 5, 2023
1 parent 7d53721 commit 4b619c6
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 4b619c6

Please sign in to comment.