From 7d647fe7ff2ede6b4f3422c72aded13ce03011ed Mon Sep 17 00:00:00 2001 From: Andrei Silviu Dragnea Date: Sun, 21 Apr 2024 13:50:14 +0300 Subject: [PATCH] Refactor `log_messages_bytes_limit` parameter usage Replacing `log_messages_bytes_limit` parameter inside `TransactionBatchProcessor::execute_loaded_transaction()` with `self.runtime_config.log_messages_bytes_limit` allows removing many `log_messages_bytes_limit` parameters propagated across the codebase. --- banking-bench/src/main.rs | 1 - core/benches/banking_stage.rs | 3 +-- core/benches/consumer.rs | 2 +- core/src/banking_stage.rs | 23 +---------------- core/src/banking_stage/consume_worker.rs | 2 +- core/src/banking_stage/consumer.rs | 30 ++++++++++----------- core/src/replay_stage.rs | 12 --------- core/src/tpu.rs | 2 -- core/src/tvu.rs | 3 --- core/src/validator.rs | 3 --- ledger-tool/src/ledger_utils.rs | 1 - ledger/benches/blockstore_processor.rs | 1 - ledger/src/blockstore_processor.rs | 23 ----------------- programs/sbf/tests/programs.rs | 2 -- runtime/src/bank.rs | 7 ----- runtime/src/bank/tests.rs | 4 --- svm/src/transaction_processor.rs | 9 +------ svm/tests/integration_test.rs | 1 - unified-scheduler-pool/src/lib.rs | 33 +++++++----------------- 19 files changed, 28 insertions(+), 134 deletions(-) diff --git a/banking-bench/src/main.rs b/banking-bench/src/main.rs index f970a0002d11d1..43b9d17b550482 100644 --- a/banking-bench/src/main.rs +++ b/banking-bench/src/main.rs @@ -470,7 +470,6 @@ fn main() { num_banking_threads, None, replay_vote_sender, - None, Arc::new(connection_cache), bank_forks.clone(), &Arc::new(PrioritizationFeeCache::new(0u64)), diff --git a/core/benches/banking_stage.rs b/core/benches/banking_stage.rs index eb458ad092ba0e..6deff58370501c 100644 --- a/core/benches/banking_stage.rs +++ b/core/benches/banking_stage.rs @@ -110,7 +110,7 @@ fn bench_consume_buffered(bencher: &mut Bencher) { ); let (s, _r) = unbounded(); let committer = Committer::new(None, s, Arc::new(PrioritizationFeeCache::new(0u64))); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); // This tests the performance of buffering packets. // If the packet buffers are copied, performance will be poor. bencher.iter(move || { @@ -299,7 +299,6 @@ fn bench_banking(bencher: &mut Bencher, tx_type: TransactionType) { gossip_vote_receiver, None, s, - None, Arc::new(ConnectionCache::new("connection_cache_test")), bank_forks, &Arc::new(PrioritizationFeeCache::new(0u64)), diff --git a/core/benches/consumer.rs b/core/benches/consumer.rs index f1402f87ad08bf..eb09ea44f8e7e5 100644 --- a/core/benches/consumer.rs +++ b/core/benches/consumer.rs @@ -85,7 +85,7 @@ fn create_consumer(poh_recorder: &RwLock) -> Consumer { let (replay_vote_sender, _replay_vote_receiver) = unbounded(); let committer = Committer::new(None, replay_vote_sender, Arc::default()); let transaction_recorder = poh_recorder.read().unwrap().new_recorder(); - Consumer::new(committer, transaction_recorder, QosService::new(0), None) + Consumer::new(committer, transaction_recorder, QosService::new(0)) } struct BenchFrame { diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index d839954d380449..22027eafe70413 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -331,7 +331,6 @@ impl BankingStage { gossip_vote_receiver: BankingPacketReceiver, transaction_status_sender: Option, replay_vote_sender: ReplayVoteSender, - log_messages_bytes_limit: Option, connection_cache: Arc, bank_forks: Arc>, prioritization_fee_cache: &Arc, @@ -346,7 +345,6 @@ impl BankingStage { Self::num_threads(), transaction_status_sender, replay_vote_sender, - log_messages_bytes_limit, connection_cache, bank_forks, prioritization_fee_cache, @@ -364,7 +362,6 @@ impl BankingStage { num_threads: u32, transaction_status_sender: Option, replay_vote_sender: ReplayVoteSender, - log_messages_bytes_limit: Option, connection_cache: Arc, bank_forks: Arc>, prioritization_fee_cache: &Arc, @@ -380,7 +377,6 @@ impl BankingStage { num_threads, transaction_status_sender, replay_vote_sender, - log_messages_bytes_limit, connection_cache, bank_forks, prioritization_fee_cache, @@ -395,7 +391,6 @@ impl BankingStage { num_threads, transaction_status_sender, replay_vote_sender, - log_messages_bytes_limit, connection_cache, bank_forks, prioritization_fee_cache, @@ -413,7 +408,6 @@ impl BankingStage { num_threads: u32, transaction_status_sender: Option, replay_vote_sender: ReplayVoteSender, - log_messages_bytes_limit: Option, connection_cache: Arc, bank_forks: Arc>, prioritization_fee_cache: &Arc, @@ -478,7 +472,6 @@ impl BankingStage { decision_maker.clone(), committer.clone(), transaction_recorder.clone(), - log_messages_bytes_limit, forwarder, unprocessed_transaction_storage, ) @@ -497,7 +490,6 @@ impl BankingStage { num_threads: u32, transaction_status_sender: Option, replay_vote_sender: ReplayVoteSender, - log_messages_bytes_limit: Option, connection_cache: Arc, bank_forks: Arc>, prioritization_fee_cache: &Arc, @@ -533,7 +525,6 @@ impl BankingStage { decision_maker.clone(), committer.clone(), transaction_recorder.clone(), - log_messages_bytes_limit, Forwarder::new( poh_recorder.clone(), bank_forks.clone(), @@ -565,7 +556,6 @@ impl BankingStage { committer.clone(), poh_recorder.read().unwrap().new_recorder(), QosService::new(id), - log_messages_bytes_limit, ), finished_work_sender.clone(), poh_recorder.read().unwrap().new_leader_bank_notifier(), @@ -616,17 +606,11 @@ impl BankingStage { decision_maker: DecisionMaker, committer: Committer, transaction_recorder: TransactionRecorder, - log_messages_bytes_limit: Option, forwarder: Forwarder, unprocessed_transaction_storage: UnprocessedTransactionStorage, ) -> JoinHandle<()> { let mut packet_receiver = PacketReceiver::new(id, packet_receiver, bank_forks); - let consumer = Consumer::new( - committer, - transaction_recorder, - QosService::new(id), - log_messages_bytes_limit, - ); + let consumer = Consumer::new(committer, transaction_recorder, QosService::new(id)); Builder::new() .name(format!("solBanknStgTx{id:02}")) @@ -866,7 +850,6 @@ mod tests { gossip_vote_receiver, None, replay_vote_sender, - None, Arc::new(ConnectionCache::new("connection_cache_test")), bank_forks, &Arc::new(PrioritizationFeeCache::new(0u64)), @@ -921,7 +904,6 @@ mod tests { gossip_vote_receiver, None, replay_vote_sender, - None, Arc::new(ConnectionCache::new("connection_cache_test")), bank_forks, &Arc::new(PrioritizationFeeCache::new(0u64)), @@ -1000,7 +982,6 @@ mod tests { gossip_vote_receiver, None, replay_vote_sender, - None, Arc::new(ConnectionCache::new("connection_cache_test")), bank_forks, &Arc::new(PrioritizationFeeCache::new(0u64)), @@ -1170,7 +1151,6 @@ mod tests { 3, None, replay_vote_sender, - None, Arc::new(ConnectionCache::new("connection_cache_test")), bank_forks, &Arc::new(PrioritizationFeeCache::new(0u64)), @@ -1361,7 +1341,6 @@ mod tests { gossip_vote_receiver, None, replay_vote_sender, - None, Arc::new(ConnectionCache::new("connection_cache_test")), bank_forks, &Arc::new(PrioritizationFeeCache::new(0u64)), diff --git a/core/src/banking_stage/consume_worker.rs b/core/src/banking_stage/consume_worker.rs index 4444772fb71694..1882ef3ff44fe0 100644 --- a/core/src/banking_stage/consume_worker.rs +++ b/core/src/banking_stage/consume_worker.rs @@ -759,7 +759,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let (consume_sender, consume_receiver) = unbounded(); let (consumed_sender, consumed_receiver) = unbounded(); diff --git a/core/src/banking_stage/consumer.rs b/core/src/banking_stage/consumer.rs index 9fe46ad236e622..65df9563b66370 100644 --- a/core/src/banking_stage/consumer.rs +++ b/core/src/banking_stage/consumer.rs @@ -78,7 +78,6 @@ pub struct Consumer { committer: Committer, transaction_recorder: TransactionRecorder, qos_service: QosService, - log_messages_bytes_limit: Option, } impl Consumer { @@ -86,13 +85,11 @@ impl Consumer { committer: Committer, transaction_recorder: TransactionRecorder, qos_service: QosService, - log_messages_bytes_limit: Option, ) -> Self { Self { committer, transaction_recorder, qos_service, - log_messages_bytes_limit, } } @@ -597,7 +594,6 @@ impl Consumer { ExecutionRecordingConfig::new_single_setting(transaction_status_sender_enabled), &mut execute_and_commit_timings.execute_timings, None, // account_overrides - self.log_messages_bytes_limit, true, )); execute_and_commit_timings.load_execute_us = load_execute_us; @@ -922,7 +918,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let process_transactions_summary = consumer.process_transactions(&bank, &Instant::now(), &transactions); @@ -1095,7 +1091,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let process_transactions_batch_output = consumer.process_and_record_transactions(&bank, &transactions, 0); @@ -1279,7 +1275,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let process_transactions_batch_output = consumer.process_and_record_transactions(&bank, &transactions, 0); @@ -1380,7 +1376,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let process_transactions_batch_output = consumer.process_and_record_transactions(&bank, &transactions, 0); @@ -1469,7 +1465,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let get_block_cost = || bank.read_cost_tracker().unwrap().block_cost(); let get_tx_count = || bank.read_cost_tracker().unwrap().transaction_count(); @@ -1624,7 +1620,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let process_transactions_batch_output = consumer.process_and_record_transactions(&bank, &transactions, 0); @@ -1820,7 +1816,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder.clone(), QosService::new(1), None); + let consumer = Consumer::new(committer, recorder.clone(), QosService::new(1)); let process_transactions_summary = consumer.process_transactions(&bank, &Instant::now(), &transactions); @@ -1947,7 +1943,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let _ = consumer.process_and_record_transactions(&bank, &transactions, 0); @@ -2092,7 +2088,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); let _ = consumer.process_and_record_transactions(&bank, &[sanitized_tx.clone()], 0); @@ -2152,7 +2148,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); // When the working bank in poh_recorder is None, no packets should be processed (consume will not be called) assert!(!poh_recorder.read().unwrap().has_bank()); @@ -2230,7 +2226,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); // When the working bank in poh_recorder is None, no packets should be processed assert!(!poh_recorder.read().unwrap().has_bank()); @@ -2282,7 +2278,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); // When the working bank in poh_recorder is None, no packets should be processed (consume will not be called) assert!(!poh_recorder.read().unwrap().has_bank()); @@ -2407,7 +2403,7 @@ mod tests { replay_vote_sender, Arc::new(PrioritizationFeeCache::new(0u64)), ); - let consumer = Consumer::new(committer, recorder, QosService::new(1), None); + let consumer = Consumer::new(committer, recorder, QosService::new(1)); // When the working bank in poh_recorder is None, no packets should be processed (consume will not be called) assert!(!poh_recorder.read().unwrap().has_bank()); diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index c68f952e0af819..939a4b94c8cfda 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -550,7 +550,6 @@ impl ReplayStage { voting_sender: Sender, drop_bank_sender: Sender>, block_metadata_notifier: Option, - log_messages_bytes_limit: Option, prioritization_fee_cache: Arc, dumped_slots_sender: DumpedSlotsSender, banking_tracer: Arc, @@ -731,7 +730,6 @@ impl ReplayStage { &ancestor_hashes_replay_update_sender, block_metadata_notifier.clone(), &mut replay_timing, - log_messages_bytes_limit, &replay_mode, &replay_tx_thread_pool, &prioritization_fee_cache, @@ -2181,7 +2179,6 @@ impl ReplayStage { entry_notification_sender: Option<&EntryNotifierSender>, replay_vote_sender: &ReplayVoteSender, verify_recyclers: &VerifyRecyclers, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> result::Result { let mut w_replay_stats = replay_stats.write().unwrap(); @@ -2202,7 +2199,6 @@ impl ReplayStage { Some(replay_vote_sender), verify_recyclers, false, - log_messages_bytes_limit, prioritization_fee_cache, )?; let tx_count_after = w_replay_progress.num_txs; @@ -2763,7 +2759,6 @@ impl ReplayStage { verify_recyclers: &VerifyRecyclers, replay_vote_sender: &ReplayVoteSender, replay_timing: &mut ReplayLoopTiming, - log_messages_bytes_limit: Option, active_bank_slots: &[Slot], prioritization_fee_cache: &PrioritizationFeeCache, ) -> Vec { @@ -2846,7 +2841,6 @@ impl ReplayStage { entry_notification_sender, &replay_vote_sender.clone(), &verify_recyclers.clone(), - log_messages_bytes_limit, prioritization_fee_cache, ); replay_blockstore_time.stop(); @@ -2878,7 +2872,6 @@ impl ReplayStage { verify_recyclers: &VerifyRecyclers, replay_vote_sender: &ReplayVoteSender, replay_timing: &mut ReplayLoopTiming, - log_messages_bytes_limit: Option, bank_slot: Slot, prioritization_fee_cache: &PrioritizationFeeCache, ) -> ReplaySlotFromBlockstore { @@ -2935,7 +2928,6 @@ impl ReplayStage { entry_notification_sender, &replay_vote_sender.clone(), &verify_recyclers.clone(), - log_messages_bytes_limit, prioritization_fee_cache, ); replay_blockstore_time.stop(); @@ -3226,7 +3218,6 @@ impl ReplayStage { ancestor_hashes_replay_update_sender: &AncestorHashesReplayUpdateSender, block_metadata_notifier: Option, replay_timing: &mut ReplayLoopTiming, - log_messages_bytes_limit: Option, replay_mode: &ForkReplayMode, replay_tx_thread_pool: &ThreadPool, prioritization_fee_cache: &PrioritizationFeeCache, @@ -3259,7 +3250,6 @@ impl ReplayStage { verify_recyclers, replay_vote_sender, replay_timing, - log_messages_bytes_limit, &active_bank_slots, prioritization_fee_cache, ) @@ -3279,7 +3269,6 @@ impl ReplayStage { verify_recyclers, replay_vote_sender, replay_timing, - log_messages_bytes_limit, *bank_slot, prioritization_fee_cache, ) @@ -5101,7 +5090,6 @@ pub(crate) mod tests { None, &replay_vote_sender, &VerifyRecyclers::default(), - None, &PrioritizationFeeCache::new(0u64), ); let max_complete_transaction_status_slot = Arc::new(AtomicU64::default()); diff --git a/core/src/tpu.rs b/core/src/tpu.rs index b594e04e5d18ad..aab46ea18fc6a4 100644 --- a/core/src/tpu.rs +++ b/core/src/tpu.rs @@ -102,7 +102,6 @@ impl Tpu { connection_cache: &Arc, turbine_quic_endpoint_sender: AsyncSender<(SocketAddr, Bytes)>, keypair: &Keypair, - log_messages_bytes_limit: Option, staked_nodes: &Arc>, shared_staked_nodes_overrides: Arc>>, banking_tracer: Arc, @@ -234,7 +233,6 @@ impl Tpu { gossip_vote_receiver, transaction_status_sender, replay_vote_sender, - log_messages_bytes_limit, connection_cache.clone(), bank_forks.clone(), prioritization_fee_cache, diff --git a/core/src/tvu.rs b/core/src/tvu.rs index 3c9ed015de7c82..262f905635e92d 100644 --- a/core/src/tvu.rs +++ b/core/src/tvu.rs @@ -149,7 +149,6 @@ impl Tvu { block_metadata_notifier: Option, wait_to_vote_slot: Option, accounts_background_request_sender: AbsRequestSender, - log_messages_bytes_limit: Option, connection_cache: Option<&Arc>, prioritization_fee_cache: &Arc, banking_tracer: Arc, @@ -331,7 +330,6 @@ impl Tvu { voting_sender, drop_bank_sender, block_metadata_notifier, - log_messages_bytes_limit, prioritization_fee_cache.clone(), dumped_slots_sender, banking_tracer, @@ -509,7 +507,6 @@ pub mod tests { None, None, AbsRequestSender::default(), - None, Some(&Arc::new(ConnectionCache::new("connection_cache_test"))), &ignored_prioritization_fee_cache, BankingTracer::new_disabled(), diff --git a/core/src/validator.rs b/core/src/validator.rs index d7e94ba8ed0993..6710b7ab822d31 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -841,7 +841,6 @@ impl Validator { BlockVerificationMethod::UnifiedScheduler => { let scheduler_pool = DefaultSchedulerPool::new_dyn( config.unified_scheduler_handler_threads, - config.runtime_config.log_messages_bytes_limit, transaction_status_sender.clone(), Some(replay_vote_sender.clone()), prioritization_fee_cache.clone(), @@ -1324,7 +1323,6 @@ impl Validator { block_metadata_notifier, config.wait_to_vote_slot, accounts_background_request_sender, - config.runtime_config.log_messages_bytes_limit, json_rpc_service.is_some().then_some(&connection_cache), // for the cache warmer only used for STS for RPC service &prioritization_fee_cache, banking_tracer.clone(), @@ -1387,7 +1385,6 @@ impl Validator { &connection_cache, turbine_quic_endpoint_sender, &identity_keypair, - config.runtime_config.log_messages_bytes_limit, &staked_nodes, config.staked_nodes_overrides.clone(), banking_tracer, diff --git a/ledger-tool/src/ledger_utils.rs b/ledger-tool/src/ledger_utils.rs index c05cc6c2d64cd0..a0825687ba0e10 100644 --- a/ledger-tool/src/ledger_utils.rs +++ b/ledger-tool/src/ledger_utils.rs @@ -312,7 +312,6 @@ pub fn load_and_process_ledger( .unwrap() .install_scheduler_pool(DefaultSchedulerPool::new_dyn( unified_scheduler_handler_threads, - process_options.runtime_config.log_messages_bytes_limit, no_transaction_status_sender, no_replay_vote_sender, ignored_prioritization_fee_cache, diff --git a/ledger/benches/blockstore_processor.rs b/ledger/benches/blockstore_processor.rs index 491c0c54e03743..9aa99bc1ca0023 100644 --- a/ledger/benches/blockstore_processor.rs +++ b/ledger/benches/blockstore_processor.rs @@ -152,7 +152,6 @@ fn bench_execute_batch( None, None, &mut timing, - None, &prioritization_fee_cache, ); } diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index bc2a60efb2de87..970d9bc9834284 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -145,7 +145,6 @@ pub fn execute_batch( transaction_status_sender: Option<&TransactionStatusSender>, replay_vote_sender: Option<&ReplayVoteSender>, timings: &mut ExecuteTimings, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> Result<()> { let TransactionBatchWithIndexes { @@ -168,7 +167,6 @@ pub fn execute_batch( transaction_status_sender.is_some(), ExecutionRecordingConfig::new_single_setting(transaction_status_sender.is_some()), timings, - log_messages_bytes_limit, ); bank_utils::find_and_send_votes( @@ -246,7 +244,6 @@ fn execute_batches_internal( batches: &[TransactionBatchWithIndexes], transaction_status_sender: Option<&TransactionStatusSender>, replay_vote_sender: Option<&ReplayVoteSender>, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> Result { assert!(!batches.is_empty()); @@ -269,7 +266,6 @@ fn execute_batches_internal( transaction_status_sender, replay_vote_sender, &mut timings, - log_messages_bytes_limit, prioritization_fee_cache, ) }, @@ -330,7 +326,6 @@ fn process_batches( transaction_status_sender: Option<&TransactionStatusSender>, replay_vote_sender: Option<&ReplayVoteSender>, batch_execution_timing: &mut BatchExecutionTiming, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> Result<()> { if bank.has_installed_scheduler() { @@ -355,7 +350,6 @@ fn process_batches( transaction_status_sender, replay_vote_sender, batch_execution_timing, - log_messages_bytes_limit, prioritization_fee_cache, ) } @@ -406,7 +400,6 @@ fn rebatch_and_execute_batches( transaction_status_sender: Option<&TransactionStatusSender>, replay_vote_sender: Option<&ReplayVoteSender>, timing: &mut BatchExecutionTiming, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> Result<()> { if batches.is_empty() { @@ -489,7 +482,6 @@ fn rebatch_and_execute_batches( rebatched_txs, transaction_status_sender, replay_vote_sender, - log_messages_bytes_limit, prioritization_fee_cache, )?; @@ -547,7 +539,6 @@ pub fn process_entries_for_tests( transaction_status_sender, replay_vote_sender, &mut batch_timing, - None, &ignored_prioritization_fee_cache, ); @@ -562,7 +553,6 @@ fn process_entries( transaction_status_sender: Option<&TransactionStatusSender>, replay_vote_sender: Option<&ReplayVoteSender>, batch_timing: &mut BatchExecutionTiming, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> Result<()> { // accumulator for entries that can be processed in parallel @@ -588,7 +578,6 @@ fn process_entries( transaction_status_sender, replay_vote_sender, batch_timing, - log_messages_bytes_limit, prioritization_fee_cache, )?; batches.clear(); @@ -642,7 +631,6 @@ fn process_entries( transaction_status_sender, replay_vote_sender, batch_timing, - log_messages_bytes_limit, prioritization_fee_cache, )?; batches.clear(); @@ -658,7 +646,6 @@ fn process_entries( transaction_status_sender, replay_vote_sender, batch_timing, - log_messages_bytes_limit, prioritization_fee_cache, )?; for hash in tick_hashes { @@ -1028,7 +1015,6 @@ fn confirm_full_slot( replay_vote_sender, recyclers, opts.allow_dead_slots, - opts.runtime_config.log_messages_bytes_limit, &ignored_prioritization_fee_cache, )?; @@ -1321,7 +1307,6 @@ pub fn confirm_slot( replay_vote_sender: Option<&ReplayVoteSender>, recyclers: &VerifyRecyclers, allow_dead_slots: bool, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> result::Result<(), BlockstoreProcessorError> { let slot = bank.slot(); @@ -1351,7 +1336,6 @@ pub fn confirm_slot( entry_notification_sender, replay_vote_sender, recyclers, - log_messages_bytes_limit, prioritization_fee_cache, ) } @@ -1368,7 +1352,6 @@ fn confirm_slot_entries( entry_notification_sender: Option<&EntryNotifierSender>, replay_vote_sender: Option<&ReplayVoteSender>, recyclers: &VerifyRecyclers, - log_messages_bytes_limit: Option, prioritization_fee_cache: &PrioritizationFeeCache, ) -> result::Result<(), BlockstoreProcessorError> { let ConfirmationTiming { @@ -1511,7 +1494,6 @@ fn confirm_slot_entries( transaction_status_sender, replay_vote_sender, batch_execute_timing, - log_messages_bytes_limit, prioritization_fee_cache, ) .map_err(BlockstoreProcessorError::from); @@ -4161,7 +4143,6 @@ pub mod tests { false, ExecutionRecordingConfig::new_single_setting(false), &mut ExecuteTimings::default(), - None, ); let (err, signature) = get_first_error(&batch, fee_collection_results).unwrap(); assert_eq!(err.unwrap_err(), TransactionError::AccountNotFound); @@ -4549,7 +4530,6 @@ pub mod tests { None, None, &VerifyRecyclers::default(), - None, &PrioritizationFeeCache::new(0u64), ) } @@ -4643,7 +4623,6 @@ pub mod tests { None, None, &VerifyRecyclers::default(), - None, &PrioritizationFeeCache::new(0u64), ) .unwrap(); @@ -4688,7 +4667,6 @@ pub mod tests { None, None, &VerifyRecyclers::default(), - None, &PrioritizationFeeCache::new(0u64), ) .unwrap(); @@ -4802,7 +4780,6 @@ pub mod tests { None, None, &mut batch_execution_timing, - None, &ignored_prioritization_fee_cache ) .is_ok()); diff --git a/programs/sbf/tests/programs.rs b/programs/sbf/tests/programs.rs index b05ea6b381aaa9..b769ebb1e35ea4 100644 --- a/programs/sbf/tests/programs.rs +++ b/programs/sbf/tests/programs.rs @@ -112,7 +112,6 @@ fn process_transaction_and_record_inner( enable_return_data_recording: false, }, &mut ExecuteTimings::default(), - None, ) .0; let result = results @@ -158,7 +157,6 @@ fn execute_transactions( true, ExecutionRecordingConfig::new_single_setting(true), &mut timings, - None, ); let tx_post_token_balances = collect_token_balances(&bank, &batch, &mut mint_decimals); diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index de7dcf78b4c625..70dc253e675e43 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3432,7 +3432,6 @@ impl Bank { }, &mut timings, Some(&account_overrides), - None, true, ); @@ -3681,7 +3680,6 @@ impl Bank { recording_config: ExecutionRecordingConfig, timings: &mut ExecuteTimings, account_overrides: Option<&AccountOverrides>, - log_messages_bytes_limit: Option, limit_to_load_programs: bool, ) -> LoadAndExecuteTransactionsOutput { let sanitized_txs = batch.sanitized_transactions(); @@ -3745,7 +3743,6 @@ impl Bank { recording_config, timings, account_overrides, - log_messages_bytes_limit, limit_to_load_programs, ); @@ -4863,7 +4860,6 @@ impl Bank { collect_balances: bool, recording_config: ExecutionRecordingConfig, timings: &mut ExecuteTimings, - log_messages_bytes_limit: Option, ) -> (TransactionResults, TransactionBalancesSet) { let pre_balances = if collect_balances { self.collect_balances(batch) @@ -4885,7 +4881,6 @@ impl Bank { recording_config, timings, None, - log_messages_bytes_limit, false, ); @@ -4956,7 +4951,6 @@ impl Bank { enable_return_data_recording: true, }, &mut ExecuteTimings::default(), - Some(1000 * 1000), ); execution_results.remove(0) @@ -4992,7 +4986,6 @@ impl Bank { false, ExecutionRecordingConfig::new_single_setting(false), &mut ExecuteTimings::default(), - None, ) .0 .fee_collection_results diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index 128a6f451b78e0..785e41a87c8a99 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -3102,7 +3102,6 @@ fn test_interleaving_locks() { false, ExecutionRecordingConfig::new_single_setting(false), &mut ExecuteTimings::default(), - None, ) .0 .fee_collection_results; @@ -5928,7 +5927,6 @@ fn test_pre_post_transaction_balances() { true, ExecutionRecordingConfig::new_single_setting(false), &mut ExecuteTimings::default(), - None, ); assert_eq!(transaction_balances_set.pre_balances.len(), 3); @@ -9302,7 +9300,6 @@ fn test_tx_log_order() { enable_return_data_recording: false, }, &mut ExecuteTimings::default(), - None, ) .0 .execution_results; @@ -9412,7 +9409,6 @@ fn test_tx_return_data() { enable_return_data_recording: true, }, &mut ExecuteTimings::default(), - None, ) .0 .execution_results[0] diff --git a/svm/src/transaction_processor.rs b/svm/src/transaction_processor.rs index 9b7cc4b6956bbc..b40369a4eabf89 100644 --- a/svm/src/transaction_processor.rs +++ b/svm/src/transaction_processor.rs @@ -184,7 +184,6 @@ impl TransactionBatchProcessor { recording_config: ExecutionRecordingConfig, timings: &mut ExecuteTimings, account_overrides: Option<&AccountOverrides>, - log_messages_bytes_limit: Option, limit_to_load_programs: bool, ) -> LoadAndExecuteSanitizedTransactionsOutput { let mut program_cache_time = Measure::start("program_cache"); @@ -267,7 +266,6 @@ impl TransactionBatchProcessor { recording_config, timings, error_counters, - log_messages_bytes_limit, &programs_loaded_for_tx_batch.borrow(), ); @@ -465,7 +463,6 @@ impl TransactionBatchProcessor { recording_config: ExecutionRecordingConfig, timings: &mut ExecuteTimings, error_counters: &mut TransactionErrorMetrics, - log_messages_bytes_limit: Option, programs_loaded_for_tx_batch: &ProgramCacheForTxBatch, ) -> TransactionExecutionResult { let transaction_accounts = std::mem::take(&mut loaded_transaction.accounts); @@ -501,7 +498,7 @@ impl TransactionBatchProcessor { ); let log_collector = if recording_config.enable_log_recording { - match log_messages_bytes_limit { + match self.runtime_config.log_messages_bytes_limit { None => Some(LogCollector::new_ref()), Some(log_messages_bytes_limit) => Some(LogCollector::new_ref_with_limit(Some( log_messages_bytes_limit, @@ -912,7 +909,6 @@ mod tests { record_config, &mut ExecuteTimings::default(), &mut TransactionErrorMetrics::default(), - None, &loaded_programs, ); @@ -934,7 +930,6 @@ mod tests { record_config, &mut ExecuteTimings::default(), &mut TransactionErrorMetrics::default(), - Some(2), &loaded_programs, ); @@ -965,7 +960,6 @@ mod tests { record_config, &mut ExecuteTimings::default(), &mut TransactionErrorMetrics::default(), - None, &loaded_programs, ); @@ -1038,7 +1032,6 @@ mod tests { record_config, &mut ExecuteTimings::default(), &mut error_metrics, - None, &loaded_programs, ); diff --git a/svm/tests/integration_test.rs b/svm/tests/integration_test.rs index 07b6eb2bb4fb40..c30a5e50d9d285 100644 --- a/svm/tests/integration_test.rs +++ b/svm/tests/integration_test.rs @@ -462,7 +462,6 @@ fn svm_integration() { recording_config, &mut timings, None, - None, false, ); diff --git a/unified-scheduler-pool/src/lib.rs b/unified-scheduler-pool/src/lib.rs index 0b7c5495b0accc..a00dfe8c25bd2b 100644 --- a/unified-scheduler-pool/src/lib.rs +++ b/unified-scheduler-pool/src/lib.rs @@ -78,7 +78,6 @@ pub struct SchedulerPool, TH: TaskHandler> { #[derive(Debug)] pub struct HandlerContext { - log_messages_bytes_limit: Option, transaction_status_sender: Option, replay_vote_sender: Option, prioritization_fee_cache: Arc, @@ -97,7 +96,6 @@ where #[cfg_attr(feature = "dev-context-only-utils", qualifiers(pub))] fn new( handler_count: Option, - log_messages_bytes_limit: Option, transaction_status_sender: Option, replay_vote_sender: Option, prioritization_fee_cache: Arc, @@ -109,7 +107,6 @@ where scheduler_inners: Mutex::default(), handler_count, handler_context: HandlerContext { - log_messages_bytes_limit, transaction_status_sender, replay_vote_sender, prioritization_fee_cache, @@ -124,14 +121,12 @@ where // `dyn InstalledSchedulerPool` to be returned for type inference convenience. pub fn new_dyn( handler_count: Option, - log_messages_bytes_limit: Option, transaction_status_sender: Option, replay_vote_sender: Option, prioritization_fee_cache: Arc, ) -> InstalledSchedulerPoolArc { Self::new( handler_count, - log_messages_bytes_limit, transaction_status_sender, replay_vote_sender, prioritization_fee_cache, @@ -250,7 +245,6 @@ impl TaskHandler for DefaultTaskHandler { handler_context.transaction_status_sender.as_ref(), handler_context.replay_vote_sender.as_ref(), timings, - handler_context.log_messages_bytes_limit, &handler_context.prioritization_fee_cache, ); } @@ -1013,7 +1007,7 @@ mod tests { let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let pool = - DefaultSchedulerPool::new_dyn(None, None, None, None, ignored_prioritization_fee_cache); + DefaultSchedulerPool::new_dyn(None, None, None, ignored_prioritization_fee_cache); // this indirectly proves that there should be circular link because there's only one Arc // at this moment now @@ -1028,7 +1022,7 @@ mod tests { let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let pool = - DefaultSchedulerPool::new_dyn(None, None, None, None, ignored_prioritization_fee_cache); + DefaultSchedulerPool::new_dyn(None, None, None, ignored_prioritization_fee_cache); let bank = Arc::new(Bank::default_for_tests()); let context = SchedulingContext::new(bank); let scheduler = pool.take_scheduler(context); @@ -1042,8 +1036,7 @@ mod tests { solana_logger::setup(); let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); - let pool = - DefaultSchedulerPool::new(None, None, None, None, ignored_prioritization_fee_cache); + let pool = DefaultSchedulerPool::new(None, None, None, ignored_prioritization_fee_cache); let bank = Arc::new(Bank::default_for_tests()); let context = &SchedulingContext::new(bank); @@ -1071,8 +1064,7 @@ mod tests { solana_logger::setup(); let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); - let pool = - DefaultSchedulerPool::new(None, None, None, None, ignored_prioritization_fee_cache); + let pool = DefaultSchedulerPool::new(None, None, None, ignored_prioritization_fee_cache); let bank = Arc::new(Bank::default_for_tests()); let context = &SchedulingContext::new(bank); let mut scheduler = pool.do_take_scheduler(context.clone()); @@ -1090,8 +1082,7 @@ mod tests { solana_logger::setup(); let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); - let pool = - DefaultSchedulerPool::new(None, None, None, None, ignored_prioritization_fee_cache); + let pool = DefaultSchedulerPool::new(None, None, None, ignored_prioritization_fee_cache); let old_bank = &Arc::new(Bank::default_for_tests()); let new_bank = &Arc::new(Bank::default_for_tests()); assert!(!Arc::ptr_eq(old_bank, new_bank)); @@ -1117,7 +1108,7 @@ mod tests { let mut bank_forks = bank_forks.write().unwrap(); let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let pool = - DefaultSchedulerPool::new_dyn(None, None, None, None, ignored_prioritization_fee_cache); + DefaultSchedulerPool::new_dyn(None, None, None, ignored_prioritization_fee_cache); bank_forks.install_scheduler_pool(pool); } @@ -1131,7 +1122,7 @@ mod tests { let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let pool = - DefaultSchedulerPool::new_dyn(None, None, None, None, ignored_prioritization_fee_cache); + DefaultSchedulerPool::new_dyn(None, None, None, ignored_prioritization_fee_cache); let bank = Bank::default_for_tests(); let bank_forks = BankForks::new_rw_arc(bank); @@ -1181,7 +1172,7 @@ mod tests { let bank = setup_dummy_fork_graph(bank); let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let pool = - DefaultSchedulerPool::new_dyn(None, None, None, None, ignored_prioritization_fee_cache); + DefaultSchedulerPool::new_dyn(None, None, None, ignored_prioritization_fee_cache); let context = SchedulingContext::new(bank.clone()); assert_eq!(bank.transaction_count(), 0); @@ -1206,7 +1197,7 @@ mod tests { let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let pool = - DefaultSchedulerPool::new_dyn(None, None, None, None, ignored_prioritization_fee_cache); + DefaultSchedulerPool::new_dyn(None, None, None, ignored_prioritization_fee_cache); let context = SchedulingContext::new(bank.clone()); let mut scheduler = pool.take_scheduler(context); @@ -1320,7 +1311,6 @@ mod tests { None, None, None, - None, ignored_prioritization_fee_cache, ); let context = SchedulingContext::new(bank.clone()); @@ -1380,8 +1370,7 @@ mod tests { let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let pool = SchedulerPool::, _>::new( - Some(4), // spawn 4 threads - None, + Some(4), None, None, ignored_prioritization_fee_cache, @@ -1564,7 +1553,6 @@ mod tests { None, None, None, - None, ignored_prioritization_fee_cache, ); let scheduler = pool.take_scheduler(context); @@ -1642,7 +1630,6 @@ mod tests { let timings = &mut ExecuteTimings::default(); let prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); let handler_context = &HandlerContext { - log_messages_bytes_limit: None, transaction_status_sender: None, replay_vote_sender: None, prioritization_fee_cache,