Skip to content

Commit 24b6e5f

Browse files
committed
fixed QUIC constants
1 parent ef9e7f2 commit 24b6e5f

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/tpu-client/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ solana-message = { workspace = true }
9595
solana-net-utils = { workspace = true }
9696
solana-packet = { workspace = true }
9797
solana-pubkey = { workspace = true }
98-
solana-quic-definitions = { workspace = true }
9998
solana-rpc-client = { workspace = true, optional = true }
10099
solana-rpc-client-api = { workspace = true }
101100
solana-signature = { workspace = true, features = ["rand"] }

crates/tpu-client/src/config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use {
2-
crate::core::DEFAULT_UNUSED_CONNECTION_TTL,
2+
crate::core::{DEFAULT_UNUSED_CONNECTION_TTL, QUIC_MAX_TIMEOUT},
33
serde::{Deserialize, Deserializer, de},
44
solana_net_utils::{PortRange, VALIDATOR_PORT_RANGE},
55
solana_pubkey::Pubkey,
6-
solana_quic_definitions::QUIC_MAX_TIMEOUT,
76
std::{net::SocketAddr, num::NonZeroUsize, ops::Range, time::Duration},
87
};
98

crates/tpu-client/src/core.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ use {
5353
solana_clock::{DEFAULT_MS_PER_SLOT, NUM_CONSECUTIVE_LEADER_SLOTS},
5454
solana_keypair::Keypair,
5555
solana_pubkey::Pubkey,
56-
solana_quic_definitions::{QUIC_KEEP_ALIVE, QUIC_SEND_FAIRNESS},
5756
solana_signature::Signature,
5857
solana_signer::Signer,
5958
solana_streamer::nonblocking::quic::ALPN_TPU_PROTOCOL_ID,
@@ -80,11 +79,25 @@ use {
8079

8180
pub const PACKET_DATA_SIZE: usize = 1232;
8281

82+
pub const QUIC_SEND_FAIRNESS: bool = false;
83+
84+
///
85+
/// MAX TIMEOUT is not consistent across solana clients, firedancer has much lower timeout than agave.a
86+
/// 10 seconds the least common timeout.
87+
///
88+
pub const QUIC_MAX_TIMEOUT: Duration = Duration::from_secs(10);
89+
8390
/// Default duration after which an unused connection is evicted.
8491
pub const DEFAULT_UNUSED_CONNECTION_TTL: Duration = Duration::from_secs(10);
8592

8693
pub const DEFAULT_LEADER_DURATION: Duration = Duration::from_secs(2); // 400ms * 4 rounded to seconds
8794

95+
/// Keep-alive interval for QUIC connections.
96+
/// The rate at which we send PING frames to keep the connection alive.
97+
/// So apparently this is consistent across the network and solana client.
98+
/// putting 1s makes it the safest option.
99+
pub const QUIC_KEEP_ALIVE: Duration = Duration::from_secs(1); // seconds
100+
88101
// TODO see if its worth making this configurable
89102
#[cfg(feature = "prometheus")]
90103
pub(crate) const METRIC_UPDATE_INTERVAL: Duration = Duration::from_secs(5);

0 commit comments

Comments
 (0)