Skip to content

Commit

Permalink
Use pubkey of peer for active QUIC connection table (solana-labs#26597)
Browse files Browse the repository at this point in the history
* Use pubkey of peer for active QUIC connection table

* clippy

* update code
  • Loading branch information
pgarg66 authored Jul 13, 2022
1 parent b7e7e41 commit 49a112a
Show file tree
Hide file tree
Showing 3 changed files with 204 additions and 51 deletions.
6 changes: 3 additions & 3 deletions core/src/tpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use {
pub const DEFAULT_TPU_COALESCE_MS: u64 = 5;

// allow multiple connections for NAT and any open/close overlap
pub const MAX_QUIC_CONNECTIONS_PER_IP: usize = 8;
pub const MAX_QUIC_CONNECTIONS_PER_PEER: usize = 8;

pub struct TpuSockets {
pub transactions: Vec<UdpSocket>,
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Tpu {
cluster_info.my_contact_info().tpu.ip(),
packet_sender,
exit.clone(),
MAX_QUIC_CONNECTIONS_PER_IP,
MAX_QUIC_CONNECTIONS_PER_PEER,
staked_nodes.clone(),
MAX_STAKED_CONNECTIONS,
MAX_UNSTAKED_CONNECTIONS,
Expand All @@ -177,7 +177,7 @@ impl Tpu {
cluster_info.my_contact_info().tpu_forwards.ip(),
forwarded_packet_sender,
exit.clone(),
MAX_QUIC_CONNECTIONS_PER_IP,
MAX_QUIC_CONNECTIONS_PER_PEER,
staked_nodes,
MAX_STAKED_CONNECTIONS.saturating_add(MAX_UNSTAKED_CONNECTIONS),
0, // Prevent unstaked nodes from forwarding transactions
Expand Down
Loading

0 comments on commit 49a112a

Please sign in to comment.