From 2be38d44efd7e7d1068f4ed878a0b6228292456f Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Mon, 9 Dec 2024 20:41:58 +0400 Subject: [PATCH] remove solana-sdk from solana-client (#3844) * remove solana-sdk from solana-client * remove solana-program --- Cargo.lock | 16 +++++++++- client/Cargo.toml | 16 +++++++++- client/src/connection_cache.rs | 10 +++--- client/src/nonblocking/tpu_client.rs | 10 +++--- ...nd_and_confirm_transactions_in_parallel.rs | 13 ++++---- client/src/thin_client.rs | 31 +++++++++---------- client/src/tpu_client.rs | 10 +++--- client/src/transaction_executor.rs | 8 ++--- programs/sbf/Cargo.lock | 16 +++++++++- svm/examples/Cargo.lock | 16 +++++++++- 10 files changed, 98 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 305e64e0591520..315ba7db14fd56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6503,18 +6503,32 @@ dependencies = [ "log", "quinn", "rayon", + "solana-account", + "solana-client-traits", + "solana-commitment-config", "solana-connection-cache", + "solana-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-measure", + "solana-message", "solana-net-utils", + "solana-pubkey", "solana-pubsub-client", "solana-quic-client", + "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", "solana-rpc-client-nonce-utils", - "solana-sdk", + "solana-signature", + "solana-signer", "solana-streamer", "solana-thin-client", + "solana-time-utils", "solana-tpu-client", + "solana-transaction", + "solana-transaction-error", "solana-udp-client", "thiserror 2.0.6", "tokio", diff --git a/client/Cargo.toml b/client/Cargo.toml index 36cab356c05104..986a926fd87761 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -20,17 +20,31 @@ indicatif = { workspace = true } log = { workspace = true } quinn = { workspace = true } rayon = { workspace = true } +solana-account = { workspace = true } +solana-client-traits = { workspace = true } +solana-commitment-config = { workspace = true } solana-connection-cache = { workspace = true } +solana-epoch-info = { workspace = true } +solana-hash = { workspace = true } +solana-instruction = { workspace = true } +solana-keypair = { workspace = true } solana-measure = { workspace = true } +solana-message = { workspace = true } +solana-pubkey = { workspace = true } solana-pubsub-client = { workspace = true } solana-quic-client = { workspace = true } +solana-quic-definitions = { workspace = true } solana-rpc-client = { workspace = true, features = ["default"] } solana-rpc-client-api = { workspace = true } solana-rpc-client-nonce-utils = { workspace = true } -solana-sdk = { workspace = true, features = ["openssl-vendored"] } +solana-signature = { workspace = true } +solana-signer = { workspace = true } solana-streamer = { workspace = true } solana-thin-client = { workspace = true } +solana-time-utils = { workspace = true } solana-tpu-client = { workspace = true, features = ["default"] } +solana-transaction = { workspace = true } +solana-transaction-error = { workspace = true } solana-udp-client = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } diff --git a/client/src/connection_cache.rs b/client/src/connection_cache.rs index 28cc60a18075b3..10b3bbb9ecd609 100644 --- a/client/src/connection_cache.rs +++ b/client/src/connection_cache.rs @@ -8,12 +8,12 @@ use { NewConnectionConfig, }, }, + solana_keypair::Keypair, + solana_pubkey::Pubkey, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, - solana_sdk::{ - pubkey::Pubkey, quic::NotifyKeyUpdate, signature::Keypair, - transport::Result as TransportResult, - }, + solana_quic_definitions::NotifyKeyUpdate, solana_streamer::streamer::StakedNodes, + solana_transaction_error::TransportResult, solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool}, std::{ net::{IpAddr, Ipv4Addr, SocketAddr}, @@ -201,8 +201,8 @@ mod tests { super::*, crate::connection_cache::ConnectionCache, crossbeam_channel::unbounded, + solana_keypair::Keypair, solana_net_utils::bind_to_localhost, - solana_sdk::signature::Keypair, solana_streamer::{ quic::{QuicServerParams, SpawnServerResult}, streamer::StakedNodes, diff --git a/client/src/nonblocking/tpu_client.rs b/client/src/nonblocking/tpu_client.rs index 5e71eae36bd6e4..e49aff1b254f19 100644 --- a/client/src/nonblocking/tpu_client.rs +++ b/client/src/nonblocking/tpu_client.rs @@ -5,15 +5,13 @@ use { ConnectionCache as BackendConnectionCache, ConnectionManager, ConnectionPool, NewConnectionConfig, }, + solana_message::Message, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::nonblocking::rpc_client::RpcClient, - solana_sdk::{ - message::Message, - signers::Signers, - transaction::{Transaction, TransactionError}, - transport::Result as TransportResult, - }, + solana_signer::signers::Signers, solana_tpu_client::nonblocking::tpu_client::{Result, TpuClient as BackendTpuClient}, + solana_transaction::Transaction, + solana_transaction_error::{TransactionError, TransportResult}, std::sync::Arc, }; diff --git a/client/src/send_and_confirm_transactions_in_parallel.rs b/client/src/send_and_confirm_transactions_in_parallel.rs index eb7153316702cf..6d357180ef6770 100644 --- a/client/src/send_and_confirm_transactions_in_parallel.rs +++ b/client/src/send_and_confirm_transactions_in_parallel.rs @@ -6,6 +6,8 @@ use { bincode::serialize, dashmap::DashMap, futures_util::future::join_all, + solana_hash::Hash, + solana_message::Message, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::spinner::{self, SendTransactionProgress}, solana_rpc_client_api::{ @@ -14,14 +16,11 @@ use { request::{RpcError, RpcResponseErrorData, MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS}, response::RpcSimulateTransactionResult, }, - solana_sdk::{ - hash::Hash, - message::Message, - signature::{Signature, SignerError}, - signers::Signers, - transaction::{Transaction, TransactionError}, - }, + solana_signature::Signature, + solana_signer::{signers::Signers, SignerError}, solana_tpu_client::tpu_client::{Result, TpuSenderError}, + solana_transaction::Transaction, + solana_transaction_error::TransactionError, std::{ sync::{ atomic::{AtomicU64, AtomicUsize, Ordering}, diff --git a/client/src/thin_client.rs b/client/src/thin_client.rs index 596c9a13a6dbd3..1df00ae45cb52b 100644 --- a/client/src/thin_client.rs +++ b/client/src/thin_client.rs @@ -5,24 +5,23 @@ #[allow(deprecated)] use { crate::connection_cache::{dispatch, ConnectionCache}, + solana_account::Account, + solana_client_traits::{AsyncClient, Client, SyncClient}, + solana_commitment_config::CommitmentConfig, + solana_epoch_info::EpochInfo, + solana_hash::Hash, + solana_instruction::Instruction, + solana_keypair::Keypair, + solana_message::Message, + solana_pubkey::Pubkey, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::rpc_client::RpcClient, solana_rpc_client_api::config::RpcProgramAccountsConfig, - solana_sdk::{ - account::Account, - client::{AsyncClient, Client, SyncClient}, - commitment_config::CommitmentConfig, - epoch_info::EpochInfo, - hash::Hash, - instruction::Instruction, - message::Message, - pubkey::Pubkey, - signature::{Keypair, Signature}, - signers::Signers, - transaction::{self, Transaction, VersionedTransaction}, - transport::Result as TransportResult, - }, + solana_signature::Signature, + solana_signer::signers::Signers, solana_thin_client::thin_client::ThinClient as BackendThinClient, + solana_transaction::{versioned::VersionedTransaction, Transaction}, + solana_transaction_error::{TransactionResult, TransportResult}, solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool}, std::{net::SocketAddr, sync::Arc, time::Duration}, }; @@ -214,13 +213,13 @@ impl SyncClient for ThinClient { dispatch!(fn get_signature_status( &self, signature: &Signature - ) -> TransportResult>>); + ) -> TransportResult>>); dispatch!(fn get_signature_status_with_commitment( &self, signature: &Signature, commitment_config: CommitmentConfig - ) -> TransportResult>>); + ) -> TransportResult>>); dispatch!(fn get_slot(&self) -> TransportResult); diff --git a/client/src/tpu_client.rs b/client/src/tpu_client.rs index 893761637ce64d..695138f7234ebd 100644 --- a/client/src/tpu_client.rs +++ b/client/src/tpu_client.rs @@ -4,15 +4,13 @@ use { ConnectionCache as BackendConnectionCache, ConnectionManager, ConnectionPool, NewConnectionConfig, }, + solana_message::Message, solana_quic_client::{QuicConfig, QuicConnectionManager, QuicPool}, solana_rpc_client::rpc_client::RpcClient, - solana_sdk::{ - message::Message, - signers::Signers, - transaction::{Transaction, TransactionError}, - transport::Result as TransportResult, - }, + solana_signer::signers::Signers, solana_tpu_client::tpu_client::{Result, TpuClient as BackendTpuClient}, + solana_transaction::Transaction, + solana_transaction_error::{TransactionError, TransportResult}, solana_udp_client::{UdpConfig, UdpConnectionManager, UdpPool}, std::sync::Arc, }; diff --git a/client/src/transaction_executor.rs b/client/src/transaction_executor.rs index c85aa21f8bb555..23354818777788 100644 --- a/client/src/transaction_executor.rs +++ b/client/src/transaction_executor.rs @@ -1,12 +1,12 @@ #![allow(clippy::arithmetic_side_effects)] use { log::*, + solana_commitment_config::CommitmentConfig, solana_measure::measure::Measure, solana_rpc_client::rpc_client::RpcClient, - solana_sdk::{ - commitment_config::CommitmentConfig, signature::Signature, timing::timestamp, - transaction::Transaction, - }, + solana_signature::Signature, + solana_time_utils::timestamp, + solana_transaction::Transaction, std::{ net::SocketAddr, sync::{ diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 205717124644bd..f6ab700baf11cb 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5257,17 +5257,31 @@ dependencies = [ "log", "quinn", "rayon", + "solana-account", + "solana-client-traits", + "solana-commitment-config", "solana-connection-cache", + "solana-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-measure", + "solana-message", + "solana-pubkey", "solana-pubsub-client", "solana-quic-client", + "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", "solana-rpc-client-nonce-utils", - "solana-sdk", + "solana-signature", + "solana-signer", "solana-streamer", "solana-thin-client", + "solana-time-utils", "solana-tpu-client", + "solana-transaction", + "solana-transaction-error", "solana-udp-client", "thiserror 2.0.6", "tokio", diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index d58d5b31e561c3..da0a88726d3872 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -5108,17 +5108,31 @@ dependencies = [ "log", "quinn", "rayon", + "solana-account", + "solana-client-traits", + "solana-commitment-config", "solana-connection-cache", + "solana-epoch-info", + "solana-hash", + "solana-instruction", + "solana-keypair", "solana-measure", + "solana-message", + "solana-pubkey", "solana-pubsub-client", "solana-quic-client", + "solana-quic-definitions", "solana-rpc-client", "solana-rpc-client-api", "solana-rpc-client-nonce-utils", - "solana-sdk", + "solana-signature", + "solana-signer", "solana-streamer", "solana-thin-client", + "solana-time-utils", "solana-tpu-client", + "solana-transaction", + "solana-transaction-error", "solana-udp-client", "thiserror 2.0.6", "tokio",