Skip to content

Commit d154ea2

Browse files
committed
remove deprecated UDP TPU socket bindings
Signed-off-by: AvhiMaz <[email protected]>
1 parent df2b614 commit d154ea2

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

gossip/src/cluster_info.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,8 +2371,6 @@ pub struct Sockets {
23712371
pub ip_echo: Option<TcpListener>,
23722372
pub tvu: Vec<UdpSocket>,
23732373
pub tvu_quic: UdpSocket,
2374-
pub tpu: Vec<UdpSocket>,
2375-
pub tpu_forwards: Vec<UdpSocket>,
23762374
pub tpu_vote: Vec<UdpSocket>,
23772375
pub broadcast: Vec<UdpSocket>,
23782376
// Socket sending out local repair requests,
@@ -2872,7 +2870,6 @@ mod tests {
28722870
}
28732871
check_sockets(&node.sockets.gossip, ip, range);
28742872
check_sockets(&node.sockets.tvu, ip, range);
2875-
check_sockets(&node.sockets.tpu, ip, range);
28762873
}
28772874

28782875
#[test]
@@ -3777,7 +3774,7 @@ mod tests {
37773774
agave_logger::setup();
37783775
// If you change the format of cluster_info_trace or rpc_info_trace, please make sure
37793776
// you read the actual output so the headers lign up with the output.
3780-
const CLUSTER_INFO_TRACE_LENGTH: usize = 452;
3777+
const CLUSTER_INFO_TRACE_LENGTH: usize = 461;
37813778
const RPC_INFO_TRACE_LENGTH: usize = 335;
37823779
let keypair43 = Arc::new(
37833780
Keypair::try_from(

gossip/src/node.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ impl Node {
132132
bind_in_range_with_config(bind_ip_addr, port_range, socket_config)
133133
.expect("tvu_quic bind");
134134

135-
let (tpu_port, tpu_socket) =
136-
bind_in_range_with_config(bind_ip_addr, port_range, socket_config)
137-
.expect("tpu_socket primary bind");
138-
let tpu_sockets =
139-
bind_more_with_config(tpu_socket, 32, socket_config).expect("tpu_sockets multi_bind");
140-
141135
let (tpu_port_quic, tpu_quic) =
142136
bind_in_range_with_config(bind_ip_addr, port_range, socket_config)
143137
.expect("tpu_socket primary bind");
@@ -151,11 +145,6 @@ impl Node {
151145
);
152146
let tpu_quic_addresses = Self::get_socket_addrs(&tpu_quic);
153147

154-
let (tpu_forwards_port, tpu_forwards_socket) =
155-
bind_in_range_with_config(bind_ip_addr, port_range, socket_config)
156-
.expect("tpu_forwards primary bind");
157-
let tpu_forwards_sockets = bind_more_with_config(tpu_forwards_socket, 8, socket_config)
158-
.expect("tpu_forwards multi_bind");
159148
let (tpu_forwards_quic_port, tpu_forwards_quic) =
160149
bind_in_range_with_config(bind_ip_addr, port_range, socket_config)
161150
.expect("tpu_forwards primary bind");
@@ -295,14 +284,11 @@ impl Node {
295284
)
296285
.unwrap();
297286
info.set_tvu(QUIC, (advertised_ip, tvu_quic_port)).unwrap();
298-
info.set_tpu(UDP, (advertised_ip, tpu_port)).unwrap();
299287
info.set_tpu(
300288
QUIC,
301289
public_tpu_addr.unwrap_or_else(|| SocketAddr::new(advertised_ip, tpu_port_quic)),
302290
)
303291
.unwrap();
304-
info.set_tpu_forwards(UDP, (advertised_ip, tpu_forwards_port))
305-
.unwrap();
306292
info.set_tpu_forwards(
307293
QUIC,
308294
public_tpu_forwards_addr
@@ -342,8 +328,6 @@ impl Node {
342328
gossip: gossip_sockets.into_iter().collect(),
343329
tvu: tvu_sockets,
344330
tvu_quic,
345-
tpu: tpu_sockets,
346-
tpu_forwards: tpu_forwards_sockets,
347331
tpu_vote: tpu_vote_sockets,
348332
broadcast,
349333
repair,
@@ -531,10 +515,7 @@ pub use multihoming::*;
531515

532516
#[cfg(test)]
533517
mod tests {
534-
use {
535-
super::*,
536-
crate::contact_info::Protocol::{QUIC, UDP},
537-
};
518+
use {super::*, crate::contact_info::Protocol::QUIC};
538519

539520
/// Regression test for fix where tpu_forwards_quic was incorrectly
540521
/// using tpu_forwards_port (UDP) instead of tpu_forwards_quic_port (QUIC)
@@ -544,7 +525,6 @@ mod tests {
544525
let node = Node::new_localhost_with_pubkey(&pubkey);
545526

546527
let tpu_forwards_quic = node.info.tpu_forwards(QUIC).unwrap();
547-
let tpu_forwards_udp = node.info.tpu_forwards(UDP).unwrap();
548528

549529
let actual_quic_port = node.sockets.tpu_forwards_quic[0]
550530
.local_addr()
@@ -556,11 +536,5 @@ mod tests {
556536
actual_quic_port,
557537
"TPU forwards QUIC advertised port should match actual bound QUIC socket"
558538
);
559-
560-
assert_ne!(
561-
tpu_forwards_quic.port(),
562-
tpu_forwards_udp.port(),
563-
"TPU forwards QUIC and UDP should use different ports"
564-
);
565539
}
566540
}

0 commit comments

Comments
 (0)