From 56aa73d05d6123daee2ea951193d2e1b62521ed1 Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Wed, 31 Jul 2024 09:39:04 -0500 Subject: [PATCH] extends Turbine fanout experiment to larger fanout values Based on previous Turbine fanout experiment, larger fanouts are more effective in propagating shreds and reducing repairs: https://discord.com/channels/428295358100013066/478692221441409024/1265782094211321897 In order to identify optimal fanout value, this commit extends the experiment with larger fanout values. --- sdk/src/feature_set.rs | 5 +++++ turbine/src/cluster_nodes.rs | 36 +++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index 887d2e547f19b2..4626240a949de4 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -841,6 +841,10 @@ pub mod vote_only_retransmitter_signed_fec_sets { solana_sdk::declare_id!("RfEcA95xnhuwooVAhUUksEJLZBF7xKCLuqrJoqk4Zph"); } +pub mod enable_turbine_extended_fanout_experiments { + solana_sdk::declare_id!("BZn14Liea52wtBwrXUxTv6vojuTTmfc7XGEDTXrvMD7b"); +} + lazy_static! { /// Map of feature identifiers to user-visible description pub static ref FEATURE_NAMES: HashMap = [ @@ -1046,6 +1050,7 @@ lazy_static! { (move_stake_and_move_lamports_ixs::id(), "Enable MoveStake and MoveLamports stake program instructions #1610"), (ed25519_precompile_verify_strict::id(), "Use strict verification in ed25519 precompile SIMD-0152"), (vote_only_retransmitter_signed_fec_sets::id(), "vote only on retransmitter signed fec sets"), + (enable_turbine_extended_fanout_experiments::id(), "enable turbine extended fanout experiments #"), /*************** ADD NEW FEATURES HERE ***************/ ] .iter() diff --git a/turbine/src/cluster_nodes.rs b/turbine/src/cluster_nodes.rs index 8cc5f29033fd86..cb399b9d414551 100644 --- a/turbine/src/cluster_nodes.rs +++ b/turbine/src/cluster_nodes.rs @@ -564,8 +564,28 @@ pub fn make_test_cluster( } pub(crate) fn get_data_plane_fanout(shred_slot: Slot, root_bank: &Bank) -> usize { - if enable_turbine_fanout_experiments(shred_slot, root_bank) { + macro_rules! check_feature_activation { + ($feature:ident) => { + check_feature_activation(&feature_set::$feature::id(), shred_slot, root_bank) + }; + } + if check_feature_activation!(disable_turbine_fanout_experiments) { + DATA_PLANE_FANOUT + } else if check_feature_activation!(enable_turbine_extended_fanout_experiments) { // Allocate ~2% of slots to turbine fanout experiments. + match shred_slot % 359 { + 11 => 1152, + 61 => 1280, + 111 => 1024, + 161 => 1408, + 211 => 896, + 261 => 1536, + 311 => 768, + _ => DATA_PLANE_FANOUT, + } + } else { + // feature_set::enable_turbine_fanout_experiments + // is already activated on all clusters. match shred_slot % 359 { 11 => 64, 61 => 768, @@ -576,23 +596,9 @@ pub(crate) fn get_data_plane_fanout(shred_slot: Slot, root_bank: &Bank) -> usize 311 => 384, _ => DATA_PLANE_FANOUT, } - } else { - DATA_PLANE_FANOUT } } -fn enable_turbine_fanout_experiments(shred_slot: Slot, root_bank: &Bank) -> bool { - check_feature_activation( - &feature_set::enable_turbine_fanout_experiments::id(), - shred_slot, - root_bank, - ) && !check_feature_activation( - &feature_set::disable_turbine_fanout_experiments::id(), - shred_slot, - root_bank, - ) -} - // Returns true if the feature is effective for the shred slot. #[must_use] pub fn check_feature_activation(feature: &Pubkey, shred_slot: Slot, root_bank: &Bank) -> bool {