Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.18: extends Turbine fanout experiment to wider fanout values (backport of #2373) #2449

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/src/feature_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,10 @@ pub mod deprecate_unused_legacy_vote_plumbing {
solana_sdk::declare_id!("6Uf8S75PVh91MYgPQSHnjRAPQq6an5BDv9vomrCwDqLe");
}

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 @@ -981,6 +985,7 @@ lazy_static! {
(enable_chained_merkle_shreds::id(), "Enable chained Merkle shreds #34916"),
(deprecate_unused_legacy_vote_plumbing::id(), "Deprecate unused legacy vote tx plumbing"),
(chained_merkle_conflict_duplicate_proofs::id(), "generate duplicate proofs for chained merkle root conflicts"),
(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 @@ -584,8 +584,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 @@ -596,23 +619,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
Loading