From 23fefa338a30048296e115a8cbf654ed740e5959 Mon Sep 17 00:00:00 2001 From: Tan Chee Keong Date: Fri, 18 Apr 2025 14:14:06 +0800 Subject: [PATCH] Add more logging --- validator_client/validator_services/src/sync.rs | 6 +++--- .../src/sync_committee_service.rs | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/validator_client/validator_services/src/sync.rs b/validator_client/validator_services/src/sync.rs index b7d774d394..388c0365f8 100644 --- a/validator_client/validator_services/src/sync.rs +++ b/validator_client/validator_services/src/sync.rs @@ -672,13 +672,13 @@ pub async fn fill_in_aggregation_proofs( "Selection proof in result variable" ); } - result.map(|proof| (duty.validator_index, slot, subnet_id, proof)) + result.map(|proof| (duty.validator_index, proof_slot, subnet_id, proof)) }); } } while let Some(result) = futures_unordered.next().await { - if let Some((validator_index, slot, subnet_id, proof)) = result { + if let Some((validator_index, proof_slot, subnet_id, proof)) = result { let sync_map = duties_service.sync_duties.committees.read(); let Some(committee_duties) = sync_map.get(&sync_committee_period) else { debug!("period" = sync_committee_period, "Missing sync duties"); @@ -693,7 +693,7 @@ pub async fn fill_in_aggregation_proofs( if let Some(Some(duty)) = validators.get(&validator_index) { debug!( validator_index, - "slot" = %slot, + "slot" = %proof_slot, "subcommittee_index" = *subnet_id, // log full selection proof for debugging "full selection proof" = ?proof, diff --git a/validator_client/validator_services/src/sync_committee_service.rs b/validator_client/validator_services/src/sync_committee_service.rs index d99c0d3107..233100b570 100644 --- a/validator_client/validator_services/src/sync_committee_service.rs +++ b/validator_client/validator_services/src/sync_committee_service.rs @@ -380,11 +380,20 @@ impl SyncCommitteeService { aggregator_index, aggregator_pk, contribution.clone(), - selection_proof, + selection_proof.clone(), ) .await { - Ok(signed_contribution) => Some(signed_contribution), + Ok(signed_contribution) => { + debug!( + validator_index = aggregator_index, + %slot, + subcommittee_index = %subnet_id, + full_selection_proof = ?selection_proof, + "Produced sync contribution and proof" + ); + Some(signed_contribution) + } Err(ValidatorStoreError::UnknownPubkey(pubkey)) => { // A pubkey can be missing when a validator was recently // removed via the API.