Make minimum warmup period 32 slots long (#4031)

* Make minimum warmup period 32 slots long

* PR fixes
This commit is contained in:
carllin
2019-04-29 15:26:52 -07:00
committed by GitHub
parent bae0aadafa
commit 73f250f03a
8 changed files with 69 additions and 42 deletions

View File

@@ -2,7 +2,7 @@
//! "ticks", a measure of time in the PoH stream
use crate::poh_recorder::PohRecorder;
use crate::service::Service;
use solana_sdk::timing::NUM_TICKS_PER_SECOND;
use solana_sdk::timing::{self, NUM_TICKS_PER_SECOND};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::SyncSender;
use std::sync::{Arc, Mutex};
@@ -28,6 +28,15 @@ impl Default for PohServiceConfig {
}
}
impl PohServiceConfig {
pub fn ticks_to_ms(&self, num_ticks: u64) -> u64 {
match self {
PohServiceConfig::Sleep(d) => timing::duration_as_ms(d) * num_ticks,
_ => panic!("Unsuppported tick config"),
}
}
}
pub struct PohService {
tick_producer: JoinHandle<()>,
}