From f0b5da4bad6c35b1822b0be5717a37212803bb1b Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Sun, 18 Feb 2024 11:28:04 -0600 Subject: [PATCH] enables chained Merkle shreds for ClusterType::Development --- core/src/shred_fetch_stage.rs | 18 ++++++++++++------ .../broadcast_stage/standard_broadcast_run.rs | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/core/src/shred_fetch_stage.rs b/core/src/shred_fetch_stage.rs index 481e5333b14198..c42d5db41ee669 100644 --- a/core/src/shred_fetch_stage.rs +++ b/core/src/shred_fetch_stage.rs @@ -13,6 +13,7 @@ use { clock::{Slot, DEFAULT_MS_PER_SLOT}, epoch_schedule::EpochSchedule, feature_set::{self, FeatureSet}, + genesis_config::ClusterType, packet::{Meta, PACKET_DATA_SIZE}, pubkey::Pubkey, }, @@ -70,6 +71,10 @@ impl ShredFetchStage { ) }; let mut stats = ShredFetchStats::default(); + let cluster_type = { + let root_bank = bank_forks.read().unwrap().root_bank(); + root_bank.cluster_type() + }; for mut packet_batch in recvr { if last_updated.elapsed().as_millis() as u64 > DEFAULT_MS_PER_SLOT { @@ -113,12 +118,13 @@ impl ShredFetchStage { ) }; let enable_chained_merkle_shreds = |shred_slot| { - check_feature_activation( - &feature_set::enable_chained_merkle_shreds::id(), - shred_slot, - &feature_set, - &epoch_schedule, - ) + cluster_type == ClusterType::Development + || check_feature_activation( + &feature_set::enable_chained_merkle_shreds::id(), + shred_slot, + &feature_set, + &epoch_schedule, + ) }; let turbine_disabled = turbine_disabled.load(Ordering::Relaxed); for packet in packet_batch.iter_mut().filter(|p| !p.meta().discard()) { diff --git a/turbine/src/broadcast_stage/standard_broadcast_run.rs b/turbine/src/broadcast_stage/standard_broadcast_run.rs index 6378c0df40a8d3..256e77c78e34e5 100644 --- a/turbine/src/broadcast_stage/standard_broadcast_run.rs +++ b/turbine/src/broadcast_stage/standard_broadcast_run.rs @@ -527,8 +527,8 @@ impl BroadcastRun for StandardBroadcastRun { } } -fn should_chain_merkle_shreds(_slot: Slot, _cluster_type: ClusterType) -> bool { - false +fn should_chain_merkle_shreds(_slot: Slot, cluster_type: ClusterType) -> bool { + cluster_type == ClusterType::Development } #[cfg(test)]