From 112c6e8506b760a0d4cbba03e32c27c85dcc763f Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Mon, 5 Aug 2024 22:56:43 +0000 Subject: [PATCH 1/2] 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 | 76 ++++++++++++++++++++++++++++++++++++ turbine/src/cluster_nodes.rs | 39 +++++++++++------- 2 files changed, 100 insertions(+), 15 deletions(-) diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index 32c9973c2eb946..85f1f27e5ef91a 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -789,6 +789,65 @@ pub mod deprecate_unused_legacy_vote_plumbing { solana_sdk::declare_id!("6Uf8S75PVh91MYgPQSHnjRAPQq6an5BDv9vomrCwDqLe"); } +<<<<<<< HEAD +======= +pub mod reward_full_priority_fee { + solana_sdk::declare_id!("3opE3EzAKnUftUDURkzMgwpNgimBAypW1mNDYH4x4Zg7"); +} + +pub mod get_sysvar_syscall_enabled { + solana_sdk::declare_id!("CLCoTADvV64PSrnR6QXty6Fwrt9Xc6EdxSJE4wLRePjq"); +} + +pub mod abort_on_invalid_curve { + solana_sdk::declare_id!("FuS3FPfJDKSNot99ECLXtp3rueq36hMNStJkPJwWodLh"); +} + +pub mod migrate_feature_gate_program_to_core_bpf { + solana_sdk::declare_id!("4eohviozzEeivk1y9UbrnekbAFMDQyJz5JjA9Y6gyvky"); +} + +pub mod vote_only_full_fec_sets { + solana_sdk::declare_id!("ffecLRhhakKSGhMuc6Fz2Lnfq4uT9q3iu9ZsNaPLxPc"); +} + +pub mod migrate_config_program_to_core_bpf { + solana_sdk::declare_id!("2Fr57nzzkLYXW695UdDxDeR5fhnZWSttZeZYemrnpGFV"); +} + +pub mod enable_get_epoch_stake_syscall { + solana_sdk::declare_id!("7mScTYkJXsbdrcwTQRs7oeCSXoJm4WjzBsRyf8bCU3Np"); +} + +pub mod migrate_address_lookup_table_program_to_core_bpf { + solana_sdk::declare_id!("C97eKZygrkU4JxJsZdjgbUY7iQR7rKTr4NyDWo2E5pRm"); +} + +pub mod zk_elgamal_proof_program_enabled { + solana_sdk::declare_id!("zkhiy5oLowR7HY4zogXjCjeMXyruLqBwSWH21qcFtnv"); +} + +pub mod verify_retransmitter_signature { + solana_sdk::declare_id!("BZ5g4hRbu5hLQQBdPyo2z9icGyJ8Khiyj3QS6dhWijTb"); +} + +pub mod move_stake_and_move_lamports_ixs { + solana_sdk::declare_id!("7bTK6Jis8Xpfrs8ZoUfiMDPazTcdPcTWheZFJTA5Z6X4"); +} + +pub mod ed25519_precompile_verify_strict { + solana_sdk::declare_id!("ed9tNscbWLYBooxWA7FE2B5KHWs8A6sxfY8EzezEcoo"); +} + +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 = [ @@ -981,6 +1040,23 @@ 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"), +<<<<<<< HEAD +======= + (reward_full_priority_fee::id(), "Reward full priority fee to validators #34731"), + (abort_on_invalid_curve::id(), "Abort when elliptic curve syscalls invoked on invalid curve id SIMD-0137"), + (get_sysvar_syscall_enabled::id(), "Enable syscall for fetching Sysvar bytes #615"), + (migrate_feature_gate_program_to_core_bpf::id(), "Migrate Feature Gate program to Core BPF (programify) #1003"), + (vote_only_full_fec_sets::id(), "vote only full fec sets"), + (migrate_config_program_to_core_bpf::id(), "Migrate Config program to Core BPF #1378"), + (enable_get_epoch_stake_syscall::id(), "Enable syscall: sol_get_epoch_stake #884"), + (migrate_address_lookup_table_program_to_core_bpf::id(), "Migrate Address Lookup Table program to Core BPF #1651"), + (zk_elgamal_proof_program_enabled::id(), "Enable ZkElGamalProof program SIMD-0153"), + (verify_retransmitter_signature::id(), "Verify retransmitter signature #1840"), + (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 #"), +>>>>>>> 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 bebbda5af8b1e0..d2e3da68a4b7af 100644 --- a/turbine/src/cluster_nodes.rs +++ b/turbine/src/cluster_nodes.rs @@ -584,8 +584,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, @@ -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 { From fb900c729e10f308de40ed3ccd87a31c7e906d7e Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Tue, 6 Aug 2024 13:27:55 -0500 Subject: [PATCH 2/2] resolves merge conflicts --- sdk/src/feature_set.rs | 73 +----------------------------------------- 1 file changed, 1 insertion(+), 72 deletions(-) diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index 85f1f27e5ef91a..64f9dbc48d03de 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -789,65 +789,10 @@ pub mod deprecate_unused_legacy_vote_plumbing { solana_sdk::declare_id!("6Uf8S75PVh91MYgPQSHnjRAPQq6an5BDv9vomrCwDqLe"); } -<<<<<<< HEAD -======= -pub mod reward_full_priority_fee { - solana_sdk::declare_id!("3opE3EzAKnUftUDURkzMgwpNgimBAypW1mNDYH4x4Zg7"); -} - -pub mod get_sysvar_syscall_enabled { - solana_sdk::declare_id!("CLCoTADvV64PSrnR6QXty6Fwrt9Xc6EdxSJE4wLRePjq"); -} - -pub mod abort_on_invalid_curve { - solana_sdk::declare_id!("FuS3FPfJDKSNot99ECLXtp3rueq36hMNStJkPJwWodLh"); -} - -pub mod migrate_feature_gate_program_to_core_bpf { - solana_sdk::declare_id!("4eohviozzEeivk1y9UbrnekbAFMDQyJz5JjA9Y6gyvky"); -} - -pub mod vote_only_full_fec_sets { - solana_sdk::declare_id!("ffecLRhhakKSGhMuc6Fz2Lnfq4uT9q3iu9ZsNaPLxPc"); -} - -pub mod migrate_config_program_to_core_bpf { - solana_sdk::declare_id!("2Fr57nzzkLYXW695UdDxDeR5fhnZWSttZeZYemrnpGFV"); -} - -pub mod enable_get_epoch_stake_syscall { - solana_sdk::declare_id!("7mScTYkJXsbdrcwTQRs7oeCSXoJm4WjzBsRyf8bCU3Np"); -} - -pub mod migrate_address_lookup_table_program_to_core_bpf { - solana_sdk::declare_id!("C97eKZygrkU4JxJsZdjgbUY7iQR7rKTr4NyDWo2E5pRm"); -} - -pub mod zk_elgamal_proof_program_enabled { - solana_sdk::declare_id!("zkhiy5oLowR7HY4zogXjCjeMXyruLqBwSWH21qcFtnv"); -} - -pub mod verify_retransmitter_signature { - solana_sdk::declare_id!("BZ5g4hRbu5hLQQBdPyo2z9icGyJ8Khiyj3QS6dhWijTb"); -} - -pub mod move_stake_and_move_lamports_ixs { - solana_sdk::declare_id!("7bTK6Jis8Xpfrs8ZoUfiMDPazTcdPcTWheZFJTA5Z6X4"); -} - -pub mod ed25519_precompile_verify_strict { - solana_sdk::declare_id!("ed9tNscbWLYBooxWA7FE2B5KHWs8A6sxfY8EzezEcoo"); -} - -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 = [ @@ -1040,23 +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"), -<<<<<<< HEAD -======= - (reward_full_priority_fee::id(), "Reward full priority fee to validators #34731"), - (abort_on_invalid_curve::id(), "Abort when elliptic curve syscalls invoked on invalid curve id SIMD-0137"), - (get_sysvar_syscall_enabled::id(), "Enable syscall for fetching Sysvar bytes #615"), - (migrate_feature_gate_program_to_core_bpf::id(), "Migrate Feature Gate program to Core BPF (programify) #1003"), - (vote_only_full_fec_sets::id(), "vote only full fec sets"), - (migrate_config_program_to_core_bpf::id(), "Migrate Config program to Core BPF #1378"), - (enable_get_epoch_stake_syscall::id(), "Enable syscall: sol_get_epoch_stake #884"), - (migrate_address_lookup_table_program_to_core_bpf::id(), "Migrate Address Lookup Table program to Core BPF #1651"), - (zk_elgamal_proof_program_enabled::id(), "Enable ZkElGamalProof program SIMD-0153"), - (verify_retransmitter_signature::id(), "Verify retransmitter signature #1840"), - (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 #"), ->>>>>>> 57144b0cea (extends Turbine fanout experiment to wider fanout values (#2373)) + (enable_turbine_extended_fanout_experiments::id(), "enable turbine extended fanout experiments #2373"), /*************** ADD NEW FEATURES HERE ***************/ ] .iter()