Include validator indices in attestation logs (#3393)
## Issue Addressed Fixes #2967 ## Proposed Changes Collect validator indices alongside attestations when creating signed attestations (and aggregates) for inclusion in the logs. ## Additional Info This is my first time looking at Lighthouse source code and using Rust, so newbie feedback appreciated!
This commit is contained in:
parent
43ce0de73f
commit
386ced1aed
@ -389,12 +389,13 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(()) => Some(attestation),
|
Ok(()) => Some((attestation, duty.validator_index)),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
crit!(
|
crit!(
|
||||||
log,
|
log,
|
||||||
"Failed to sign attestation";
|
"Failed to sign attestation";
|
||||||
"error" => ?e,
|
"error" => ?e,
|
||||||
|
"validator" => ?duty.pubkey,
|
||||||
"committee_index" => committee_index,
|
"committee_index" => committee_index,
|
||||||
"slot" => slot.as_u64(),
|
"slot" => slot.as_u64(),
|
||||||
);
|
);
|
||||||
@ -404,11 +405,11 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Execute all the futures in parallel, collecting any successful results.
|
// Execute all the futures in parallel, collecting any successful results.
|
||||||
let attestations = &join_all(signing_futures)
|
let (ref attestations, ref validator_indices): (Vec<_>, Vec<_>) = join_all(signing_futures)
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flatten()
|
.flatten()
|
||||||
.collect::<Vec<Attestation<E>>>();
|
.unzip();
|
||||||
|
|
||||||
// Post the attestations to the BN.
|
// Post the attestations to the BN.
|
||||||
match self
|
match self
|
||||||
@ -428,6 +429,7 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
|||||||
log,
|
log,
|
||||||
"Successfully published attestations";
|
"Successfully published attestations";
|
||||||
"count" => attestations.len(),
|
"count" => attestations.len(),
|
||||||
|
"validator_indices" => ?validator_indices,
|
||||||
"head_block" => ?attestation_data.beacon_block_root,
|
"head_block" => ?attestation_data.beacon_block_root,
|
||||||
"committee_index" => attestation_data.index,
|
"committee_index" => attestation_data.index,
|
||||||
"slot" => attestation_data.slot.as_u64(),
|
"slot" => attestation_data.slot.as_u64(),
|
||||||
@ -549,7 +551,7 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
|||||||
let attestation = &signed_aggregate_and_proof.message.aggregate;
|
let attestation = &signed_aggregate_and_proof.message.aggregate;
|
||||||
info!(
|
info!(
|
||||||
log,
|
log,
|
||||||
"Successfully published attestations";
|
"Successfully published attestation";
|
||||||
"aggregator" => signed_aggregate_and_proof.message.aggregator_index,
|
"aggregator" => signed_aggregate_and_proof.message.aggregator_index,
|
||||||
"signatures" => attestation.aggregation_bits.num_set_bits(),
|
"signatures" => attestation.aggregation_bits.num_set_bits(),
|
||||||
"head_block" => format!("{:?}", attestation.data.beacon_block_root),
|
"head_block" => format!("{:?}", attestation.data.beacon_block_root),
|
||||||
@ -566,6 +568,7 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
|||||||
log,
|
log,
|
||||||
"Failed to publish attestation";
|
"Failed to publish attestation";
|
||||||
"error" => %e,
|
"error" => %e,
|
||||||
|
"aggregator" => signed_aggregate_and_proof.message.aggregator_index,
|
||||||
"committee_index" => attestation.data.index,
|
"committee_index" => attestation.data.index,
|
||||||
"slot" => attestation.data.slot.as_u64(),
|
"slot" => attestation.data.slot.as_u64(),
|
||||||
"type" => "aggregated",
|
"type" => "aggregated",
|
||||||
|
Loading…
Reference in New Issue
Block a user