From f0eab1a2241a5ac67c8efd60d7ffc531c7b1318a Mon Sep 17 00:00:00 2001 From: kevinheavey Date: Thu, 2 Jan 2025 23:00:20 +0400 Subject: [PATCH] replace solana_sdk::pubkey with solana_pubkey in gossip --- Cargo.lock | 1 + gossip/Cargo.toml | 1 + gossip/benches/crds.rs | 2 +- gossip/src/cluster_info.rs | 37 ++++++++++++++----------------- gossip/src/contact_info.rs | 2 +- gossip/src/crds.rs | 4 ++-- gossip/src/crds_entry.rs | 2 +- gossip/src/crds_gossip_pull.rs | 22 +++++++++--------- gossip/src/crds_gossip_push.rs | 24 ++++++++++---------- gossip/src/epoch_slots.rs | 2 +- gossip/src/gossip_service.rs | 8 +++---- gossip/src/legacy_contact_info.rs | 2 +- gossip/src/main.rs | 2 +- gossip/src/protocol.rs | 2 +- gossip/src/received_cache.rs | 2 +- gossip/src/restart_crds_values.rs | 4 ++-- programs/sbf/Cargo.lock | 1 + svm/examples/Cargo.lock | 1 + 18 files changed, 60 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bc446c70bb6d85..dd75ab208c526d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7375,6 +7375,7 @@ dependencies = [ "solana-metrics", "solana-net-utils", "solana-perf", + "solana-pubkey", "solana-rayon-threadlimit", "solana-rpc-client", "solana-runtime", diff --git a/gossip/Cargo.toml b/gossip/Cargo.toml index fc2ee43522dd5c..71d1ed26b9a321 100644 --- a/gossip/Cargo.toml +++ b/gossip/Cargo.toml @@ -47,6 +47,7 @@ solana-measure = { workspace = true } solana-metrics = { workspace = true } solana-net-utils = { workspace = true } solana-perf = { workspace = true } +solana-pubkey = { workspace = true } solana-rayon-threadlimit = { workspace = true } solana-rpc-client = { workspace = true } solana-runtime = { workspace = true } diff --git a/gossip/benches/crds.rs b/gossip/benches/crds.rs index 7ff58cacd4f212..71b2f4c870fca1 100644 --- a/gossip/benches/crds.rs +++ b/gossip/benches/crds.rs @@ -10,7 +10,7 @@ use { crds_gossip_pull::{CrdsTimeouts, CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS}, crds_value::CrdsValue, }, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, std::{collections::HashMap, time::Duration}, test::Bencher, }; diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index 4dad5e083aba42..9d84db4e5fe6d2 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -2598,7 +2598,7 @@ pub struct Node { impl Node { pub fn new_localhost() -> Self { - let pubkey = solana_sdk::pubkey::new_rand(); + let pubkey = solana_pubkey::new_rand(); Self::new_localhost_with_pubkey(&pubkey) } @@ -3150,16 +3150,13 @@ mod tests { #[test] fn test_gossip_node() { //check that a gossip nodes always show up as spies - let (node, _, _) = ClusterInfo::spy_node(solana_sdk::pubkey::new_rand(), 0); + let (node, _, _) = ClusterInfo::spy_node(solana_pubkey::new_rand(), 0); assert!(ClusterInfo::is_spy_node( &node, &SocketAddrSpace::Unspecified )); - let (node, _, _) = ClusterInfo::gossip_node( - solana_sdk::pubkey::new_rand(), - &"1.1.1.1:0".parse().unwrap(), - 0, - ); + let (node, _, _) = + ClusterInfo::gossip_node(solana_pubkey::new_rand(), &"1.1.1.1:0".parse().unwrap(), 0); assert!(ClusterInfo::is_spy_node( &node, &SocketAddrSpace::Unspecified @@ -3174,7 +3171,7 @@ mod tests { let node = Node::new_localhost_with_pubkey(&keypair.pubkey()); ClusterInfo::new(node.info, keypair, SocketAddrSpace::Unspecified) }); - let entrypoint_pubkey = solana_sdk::pubkey::new_rand(); + let entrypoint_pubkey = solana_pubkey::new_rand(); let data = test_crds_values(entrypoint_pubkey); let stakes = HashMap::from([(Pubkey::new_unique(), 1u64)]); let timeouts = CrdsTimeouts::new( @@ -3300,7 +3297,7 @@ mod tests { fn test_cluster_spy_gossip() { let thread_pool = ThreadPoolBuilder::new().build().unwrap(); //check that gossip doesn't try to push to invalid addresses - let (spy, _, _) = ClusterInfo::spy_node(solana_sdk::pubkey::new_rand(), 0); + let (spy, _, _) = ClusterInfo::spy_node(solana_pubkey::new_rand(), 0); let cluster_info = Arc::new({ let keypair = Arc::new(Keypair::new()); let node = Node::new_localhost_with_pubkey(&keypair.pubkey()); @@ -3343,7 +3340,7 @@ mod tests { let keypair = Arc::new(Keypair::new()); let d = ContactInfo::new_localhost(&keypair.pubkey(), timestamp()); let cluster_info = ClusterInfo::new(d, keypair, SocketAddrSpace::Unspecified); - let d = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); + let d = ContactInfo::new_localhost(&solana_pubkey::new_rand(), timestamp()); let label = CrdsValueLabel::ContactInfo(*d.pubkey()); cluster_info.insert_info(d); let gossip_crds = cluster_info.gossip.crds.read().unwrap(); @@ -3392,7 +3389,7 @@ mod tests { num_quic_endpoints: DEFAULT_NUM_QUIC_ENDPOINTS, }; - let node = Node::new_with_external_ip(&solana_sdk::pubkey::new_rand(), config); + let node = Node::new_with_external_ip(&solana_pubkey::new_rand(), config); check_node_sockets(&node, IpAddr::V4(ip), VALIDATOR_PORT_RANGE); } @@ -3415,7 +3412,7 @@ mod tests { num_quic_endpoints: DEFAULT_NUM_QUIC_ENDPOINTS, }; - let node = Node::new_with_external_ip(&solana_sdk::pubkey::new_rand(), config); + let node = Node::new_with_external_ip(&solana_pubkey::new_rand(), config); check_node_sockets(&node, ip, port_range); @@ -3800,7 +3797,7 @@ mod tests { node_keypair, SocketAddrSpace::Unspecified, ); - let entrypoint_pubkey = solana_sdk::pubkey::new_rand(); + let entrypoint_pubkey = solana_pubkey::new_rand(); let entrypoint = ContactInfo::new_localhost(&entrypoint_pubkey, timestamp()); cluster_info.set_entrypoint(entrypoint.clone()); let (pings, pulls) = cluster_info.new_pull_requests(&thread_pool, None, &HashMap::new()); @@ -3880,7 +3877,7 @@ mod tests { node_keypair, SocketAddrSpace::Unspecified, ); - let entrypoint_pubkey = solana_sdk::pubkey::new_rand(); + let entrypoint_pubkey = solana_pubkey::new_rand(); let mut entrypoint = ContactInfo::new_localhost(&entrypoint_pubkey, timestamp()); entrypoint .set_gossip(socketaddr!("127.0.0.2:1234")) @@ -3889,7 +3886,7 @@ mod tests { let mut stakes = HashMap::new(); - let other_node_pubkey = solana_sdk::pubkey::new_rand(); + let other_node_pubkey = solana_pubkey::new_rand(); let other_node = ContactInfo::new_localhost(&other_node_pubkey, timestamp()); assert_ne!(other_node.gossip().unwrap(), entrypoint.gossip().unwrap()); cluster_info.ping_cache.lock().unwrap().mock_pong( @@ -3945,7 +3942,7 @@ mod tests { for i in 0..10 { // make these invalid for the upcoming repair request let peer_lowest = if i >= 5 { 10 } else { 0 }; - let other_node_pubkey = solana_sdk::pubkey::new_rand(); + let other_node_pubkey = solana_pubkey::new_rand(); let other_node = ContactInfo::new_localhost(&other_node_pubkey, timestamp()); cluster_info.insert_info(other_node.clone()); let value = CrdsValue::new_unsigned(CrdsData::LowestSlot( @@ -4009,7 +4006,7 @@ mod tests { // Simulate getting entrypoint ContactInfo from gossip with an entrypoint1 shred version of // 0 let mut gossiped_entrypoint1_info = - ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); + ContactInfo::new_localhost(&solana_pubkey::new_rand(), timestamp()); gossiped_entrypoint1_info .set_gossip(entrypoint1_gossip_addr) .unwrap(); @@ -4038,7 +4035,7 @@ mod tests { // Simulate getting entrypoint ContactInfo from gossip with an entrypoint2 shred version of // !0 let mut gossiped_entrypoint2_info = - ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); + ContactInfo::new_localhost(&solana_pubkey::new_rand(), timestamp()); gossiped_entrypoint2_info .set_gossip(entrypoint2_gossip_addr) .unwrap(); @@ -4091,7 +4088,7 @@ mod tests { // Simulate getting entrypoint ContactInfo from gossip let mut gossiped_entrypoint_info = - ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), timestamp()); + ContactInfo::new_localhost(&solana_pubkey::new_rand(), timestamp()); gossiped_entrypoint_info .set_gossip(entrypoint_gossip_addr) .unwrap(); @@ -4118,7 +4115,7 @@ mod tests { Arc::new(Keypair::new()), SocketAddrSpace::Unspecified, )); - let entrypoint_pubkey = solana_sdk::pubkey::new_rand(); + let entrypoint_pubkey = solana_pubkey::new_rand(); let entrypoint = ContactInfo::new_localhost(&entrypoint_pubkey, timestamp()); cluster_info.set_entrypoint(entrypoint); diff --git a/gossip/src/contact_info.rs b/gossip/src/contact_info.rs index 430bfa34730574..fe47bb7e71204b 100644 --- a/gossip/src/contact_info.rs +++ b/gossip/src/contact_info.rs @@ -376,7 +376,7 @@ impl ContactInfo { pub fn new_rand(rng: &mut R, pubkey: Option) -> Self { let delay = 10 * 60 * 1000; // 10 minutes let now = solana_sdk::timing::timestamp() - delay + rng.gen_range(0..2 * delay); - let pubkey = pubkey.unwrap_or_else(solana_sdk::pubkey::new_rand); + let pubkey = pubkey.unwrap_or_else(solana_pubkey::new_rand); let mut node = ContactInfo::new_localhost(&pubkey, now); let _ = node.set_gossip((Ipv4Addr::LOCALHOST, rng.gen_range(1024..u16::MAX))); node diff --git a/gossip/src/crds.rs b/gossip/src/crds.rs index e665f0f615309f..9e56736d40873a 100644 --- a/gossip/src/crds.rs +++ b/gossip/src/crds.rs @@ -1544,7 +1544,7 @@ mod tests { fn test_label_order() { let v1 = VersionedCrdsValue::new( CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))), Cursor::default(), @@ -1553,7 +1553,7 @@ mod tests { ); let v2 = VersionedCrdsValue::new( CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))), Cursor::default(), diff --git a/gossip/src/crds_entry.rs b/gossip/src/crds_entry.rs index ccb25874f3d3ed..43aeda1a686d38 100644 --- a/gossip/src/crds_entry.rs +++ b/gossip/src/crds_entry.rs @@ -6,7 +6,7 @@ use { crds_value::{CrdsValue, CrdsValueLabel}, }, indexmap::IndexMap, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, }; type CrdsTable = IndexMap; diff --git a/gossip/src/crds_gossip_pull.rs b/gossip/src/crds_gossip_pull.rs index 1f6ad65b432c8f..e94df193d7a1e4 100644 --- a/gossip/src/crds_gossip_pull.rs +++ b/gossip/src/crds_gossip_pull.rs @@ -899,7 +899,7 @@ pub(crate) mod tests { Err(CrdsGossipError::NoPeers) ); let now = 1625029781069; - let new = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), now); + let new = ContactInfo::new_localhost(&solana_pubkey::new_rand(), now); ping_cache .lock() .unwrap() @@ -925,7 +925,7 @@ pub(crate) mod tests { let peers: Vec<_> = req.unwrap().into_iter().map(|(node, _)| node).collect(); assert_eq!(peers, vec![new.contact_info().unwrap().clone()]); - let offline = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), now); + let offline = ContactInfo::new_localhost(&solana_pubkey::new_rand(), now); let offline = CrdsValue::new_unsigned(CrdsData::ContactInfo(offline)); crds.write() .unwrap() @@ -963,12 +963,12 @@ pub(crate) mod tests { ))); let node = CrdsGossipPull::default(); crds.insert(entry, now, GossipRoute::LocalMessage).unwrap(); - let old = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let old = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); ping_cache.mock_pong(*old.pubkey(), old.gossip().unwrap(), Instant::now()); let old = CrdsValue::new_unsigned(CrdsData::ContactInfo(old)); crds.insert(old.clone(), now, GossipRoute::LocalMessage) .unwrap(); - let new = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let new = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); ping_cache.mock_pong(*new.pubkey(), new.gossip().unwrap(), Instant::now()); let new = CrdsValue::new_unsigned(CrdsData::ContactInfo(new)); crds.insert(new, now, GossipRoute::LocalMessage).unwrap(); @@ -1023,7 +1023,7 @@ pub(crate) mod tests { node_crds .insert(entry, now, GossipRoute::LocalMessage) .unwrap(); - let new = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), now); + let new = ContactInfo::new_localhost(&solana_pubkey::new_rand(), now); ping_cache.mock_pong(*new.pubkey(), new.gossip().unwrap(), Instant::now()); let new = CrdsValue::new_unsigned(CrdsData::ContactInfo(new)); node_crds @@ -1061,7 +1061,7 @@ pub(crate) mod tests { let now = now + CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS; let new = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), now, ))); dest_crds @@ -1123,13 +1123,13 @@ pub(crate) mod tests { .insert(entry, 0, GossipRoute::LocalMessage) .unwrap(); let mut ping_cache = new_ping_cache(); - let new = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 1); + let new = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 1); ping_cache.mock_pong(*new.pubkey(), new.gossip().unwrap(), Instant::now()); let new = CrdsValue::new_unsigned(CrdsData::ContactInfo(new)); node_crds.insert(new, 0, GossipRoute::LocalMessage).unwrap(); let mut dest_crds = Crds::default(); - let new_id = solana_sdk::pubkey::new_rand(); + let new_id = solana_pubkey::new_rand(); let same_key = ContactInfo::new_localhost(&new_id, 0); let new = ContactInfo::new_localhost(&new_id, 1); ping_cache.mock_pong(*new.pubkey(), new.gossip().unwrap(), Instant::now()); @@ -1224,7 +1224,7 @@ pub(crate) mod tests { let thread_pool = ThreadPoolBuilder::new().build().unwrap(); let mut node_crds = Crds::default(); let entry = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))); let node_label = entry.label(); @@ -1234,7 +1234,7 @@ pub(crate) mod tests { .insert(entry, 0, GossipRoute::LocalMessage) .unwrap(); let old = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))); node_crds @@ -1360,7 +1360,7 @@ pub(crate) mod tests { let node_crds = RwLock::::default(); let node = CrdsGossipPull::default(); - let peer_pubkey = solana_sdk::pubkey::new_rand(); + let peer_pubkey = solana_pubkey::new_rand(); let peer_entry = CrdsValue::new_unsigned(CrdsData::ContactInfo( ContactInfo::new_localhost(&peer_pubkey, 0), )); diff --git a/gossip/src/crds_gossip_push.rs b/gossip/src/crds_gossip_push.rs index 43c500cbdcfd4d..4c0d04f282d8fc 100644 --- a/gossip/src/crds_gossip_push.rs +++ b/gossip/src/crds_gossip_push.rs @@ -299,7 +299,7 @@ mod tests { let crds = RwLock::::default(); let push = CrdsGossipPush::default(); let value = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))); let label = value.label(); @@ -319,7 +319,7 @@ mod tests { fn test_process_push_old_version() { let crds = RwLock::::default(); let push = CrdsGossipPush::default(); - let mut ci = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let mut ci = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); ci.set_wallclock(1); let value = CrdsValue::new_unsigned(CrdsData::ContactInfo(ci.clone())); @@ -341,7 +341,7 @@ mod tests { let crds = RwLock::::default(); let push = CrdsGossipPush::default(); let timeout = push.msg_timeout; - let mut ci = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let mut ci = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); // push a version to far in the future ci.set_wallclock(timeout + 1); @@ -361,7 +361,7 @@ mod tests { fn test_process_push_update() { let crds = RwLock::::default(); let push = CrdsGossipPush::default(); - let mut ci = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let mut ci = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); let origin = *ci.pubkey(); ci.set_wallclock(0); let value_old = CrdsValue::new_unsigned(CrdsData::ContactInfo(ci.clone())); @@ -387,7 +387,7 @@ mod tests { let mut crds = Crds::default(); let push = CrdsGossipPush::default(); let mut ping_cache = new_ping_cache(); - let peer = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let peer = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); ping_cache.mock_pong(*peer.pubkey(), peer.gossip().unwrap(), Instant::now()); let peer = CrdsValue::new_unsigned(CrdsData::ContactInfo(peer)); assert_eq!( @@ -408,7 +408,7 @@ mod tests { ); let new_msg = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))); let mut expected = HashMap::new(); @@ -496,10 +496,10 @@ mod tests { #[test] fn test_process_prune() { let mut crds = Crds::default(); - let self_id = solana_sdk::pubkey::new_rand(); + let self_id = solana_pubkey::new_rand(); let push = CrdsGossipPush::default(); let peer = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))); assert_eq!( @@ -520,7 +520,7 @@ mod tests { ); let new_msg = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))); let expected = HashMap::new(); @@ -551,7 +551,7 @@ mod tests { let mut crds = Crds::default(); let push = CrdsGossipPush::default(); let peer = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost( - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 0, ))); assert_eq!(crds.insert(peer, 0, GossipRoute::LocalMessage), Ok(())); @@ -568,7 +568,7 @@ mod tests { &SocketAddrSpace::Unspecified, ); - let mut ci = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let mut ci = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); ci.set_wallclock(1); let new_msg = CrdsValue::new_unsigned(CrdsData::ContactInfo(ci)); let expected = HashMap::new(); @@ -593,7 +593,7 @@ mod tests { fn test_purge_old_received_cache() { let crds = RwLock::::default(); let push = CrdsGossipPush::default(); - let mut ci = ContactInfo::new_localhost(&solana_sdk::pubkey::new_rand(), 0); + let mut ci = ContactInfo::new_localhost(&solana_pubkey::new_rand(), 0); ci.set_wallclock(0); let value = CrdsValue::new_unsigned(CrdsData::ContactInfo(ci)); let label = value.label(); diff --git a/gossip/src/epoch_slots.rs b/gossip/src/epoch_slots.rs index 7c76b7cefb3b26..ea7d472c7cf34b 100644 --- a/gossip/src/epoch_slots.rs +++ b/gossip/src/epoch_slots.rs @@ -326,7 +326,7 @@ impl EpochSlots { /// New random EpochSlots for tests and simulations. pub(crate) fn new_rand(rng: &mut R, pubkey: Option) -> Self { let now = crds_data::new_rand_timestamp(rng); - let pubkey = pubkey.unwrap_or_else(solana_sdk::pubkey::new_rand); + let pubkey = pubkey.unwrap_or_else(solana_pubkey::new_rand); let mut epoch_slots = Self::new(pubkey, now); let num_slots = rng.gen_range(0..20); let slots: Vec<_> = std::iter::repeat_with(|| 47825632 + rng.gen_range(0..512)) diff --git a/gossip/src/gossip_service.rs b/gossip/src/gossip_service.rs index 9e23e3eeee1c45..f066b6a5af1c23 100644 --- a/gossip/src/gossip_service.rs +++ b/gossip/src/gossip_service.rs @@ -382,8 +382,8 @@ mod tests { fn test_gossip_services_spy() { const TIMEOUT: Duration = Duration::from_secs(5); let keypair = Keypair::new(); - let peer0 = solana_sdk::pubkey::new_rand(); - let peer1 = solana_sdk::pubkey::new_rand(); + let peer0 = solana_pubkey::new_rand(); + let peer1 = solana_pubkey::new_rand(); let contact_info = ContactInfo::new_localhost(&keypair.pubkey(), 0); let peer0_info = ContactInfo::new_localhost(&peer0, 0); let peer1_info = ContactInfo::new_localhost(&peer1, 0); @@ -415,7 +415,7 @@ mod tests { spy_ref.clone(), None, TIMEOUT, - Some(&[solana_sdk::pubkey::new_rand()]), + Some(&[solana_pubkey::new_rand()]), None, ); assert!(!met_criteria); @@ -429,7 +429,7 @@ mod tests { spy_ref.clone(), Some(1), TIMEOUT, - Some(&[solana_sdk::pubkey::new_rand()]), + Some(&[solana_pubkey::new_rand()]), None, ); assert!(!met_criteria); diff --git a/gossip/src/legacy_contact_info.rs b/gossip/src/legacy_contact_info.rs index d9733ad9ce3802..d0b2bad651b7a8 100644 --- a/gossip/src/legacy_contact_info.rs +++ b/gossip/src/legacy_contact_info.rs @@ -7,8 +7,8 @@ use { }, crds_data::MAX_WALLCLOCK, }, + solana_pubkey::Pubkey, solana_sanitize::{Sanitize, SanitizeError}, - solana_sdk::pubkey::Pubkey, solana_streamer::socket::SocketAddrSpace, std::net::{IpAddr, SocketAddr}, }; diff --git a/gossip/src/main.rs b/gossip/src/main.rs index 44e13ecd49ecc8..de5ba4385fed1e 100644 --- a/gossip/src/main.rs +++ b/gossip/src/main.rs @@ -12,7 +12,7 @@ use { input_validators::{is_keypair_or_ask_keyword, is_port, is_pubkey}, }, solana_gossip::{contact_info::ContactInfo, gossip_service::discover}, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, solana_streamer::socket::SocketAddrSpace, std::{ error, diff --git a/gossip/src/protocol.rs b/gossip/src/protocol.rs index 61ee47750e04eb..9d4385d5148866 100644 --- a/gossip/src/protocol.rs +++ b/gossip/src/protocol.rs @@ -548,7 +548,7 @@ pub(crate) mod tests { .collect(); let splits: Vec<_> = split_gossip_messages(PUSH_MESSAGE_MAX_PAYLOAD_SIZE, values.clone()).collect(); - let self_pubkey = solana_sdk::pubkey::new_rand(); + let self_pubkey = solana_pubkey::new_rand(); assert!(splits.len() * 2 < NUM_CRDS_VALUES); // Assert that all messages are included in the splits. assert_eq!(NUM_CRDS_VALUES, splits.iter().map(Vec::len).sum::()); diff --git a/gossip/src/received_cache.rs b/gossip/src/received_cache.rs index 8a82336312bcee..da287774235402 100644 --- a/gossip/src/received_cache.rs +++ b/gossip/src/received_cache.rs @@ -1,7 +1,7 @@ use { itertools::Itertools, lru::LruCache, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, std::{cmp::Reverse, collections::HashMap}, }; diff --git a/gossip/src/restart_crds_values.rs b/gossip/src/restart_crds_values.rs index 61ee7a1c329fec..2543e9a8c63b04 100644 --- a/gossip/src/restart_crds_values.rs +++ b/gossip/src/restart_crds_values.rs @@ -108,7 +108,7 @@ impl RestartLastVotedForkSlots { /// New random Version for tests and benchmarks. pub(crate) fn new_rand(rng: &mut R, pubkey: Option) -> Self { - let pubkey = pubkey.unwrap_or_else(solana_sdk::pubkey::new_rand); + let pubkey = pubkey.unwrap_or_else(solana_pubkey::new_rand); let num_slots = rng.gen_range(2..20); let slots = std::iter::repeat_with(|| 47825632 + rng.gen_range(0..512)) .take(num_slots) @@ -144,7 +144,7 @@ impl Sanitize for RestartHeaviestFork { impl RestartHeaviestFork { pub(crate) fn new_rand(rng: &mut R, from: Option) -> Self { - let from = from.unwrap_or_else(solana_sdk::pubkey::new_rand); + let from = from.unwrap_or_else(solana_pubkey::new_rand); Self { from, wallclock: new_rand_timestamp(rng), diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index a75be35eab0470..957f420f9b3992 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5860,6 +5860,7 @@ dependencies = [ "solana-metrics", "solana-net-utils", "solana-perf", + "solana-pubkey", "solana-rayon-threadlimit", "solana-rpc-client", "solana-runtime", diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index 5ba86432eba1c9..da73405a0a5015 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -5680,6 +5680,7 @@ dependencies = [ "solana-metrics", "solana-net-utils", "solana-perf", + "solana-pubkey", "solana-rayon-threadlimit", "solana-rpc-client", "solana-runtime",