mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
Refactor timestamp_now (#9094)
#9077 Where possible replaces all instances of `validator_monitor::timestamp_now` with `chain.slot_clock.now_duration().unwrap_or_default()`. Where chain/slot_clock is not available, instead replace it with a convenience function `slot_clock::timestamp_now`. Remove the `validator_monitor::timestamp_now` function. Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -35,15 +35,13 @@
|
||||
//! appears that this validator is capable of producing valid
|
||||
//! attestations and there's no immediate cause for concern.
|
||||
use crate::task_spawner::{Priority, TaskSpawner};
|
||||
use beacon_chain::{
|
||||
AttestationError, BeaconChain, BeaconChainError, BeaconChainTypes,
|
||||
validator_monitor::timestamp_now,
|
||||
};
|
||||
use beacon_chain::{AttestationError, BeaconChain, BeaconChainError, BeaconChainTypes};
|
||||
use beacon_processor::work_reprocessing_queue::{QueuedUnaggregate, ReprocessQueueMessage};
|
||||
use beacon_processor::{Work, WorkEvent};
|
||||
use eth2::types::Failure;
|
||||
use lighthouse_network::PubsubMessage;
|
||||
use network::NetworkMessage;
|
||||
use slot_clock::SlotClock;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use tokio::sync::{mpsc::UnboundedSender, oneshot};
|
||||
@@ -138,7 +136,7 @@ pub async fn publish_attestations<T: BeaconChainTypes>(
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Gossip validate and publish attestations that can be immediately processed.
|
||||
let seen_timestamp = timestamp_now();
|
||||
let seen_timestamp = chain.slot_clock.now_duration().unwrap_or_default();
|
||||
let mut prelim_results = task_spawner
|
||||
.clone()
|
||||
.blocking_task(Priority::P0, move || {
|
||||
|
||||
Reference in New Issue
Block a user