Skip to content

Commit

Permalink
re-export some constants moved/renamed and mark them deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunwangs committed Jan 11, 2025
1 parent a22ceba commit 133db69
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/tpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ use {
tokio::sync::mpsc::Sender as AsyncSender,
};

// allow multiple connections for NAT and any open/close overlap
#[deprecated(
since = "2.2.0",
note = "Use solana_streamer::quic::DEFAULT_MAX_QUIC_CONNECTIONS_PER_PEER instead"
)]
pub const MAX_QUIC_CONNECTIONS_PER_PEER: usize = 8;

pub struct TpuSockets {
pub transactions: Vec<UdpSocket>,
pub transaction_forwards: Vec<UdpSocket>,
Expand Down
16 changes: 16 additions & 0 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ const CONNECTION_CLOSE_REASON_TOO_MANY: &[u8] = b"too_many";
const CONNECTION_CLOSE_CODE_INVALID_STREAM: u32 = 5;
const CONNECTION_CLOSE_REASON_INVALID_STREAM: &[u8] = b"invalid_stream";

/// Limit to 250K PPS
#[deprecated(
since = "2.2.0",
note = "Use solana_streamer::quic::DEFAULT_MAX_STREAMS_PER_MS"
)]
pub const DEFAULT_MAX_STREAMS_PER_MS: u64 = 250;

/// The new connections per minute from a particular IP address.
/// Heuristically set to the default maximum concurrent connections
/// per IP address. Might be adjusted later.
#[deprecated(
since = "2.2.0",
note = "Use solana_streamer::quic::DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE"
)]
pub const DEFAULT_MAX_CONNECTIONS_PER_IPADDR_PER_MINUTE: u64 = 8;

/// Total new connection counts per second. Heuristically taken from
/// the default staked and unstaked connection limits. Might be adjusted
/// later.
Expand Down
13 changes: 13 additions & 0 deletions streamer/src/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,20 @@ use {
// allow multiple connections for NAT and any open/close overlap
pub const DEFAULT_MAX_QUIC_CONNECTIONS_PER_PEER: usize = 8;

#[deprecated(
since = "2.2.0",
note = "Use solana_streamer::quic::DEFAULT_MAX_STAKED_CONNECTIONS"
)]
pub const MAX_STAKED_CONNECTIONS: usize = 2000;

pub const DEFAULT_MAX_STAKED_CONNECTIONS: usize = 2000;

#[deprecated(
since = "2.2.0",
note = "Use solana_streamer::quic::DEFAULT_MAX_UNSTAKED_CONNECTIONS"
)]
pub const MAX_UNSTAKED_CONNECTIONS: usize = 500;

pub const DEFAULT_MAX_UNSTAKED_CONNECTIONS: usize = 500;

/// Limit to 250K PPS
Expand Down

0 comments on commit 133db69

Please sign in to comment.