Skip to content

Commit

Permalink
simplify code that calculates reference_tick
Browse files Browse the repository at this point in the history
No need to apply the mask in turbine code as the underlying code will do
it for us
  • Loading branch information
steviez committed Jan 28, 2025
1 parent 38acba2 commit 55ed445
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions turbine/src/broadcast_stage/standard_broadcast_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
solana_entry::entry::Entry,
solana_ledger::{
blockstore,
shred::{shred_code, ProcessShredsStats, ReedSolomonCache, Shred, ShredFlags, Shredder},
shred::{shred_code, ProcessShredsStats, ReedSolomonCache, Shred, Shredder},
},
solana_sdk::{
genesis_config::ClusterType, hash::Hash, signature::Keypair, timing::AtomicInterval,
Expand Down Expand Up @@ -79,11 +79,11 @@ impl StandardBroadcastRun {
cluster_type: ClusterType,
stats: &mut ProcessShredsStats,
) -> Vec<Shred> {
const SHRED_TICK_REFERENCE_MASK: u8 = ShredFlags::SHRED_TICK_REFERENCE_MASK.bits();
if self.completed {
return vec![];
}
let reference_tick = max_ticks_in_slot & SHRED_TICK_REFERENCE_MASK;
// Set the reference_tick as if the PoH completed for this slot
let reference_tick = max_ticks_in_slot;
let (mut shreds, coding_shreds) =
Shredder::new(self.slot, self.parent, reference_tick, self.shred_version)
.unwrap()
Expand Down

0 comments on commit 55ed445

Please sign in to comment.