diff --git a/poh/src/poh_recorder.rs b/poh/src/poh_recorder.rs index c3bde4c06c..900eab0346 100644 --- a/poh/src/poh_recorder.rs +++ b/poh/src/poh_recorder.rs @@ -322,7 +322,7 @@ pub struct PohRecorder { last_reported_slot_for_pending_fork: Arc>, pub is_exited: Arc, pub is_alpenglow_enabled: bool, - pub use_alpenglow_tick_produer: bool, + pub use_alpenglow_tick_producer: bool, } impl PohRecorder { @@ -651,7 +651,7 @@ impl PohRecorder { fn reset_poh(&mut self, reset_bank: Arc, reset_start_bank: bool) { let blockhash = reset_bank.last_blockhash(); - let hashes_per_tick = if self.use_alpenglow_tick_produer { + let hashes_per_tick = if self.use_alpenglow_tick_producer { None } else { *reset_bank.hashes_per_tick() @@ -1142,7 +1142,7 @@ impl PohRecorder { last_reported_slot_for_pending_fork: Arc::default(), is_exited, is_alpenglow_enabled, - use_alpenglow_tick_produer: is_alpenglow_enabled, + use_alpenglow_tick_producer: is_alpenglow_enabled, }, working_bank_receiver, record_receiver, diff --git a/poh/src/poh_service.rs b/poh/src/poh_service.rs index c71b9f5bb8..31fee31586 100644 --- a/poh/src/poh_service.rs +++ b/poh/src/poh_service.rs @@ -159,17 +159,6 @@ impl PohService { && poh_recorder.read().unwrap().is_alpenglow_enabled { info!("Migrating poh service to alpenglow tick producer"); - // Important this is called *before* any new alpenglow - // leaders call `set_bank()`, otherwise, the old PoH - // tick producer will still tick in that alpenglow bank - // - // TODO: Can essentailly replace this with no ticks - // once we properly remove poh/entry verification in replay - { - let mut w_poh_recorder = poh_recorder.write().unwrap(); - w_poh_recorder.migrate_to_alpenglow_poh(); - w_poh_recorder.use_alpenglow_tick_produer = true; - } } else { poh_exit.store(true, Ordering::Relaxed); return; @@ -177,6 +166,18 @@ impl PohService { } // Start alpenglow + // + // Important this is called *before* any new alpenglow + // leaders call `set_bank()`, otherwise, the old PoH + // tick producer will still tick in that alpenglow bank + // + // TODO: Can essentailly replace this with no ticks + // once we properly remove poh/entry verification in replay + { + let mut w_poh_recorder = poh_recorder.write().unwrap(); + w_poh_recorder.migrate_to_alpenglow_poh(); + w_poh_recorder.use_alpenglow_tick_producer = true; + } Self::alpenglow_tick_producer(poh_recorder, &poh_exit, record_receiver); poh_exit.store(true, Ordering::Relaxed); })