Skip to content

Commit 8463944

Browse files
authored
Support --block-production-method in banking-bench (pyth-network#269)
1 parent 91b1ee3 commit 8463944

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

banking-bench/src/main.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use {
99
solana_core::{
1010
banking_stage::BankingStage,
1111
banking_trace::{BankingPacketBatch, BankingTracer, BANKING_TRACE_DIR_DEFAULT_BYTE_LIMIT},
12+
validator::BlockProductionMethod,
1213
},
1314
solana_gossip::cluster_info::{ClusterInfo, Node},
1415
solana_ledger::{
@@ -279,6 +280,14 @@ fn main() {
279280
.takes_value(true)
280281
.help("Number of batches to send in each iteration"),
281282
)
283+
.arg(
284+
Arg::with_name("block_production_method")
285+
.long("block-production-method")
286+
.value_name("METHOD")
287+
.takes_value(true)
288+
.possible_values(BlockProductionMethod::cli_names())
289+
.help(BlockProductionMethod::cli_message()),
290+
)
282291
.arg(
283292
Arg::new("num_banking_threads")
284293
.long("num-banking-threads")
@@ -306,6 +315,9 @@ fn main() {
306315
)
307316
.get_matches();
308317

318+
let block_production_method = matches
319+
.value_of_t::<BlockProductionMethod>("block_production_method")
320+
.unwrap_or_default();
309321
let num_banking_threads = matches
310322
.value_of_t::<u32>("num_banking_threads")
311323
.unwrap_or_else(|_| BankingStage::num_threads());
@@ -448,7 +460,8 @@ fn main() {
448460
DEFAULT_TPU_CONNECTION_POOL_SIZE,
449461
),
450462
};
451-
let banking_stage = BankingStage::new_thread_local_multi_iterator(
463+
let banking_stage = BankingStage::new_num_threads(
464+
block_production_method,
452465
&cluster_info,
453466
&poh_recorder,
454467
non_vote_receiver,

0 commit comments

Comments
 (0)