diff --git a/rpc-client-api/src/response.rs b/rpc-client-api/src/response.rs index fa70e89b6b88ee..879d7fc09e1d90 100644 --- a/rpc-client-api/src/response.rs +++ b/rpc-client-api/src/response.rs @@ -294,10 +294,20 @@ pub struct RpcContactInfo { pub pubkey: String, /// Gossip port pub gossip: Option, + /// Tvu UDP port + pub tvu: Option, /// Tpu UDP port pub tpu: Option, /// Tpu QUIC port pub tpu_quic: Option, + /// Tpu UDP forwards port + pub tpu_forwards: Option, + /// Tpu QUIC forwards port + pub tpu_forwards_quic: Option, + /// Tpu UDP vote port + pub tpu_vote: Option, + /// Server repair UDP port + pub serve_repair: Option, /// JSON RPC port pub rpc: Option, /// WebSocket PubSub port diff --git a/rpc-client/src/mock_sender.rs b/rpc-client/src/mock_sender.rs index 44ab26359c3f32..33ced028e50e55 100644 --- a/rpc-client/src/mock_sender.rs +++ b/rpc-client/src/mock_sender.rs @@ -375,8 +375,13 @@ impl RpcSender for MockSender { "getClusterNodes" => serde_json::to_value(vec![RpcContactInfo { pubkey: PUBKEY.to_string(), gossip: Some(SocketAddr::from(([10, 239, 6, 48], 8899))), + tvu: Some(SocketAddr::from(([10, 239, 6, 48], 8865))), tpu: Some(SocketAddr::from(([10, 239, 6, 48], 8856))), tpu_quic: Some(SocketAddr::from(([10, 239, 6, 48], 8862))), + tpu_forwards: Some(SocketAddr::from(([10, 239, 6, 48], 8857))), + tpu_forwards_quic: Some(SocketAddr::from(([10, 239, 6, 48], 8863))), + tpu_vote: Some(SocketAddr::from(([10, 239, 6, 48], 8870))), + serve_repair: Some(SocketAddr::from(([10, 239, 6, 48], 8880))), rpc: Some(SocketAddr::from(([10, 239, 6, 48], 8899))), pubsub: Some(SocketAddr::from(([10, 239, 6, 48], 8900))), version: Some("1.0.0 c375ce1f".to_string()), diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index 60458ff3add646..b449851b5ea00c 100644 --- a/rpc/src/rpc.rs +++ b/rpc/src/rpc.rs @@ -3457,6 +3457,10 @@ pub mod rpc_full { Some(RpcContactInfo { pubkey: contact_info.pubkey().to_string(), gossip: contact_info.gossip().ok(), + tvu: contact_info + .tvu(Protocol::UDP) + .ok() + .filter(|addr| socket_addr_space.check(addr)), tpu: contact_info .tpu(Protocol::UDP) .ok() @@ -3465,6 +3469,22 @@ pub mod rpc_full { .tpu(Protocol::QUIC) .ok() .filter(|addr| socket_addr_space.check(addr)), + tpu_forwards: contact_info + .tpu_forwards(Protocol::UDP) + .ok() + .filter(|addr| socket_addr_space.check(addr)), + tpu_forwards_quic: contact_info + .tpu_forwards(Protocol::QUIC) + .ok() + .filter(|addr| socket_addr_space.check(addr)), + tpu_vote: contact_info + .tpu_vote() + .ok() + .filter(|addr| socket_addr_space.check(addr)), + serve_repair: contact_info + .serve_repair(Protocol::UDP) + .ok() + .filter(|addr| socket_addr_space.check(addr)), rpc: contact_info .rpc() .ok() @@ -5189,8 +5209,13 @@ pub mod tests { "pubkey": rpc.identity.to_string(), "gossip": "127.0.0.1:8000", "shredVersion": 0u16, + "tvu": "127.0.0.1:8001", "tpu": "127.0.0.1:8003", "tpuQuic": "127.0.0.1:8009", + "tpuForwards": "127.0.0.1:8004", + "tpuForwardsQuic": "127.0.0.1:8010", + "tpuVote": "127.0.0.1:8005", + "serveRepair": "127.0.0.1:8008", "rpc": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PORT), "pubsub": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PUBSUB_PORT), "version": null, @@ -5199,8 +5224,13 @@ pub mod tests { "pubkey": rpc.leader_pubkey().to_string(), "gossip": "127.0.0.1:1235", "shredVersion": 0u16, + "tvu": "127.0.0.1:1236", "tpu": "127.0.0.1:1234", "tpuQuic": "127.0.0.1:1240", + "tpuForwards": "127.0.0.1:1239", + "tpuForwardsQuic": "127.0.0.1:1245", + "tpuVote": "127.0.0.1:1241", + "serveRepair": "127.0.0.1:1242", "rpc": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PORT), "pubsub": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PUBSUB_PORT), "version": null,