Skip to content

Commit

Permalink
v2.0: extends Turbine fanout experiment to wider fanout values (backp…
Browse files Browse the repository at this point in the history
…ort of #2373) (#2450)

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 57144b0)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
  • Loading branch information
mergify[bot] and behzadnouri authored Sep 10, 2024
1 parent 81c310a commit 1b4dfb3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
5 changes: 5 additions & 0 deletions sdk/src/feature_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,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<Pubkey, &'static str> = [
Expand Down Expand Up @@ -1056,6 +1060,7 @@ lazy_static! {
(verify_retransmitter_signature::id(), "Verify retransmitter signature #1840"),
(vote_only_retransmitter_signed_fec_sets::id(), "vote only on retransmitter signed fec sets"),
(partitioned_epoch_rewards_superfeature::id(), "replaces enable_partitioned_epoch_reward to enable partitioned rewards at epoch boundary SIMD-0118"),
(enable_turbine_extended_fanout_experiments::id(), "enable turbine extended fanout experiments #2373"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down
39 changes: 24 additions & 15 deletions turbine/src/cluster_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,31 @@ pub fn make_test_cluster<R: Rng>(
}

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,
Expand All @@ -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 {
Expand Down

0 comments on commit 1b4dfb3

Please sign in to comment.