From b4eeb3a713815cc83060645152e39002a42dbca7 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Wed, 11 Dec 2024 11:42:54 -0600 Subject: [PATCH 1/4] Basic scheduler config --- core/src/banking_stage.rs | 9 +++++- .../prio_graph_scheduler.rs | 28 ++++++++++++++----- .../scheduler_controller.rs | 18 ++++++++++-- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index 49ccdb6ae15eff..f5b70e238196f4 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -31,6 +31,7 @@ use { crossbeam_channel::{unbounded, Receiver, RecvTimeoutError, Sender}, histogram::Histogram, solana_client::connection_cache::ConnectionCache, + solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo}, solana_ledger::blockstore_processor::TransactionStatusSender, solana_measure::measure_us, @@ -52,6 +53,7 @@ use { time::{Duration, Instant}, }, transaction_scheduler::{ + prio_graph_scheduler::PrioGraphSchedulerConfig, receive_and_buffer::SanitizedTransactionReceiveAndBuffer, transaction_state_container::TransactionStateContainer, }, @@ -621,7 +623,12 @@ impl BankingStage { bank_forks.clone(), forwarder.is_some(), ); - let scheduler = PrioGraphScheduler::new(work_senders, finished_work_receiver); + let scheduler_config = PrioGraphSchedulerConfig { + max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, + max_transactions_per_scheduling_pass: 100_000, + }; + let scheduler = + PrioGraphScheduler::new(work_senders, finished_work_receiver, scheduler_config); let scheduler_controller = SchedulerController::new( decision_maker.clone(), receive_and_buffer, diff --git a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs index 950f506fd51af4..9e5e86be2d10db 100644 --- a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs +++ b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs @@ -19,7 +19,6 @@ use { crossbeam_channel::{Receiver, Sender, TryRecvError}, itertools::izip, prio_graph::{AccessKind, GraphNode, PrioGraph}, - solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_measure::measure_us, solana_runtime_transaction::transaction_with_meta::TransactionWithMeta, solana_sdk::{pubkey::Pubkey, saturating_add_assign}, @@ -41,6 +40,11 @@ type SchedulerPrioGraph = PrioGraph< fn(&TransactionPriorityId, &GraphNode) -> TransactionPriorityId, >; +pub(crate) struct PrioGraphSchedulerConfig { + pub max_cu_per_thread: u64, + pub max_transactions_per_scheduling_pass: usize, +} + pub(crate) struct PrioGraphScheduler { in_flight_tracker: InFlightTracker, account_locks: ThreadAwareAccountLocks, @@ -48,12 +52,14 @@ pub(crate) struct PrioGraphScheduler { finished_consume_work_receiver: Receiver>, look_ahead_window_size: usize, prio_graph: SchedulerPrioGraph, + config: PrioGraphSchedulerConfig, } impl PrioGraphScheduler { pub(crate) fn new( consume_work_senders: Vec>>, finished_consume_work_receiver: Receiver>, + config: PrioGraphSchedulerConfig, ) -> Self { let num_threads = consume_work_senders.len(); Self { @@ -63,6 +69,7 @@ impl PrioGraphScheduler { finished_consume_work_receiver, look_ahead_window_size: 2048, prio_graph: PrioGraph::new(passthrough_priority), + config, } } @@ -89,7 +96,7 @@ impl PrioGraphScheduler { pre_lock_filter: impl Fn(&Tx) -> bool, ) -> Result { let num_threads = self.consume_work_senders.len(); - let max_cu_per_thread = MAX_BLOCK_UNITS / num_threads as u64; + let max_cu_per_thread = self.config.max_cu_per_thread; let mut schedulable_threads = ThreadSet::any(num_threads); for thread_id in 0..num_threads { @@ -172,11 +179,10 @@ impl PrioGraphScheduler { let mut unblock_this_batch = Vec::with_capacity(self.consume_work_senders.len() * TARGET_NUM_TRANSACTIONS_PER_BATCH); - const MAX_TRANSACTIONS_PER_SCHEDULING_PASS: usize = 100_000; let mut num_scheduled: usize = 0; let mut num_sent: usize = 0; let mut num_unschedulable: usize = 0; - while num_scheduled < MAX_TRANSACTIONS_PER_SCHEDULING_PASS { + while num_scheduled < self.config.max_transactions_per_scheduling_pass { // If nothing is in the main-queue of the `PrioGraph` then there's nothing left to schedule. if self.prio_graph.is_empty() { break; @@ -248,7 +254,7 @@ impl PrioGraphScheduler { } } - if num_scheduled >= MAX_TRANSACTIONS_PER_SCHEDULING_PASS { + if num_scheduled >= self.config.max_transactions_per_scheduling_pass { break; } } @@ -611,6 +617,7 @@ mod tests { }, crossbeam_channel::{unbounded, Receiver}, itertools::Itertools, + solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_runtime_transaction::runtime_transaction::RuntimeTransaction, solana_sdk::{ compute_budget::ComputeBudgetInstruction, @@ -637,8 +644,15 @@ mod tests { let (consume_work_senders, consume_work_receivers) = (0..num_threads).map(|_| unbounded()).unzip(); let (finished_consume_work_sender, finished_consume_work_receiver) = unbounded(); - let scheduler = - PrioGraphScheduler::new(consume_work_senders, finished_consume_work_receiver); + let scheduler_config = PrioGraphSchedulerConfig { + max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, + max_transactions_per_scheduling_pass: 100_000, + }; + let scheduler = PrioGraphScheduler::new( + consume_work_senders, + finished_consume_work_receiver, + scheduler_config, + ); ( scheduler, consume_work_receivers, diff --git a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs index 14a175b2018260..6d336391c9cc89 100644 --- a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs +++ b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs @@ -441,13 +441,17 @@ mod tests { packet_deserializer::PacketDeserializer, scheduler_messages::{ConsumeWork, FinishedConsumeWork, TransactionBatchId}, tests::create_slow_genesis_config, - transaction_scheduler::receive_and_buffer::SanitizedTransactionReceiveAndBuffer, + transaction_scheduler::{ + prio_graph_scheduler::PrioGraphSchedulerConfig, + receive_and_buffer::SanitizedTransactionReceiveAndBuffer, + }, }, banking_trace::BankingPacketBatch, sigverify::SigverifyTracerPacketStats, }, crossbeam_channel::{unbounded, Receiver, Sender}, itertools::Itertools, + solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_gossip::cluster_info::ClusterInfo, solana_ledger::{ blockstore::Blockstore, genesis_utils::GenesisConfigInfo, @@ -550,11 +554,21 @@ mod tests { false, ); + let scheduler_config = PrioGraphSchedulerConfig { + max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, + max_transactions_per_scheduling_pass: 100_000, + }; + let scheduler = PrioGraphScheduler::new( + consume_work_senders, + finished_consume_work_receiver, + scheduler_config, + ); + let scheduler_controller = SchedulerController::new( decision_maker, receive_and_buffer, bank_forks, - PrioGraphScheduler::new(consume_work_senders, finished_consume_work_receiver), + scheduler, vec![], // no actual workers with metrics to report, this can be empty None, ); From 6f3215f9d554cf61601f36121f967552a84f031d Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Wed, 11 Dec 2024 11:47:41 -0600 Subject: [PATCH 2/4] look_ahead_window_size into config --- core/src/banking_stage.rs | 1 + .../transaction_scheduler/prio_graph_scheduler.rs | 8 ++++---- .../transaction_scheduler/scheduler_controller.rs | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index f5b70e238196f4..4871ac74efafe2 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -626,6 +626,7 @@ impl BankingStage { let scheduler_config = PrioGraphSchedulerConfig { max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, max_transactions_per_scheduling_pass: 100_000, + look_ahead_window_size: 2048, }; let scheduler = PrioGraphScheduler::new(work_senders, finished_work_receiver, scheduler_config); diff --git a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs index 9e5e86be2d10db..80c6fc3be3acc1 100644 --- a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs +++ b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs @@ -43,6 +43,7 @@ type SchedulerPrioGraph = PrioGraph< pub(crate) struct PrioGraphSchedulerConfig { pub max_cu_per_thread: u64, pub max_transactions_per_scheduling_pass: usize, + pub look_ahead_window_size: usize, } pub(crate) struct PrioGraphScheduler { @@ -50,7 +51,6 @@ pub(crate) struct PrioGraphScheduler { account_locks: ThreadAwareAccountLocks, consume_work_senders: Vec>>, finished_consume_work_receiver: Receiver>, - look_ahead_window_size: usize, prio_graph: SchedulerPrioGraph, config: PrioGraphSchedulerConfig, } @@ -67,7 +67,6 @@ impl PrioGraphScheduler { account_locks: ThreadAwareAccountLocks::new(num_threads), consume_work_senders, finished_consume_work_receiver, - look_ahead_window_size: 2048, prio_graph: PrioGraph::new(passthrough_priority), config, } @@ -125,7 +124,7 @@ impl PrioGraphScheduler { let mut num_filtered_out: usize = 0; let mut total_filter_time_us: u64 = 0; - let mut window_budget = self.look_ahead_window_size; + let mut window_budget = self.config.look_ahead_window_size; let mut chunked_pops = |container: &mut S, prio_graph: &mut PrioGraph<_, _, _, _>, window_budget: &mut usize| { @@ -647,6 +646,7 @@ mod tests { let scheduler_config = PrioGraphSchedulerConfig { max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, max_transactions_per_scheduling_pass: 100_000, + look_ahead_window_size: 2048, }; let scheduler = PrioGraphScheduler::new( consume_work_senders, @@ -835,7 +835,7 @@ mod tests { fn test_schedule_priority_guard() { let (mut scheduler, work_receivers, finished_work_sender) = create_test_frame(2); // intentionally shorten the look-ahead window to cause unschedulable conflicts - scheduler.look_ahead_window_size = 2; + scheduler.config.look_ahead_window_size = 2; let accounts = (0..8).map(|_| Keypair::new()).collect_vec(); let mut container = create_container([ diff --git a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs index 6d336391c9cc89..397e4f86b8565e 100644 --- a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs +++ b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs @@ -557,6 +557,7 @@ mod tests { let scheduler_config = PrioGraphSchedulerConfig { max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, max_transactions_per_scheduling_pass: 100_000, + look_ahead_window_size: 2048, }; let scheduler = PrioGraphScheduler::new( consume_work_senders, From ed07130e86838549112e6298dd91309db4f61de8 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Wed, 11 Dec 2024 11:52:38 -0600 Subject: [PATCH 3/4] target_num_transactions_per_batch as config --- core/src/banking_stage.rs | 2 ++ .../prio_graph_scheduler.rs | 31 +++++++++++-------- .../scheduler_controller.rs | 1 + 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index 4871ac74efafe2..b8b4993ec0f96f 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -28,6 +28,7 @@ use { tracer_packet_stats::TracerPacketStats, validator::BlockProductionMethod, }, + consumer::TARGET_NUM_TRANSACTIONS_PER_BATCH, crossbeam_channel::{unbounded, Receiver, RecvTimeoutError, Sender}, histogram::Histogram, solana_client::connection_cache::ConnectionCache, @@ -627,6 +628,7 @@ impl BankingStage { max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, max_transactions_per_scheduling_pass: 100_000, look_ahead_window_size: 2048, + target_transactions_per_batch: TARGET_NUM_TRANSACTIONS_PER_BATCH, }; let scheduler = PrioGraphScheduler::new(work_senders, finished_work_receiver, scheduler_config); diff --git a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs index 80c6fc3be3acc1..ab2e7fba9122ce 100644 --- a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs +++ b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs @@ -6,7 +6,6 @@ use { transaction_state::SanitizedTransactionTTL, }, crate::banking_stage::{ - consumer::TARGET_NUM_TRANSACTIONS_PER_BATCH, read_write_account_set::ReadWriteAccountSet, scheduler_messages::{ ConsumeWork, FinishedConsumeWork, MaxAge, TransactionBatchId, TransactionId, @@ -44,6 +43,7 @@ pub(crate) struct PrioGraphSchedulerConfig { pub max_cu_per_thread: u64, pub max_transactions_per_scheduling_pass: usize, pub look_ahead_window_size: usize, + pub target_transactions_per_batch: usize, } pub(crate) struct PrioGraphScheduler { @@ -112,7 +112,7 @@ impl PrioGraphScheduler { }); } - let mut batches = Batches::new(num_threads); + let mut batches = Batches::new(num_threads, self.config.target_transactions_per_batch); // Some transactions may be unschedulable due to multi-thread conflicts. // These transactions cannot be scheduled until some conflicting work is completed. // However, the scheduler should not allow other transactions that conflict with @@ -176,8 +176,9 @@ impl PrioGraphScheduler { // Check transactions against filter, remove from container if it fails. chunked_pops(container, &mut self.prio_graph, &mut window_budget); - let mut unblock_this_batch = - Vec::with_capacity(self.consume_work_senders.len() * TARGET_NUM_TRANSACTIONS_PER_BATCH); + let mut unblock_this_batch = Vec::with_capacity( + self.consume_work_senders.len() * self.config.target_transactions_per_batch, + ); let mut num_scheduled: usize = 0; let mut num_sent: usize = 0; let mut num_unschedulable: usize = 0; @@ -234,7 +235,8 @@ impl PrioGraphScheduler { saturating_add_assign!(batches.total_cus[thread_id], cost); // If target batch size is reached, send only this batch. - if batches.ids[thread_id].len() >= TARGET_NUM_TRANSACTIONS_PER_BATCH { + if batches.ids[thread_id].len() >= self.config.target_transactions_per_batch + { saturating_add_assign!( num_sent, self.send_batch(&mut batches, thread_id)? @@ -413,7 +415,8 @@ impl PrioGraphScheduler { return Ok(0); } - let (ids, transactions, max_ages, total_cus) = batches.take_batch(thread_index); + let (ids, transactions, max_ages, total_cus) = + batches.take_batch(thread_index, self.config.target_transactions_per_batch); let batch_id = self .in_flight_tracker @@ -503,14 +506,14 @@ struct Batches { } impl Batches { - fn new(num_threads: usize) -> Self { + fn new(num_threads: usize, target_num_transactions_per_batch: usize) -> Self { Self { - ids: vec![Vec::with_capacity(TARGET_NUM_TRANSACTIONS_PER_BATCH); num_threads], + ids: vec![Vec::with_capacity(target_num_transactions_per_batch); num_threads], transactions: (0..num_threads) - .map(|_| Vec::with_capacity(TARGET_NUM_TRANSACTIONS_PER_BATCH)) + .map(|_| Vec::with_capacity(target_num_transactions_per_batch)) .collect(), - max_ages: vec![Vec::with_capacity(TARGET_NUM_TRANSACTIONS_PER_BATCH); num_threads], + max_ages: vec![Vec::with_capacity(target_num_transactions_per_batch); num_threads], total_cus: vec![0; num_threads], } } @@ -518,19 +521,20 @@ impl Batches { fn take_batch( &mut self, thread_id: ThreadId, + target_num_transactions_per_batch: usize, ) -> (Vec, Vec, Vec, u64) { ( core::mem::replace( &mut self.ids[thread_id], - Vec::with_capacity(TARGET_NUM_TRANSACTIONS_PER_BATCH), + Vec::with_capacity(target_num_transactions_per_batch), ), core::mem::replace( &mut self.transactions[thread_id], - Vec::with_capacity(TARGET_NUM_TRANSACTIONS_PER_BATCH), + Vec::with_capacity(target_num_transactions_per_batch), ), core::mem::replace( &mut self.max_ages[thread_id], - Vec::with_capacity(TARGET_NUM_TRANSACTIONS_PER_BATCH), + Vec::with_capacity(target_num_transactions_per_batch), ), core::mem::replace(&mut self.total_cus[thread_id], 0), ) @@ -647,6 +651,7 @@ mod tests { max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, max_transactions_per_scheduling_pass: 100_000, look_ahead_window_size: 2048, + target_transactions_per_batch: TARGET_NUM_TRANSACTIONS_PER_BATCH, }; let scheduler = PrioGraphScheduler::new( consume_work_senders, diff --git a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs index 397e4f86b8565e..327062dca476cb 100644 --- a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs +++ b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs @@ -558,6 +558,7 @@ mod tests { max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, max_transactions_per_scheduling_pass: 100_000, look_ahead_window_size: 2048, + target_transactions_per_batch: TARGET_NUM_TRANSACTIONS_PER_BATCH, }; let scheduler = PrioGraphScheduler::new( consume_work_senders, From 80c0975f71f349c86db94daf57beb8da982abe26 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Wed, 11 Dec 2024 12:00:59 -0600 Subject: [PATCH 4/4] More convient way to configure --- core/src/banking_stage.rs | 15 ++++------- .../prio_graph_scheduler.rs | 27 +++++++++++-------- .../scheduler_controller.rs | 10 +------ 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index b8b4993ec0f96f..dfb29cbcef0ca9 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -28,11 +28,9 @@ use { tracer_packet_stats::TracerPacketStats, validator::BlockProductionMethod, }, - consumer::TARGET_NUM_TRANSACTIONS_PER_BATCH, crossbeam_channel::{unbounded, Receiver, RecvTimeoutError, Sender}, histogram::Histogram, solana_client::connection_cache::ConnectionCache, - solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo}, solana_ledger::blockstore_processor::TransactionStatusSender, solana_measure::measure_us, @@ -624,14 +622,11 @@ impl BankingStage { bank_forks.clone(), forwarder.is_some(), ); - let scheduler_config = PrioGraphSchedulerConfig { - max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, - max_transactions_per_scheduling_pass: 100_000, - look_ahead_window_size: 2048, - target_transactions_per_batch: TARGET_NUM_TRANSACTIONS_PER_BATCH, - }; - let scheduler = - PrioGraphScheduler::new(work_senders, finished_work_receiver, scheduler_config); + let scheduler = PrioGraphScheduler::new( + work_senders, + finished_work_receiver, + PrioGraphSchedulerConfig::default(), + ); let scheduler_controller = SchedulerController::new( decision_maker.clone(), receive_and_buffer, diff --git a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs index ab2e7fba9122ce..8edebc1f80c200 100644 --- a/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs +++ b/core/src/banking_stage/transaction_scheduler/prio_graph_scheduler.rs @@ -6,6 +6,7 @@ use { transaction_state::SanitizedTransactionTTL, }, crate::banking_stage::{ + consumer::TARGET_NUM_TRANSACTIONS_PER_BATCH, read_write_account_set::ReadWriteAccountSet, scheduler_messages::{ ConsumeWork, FinishedConsumeWork, MaxAge, TransactionBatchId, TransactionId, @@ -18,6 +19,7 @@ use { crossbeam_channel::{Receiver, Sender, TryRecvError}, itertools::izip, prio_graph::{AccessKind, GraphNode, PrioGraph}, + solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_measure::measure_us, solana_runtime_transaction::transaction_with_meta::TransactionWithMeta, solana_sdk::{pubkey::Pubkey, saturating_add_assign}, @@ -40,12 +42,23 @@ type SchedulerPrioGraph = PrioGraph< >; pub(crate) struct PrioGraphSchedulerConfig { - pub max_cu_per_thread: u64, + pub max_scheduled_cus: u64, pub max_transactions_per_scheduling_pass: usize, pub look_ahead_window_size: usize, pub target_transactions_per_batch: usize, } +impl Default for PrioGraphSchedulerConfig { + fn default() -> Self { + Self { + max_scheduled_cus: MAX_BLOCK_UNITS, + max_transactions_per_scheduling_pass: 100_000, + look_ahead_window_size: 2048, + target_transactions_per_batch: TARGET_NUM_TRANSACTIONS_PER_BATCH, + } + } +} + pub(crate) struct PrioGraphScheduler { in_flight_tracker: InFlightTracker, account_locks: ThreadAwareAccountLocks, @@ -95,7 +108,7 @@ impl PrioGraphScheduler { pre_lock_filter: impl Fn(&Tx) -> bool, ) -> Result { let num_threads = self.consume_work_senders.len(); - let max_cu_per_thread = self.config.max_cu_per_thread; + let max_cu_per_thread = self.config.max_scheduled_cus / num_threads as u64; let mut schedulable_threads = ThreadSet::any(num_threads); for thread_id in 0..num_threads { @@ -614,13 +627,11 @@ mod tests { use { super::*, crate::banking_stage::{ - consumer::TARGET_NUM_TRANSACTIONS_PER_BATCH, immutable_deserialized_packet::ImmutableDeserializedPacket, transaction_scheduler::transaction_state_container::TransactionStateContainer, }, crossbeam_channel::{unbounded, Receiver}, itertools::Itertools, - solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_runtime_transaction::runtime_transaction::RuntimeTransaction, solana_sdk::{ compute_budget::ComputeBudgetInstruction, @@ -647,16 +658,10 @@ mod tests { let (consume_work_senders, consume_work_receivers) = (0..num_threads).map(|_| unbounded()).unzip(); let (finished_consume_work_sender, finished_consume_work_receiver) = unbounded(); - let scheduler_config = PrioGraphSchedulerConfig { - max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, - max_transactions_per_scheduling_pass: 100_000, - look_ahead_window_size: 2048, - target_transactions_per_batch: TARGET_NUM_TRANSACTIONS_PER_BATCH, - }; let scheduler = PrioGraphScheduler::new( consume_work_senders, finished_consume_work_receiver, - scheduler_config, + PrioGraphSchedulerConfig::default(), ); ( scheduler, diff --git a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs index 327062dca476cb..e4fca69c3f4d11 100644 --- a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs +++ b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs @@ -451,7 +451,6 @@ mod tests { }, crossbeam_channel::{unbounded, Receiver, Sender}, itertools::Itertools, - solana_cost_model::block_cost_limits::MAX_BLOCK_UNITS, solana_gossip::cluster_info::ClusterInfo, solana_ledger::{ blockstore::Blockstore, genesis_utils::GenesisConfigInfo, @@ -554,18 +553,11 @@ mod tests { false, ); - let scheduler_config = PrioGraphSchedulerConfig { - max_cu_per_thread: MAX_BLOCK_UNITS / num_threads as u64, - max_transactions_per_scheduling_pass: 100_000, - look_ahead_window_size: 2048, - target_transactions_per_batch: TARGET_NUM_TRANSACTIONS_PER_BATCH, - }; let scheduler = PrioGraphScheduler::new( consume_work_senders, finished_consume_work_receiver, - scheduler_config, + PrioGraphSchedulerConfig::default(), ); - let scheduler_controller = SchedulerController::new( decision_maker, receive_and_buffer,