mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Add specific log and metric for delayed blocks (#2308)
## Issue Addressed
NA
## Proposed Changes
- Adds a specific log and metric for when a block is enshrined as head with a delay that will caused bad attestations
- We *technically* already expose this information, but it's a little tricky to determine during debugging. This makes it nice and explicit.
- Fixes a minor reporting bug with the validator monitor where it was expecting agg. attestations too early (at half-slot rather than two-thirds-slot).
## Additional Info
NA
This commit is contained in:
@@ -75,4 +75,16 @@ pub trait SlotClock: Send + Sync + Sized + Clone {
|
||||
self.slot_of(self.now_duration()?.checked_sub(tolerance)?)
|
||||
.or_else(|| Some(self.genesis_slot()))
|
||||
}
|
||||
|
||||
/// Returns the delay between the start of the slot and when unaggregated attestations should be
|
||||
/// produced.
|
||||
fn unagg_attestation_production_delay(&self) -> Duration {
|
||||
self.slot_duration() / 3
|
||||
}
|
||||
|
||||
/// Returns the delay between the start of the slot and when aggregated attestations should be
|
||||
/// produced.
|
||||
fn agg_attestation_production_delay(&self) -> Duration {
|
||||
self.slot_duration() * 2 / 3
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user