mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Address code review feedback
- Fix comment about available time computation to reflect actual implementation - Use current time for reconstructed column timestamps instead of max partial timestamp Co-authored-by: michaelsproul <4452260+michaelsproul@users.noreply.github.com>
This commit is contained in:
@@ -43,7 +43,7 @@ pub struct BlockDelays {
|
|||||||
pub execution_time: Option<Duration>,
|
pub execution_time: Option<Duration>,
|
||||||
/// The delay from the start of the slot before the block became available
|
/// The delay from the start of the slot before the block became available
|
||||||
///
|
///
|
||||||
/// Equal to max(`observed + execution_time`, `all_blobs_observed` or `all_data_columns_observed`).
|
/// Equal to max(`executed`, `all_blobs_observed` or `all_data_columns_observed`) minus slot start time.
|
||||||
pub available: Option<Duration>,
|
pub available: Option<Duration>,
|
||||||
/// Time after `available`.
|
/// Time after `available`.
|
||||||
pub attestable: Option<Duration>,
|
pub attestable: Option<Duration>,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use ssz_types::VariableList;
|
|||||||
use std::iter;
|
use std::iter;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||||
use tracing::{debug, instrument};
|
use tracing::{debug, instrument};
|
||||||
use types::data::ColumnIndex;
|
use types::data::ColumnIndex;
|
||||||
use types::{
|
use types::{
|
||||||
@@ -475,12 +475,10 @@ impl<E: EthSpec> KzgVerifiedCustodyDataColumn<E> {
|
|||||||
spec,
|
spec,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
// Use the maximum timestamp from the partial set for reconstructed columns
|
// Use the current time as the seen_timestamp for reconstructed columns
|
||||||
let seen_timestamp = partial_set_of_columns
|
let seen_timestamp = SystemTime::now()
|
||||||
.iter()
|
.duration_since(UNIX_EPOCH)
|
||||||
.map(|col| col.seen_timestamp)
|
.unwrap_or_else(|_| Duration::from_secs(0));
|
||||||
.max()
|
|
||||||
.unwrap_or_default();
|
|
||||||
|
|
||||||
Ok(all_data_columns
|
Ok(all_data_columns
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user