From eeb356291ee25f94b48d3bdda53faba54889b261 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Mon, 25 Nov 2024 17:21:00 +0400 Subject: [PATCH] remove solana-sdk from solana-bucket-map (#3716) --- Cargo.lock | 3 ++- bucket_map/Cargo.toml | 4 +++- bucket_map/benches/bucket_map.rs | 2 +- bucket_map/src/bucket.rs | 2 +- bucket_map/src/bucket_api.rs | 2 +- bucket_map/src/bucket_item.rs | 2 +- bucket_map/src/bucket_map.rs | 4 ++-- bucket_map/src/index_entry.rs | 3 ++- bucket_map/tests/bucket_map.rs | 2 +- programs/sbf/Cargo.lock | 3 ++- svm/examples/Cargo.lock | 3 ++- 11 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa567249c914cd..044cb68953cc79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6258,9 +6258,10 @@ dependencies = [ "num_enum", "rand 0.8.5", "rayon", + "solana-clock", "solana-logger", "solana-measure", - "solana-sdk", + "solana-pubkey", "tempfile", ] diff --git a/bucket_map/Cargo.toml b/bucket_map/Cargo.toml index 36d29140a025a1..00f26c25611a39 100644 --- a/bucket_map/Cargo.toml +++ b/bucket_map/Cargo.toml @@ -19,14 +19,16 @@ memmap2 = { workspace = true } modular-bitfield = { workspace = true } num_enum = { workspace = true } rand = { workspace = true } +solana-clock = { workspace = true } solana-measure = { workspace = true } -solana-sdk = { workspace = true } +solana-pubkey = { workspace = true } tempfile = { workspace = true } [dev-dependencies] fs_extra = { workspace = true } rayon = { workspace = true } solana-logger = { workspace = true } +solana-pubkey = { workspace = true, features = ["rand"] } [lib] crate-type = ["lib"] diff --git a/bucket_map/benches/bucket_map.rs b/bucket_map/benches/bucket_map.rs index aec83fe502709d..6866473382f0b8 100644 --- a/bucket_map/benches/bucket_map.rs +++ b/bucket_map/benches/bucket_map.rs @@ -22,7 +22,7 @@ extern crate test; use { rayon::prelude::*, solana_bucket_map::bucket_map::{BucketMap, BucketMapConfig}, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, std::{collections::hash_map::HashMap, sync::RwLock}, test::Bencher, }; diff --git a/bucket_map/src/bucket.rs b/bucket_map/src/bucket.rs index c8f7fb699173dd..a74a366881fb25 100644 --- a/bucket_map/src/bucket.rs +++ b/bucket_map/src/bucket.rs @@ -16,7 +16,7 @@ use { }, rand::{thread_rng, Rng}, solana_measure::measure::Measure, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, std::{ collections::hash_map::DefaultHasher, fs, diff --git a/bucket_map/src/bucket_api.rs b/bucket_map/src/bucket_api.rs index 6677d6932e1e82..47f3db3dc016bf 100644 --- a/bucket_map/src/bucket_api.rs +++ b/bucket_map/src/bucket_api.rs @@ -3,7 +3,7 @@ use { bucket::Bucket, bucket_item::BucketItem, bucket_map::BucketMapError, bucket_stats::BucketMapStats, restart::RestartableBucket, MaxSearch, RefCount, }, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, std::{ ops::RangeBounds, path::PathBuf, diff --git a/bucket_map/src/bucket_item.rs b/bucket_map/src/bucket_item.rs index 8f11c432060f08..7733f5aeee9413 100644 --- a/bucket_map/src/bucket_item.rs +++ b/bucket_map/src/bucket_item.rs @@ -1,4 +1,4 @@ -use {crate::RefCount, solana_sdk::pubkey::Pubkey}; +use {crate::RefCount, solana_pubkey::Pubkey}; #[derive(Debug, Default, Clone)] pub struct BucketItem { diff --git a/bucket_map/src/bucket_map.rs b/bucket_map/src/bucket_map.rs index 063d28352f148a..f86ef6b089bd0f 100644 --- a/bucket_map/src/bucket_map.rs +++ b/bucket_map/src/bucket_map.rs @@ -4,7 +4,7 @@ use { crate::{ bucket_api::BucketApi, bucket_stats::BucketMapStats, restart::Restart, MaxSearch, RefCount, }, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, std::{ convert::TryInto, fmt::Debug, @@ -491,7 +491,7 @@ mod tests { let additions = (0..to_add) .map(|_| { - let k = solana_sdk::pubkey::new_rand(); + let k = solana_pubkey::new_rand(); let mut v = gen_rand_value(); if use_batch_insert { // refcount has to be 1 to use batch insert diff --git a/bucket_map/src/index_entry.rs b/bucket_map/src/index_entry.rs index a56a42aa413d77..b62f8954937802 100644 --- a/bucket_map/src/index_entry.rs +++ b/bucket_map/src/index_entry.rs @@ -8,7 +8,8 @@ use { bv::BitVec, modular_bitfield::prelude::*, num_enum::FromPrimitive, - solana_sdk::{clock::Slot, pubkey::Pubkey}, + solana_clock::Slot, + solana_pubkey::Pubkey, std::{fmt::Debug, marker::PhantomData}, }; diff --git a/bucket_map/tests/bucket_map.rs b/bucket_map/tests/bucket_map.rs index dfc67f138da410..715309621d6ac8 100644 --- a/bucket_map/tests/bucket_map.rs +++ b/bucket_map/tests/bucket_map.rs @@ -2,7 +2,7 @@ use { rayon::prelude::*, solana_bucket_map::bucket_map::{BucketMap, BucketMapConfig}, solana_measure::measure::Measure, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, std::path::PathBuf, }; #[test] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index e1f610bc21e2c2..49d00d74396a7f 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5149,8 +5149,9 @@ dependencies = [ "modular-bitfield", "num_enum", "rand 0.8.5", + "solana-clock", "solana-measure", - "solana-sdk", + "solana-pubkey", "tempfile", ] diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index 6a7a36b8e06778..6b6809a4296b0a 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -5000,8 +5000,9 @@ dependencies = [ "modular-bitfield", "num_enum", "rand 0.8.5", + "solana-clock", "solana-measure", - "solana-sdk", + "solana-pubkey", "tempfile", ]