Browse Source

Remove deprecated symbols from solana-client (mostly re-exports) (#1992)

* Remove usage of deprecated re-export from SendTransactionService

* Remove usage of deprecated re-export from core

* Remove usage of deprecated re-export from solana-dos

* Remove deprecated ConnectionCache methods

* Remove deprecated udp_client re-export

* Remove deprecated tpu_connection re-export

* Remove deprecated quic_client re-export
Tyera 1 year ago
parent
commit
3cd7621a81

+ 3 - 0
Cargo.lock

@@ -6110,6 +6110,7 @@ dependencies = [
  "solana-bloom",
  "solana-client",
  "solana-compute-budget",
+ "solana-connection-cache",
  "solana-core",
  "solana-cost-model",
  "solana-entry",
@@ -6212,6 +6213,7 @@ dependencies = [
  "serde",
  "solana-bench-tps",
  "solana-client",
+ "solana-connection-cache",
  "solana-core",
  "solana-faucet",
  "solana-gossip",
@@ -7350,6 +7352,7 @@ dependencies = [
  "crossbeam-channel",
  "log",
  "solana-client",
+ "solana-connection-cache",
  "solana-logger",
  "solana-measure",
  "solana-metrics",

+ 0 - 24
client/src/connection_cache.rs

@@ -16,7 +16,6 @@ use {
     solana_streamer::streamer::StakedNodes,
     solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool},
     std::{
-        error::Error,
         net::{IpAddr, Ipv4Addr, SocketAddr},
         sync::{Arc, RwLock},
     },
@@ -110,29 +109,6 @@ impl ConnectionCache {
         }
     }
 
-    #[deprecated(
-        since = "1.15.0",
-        note = "This method does not do anything. Please use `new_with_client_options` instead to set the client certificate."
-    )]
-    pub fn update_client_certificate(
-        &mut self,
-        _keypair: &Keypair,
-        _ipaddr: IpAddr,
-    ) -> Result<(), Box<dyn Error>> {
-        Ok(())
-    }
-
-    #[deprecated(
-        since = "1.15.0",
-        note = "This method does not do anything. Please use `new_with_client_options` instead to set staked nodes information."
-    )]
-    pub fn set_staked_nodes(
-        &mut self,
-        _staked_nodes: &Arc<RwLock<StakedNodes>>,
-        _client_pubkey: &Pubkey,
-    ) {
-    }
-
     pub fn with_udp(name: &'static str, connection_pool_size: usize) -> Self {
         // The minimum pool size is 1.
         let connection_pool_size = 1.max(connection_pool_size);

+ 0 - 3
client/src/lib.rs

@@ -2,13 +2,10 @@
 
 pub mod connection_cache;
 pub mod nonblocking;
-pub mod quic_client;
 pub mod send_and_confirm_transactions_in_parallel;
 pub mod thin_client;
 pub mod tpu_client;
-pub mod tpu_connection;
 pub mod transaction_executor;
-pub mod udp_client;
 
 extern crate solana_metrics;
 

+ 0 - 3
client/src/nonblocking/mod.rs

@@ -1,7 +1,4 @@
-pub mod quic_client;
 pub mod tpu_client;
-pub mod tpu_connection;
-pub mod udp_client;
 
 pub mod blockhash_query {
     pub use solana_rpc_client_nonce_utils::nonblocking::blockhash_query::*;

+ 0 - 8
client/src/nonblocking/quic_client.rs

@@ -1,8 +0,0 @@
-#[deprecated(
-    since = "1.15.0",
-    note = "Please use `solana_quic_client::nonblocking::quic_client::QuicClientConnection` instead."
-)]
-pub use solana_quic_client::nonblocking::quic_client::QuicClientConnection as QuicTpuConnection;
-pub use solana_quic_client::nonblocking::quic_client::{
-    QuicClient, QuicClientCertificate, QuicLazyInitializedEndpoint,
-};

+ 0 - 5
client/src/nonblocking/tpu_connection.rs

@@ -1,5 +0,0 @@
-#[deprecated(
-    since = "1.15.0",
-    note = "Please use `solana_connection_cache::nonblocking::client_connection::ClientConnection` instead."
-)]
-pub use solana_connection_cache::nonblocking::client_connection::ClientConnection as TpuConnection;

+ 0 - 5
client/src/nonblocking/udp_client.rs

@@ -1,5 +0,0 @@
-#[deprecated(
-    since = "1.15.0",
-    note = "Please use `solana_udp_client::nonblocking::udp_client::UdpClientConnection` instead."
-)]
-pub use solana_udp_client::nonblocking::udp_client::UdpClientConnection as UdpTpuConnection;

+ 0 - 5
client/src/quic_client.rs

@@ -1,5 +0,0 @@
-#[deprecated(
-    since = "1.15.0",
-    note = "Please use `solana_quic_client::quic_client::QuicClientConnection` instead."
-)]
-pub use solana_quic_client::quic_client::QuicClientConnection as QuicTpuConnection;

+ 0 - 6
client/src/tpu_connection.rs

