From fd38a30d7f6822f3caf8b3a3fbb643dd845646cc Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Fri, 15 Nov 2024 03:29:11 +0400 Subject: [PATCH] Remove solana-sdk from solana-metrics (#3374) * remove solana-sdk from solana-metrics * activate features that got deactivate by removing solana-sdk * add back solana-clock dependency --- Cargo.lock | 5 ++++- metrics/Cargo.toml | 5 ++++- metrics/src/counter.rs | 3 +-- metrics/src/metrics.rs | 3 ++- metrics/src/poh_timing_point.rs | 2 +- perf/Cargo.toml | 4 ++-- programs/sbf/Cargo.lock | 5 ++++- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf88964cae5986..1c313de54e3402 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7453,7 +7453,10 @@ dependencies = [ "rand 0.8.5", "reqwest", "serial_test", - "solana-sdk", + "solana-clock", + "solana-cluster-type", + "solana-sha256-hasher", + "solana-time-utils", "thiserror 1.0.69", ] diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 80f94e417bf3e7..5b91ed40886089 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -15,7 +15,10 @@ gethostname = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } reqwest = { workspace = true, features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] } -solana-sdk = { workspace = true } +solana-clock = { workspace = true } +solana-cluster-type = { workspace = true } +solana-sha256-hasher = { workspace = true } +solana-time-utils = { workspace = true } thiserror = { workspace = true } [dev-dependencies] diff --git a/metrics/src/counter.rs b/metrics/src/counter.rs index 0431a3538a108b..a500ca8ed88194 100644 --- a/metrics/src/counter.rs +++ b/metrics/src/counter.rs @@ -1,7 +1,6 @@ use { crate::metrics::submit_counter, log::*, - solana_sdk::timing, std::{ env, sync::atomic::{AtomicU64, AtomicUsize, Ordering}, @@ -174,7 +173,7 @@ impl Counter { .compare_and_swap(0, Self::default_metrics_rate(), Ordering::Relaxed); } pub fn inc(&mut self, level: log::Level, events: usize) { - let now = timing::timestamp(); + let now = solana_time_utils::timestamp(); let counts = self.counts.fetch_add(events, Ordering::Relaxed); let times = self.times.fetch_add(1, Ordering::Relaxed); let lograte = self.lograte.load(Ordering::Relaxed); diff --git a/metrics/src/metrics.rs b/metrics/src/metrics.rs index 2c7c025296d14a..9f67d04220fe70 100644 --- a/metrics/src/metrics.rs +++ b/metrics/src/metrics.rs @@ -6,7 +6,8 @@ use { gethostname::gethostname, lazy_static::lazy_static, log::*, - solana_sdk::{genesis_config::ClusterType, hash::hash}, + solana_cluster_type::ClusterType, + solana_sha256_hasher::hash, std::{ cmp, collections::HashMap, diff --git a/metrics/src/poh_timing_point.rs b/metrics/src/poh_timing_point.rs index 1d3f8cabb9c97f..77b09c2972b879 100644 --- a/metrics/src/poh_timing_point.rs +++ b/metrics/src/poh_timing_point.rs @@ -3,7 +3,7 @@ use { crossbeam_channel::{Receiver, Sender}, log::*, - solana_sdk::clock::Slot, + solana_clock::Slot, std::fmt, }; diff --git a/perf/Cargo.toml b/perf/Cargo.toml index 2610461d7f2e0f..4af056343ba218 100644 --- a/perf/Cargo.toml +++ b/perf/Cargo.toml @@ -29,13 +29,13 @@ solana-frozen-abi-macro = { workspace = true, optional = true, features = [ ] } solana-hash = { workspace = true } solana-metrics = { workspace = true } -solana-packet = { workspace = true } +solana-packet = { workspace = true, features = ["bincode"] } solana-program = { workspace = true, default-features = false } solana-pubkey = { workspace = true, default-features = false } solana-rayon-threadlimit = { workspace = true } solana-sdk = { workspace = true, optional = true } solana-short-vec = { workspace = true } -solana-signature = { workspace = true } +solana-signature = { workspace = true, features = ["verify"] } solana-time-utils = { workspace = true } solana-vote-program = { workspace = true, optional = true } diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 487ac318fa17b3..67af139491beea 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5888,7 +5888,10 @@ dependencies = [ "lazy_static", "log", "reqwest", - "solana-sdk", + "solana-clock", + "solana-cluster-type", + "solana-sha256-hasher", + "solana-time-utils", "thiserror 1.0.69", ]