Skip to content

Commit

Permalink
put TpuClientWrapper back in solana_client
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcusack committed Mar 21, 2024
1 parent eafb291 commit 2d12d8a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions client/src/tpu_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ use {
transport::Result as TransportResult,
},
solana_tpu_client::tpu_client::{Result, TpuClient as BackendTpuClient},
solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool},
std::sync::Arc,
};
pub use {
crate::nonblocking::tpu_client::TpuSenderError,
solana_tpu_client::tpu_client::{TpuClientConfig, DEFAULT_FANOUT_SLOTS, MAX_FANOUT_SLOTS},
};

pub enum TpuClientWrapper {
Quic(BackendTpuClient<QuicPool, QuicConnectionManager, QuicConfig>),
Udp(BackendTpuClient<UdpPool, UdpConnectionManager, UdpConfig>),
}

/// Client which sends transactions directly to the current leader's TPU port over UDP.
/// The client uses RPC to determine the current leader and fetch node contact info
/// This is just a thin wrapper over the "BackendTpuClient", use that directly for more efficiency.
Expand Down
5 changes: 4 additions & 1 deletion dos/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ use {
log::*,
rand::{thread_rng, Rng},
solana_bench_tps::{bench::generate_and_fund_keypairs, bench_tps_client::BenchTpsClient},
solana_client::{connection_cache::ConnectionCache, tpu_connection::TpuConnection},
solana_client::{
connection_cache::ConnectionCache, tpu_client::TpuClientWrapper,
tpu_connection::TpuConnection,
},
solana_core::repair::serve_repair::{RepairProtocol, RepairRequestHeader, ServeRepair},
solana_dos::cli::*,
solana_gossip::{
Expand Down
6 changes: 4 additions & 2 deletions gossip/src/gossip_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use {
crate::{cluster_info::ClusterInfo, legacy_contact_info::LegacyContactInfo as ContactInfo},
crossbeam_channel::{unbounded, Sender},
rand::{thread_rng, Rng},
solana_client::{connection_cache::ConnectionCache, rpc_client::RpcClient},
solana_client::{
connection_cache::ConnectionCache, rpc_client::RpcClient, tpu_client::TpuClientWrapper,
},
solana_perf::recycler::Recycler,
solana_runtime::bank_forks::BankForks,
solana_sdk::{
Expand All @@ -15,7 +17,7 @@ use {
socket::SocketAddrSpace,
streamer::{self, StreamerReceiveStats},
},
solana_tpu_client::tpu_client::{TpuClient, TpuClientConfig, TpuClientWrapper},
solana_tpu_client::tpu_client::{TpuClient, TpuClientConfig},
std::{
collections::HashSet,
net::{SocketAddr, TcpListener, UdpSocket},
Expand Down

0 comments on commit 2d12d8a

Please sign in to comment.