@@ -1,6 +0,0 @@
-#[deprecated(
-    since = "1.15.0",
-    note = "Please use `solana_connection_cache::client_connection::ClientConnection` instead."
-)]
-pub use solana_connection_cache::client_connection::ClientConnection as TpuConnection;
-pub use solana_connection_cache::client_connection::ClientStats;

+ 0 - 5
client/src/udp_client.rs

@@ -1,5 +0,0 @@
-#[deprecated(
-    since = "1.15.0",
-    note = "Please use `solana_udp_client::udp_client::UdpClientConnection` instead."
-)]
-pub use solana_udp_client::udp_client::UdpClientConnection as UdpTpuConnection;

+ 1 - 0
core/Cargo.toml

@@ -47,6 +47,7 @@ solana-accounts-db = { workspace = true }
 solana-bloom = { workspace = true }
 solana-client = { workspace = true }
 solana-compute-budget = { workspace = true }
+solana-connection-cache = { workspace = true }
 solana-cost-model = { workspace = true }
 solana-entry = { workspace = true }
 solana-frozen-abi = { workspace = true, optional = true }

+ 2 - 1
core/src/banking_stage/forwarder.rs

@@ -10,7 +10,8 @@ use {
         next_leader::{next_leader, next_leader_tpu_vote},
         tracer_packet_stats::TracerPacketStats,
     },
-    solana_client::{connection_cache::ConnectionCache, tpu_connection::TpuConnection},
+    solana_client::connection_cache::ConnectionCache,
+    solana_connection_cache::client_connection::ClientConnection as TpuConnection,
     solana_gossip::cluster_info::ClusterInfo,
     solana_measure::measure_us,
     solana_perf::{data_budget::DataBudget, packet::Packet},

+ 2 - 4
core/src/warm_quic_cache_service.rs

@@ -3,10 +3,8 @@
 
 use {
     rand::{thread_rng, Rng},
-    solana_client::{
-        connection_cache::{ConnectionCache, Protocol},
-        tpu_connection::TpuConnection,
-    },
+    solana_client::connection_cache::{ConnectionCache, Protocol},
+    solana_connection_cache::client_connection::ClientConnection as TpuConnection,
     solana_gossip::cluster_info::ClusterInfo,
     solana_poh::poh_recorder::PohRecorder,
     std::{

+ 1 - 0
dos/Cargo.toml

@@ -19,6 +19,7 @@ rand = { workspace = true }
 serde = { workspace = true }
 solana-bench-tps = { workspace = true }
 solana-client = { workspace = true }
+solana-connection-cache = { workspace = true }
 solana-core = { workspace = true }
 solana-faucet = { workspace = true }
 solana-gossip = { workspace = true }

+ 2 - 4
dos/src/main.rs

@@ -46,10 +46,8 @@ use {
     log::*,
     rand::{thread_rng, Rng},
     solana_bench_tps::bench::generate_and_fund_keypairs,
-    solana_client::{
-        connection_cache::ConnectionCache, tpu_client::TpuClientWrapper,
-        tpu_connection::TpuConnection,
-    },
+    solana_client::{connection_cache::ConnectionCache, tpu_client::TpuClientWrapper},
+    solana_connection_cache::client_connection::ClientConnection as TpuConnection,
     solana_core::repair::serve_repair::{RepairProtocol, RepairRequestHeader, ServeRepair},
     solana_dos::cli::*,
     solana_gossip::{

+ 2 - 0
programs/sbf/Cargo.lock

@@ -4873,6 +4873,7 @@ dependencies = [
  "solana-bloom",
  "solana-client",
  "solana-compute-budget",
+ "solana-connection-cache",
  "solana-cost-model",
  "solana-entry",
  "solana-geyser-plugin-manager",
@@ -6190,6 +6191,7 @@ dependencies = [
  "crossbeam-channel",
  "log",
  "solana-client",
+ "solana-connection-cache",
  "solana-measure",
  "solana-metrics",
  "solana-runtime",

+ 1 - 0
send-transaction-service/Cargo.toml

@@ -13,6 +13,7 @@ edition = { workspace = true }
 crossbeam-channel = { workspace = true }
 log = { workspace = true }
 solana-client = { workspace = true }
+solana-connection-cache = { workspace = true }
 solana-measure = { workspace = true }
 solana-metrics = { workspace = true }
 solana-runtime = { workspace = true }

+ 2 - 4
send-transaction-service/src/send_transaction_service.rs

@@ -2,10 +2,8 @@ use {
     crate::tpu_info::TpuInfo,
     crossbeam_channel::{Receiver, RecvTimeoutError},
     log::*,
-    solana_client::{
-        connection_cache::{ConnectionCache, Protocol},
-        tpu_connection::TpuConnection,
-    },
+    solana_client::connection_cache::{ConnectionCache, Protocol},
+    solana_connection_cache::client_connection::ClientConnection as TpuConnection,
     solana_measure::measure::Measure,
     solana_runtime::{bank::Bank, bank_forks::BankForks},
     solana_sdk::{