core: disable quic servers on mainnet-beta
This commit is contained in:
parent
deccc880d3
commit
a5f290a66f
|
@ -66,8 +66,8 @@ pub struct Tpu {
|
|||
banking_stage: BankingStage,
|
||||
cluster_info_vote_listener: ClusterInfoVoteListener,
|
||||
broadcast_stage: BroadcastStage,
|
||||
tpu_quic_t: thread::JoinHandle<()>,
|
||||
tpu_forwards_quic_t: thread::JoinHandle<()>,
|
||||
tpu_quic_t: Option<thread::JoinHandle<()>>,
|
||||
tpu_forwards_quic_t: Option<thread::JoinHandle<()>>,
|
||||
find_packet_sender_stake_stage: FindPacketSenderStakeStage,
|
||||
vote_find_packet_sender_stake_stage: FindPacketSenderStakeStage,
|
||||
staked_nodes_updater_service: StakedNodesUpdaterService,
|
||||
|
@ -99,6 +99,7 @@ impl Tpu {
|
|||
cost_model: &Arc<RwLock<CostModel>>,
|
||||
connection_cache: &Arc<ConnectionCache>,
|
||||
keypair: &Keypair,
|
||||
enable_quic_servers: bool,
|
||||
) -> Self {
|
||||
let TpuSockets {
|
||||
transactions: transactions_sockets,
|
||||
|
@ -156,7 +157,8 @@ impl Tpu {
|
|||
let (verified_sender, verified_receiver) = unbounded();
|
||||
|
||||
let stats = Arc::new(StreamStats::default());
|
||||
let tpu_quic_t = spawn_server(
|
||||
let tpu_quic_t = enable_quic_servers.then(|| {
|
||||
spawn_server(
|
||||
transactions_quic_sockets,
|
||||
keypair,
|
||||
cluster_info.my_contact_info().tpu.ip(),
|
||||
|
@ -168,9 +170,11 @@ impl Tpu {
|
|||
MAX_UNSTAKED_CONNECTIONS,
|
||||
stats.clone(),
|
||||
)
|
||||
.unwrap();
|
||||
.unwrap()
|
||||
});
|
||||
|
||||
let tpu_forwards_quic_t = spawn_server(
|
||||
let tpu_forwards_quic_t = enable_quic_servers.then(|| {
|
||||
spawn_server(
|
||||
transactions_forwards_quic_sockets,
|
||||
keypair,
|
||||
cluster_info.my_contact_info().tpu_forwards.ip(),
|
||||
|
@ -182,7 +186,8 @@ impl Tpu {
|
|||
0, // Prevent unstaked nodes from forwarding transactions
|
||||
stats,
|
||||
)
|
||||
.unwrap();
|
||||
.unwrap()
|
||||
});
|
||||
|
||||
let sigverify_stage = {
|
||||
let verifier = TransactionSigVerifier::new(verified_sender);
|
||||
|
@ -284,8 +289,12 @@ impl Tpu {
|
|||
self.vote_find_packet_sender_stake_stage.join(),
|
||||
self.staked_nodes_updater_service.join(),
|
||||
];
|
||||
self.tpu_quic_t.join()?;
|
||||
self.tpu_forwards_quic_t.join()?;
|
||||
if let Some(tpu_quic_t) = self.tpu_quic_t {
|
||||
tpu_quic_t.join()?;
|
||||
}
|
||||
if let Some(tpu_forwards_quic_t) = self.tpu_forwards_quic_t {
|
||||
tpu_forwards_quic_t.join()?;
|
||||
}
|
||||
let broadcast_result = self.broadcast_stage.join();
|
||||
for result in results {
|
||||
result?;
|
||||
|
|
|
@ -90,7 +90,7 @@ use {
|
|||
clock::Slot,
|
||||
epoch_schedule::MAX_LEADER_SCHEDULE_EPOCH_OFFSET,
|
||||
exit::Exit,
|
||||
genesis_config::GenesisConfig,
|
||||
genesis_config::{ClusterType, GenesisConfig},
|
||||
hash::Hash,
|
||||
pubkey::Pubkey,
|
||||
shred_version::compute_shred_version,
|
||||
|
@ -176,6 +176,7 @@ pub struct ValidatorConfig {
|
|||
pub wait_to_vote_slot: Option<Slot>,
|
||||
pub ledger_column_options: LedgerColumnOptions,
|
||||
pub runtime_config: RuntimeConfig,
|
||||
pub enable_quic_servers: bool,
|
||||
}
|
||||
|
||||
impl Default for ValidatorConfig {
|
||||
|
@ -237,6 +238,7 @@ impl Default for ValidatorConfig {
|
|||
wait_to_vote_slot: None,
|
||||
ledger_column_options: LedgerColumnOptions::default(),
|
||||
runtime_config: RuntimeConfig::default(),
|
||||
enable_quic_servers: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -980,6 +982,18 @@ impl Validator {
|
|||
&connection_cache,
|
||||
);
|
||||
|
||||
let enable_quic_servers = if genesis_config.cluster_type == ClusterType::MainnetBeta {
|
||||
config.enable_quic_servers
|
||||
} else {
|
||||
if config.enable_quic_servers {
|
||||
warn!(
|
||||
"ignoring --enable-quic-servers. QUIC is always enabled for cluster type: {:?}",
|
||||
genesis_config.cluster_type
|
||||
);
|
||||
}
|
||||
true
|
||||
};
|
||||
|
||||
let tpu = Tpu::new(
|
||||
&cluster_info,
|
||||
&poh_recorder,
|
||||
|
@ -1011,6 +1025,7 @@ impl Validator {
|
|||
&cost_model,
|
||||
&connection_cache,
|
||||
&identity_keypair,
|
||||
enable_quic_servers,
|
||||
);
|
||||
|
||||
datapoint_info!(
|
||||
|
|
|
@ -63,6 +63,7 @@ pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
|
|||
wait_to_vote_slot: config.wait_to_vote_slot,
|
||||
ledger_column_options: config.ledger_column_options.clone(),
|
||||
runtime_config: config.runtime_config.clone(),
|
||||
enable_quic_servers: config.enable_quic_servers,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1210,6 +1210,11 @@ pub fn main() {
|
|||
.takes_value(false)
|
||||
.help("Use QUIC to send transactions."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("enable_quic_servers")
|
||||
.hidden(true)
|
||||
.long("enable-quic-servers")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("tpu_connection_pool_size")
|
||||
.long("tpu-connection-pool-size")
|
||||
|
@ -2231,6 +2236,7 @@ pub fn main() {
|
|||
let accounts_shrink_optimize_total_space =
|
||||
value_t_or_exit!(matches, "accounts_shrink_optimize_total_space", bool);
|
||||
let tpu_use_quic = matches.is_present("tpu_use_quic");
|
||||
let enable_quic_servers = matches.is_present("enable_quic_servers");
|
||||
let tpu_connection_pool_size = value_t_or_exit!(matches, "tpu_connection_pool_size", usize);
|
||||
|
||||
let shrink_ratio = value_t_or_exit!(matches, "accounts_shrink_ratio", f64);
|
||||
|
@ -2573,6 +2579,7 @@ pub fn main() {
|
|||
bpf_jit: !matches.is_present("no_bpf_jit"),
|
||||
..RuntimeConfig::default()
|
||||
},
|
||||
enable_quic_servers,
|
||||
..ValidatorConfig::default()
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue