From d169762b998850d2a7434ef4f24d8328d2e38a7e Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Mon, 5 Aug 2024 22:56:43 +0000 Subject: [PATCH] extends Turbine fanout experiment to wider fanout values (#2373) Based on previous Turbine fanout experiment, wider 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 wider fanout values. (cherry picked from commit 57144b0ceadc03ca15b47f656d44cb3e7909b75e) # Conflicts: # sdk/src/feature_set.rs --- sdk/src/feature_set.rs | 16 +++++++++++++++ turbine/src/cluster_nodes.rs | 39 ++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index c0ff5eec0c892c..09d1b41c0afcab 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -837,6 +837,17 @@ pub mod ed25519_precompile_verify_strict { solana_sdk::declare_id!("ed9tNscbWLYBooxWA7FE2B5KHWs8A6sxfY8EzezEcoo"); } +<<<<<<< HEAD +======= +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"); +} + +>>>>>>> 57144b0cea (extends Turbine fanout experiment to wider fanout values (#2373)) lazy_static! { /// Map of feature identifiers to user-visible description pub static ref FEATURE_NAMES: HashMap = [ @@ -1041,6 +1052,11 @@ lazy_static! { (zk_elgamal_proof_program_enabled::id(), "Enable ZkElGamalProof program SIMD-0153"), (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"), +<<<<<<< HEAD +======= + (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 #"), +>>>>>>> 57144b0cea (extends Turbine fanout experiment to wider fanout values (#2373)) /*************** ADD NEW FEATURES HERE ***************/ ] .iter() diff --git a/turbine/src/cluster_nodes.rs b/turbine/src/cluster_nodes.rs index 8cc5f29033fd86..42236d908da90a 100644 --- a/turbine/src/cluster_nodes.rs +++ b/turbine/src/cluster_nodes.rs @@ -564,8 +564,31 @@ 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) { + if check_feature_activation( + &feature_set::disable_turbine_fanout_experiments::id(), + shred_slot, + root_bank, + ) { + DATA_PLANE_FANOUT + } else if check_feature_activation( + &feature_set::enable_turbine_extended_fanout_experiments::id(), + shred_slot, + root_bank, + ) { // 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 +599,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 {