From b5333b4d92b60cce8cd457576148ec550b962461 Mon Sep 17 00:00:00 2001 From: Mark Mackey Date: Wed, 15 May 2024 17:05:40 +0300 Subject: [PATCH] just one more check bro plz.. --- validator_client/src/attestation_service.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/validator_client/src/attestation_service.rs b/validator_client/src/attestation_service.rs index f005540bc6..c885763717 100644 --- a/validator_client/src/attestation_service.rs +++ b/validator_client/src/attestation_service.rs @@ -375,7 +375,8 @@ impl AttestationService { // Ensure that the attestation matches the duties. #[allow(clippy::suspicious_operation_groupings)] - if duty.slot != attestation_data.slot || (fork_name < ForkName::Electra && duty.committee_index != attestation_data.index) + if duty.slot != attestation_data.slot + || (fork_name < ForkName::Electra && duty.committee_index != attestation_data.index) { crit!( log, @@ -576,6 +577,12 @@ impl AttestationService { .await .map_err(|e| e.to_string())?; + let fork_name = self + .context + .eth2_config + .spec + .fork_name_at_slot::(attestation_data.slot); + // Create futures to produce the signed aggregated attestations. let signing_futures = validator_duties.iter().map(|duty_and_proof| async move { let duty = &duty_and_proof.duty; @@ -584,7 +591,9 @@ impl AttestationService { let slot = attestation_data.slot; let committee_index = attestation_data.index; - if duty.slot != slot || duty.committee_index != committee_index { + if duty.slot != slot + || (fork_name < ForkName::Electra && duty.committee_index != committee_index) + { crit!(log, "Inconsistent validator duties during signing"); return None; }