diff --git a/banking-bench/src/main.rs b/banking-bench/src/main.rs index c0edc0bee1f73d..39b233c9c352ec 100644 --- a/banking-bench/src/main.rs +++ b/banking-bench/src/main.rs @@ -453,6 +453,13 @@ fn main() { BANKING_TRACE_DIR_DEFAULT_BYTE_LIMIT, ))) .unwrap(); + let prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64)); + let cluster_info = { + let keypair = Arc::new(Keypair::new()); + let node = Node::new_localhost_with_pubkey(&keypair.pubkey()); + ClusterInfo::new(node.info, keypair, SocketAddrSpace::Unspecified) + }; + let cluster_info = Arc::new(cluster_info); let Channels { non_vote_sender, non_vote_receiver, @@ -461,12 +468,6 @@ fn main() { gossip_vote_sender, gossip_vote_receiver, } = banking_tracer.create_channels(false); - let cluster_info = { - let keypair = Arc::new(Keypair::new()); - let node = Node::new_localhost_with_pubkey(&keypair.pubkey()); - ClusterInfo::new(node.info, keypair, SocketAddrSpace::Unspecified) - }; - let cluster_info = Arc::new(cluster_info); let tpu_disable_quic = matches.is_present("tpu_disable_quic"); let connection_cache = if tpu_disable_quic { ConnectionCache::with_udp( @@ -493,7 +494,7 @@ fn main() { None, Arc::new(connection_cache), bank_forks.clone(), - &Arc::new(PrioritizationFeeCache::new(0u64)), + &prioritization_fee_cache, false, ); diff --git a/core/Cargo.toml b/core/Cargo.toml index 0c23cfa9108ed4..06b1e43e05ec59 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -107,7 +107,6 @@ tokio = { workspace = true, features = ["full"] } trees = { workspace = true } [dev-dependencies] -assert_matches = { workspace = true } fs_extra = { workspace = true } serde_json = { workspace = true } serial_test = { workspace = true } diff --git a/core/src/banking_simulation.rs b/core/src/banking_simulation.rs index 291883bd960828..5f58103f0ba0fc 100644 --- a/core/src/banking_simulation.rs +++ b/core/src/banking_simulation.rs @@ -759,6 +759,10 @@ impl BankingSimulator { BANKING_TRACE_DIR_DEFAULT_BYTE_LIMIT, ); + // Create a partially-dummy ClusterInfo for the banking stage. + let cluster_info_for_banking = Arc::new(DummyClusterInfo { + id: simulated_leader.into(), + }); let Channels { non_vote_sender, non_vote_receiver, @@ -781,7 +785,7 @@ impl BankingSimulator { // We only need it to write shreds into the blockstore and it seems given ClusterInfo is // irrelevant for the neccesary minimum work for this simulation. let random_keypair = Arc::new(Keypair::new()); - let cluster_info = Arc::new(ClusterInfo::new( + let cluster_info_for_broadcast = Arc::new(ClusterInfo::new( Node::new_localhost_with_pubkey(&random_keypair.pubkey()).info, random_keypair, SocketAddrSpace::Unspecified, @@ -790,7 +794,7 @@ impl BankingSimulator { // inserting produced shreds into the blockstore. let broadcast_stage = BroadcastStageType::Standard.new_broadcast_stage( vec![bind_to_localhost().unwrap()], - cluster_info.clone(), + cluster_info_for_broadcast.clone(), entry_receiver, retransmit_slots_receiver, exit.clone(), @@ -801,15 +805,11 @@ impl BankingSimulator { ); info!("Start banking stage!..."); - // Create a partially-dummy ClusterInfo for the banking stage. - let cluster_info = Arc::new(DummyClusterInfo { - id: simulated_leader.into(), - }); let prioritization_fee_cache = &Arc::new(PrioritizationFeeCache::new(0u64)); let banking_stage = BankingStage::new_num_threads( block_production_method.clone(), transaction_struct.clone(), - &cluster_info, + &cluster_info_for_banking, &poh_recorder, non_vote_receiver, tpu_vote_receiver, diff --git a/core/src/banking_trace.rs b/core/src/banking_trace.rs index 0c9fb856aecb87..f0927e97fc772d 100644 --- a/core/src/banking_trace.rs +++ b/core/src/banking_trace.rs @@ -59,6 +59,11 @@ pub struct BankingTracer { active_tracer: Option, } +#[cfg_attr( + feature = "frozen-abi", + derive(AbiExample), + frozen_abi(digest = "DAdZnX6ijBWaxKAyksq4nJa6PAZqT4RShZqLWTtNvyAM") +)] #[derive(Serialize, Deserialize, Debug)] pub struct TimedTracedEvent(pub std::time::SystemTime, pub TracedEvent); diff --git a/core/src/tpu.rs b/core/src/tpu.rs index be9537cbc8624e..3684b197fbddaa 100644 --- a/core/src/tpu.rs +++ b/core/src/tpu.rs @@ -11,7 +11,7 @@ pub use solana_streamer::quic::DEFAULT_MAX_QUIC_CONNECTIONS_PER_PEER as MAX_QUIC use { crate::{ banking_stage::BankingStage, - banking_trace::{BankingTracer, Channels, TracerThread}, + banking_trace::{Channels, TracerThread}, cluster_info_vote_listener::{ ClusterInfoVoteListener, DuplicateConfirmedSlotsSender, GossipVerifiedVoteHashSender, VerifiedVoteSender, VoteTracker, @@ -112,7 +112,7 @@ impl Tpu { log_messages_bytes_limit: Option, staked_nodes: &Arc>, shared_staked_nodes_overrides: Arc>>, - banking_tracer: Arc, + banking_tracer_channels: Channels, tracer_thread_hdl: TracerThread, tpu_enable_udp: bool, tpu_quic_server_config: QuicServerParams, @@ -166,7 +166,7 @@ impl Tpu { tpu_vote_receiver, gossip_vote_sender, gossip_vote_receiver, - } = banking_tracer.create_channels(false); + } = banking_tracer_channels; // Streamer for Votes: let SpawnServerResult { diff --git a/core/src/validator.rs b/core/src/validator.rs index b6aa4c808fb1c4..9cb3dd7d86c949 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -967,6 +967,22 @@ impl Validator { }; let poh_recorder = Arc::new(RwLock::new(poh_recorder)); + let (banking_tracer, tracer_thread) = + BankingTracer::new((config.banking_trace_dir_byte_limit > 0).then_some(( + &blockstore.banking_trace_path(), + exit.clone(), + config.banking_trace_dir_byte_limit, + )))?; + if banking_tracer.is_enabled() { + info!( + "Enabled banking trace (dir_byte_limit: {})", + config.banking_trace_dir_byte_limit + ); + } else { + info!("Disabled banking trace"); + } + let banking_tracer_channels = banking_tracer.create_channels(false); + match &config.block_verification_method { BlockVerificationMethod::BlockstoreProcessor => { info!("no scheduler pool is installed for block verification..."); @@ -1328,21 +1344,6 @@ impl Validator { let (gossip_verified_vote_hash_sender, gossip_verified_vote_hash_receiver) = unbounded(); let (duplicate_confirmed_slot_sender, duplicate_confirmed_slots_receiver) = unbounded(); - let (banking_tracer, tracer_thread) = - BankingTracer::new((config.banking_trace_dir_byte_limit > 0).then_some(( - &blockstore.banking_trace_path(), - exit.clone(), - config.banking_trace_dir_byte_limit, - )))?; - if banking_tracer.is_enabled() { - info!( - "Enabled banking trace (dir_byte_limit: {})", - config.banking_trace_dir_byte_limit - ); - } else { - info!("Disabled banking trace"); - } - let entry_notification_sender = entry_notifier_service .as_ref() .map(|service| service.sender_cloned()); @@ -1584,7 +1585,7 @@ impl Validator { config.runtime_config.log_messages_bytes_limit, &staked_nodes, config.staked_nodes_overrides.clone(), - banking_tracer, + banking_tracer_channels, tracer_thread, tpu_enable_udp, tpu_quic_server_config,