Skip to content
Merged
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
9 changes: 0 additions & 9 deletions banking-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use {
banking_trace::{BankingTracer, Channels, BANKING_TRACE_DIR_DEFAULT_BYTE_LIMIT},
validator::{BlockProductionMethod, TransactionStructure},
},
solana_gossip::cluster_info::{ClusterInfo, Node},
solana_hash::Hash,
solana_keypair::Keypair,
solana_ledger::{
Expand All @@ -32,7 +31,6 @@ use {
},
solana_signature::Signature,
solana_signer::Signer,
solana_streamer::socket::SocketAddrSpace,
solana_system_interface::instruction as system_instruction,
solana_system_transaction as system_transaction,
solana_time_utils::timestamp,
Expand Down Expand Up @@ -448,12 +446,6 @@ fn main() {
)))
.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 @@ -465,7 +457,6 @@ fn main() {
let banking_stage = BankingStage::new_num_threads(
block_production_method,
transaction_struct,
&cluster_info,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down
9 changes: 0 additions & 9 deletions core/benches/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use {
solana_core::{banking_stage::BankingStage, banking_trace::BankingTracer},
solana_entry::entry::{next_hash, Entry},
solana_genesis_config::GenesisConfig,
solana_gossip::cluster_info::{ClusterInfo, Node},
solana_hash::Hash,
solana_keypair::Keypair,
solana_ledger::{
Expand All @@ -39,7 +38,6 @@ use {
},
solana_signature::Signature,
solana_signer::Signer,
solana_streamer::socket::SocketAddrSpace,
solana_system_interface::instruction as system_instruction,
solana_system_transaction as system_transaction,
solana_time_utils::timestamp,
Expand Down Expand Up @@ -236,17 +234,10 @@ fn bench_banking(
);
let (exit, poh_recorder, transaction_recorder, poh_service, signal_receiver) =
create_test_recorder(bank.clone(), blockstore, None, None);
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 (s, _r) = unbounded();
let _banking_stage = BankingStage::new(
block_production_method,
transaction_struct,
&cluster_info,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down
5 changes: 0 additions & 5 deletions core/src/banking_simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,6 @@ impl BankingSimulator {
assert!(retracer.is_enabled());
info!("Enabled banking retracer (dir_byte_limit: {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,
Expand Down Expand Up @@ -830,7 +826,6 @@ impl BankingSimulator {
let banking_stage = BankingStage::new_num_threads(
block_production_method.clone(),
transaction_struct.clone(),
&cluster_info_for_banking,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down
32 changes: 1 addition & 31 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ impl BankingStage {
pub fn new(
block_production_method: BlockProductionMethod,
transaction_struct: TransactionStructure,
cluster_info: &impl LikeClusterInfo,
poh_recorder: &Arc<RwLock<PohRecorder>>,
transaction_recorder: TransactionRecorder,
non_vote_receiver: BankingPacketReceiver,
Expand All @@ -381,7 +380,6 @@ impl BankingStage {
Self::new_num_threads(
block_production_method,
transaction_struct,
cluster_info,
poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand All @@ -400,7 +398,6 @@ impl BankingStage {
pub fn new_num_threads(
block_production_method: BlockProductionMethod,
transaction_struct: TransactionStructure,
cluster_info: &impl LikeClusterInfo,
poh_recorder: &Arc<RwLock<PohRecorder>>,
transaction_recorder: TransactionRecorder,
non_vote_receiver: BankingPacketReceiver,
Expand All @@ -420,7 +417,6 @@ impl BankingStage {
Self::new_central_scheduler(
transaction_struct,
use_greedy_scheduler,
cluster_info,
poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand All @@ -439,7 +435,6 @@ impl BankingStage {
pub fn new_central_scheduler(
transaction_struct: TransactionStructure,
use_greedy_scheduler: bool,
cluster_info: &impl LikeClusterInfo,
poh_recorder: &Arc<RwLock<PohRecorder>>,
transaction_recorder: TransactionRecorder,
non_vote_receiver: BankingPacketReceiver,
Expand All @@ -458,7 +453,7 @@ impl BankingStage {
VoteStorage::new(&bank)
};

let decision_maker = DecisionMaker::new(cluster_info.id(), poh_recorder.clone());
let decision_maker = DecisionMaker::new(poh_recorder.clone());
let committer = Committer::new(
transaction_status_sender.clone(),
replay_vote_sender.clone(),
Expand Down Expand Up @@ -688,7 +683,6 @@ mod tests {
crossbeam_channel::{unbounded, Receiver},
itertools::Itertools,
solana_entry::entry::{self, Entry, EntrySlice},
solana_gossip::cluster_info::Node,
solana_hash::Hash,
solana_keypair::Keypair,
solana_ledger::{
Expand All @@ -710,7 +704,6 @@ mod tests {
solana_runtime::{bank::Bank, genesis_utils::bootstrap_validator_stake_lamports},
solana_runtime_transaction::runtime_transaction::RuntimeTransaction,
solana_signer::Signer,
solana_streamer::socket::SocketAddrSpace,
solana_system_transaction as system_transaction,
solana_transaction::{sanitized::SanitizedTransaction, Transaction},
solana_vote::vote_transaction::new_tower_sync_transaction,
Expand All @@ -723,14 +716,6 @@ mod tests {
test_case::test_case,
};

pub(crate) fn new_test_cluster_info(keypair: Option<Arc<Keypair>>) -> (Node, ClusterInfo) {
let keypair = keypair.unwrap_or_else(|| Arc::new(Keypair::new()));
let node = Node::new_localhost_with_pubkey(&keypair.pubkey());
let cluster_info =
ClusterInfo::new(node.info.clone(), keypair, SocketAddrSpace::Unspecified);
(node, cluster_info)
}

pub(crate) fn sanitize_transactions(
txs: Vec<Transaction>,
) -> Vec<RuntimeTransaction<SanitizedTransaction>> {
Expand Down Expand Up @@ -760,14 +745,11 @@ mod tests {
);
let (exit, poh_recorder, transaction_recorder, poh_service, _entry_receiever) =
create_test_recorder(bank, blockstore, None, None);
let (_, cluster_info) = new_test_cluster_info(/*keypair:*/ None);
let cluster_info = Arc::new(cluster_info);
let (replay_vote_sender, _replay_vote_receiver) = unbounded();

let banking_stage = BankingStage::new(
BlockProductionMethod::CentralScheduler,
transaction_struct,
&cluster_info,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down Expand Up @@ -818,14 +800,11 @@ mod tests {
};
let (exit, poh_recorder, transaction_recorder, poh_service, entry_receiver) =
create_test_recorder(bank.clone(), blockstore, Some(poh_config), None);
let (_, cluster_info) = new_test_cluster_info(/*keypair:*/ None);
let cluster_info = Arc::new(cluster_info);
let (replay_vote_sender, _replay_vote_receiver) = unbounded();

let banking_stage = BankingStage::new(
BlockProductionMethod::CentralScheduler,
transaction_struct,
&cluster_info,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down Expand Up @@ -885,14 +864,11 @@ mod tests {
);
let (exit, poh_recorder, transaction_recorder, poh_service, entry_receiver) =
create_test_recorder(bank.clone(), blockstore, None, None);
let (_, cluster_info) = new_test_cluster_info(/*keypair:*/ None);
let cluster_info = Arc::new(cluster_info);
let (replay_vote_sender, _replay_vote_receiver) = unbounded();

let banking_stage = BankingStage::new(
block_production_method,
transaction_struct,
&cluster_info,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down Expand Up @@ -1042,12 +1018,9 @@ mod tests {
let (bank, bank_forks) = Bank::new_no_wallclock_throttle_for_tests(&genesis_config);
let (exit, poh_recorder, transaction_recorder, poh_service, entry_receiver) =
create_test_recorder(bank.clone(), blockstore, None, None);
let (_, cluster_info) = new_test_cluster_info(/*keypair:*/ None);
let cluster_info = Arc::new(cluster_info);
let _banking_stage = BankingStage::new(
BlockProductionMethod::CentralScheduler,
transaction_struct,
&cluster_info,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down Expand Up @@ -1229,14 +1202,11 @@ mod tests {
);
let (exit, poh_recorder, transaction_recorder, poh_service, _entry_receiver) =
create_test_recorder(bank.clone(), blockstore, None, None);
let (_, cluster_info) = new_test_cluster_info(/*keypair:*/ None);
let cluster_info = Arc::new(cluster_info);
let (replay_vote_sender, _replay_vote_receiver) = unbounded();

let banking_stage = BankingStage::new(
BlockProductionMethod::CentralScheduler,
transaction_struct,
&cluster_info,
&poh_recorder,
transaction_recorder,
non_vote_receiver,
Expand Down
Loading
Loading