Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade duplication log of attestation to Debug #6007

Merged
merged 11 commits into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 72 additions & 22 deletions beacon_node/beacon_chain/src/validator_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,17 +1382,43 @@ impl<E: EthSpec> ValidatorMonitor<E> {
});

if self.individual_tracking() {
info!(
self.log,
"Attestation included in aggregate";
"head" => ?data.beacon_block_root,
"index" => %data.index,
"delay_ms" => %delay.as_millis(),
"epoch" => %epoch,
"slot" => %data.slot,
"src" => src,
"validator" => %id,
);
let is_first_inclusion_aggregate = validator
.get_from_epoch_summary(epoch, |summary_opt| {
if let Some(summary) = summary_opt {
Some(summary.attestation_aggregate_inclusions == 0)
} else {
// No data for this validator: no inclusion.
Some(true)
}
})
.unwrap_or(true);

if is_first_inclusion_aggregate {
info!(
self.log,
"Attestation included in aggregate";
"head" => ?data.beacon_block_root,
"index" => %data.index,
"delay_ms" => %delay.as_millis(),
"epoch" => %epoch,
"slot" => %data.slot,
"src" => src,
"validator" => %id,
);
} else {
// Downgrade to Debug for second and onwards of logging to reduce verbosity
debug!(
self.log,
"Attestation included in aggregate";
"head" => ?data.beacon_block_root,
"index" => %data.index,
"delay_ms" => %delay.as_millis(),
"epoch" => %epoch,
"slot" => %data.slot,
"src" => src,
"validator" => %id,
)
};
}

validator.with_epoch_summary(epoch, |summary| {
Expand Down Expand Up @@ -1433,24 +1459,48 @@ impl<E: EthSpec> ValidatorMonitor<E> {
&["block", label],
);
});

if self.individual_tracking() {
metrics::set_int_gauge(
&metrics::VALIDATOR_MONITOR_ATTESTATION_IN_BLOCK_DELAY_SLOTS,
&["block", id],
delay.as_u64() as i64,
);

info!(
self.log,
"Attestation included in block";
"head" => ?data.beacon_block_root,
"index" => %data.index,
"inclusion_lag" => format!("{} slot(s)", delay),
"epoch" => %epoch,
"slot" => %data.slot,
"validator" => %id,
);
let is_first_inclusion_block = validator
.get_from_epoch_summary(epoch, |summary_opt| {
if let Some(summary) = summary_opt {
Some(summary.attestation_block_inclusions == 0)
} else {
// No data for this validator: no inclusion.
Some(true)
}
})
.unwrap_or(true);

if is_first_inclusion_block {
info!(
self.log,
"Attestation included in block";
"head" => ?data.beacon_block_root,
"index" => %data.index,
"inclusion_lag" => format!("{} slot(s)", delay),
"epoch" => %epoch,
"slot" => %data.slot,
"validator" => %id,
);
} else {
// Downgrade to Debug for second and onwards of logging to reduce verbosity
debug!(
self.log,
"Attestation included in block";
"head" => ?data.beacon_block_root,
"index" => %data.index,
"inclusion_lag" => format!("{} slot(s)", delay),
"epoch" => %epoch,
"slot" => %data.slot,
"validator" => %id,
);
}
}

validator.with_epoch_summary(epoch, |summary| {
Expand Down