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

Apply more unified scheduler related core cleanups #4453

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 8 additions & 7 deletions banking-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,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,
Expand All @@ -450,12 +457,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(
Expand All @@ -481,7 +482,7 @@ fn main() {
None,
Arc::new(connection_cache),
bank_forks.clone(),
&Arc::new(PrioritizationFeeCache::new(0u64)),
&prioritization_fee_cache,
false,
);

Expand Down
1 change: 0 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ tokio = { workspace = true, features = ["full"] }
trees = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have been removed at the same timing with #4123...

fs_extra = { workspace = true }
serde_json = { workspace = true }
serial_test = { workspace = true }
Expand Down
14 changes: 7 additions & 7 deletions core/src/banking_simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,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(),
});
Comment on lines +764 to +767

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc cluster info is only needed for forwarding. once I remove forwarding from banking stage (soon after #3820) we can get rid of all this I think.

let Channels {
non_vote_sender,
non_vote_receiver,
Expand All @@ -783,7 +787,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,
Expand All @@ -792,7 +796,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(),
Expand All @@ -803,14 +807,10 @@ 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(),
&cluster_info,
&cluster_info_for_banking,
&poh_recorder,
non_vote_receiver,
tpu_vote_receiver,
Expand Down
5 changes: 5 additions & 0 deletions core/src/banking_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ pub struct BankingTracer {
active_tracer: Option<ActiveTracer>,
}

#[cfg_attr(
feature = "frozen-abi",
derive(AbiExample),
frozen_abi(digest = "DAdZnX6ijBWaxKAyksq4nJa6PAZqT4RShZqLWTtNvyAM")
)]
Comment on lines +62 to +66
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was temporarily removed by #3974. but it seems the reported build issue disappeared..

#[derive(Serialize, Deserialize, Debug)]
pub struct TimedTracedEvent(pub std::time::SystemTime, pub TracedEvent);

Expand Down
6 changes: 3 additions & 3 deletions core/src/tpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub use solana_sdk::net::DEFAULT_TPU_COALESCE;
use {
crate::{
banking_stage::BankingStage,
banking_trace::{BankingTracer, Channels, TracerThread},
banking_trace::{Channels, TracerThread},
cluster_info_vote_listener::{
ClusterInfoVoteListener, DuplicateConfirmedSlotsSender, GossipVerifiedVoteHashSender,
VerifiedVoteSender, VoteTracker,
Expand Down Expand Up @@ -112,7 +112,7 @@ impl Tpu {
log_messages_bytes_limit: Option<usize>,
staked_nodes: &Arc<RwLock<StakedNodes>>,
shared_staked_nodes_overrides: Arc<RwLock<HashMap<Pubkey, u64>>>,
banking_tracer: Arc<BankingTracer>,
banking_tracer_channels: Channels,
tracer_thread_hdl: TracerThread,
tpu_enable_udp: bool,
tpu_max_connections_per_ipaddr_per_minute: u64,
Expand Down Expand Up @@ -163,7 +163,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 {
Expand Down
33 changes: 17 additions & 16 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,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...");
Expand Down Expand Up @@ -1262,21 +1278,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());
Expand Down Expand Up @@ -1518,7 +1519,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_max_connections_per_ipaddr_per_minute,
Expand Down
Loading