From d2e89cad2da6a847b438f10df9c03d81a4a86cce Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 11:37:28 +0200 Subject: [PATCH 01/25] feat: add tracing crates --- Cargo.lock | 117 ++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 2 + grandine/Cargo.toml | 1 + grandine/src/main.rs | 5 +- logging/Cargo.toml | 3 ++ logging/src/lib.rs | 23 +++++++++ 6 files changed, 142 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f74cc6..b41e550 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1018,7 +1018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "regex-automata", + "regex-automata 0.4.7", "serde", ] @@ -3077,6 +3077,7 @@ dependencies = [ "thiserror", "tokio", "tower-http", + "tracing", "types", "validator", "validator_key_cache", @@ -4371,7 +4372,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax", + "regex-syntax 0.8.4", "string_cache", "term", "tiny-keccak", @@ -4385,7 +4386,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata", + "regex-automata 0.4.7", ] [[package]] @@ -5024,6 +5025,9 @@ name = "logging" version = "0.0.0" dependencies = [ "derive_more", + "tracing", + "tracing-appender", + "tracing-subscriber", ] [[package]] @@ -5059,6 +5063,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matchit" version = "0.7.3" @@ -5348,6 +5361,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -5566,6 +5589,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "p256" version = "0.13.2" @@ -5730,7 +5759,7 @@ checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" dependencies = [ "parse-display-derive", "regex", - "regex-syntax", + "regex-syntax 0.8.4", ] [[package]] @@ -5742,7 +5771,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.36", "regex", - "regex-syntax", + "regex-syntax 0.8.4", "structmeta", "syn 2.0.68", ] @@ -6493,8 +6522,17 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -6505,9 +6543,15 @@ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.4" @@ -7229,6 +7273,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "1.3.0" @@ -8213,6 +8266,18 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-appender" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +dependencies = [ + "crossbeam-channel", + "thiserror", + "time", + "tracing-subscriber", +] + [[package]] name = "tracing-attributes" version = "0.1.27" @@ -8231,6 +8296,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -8568,6 +8663,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "value-bag" version = "1.9.0" diff --git a/Cargo.toml b/Cargo.toml index d17c38d..658b142 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -414,6 +414,8 @@ tokio-util = { version = '0.7', features = ['codec', 'compat', 'time'] } tower = { version = '0.4.13', features = ['timeout'] } tower-http = { version = '0.5.2', features = ['cors', 'trace'] } tracing = '0.1.40' +tracing-appender = "0.2.3" +tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } triomphe = '0.1.13' tynm = '0.1.10' typenum = '1.17.0' diff --git a/grandine/Cargo.toml b/grandine/Cargo.toml index e5cde9a..2b5d3fa 100644 --- a/grandine/Cargo.toml +++ b/grandine/Cargo.toml @@ -59,6 +59,7 @@ tap = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } tower-http = { workspace = true } +tracing = {workspace = true} types = { workspace = true } validator = { workspace = true } validator_key_cache = { workspace = true } diff --git a/grandine/src/main.rs b/grandine/src/main.rs index aa6e2d7..f12f7a4 100644 --- a/grandine/src/main.rs +++ b/grandine/src/main.rs @@ -5,7 +5,8 @@ use std::{ process::ExitCode, sync::Arc, }; - +use logging::setup_tracing; +use tracing::{info as tracing_info}; use allocator as _; use anyhow::{bail, ensure, Context as _, Result}; use builder_api::BuilderConfig; @@ -308,6 +309,8 @@ enum Error { } fn main() -> ExitCode { + let _guard = setup_tracing(); + tracing_info!("This is an info message."); if let Err(error) = try_main() { error.downcast_ref().map(ClapError::exit); error!("{error:?}"); diff --git a/logging/Cargo.toml b/logging/Cargo.toml index 52c5fdf..50dd4b5 100644 --- a/logging/Cargo.toml +++ b/logging/Cargo.toml @@ -8,3 +8,6 @@ workspace = true [dependencies] derive_more = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +tracing-appender = { workspace = true } diff --git a/logging/src/lib.rs b/logging/src/lib.rs index 662ae42..c7d2182 100644 --- a/logging/src/lib.rs +++ b/logging/src/lib.rs @@ -1,6 +1,10 @@ use core::sync::atomic::{AtomicUsize, Ordering}; use derive_more::Display; +use tracing::info; +use tracing_appender::non_blocking::NonBlocking; +use tracing_appender::rolling::{RollingFileAppender, Rotation}; +use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; pub static PEER_LOG_METRICS: PeerLogMetrics = PeerLogMetrics::new(0); @@ -30,3 +34,22 @@ impl PeerLogMetrics { .store(target_peer_count, Ordering::Relaxed) } } + +pub fn setup_tracing() -> impl Drop { + let log_path = "logs/testing.log"; + let log_appender = RollingFileAppender::new(Rotation::DAILY, "", log_path); + let (log_non_blocking, guard) = NonBlocking::new(log_appender); + + let env_filter = EnvFilter::try_from_default_env() + .or_else(|_| EnvFilter::try_new("info")) + .expect("Failed to create EnvFilter"); + + tracing_subscriber::registry() + .with(env_filter) + .with(fmt::layer().with_writer(log_non_blocking).with_ansi(false)) + .try_init() + .expect("Failed to initialize tracing subscriber"); + info!("This is a message from lib.rs."); + println!("Tracing initialized successfully."); + guard +} From 66d053aa38f64673dca554eb830ec217025fba68 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 11:56:00 +0200 Subject: [PATCH 02/25] feat: replace `log` with `tracing` crate in grandine/src/main.rs --- grandine/src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/grandine/src/main.rs b/grandine/src/main.rs index f12f7a4..c637b35 100644 --- a/grandine/src/main.rs +++ b/grandine/src/main.rs @@ -5,8 +5,7 @@ use std::{ process::ExitCode, sync::Arc, }; -use logging::setup_tracing; -use tracing::{info as tracing_info}; + use allocator as _; use anyhow::{bail, ensure, Context as _, Result}; use builder_api::BuilderConfig; @@ -20,8 +19,7 @@ use fork_choice_store::StoreConfig; use genesis::AnchorCheckpointProvider; use grandine_version::APPLICATION_VERSION_WITH_PLATFORM; use http_api::HttpApiConfig; -use log::{error, info, warn}; -use logging::PEER_LOG_METRICS; +use logging::{PEER_LOG_METRICS, setup_tracing}; use metrics::MetricsServerConfig; use p2p::{ListenAddr, NetworkConfig}; use reqwest::{Client, ClientBuilder, Url}; @@ -33,6 +31,7 @@ use ssz::SszRead as _; use std_ext::ArcExt as _; use thiserror::Error; use tokio::runtime::Builder; +use tracing::{error, info, warn}; use types::{ config::Config as ChainConfig, phase0::primitives::{ExecutionBlockNumber, Slot}, @@ -310,7 +309,7 @@ enum Error { fn main() -> ExitCode { let _guard = setup_tracing(); - tracing_info!("This is an info message."); + info!("Gradine firing up..."); if let Err(error) = try_main() { error.downcast_ref().map(ClapError::exit); error!("{error:?}"); From 558b6aee244d26fec3055ca13a01898b98d616d3 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 12:14:01 +0200 Subject: [PATCH 03/25] feat: improve tracing setup and add stdout writer --- logging/src/lib.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/logging/src/lib.rs b/logging/src/lib.rs index c7d2182..fc8fd04 100644 --- a/logging/src/lib.rs +++ b/logging/src/lib.rs @@ -38,18 +38,24 @@ impl PeerLogMetrics { pub fn setup_tracing() -> impl Drop { let log_path = "logs/testing.log"; let log_appender = RollingFileAppender::new(Rotation::DAILY, "", log_path); - let (log_non_blocking, guard) = NonBlocking::new(log_appender); + let (file_non_blocking, file_guard) = NonBlocking::new(log_appender); + + let stdout_layer = fmt::layer().with_writer(std::io::stdout).with_ansi(true); + + let file_layer = fmt::layer().with_writer(file_non_blocking).with_ansi(false); let env_filter = EnvFilter::try_from_default_env() .or_else(|_| EnvFilter::try_new("info")) .expect("Failed to create EnvFilter"); - tracing_subscriber::registry() + let subscriber = tracing_subscriber::registry() .with(env_filter) - .with(fmt::layer().with_writer(log_non_blocking).with_ansi(false)) - .try_init() + .with(stdout_layer) + .with(file_layer); + + tracing::subscriber::set_global_default(subscriber) .expect("Failed to initialize tracing subscriber"); - info!("This is a message from lib.rs."); - println!("Tracing initialized successfully."); - guard + + info!("Tracing initialized successfully."); + file_guard } From b14b17b8fff8e20b52fd61c522caf601893aa7ff Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 12:49:51 +0200 Subject: [PATCH 04/25] feat: replace all log with tracing in grandine module --- grandine/src/grandine_args.rs | 2 +- grandine/src/grandine_config.rs | 8 ++++---- grandine/src/predefined_network.rs | 2 +- grandine/src/validators.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/grandine/src/grandine_args.rs b/grandine/src/grandine_args.rs index fe8b00b..bc1300a 100644 --- a/grandine/src/grandine_args.rs +++ b/grandine/src/grandine_args.rs @@ -30,7 +30,7 @@ use fork_choice_store::{StoreConfig, DEFAULT_CACHE_LOCK_TIMEOUT_MILLIS}; use grandine_version::{APPLICATION_NAME, APPLICATION_NAME_AND_VERSION, APPLICATION_VERSION}; use http_api::HttpApiConfig; use itertools::{EitherOrBoth, Itertools as _}; -use log::warn; +use tracing::warn; use metrics::{MetricsServerConfig, MetricsServiceConfig}; use p2p::{Enr, Multiaddr, NetworkConfig}; use prometheus_metrics::{Metrics, METRICS}; diff --git a/grandine/src/grandine_config.rs b/grandine/src/grandine_config.rs index 0f25776..968587e 100644 --- a/grandine/src/grandine_config.rs +++ b/grandine/src/grandine_config.rs @@ -6,11 +6,11 @@ use eth1_api::AuthOptions; use features::Feature; use http_api::HttpApiConfig; use itertools::Itertools as _; -use log::info; use p2p::NetworkConfig; use reqwest::Url; use runtime::{MetricsConfig, StorageConfig}; use signer::Web3SignerConfig; +use tracing::info; use types::{ config::Config as ChainConfig, phase0::primitives::{ExecutionAddress, ExecutionBlockNumber, Slot, H256}, @@ -110,7 +110,7 @@ impl GrandineConfig { storage_config.eth1_db_size.to_string_as(true), ); - info!("Eth1 RPC URLs: [{}]", eth1_rpc_urls.iter().format(", ")); + info!("Eth1 RPC URLs: {:?}", eth1_rpc_urls); info!("graffiti: {graffiti:?}"); info!("HTTP API address: {}", http_api_config.address); @@ -151,8 +151,8 @@ impl GrandineConfig { if !web3signer_config.urls.is_empty() { info!( - "using Web3Signer API to sign validator messages (API URLs: [{}])", - web3signer_config.urls.iter().format(", "), + "using Web3Signer API to sign validator messages (API URLs: {:?})", + web3signer_config.urls, ); } diff --git a/grandine/src/predefined_network.rs b/grandine/src/predefined_network.rs index d1e62e0..8595434 100644 --- a/grandine/src/predefined_network.rs +++ b/grandine/src/predefined_network.rs @@ -5,7 +5,7 @@ use anyhow::{bail, Context as _, Result}; use deposit_tree::DepositTree; use fork_choice_control::checkpoint_sync; use genesis::AnchorCheckpointProvider; -use log::info; +use tracing::info; use p2p::{Enr, NetworkConfig}; use reqwest::{Client, Url}; use ssz::SszRead as _; diff --git a/grandine/src/validators.rs b/grandine/src/validators.rs index 54fcffe..bae4bde 100644 --- a/grandine/src/validators.rs +++ b/grandine/src/validators.rs @@ -3,7 +3,7 @@ use std::{collections::HashMap, path::PathBuf, sync::Arc}; use anyhow::{Error, Result}; use bls::{PublicKeyBytes, SecretKey}; use eip_2335::Keystore; -use log::{info, warn}; +use tracing::{info, warn}; use rayon::iter::{IntoParallelIterator as _, ParallelIterator as _}; use signer::KeyOrigin; use std_ext::ArcExt; From 9596fa0ce8f932489c5372f3b540a1100d8dcc3b Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 12:50:43 +0200 Subject: [PATCH 05/25] chore: cleanup unused imports --- Cargo.lock | 1 - grandine/Cargo.toml | 1 - grandine/src/grandine_config.rs | 1 - grandine/src/main.rs | 4 ++-- logging/src/lib.rs | 2 +- 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b41e550..912bcc8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3052,7 +3052,6 @@ dependencies = [ "http_api", "itertools 0.13.0", "keymanager", - "log", "logging", "metrics", "p2p", diff --git a/grandine/Cargo.toml b/grandine/Cargo.toml index 2b5d3fa..7b187d3 100644 --- a/grandine/Cargo.toml +++ b/grandine/Cargo.toml @@ -36,7 +36,6 @@ hex-literal = { workspace = true } http_api = { workspace = true } itertools = { workspace = true } keymanager = { workspace = true } -log = { workspace = true } logging = { workspace = true } metrics = { workspace = true } p2p = { workspace = true } diff --git a/grandine/src/grandine_config.rs b/grandine/src/grandine_config.rs index 968587e..3213902 100644 --- a/grandine/src/grandine_config.rs +++ b/grandine/src/grandine_config.rs @@ -5,7 +5,6 @@ use builder_api::BuilderConfig; use eth1_api::AuthOptions; use features::Feature; use http_api::HttpApiConfig; -use itertools::Itertools as _; use p2p::NetworkConfig; use reqwest::Url; use runtime::{MetricsConfig, StorageConfig}; diff --git a/grandine/src/main.rs b/grandine/src/main.rs index c637b35..95035f3 100644 --- a/grandine/src/main.rs +++ b/grandine/src/main.rs @@ -19,7 +19,7 @@ use fork_choice_store::StoreConfig; use genesis::AnchorCheckpointProvider; use grandine_version::APPLICATION_VERSION_WITH_PLATFORM; use http_api::HttpApiConfig; -use logging::{PEER_LOG_METRICS, setup_tracing}; +use logging::{setup_tracing, PEER_LOG_METRICS}; use metrics::MetricsServerConfig; use p2p::{ListenAddr, NetworkConfig}; use reqwest::{Client, ClientBuilder, Url}; @@ -309,7 +309,7 @@ enum Error { fn main() -> ExitCode { let _guard = setup_tracing(); - info!("Gradine firing up..."); + info!("Grandine firing up..."); if let Err(error) = try_main() { error.downcast_ref().map(ClapError::exit); error!("{error:?}"); diff --git a/logging/src/lib.rs b/logging/src/lib.rs index fc8fd04..fb95544 100644 --- a/logging/src/lib.rs +++ b/logging/src/lib.rs @@ -4,7 +4,7 @@ use derive_more::Display; use tracing::info; use tracing_appender::non_blocking::NonBlocking; use tracing_appender::rolling::{RollingFileAppender, Rotation}; -use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; +use tracing_subscriber::{fmt, layer::SubscriberExt, EnvFilter}; pub static PEER_LOG_METRICS: PeerLogMetrics = PeerLogMetrics::new(0); From eff1618604bc68457d75622ab433b86f960e8d0c Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 16:15:19 +0200 Subject: [PATCH 06/25] feat: replace all log with tracing in attestation_verifier module --- Cargo.lock | 2 +- attestation_verifier/Cargo.toml | 2 +- attestation_verifier/src/attestation_verifier.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 912bcc8..79c7425 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -565,10 +565,10 @@ dependencies = [ "futures", "helper_functions", "itertools 0.13.0", - "log", "prometheus_metrics", "rayon", "std_ext", + "tracing", "types", ] diff --git a/attestation_verifier/Cargo.toml b/attestation_verifier/Cargo.toml index 79399df..52fb54e 100644 --- a/attestation_verifier/Cargo.toml +++ b/attestation_verifier/Cargo.toml @@ -17,8 +17,8 @@ fork_choice_store = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } rayon = { workspace = true } std_ext = { workspace = true } +tracing = {workspace = true } types = { workspace = true } diff --git a/attestation_verifier/src/attestation_verifier.rs b/attestation_verifier/src/attestation_verifier.rs index dd21abb..f6c90fa 100644 --- a/attestation_verifier/src/attestation_verifier.rs +++ b/attestation_verifier/src/attestation_verifier.rs @@ -22,7 +22,7 @@ use helper_functions::{ verifier::{MultiVerifier, Triple, Verifier}, }; use itertools::Either; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use rayon::iter::{IntoParallelIterator as _, ParallelBridge as _, ParallelIterator as _}; use std_ext::ArcExt as _; From 6e387dd3b4a4b6c9a7308f046a594792d94cce07 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 16:20:06 +0200 Subject: [PATCH 07/25] feat: replace all log with tracing in ad_hoc_bench module --- Cargo.lock | 2 +- ad_hoc_bench/Cargo.toml | 2 +- ad_hoc_bench/src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 79c7425..9504fed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,8 +16,8 @@ dependencies = [ "fork_choice_store", "futures", "jemalloc-ctl", - "log", "rand", + "tracing", "types", ] diff --git a/ad_hoc_bench/Cargo.toml b/ad_hoc_bench/Cargo.toml index f5ea5c3..d583e9d 100644 --- a/ad_hoc_bench/Cargo.toml +++ b/ad_hoc_bench/Cargo.toml @@ -17,6 +17,6 @@ fork_choice_control = { workspace = true } fork_choice_store = { workspace = true } futures = { workspace = true } jemalloc-ctl = { workspace = true } -log = { workspace = true } rand = { workspace = true } +tracing = { workspace = true } types = { workspace = true } diff --git a/ad_hoc_bench/src/main.rs b/ad_hoc_bench/src/main.rs index 3254d34..1dd3831 100644 --- a/ad_hoc_bench/src/main.rs +++ b/ad_hoc_bench/src/main.rs @@ -9,7 +9,7 @@ use eth2_cache_utils::{goerli, holesky, holesky_devnet, mainnet, medalla, withdr use fork_choice_control::AdHocBenchController; use fork_choice_store::StoreConfig; use jemalloc_ctl::Result as JemallocResult; -use log::info; +use tracing::info; use rand::seq::SliceRandom as _; use types::{ combined::{BeaconState, SignedBeaconBlock}, From 1292575b6780794a346a592788fd0e7ed2333ddb Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 16:24:49 +0200 Subject: [PATCH 08/25] feat: replace all log with tracing in block_producer module --- Cargo.lock | 2 +- block_producer/Cargo.toml | 2 +- block_producer/src/block_producer.rs | 2 +- block_producer/src/eth1_storage.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9504fed..671381b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,7 +935,6 @@ dependencies = [ "interop", "itertools 0.13.0", "keymanager", - "log", "nonzero_ext", "operation_pools", "prometheus_metrics", @@ -946,6 +945,7 @@ dependencies = [ "tap", "thiserror", "tokio", + "tracing", "transition_functions", "try_from_iterator", "tynm", diff --git a/block_producer/Cargo.toml b/block_producer/Cargo.toml index 26d169e..9790311 100644 --- a/block_producer/Cargo.toml +++ b/block_producer/Cargo.toml @@ -25,7 +25,6 @@ futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } keymanager = { workspace = true } -log = { workspace = true } nonzero_ext = { workspace = true } operation_pools = { workspace = true } prometheus_metrics = { workspace = true } @@ -36,6 +35,7 @@ std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } try_from_iterator = { workspace = true } tynm = { workspace = true } diff --git a/block_producer/src/block_producer.rs b/block_producer/src/block_producer.rs index 83caf5c..50ad805 100644 --- a/block_producer/src/block_producer.rs +++ b/block_producer/src/block_producer.rs @@ -23,7 +23,7 @@ use futures::{ use helper_functions::{accessors, misc, predicates}; use itertools::{Either, Itertools as _}; use keymanager::ProposerConfigs; -use log::{error, info, warn}; +use tracing::{error, info, warn}; use nonzero_ext::nonzero; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, PoolAdditionOutcome, PoolRejectionReason, diff --git a/block_producer/src/eth1_storage.rs b/block_producer/src/eth1_storage.rs index e1f1ec1..8517e76 100644 --- a/block_producer/src/eth1_storage.rs +++ b/block_producer/src/eth1_storage.rs @@ -13,7 +13,7 @@ use deposit_tree::DepositTree; use eth1::{DepositEvent, Eth1Block, Eth1Chain}; use helper_functions::misc::compute_timestamp_at_slot; use itertools::Itertools as _; -use log::{error, warn}; +use tracing::{error, warn}; use prometheus_metrics::Metrics; use ssz::ContiguousList; use thiserror::Error; From f4e4cfa078df00388e6c6bd9dcb880a8c404e153 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 16:26:53 +0200 Subject: [PATCH 09/25] feat: replace all log with tracing in builder_api module --- Cargo.lock | 2 +- builder_api/Cargo.toml | 2 +- builder_api/src/api.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 671381b..4c00b65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1046,7 +1046,6 @@ dependencies = [ "helper_functions", "hex-literal", "itertools 0.13.0", - "log", "prometheus_metrics", "reqwest", "serde", @@ -1055,6 +1054,7 @@ dependencies = [ "ssz", "test-case", "thiserror", + "tracing", "typenum", "types", ] diff --git a/builder_api/Cargo.toml b/builder_api/Cargo.toml index acd4f9c..2b9ebc2 100644 --- a/builder_api/Cargo.toml +++ b/builder_api/Cargo.toml @@ -14,13 +14,13 @@ derive_more = { workspace = true } helper_functions = { workspace = true } hex-literal = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } serde_utils = { workspace = true } ssz = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } typenum = { workspace = true } types = { workspace = true } diff --git a/builder_api/src/api.rs b/builder_api/src/api.rs index 75ec301..03aaf68 100644 --- a/builder_api/src/api.rs +++ b/builder_api/src/api.rs @@ -6,7 +6,7 @@ use bls::PublicKeyBytes; use derive_more::Constructor; use helper_functions::signing::SignForAllForks; use itertools::Itertools as _; -use log::{debug, info}; +use tracing::{debug, info}; use prometheus_metrics::Metrics; use reqwest::{Client, Response, StatusCode, Url}; use ssz::SszHash as _; From 8ccce1c14edf2ff1b18aa46cba74f12651b4dd01 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 16:29:36 +0200 Subject: [PATCH 10/25] feat: replace all log with tracing in database module --- Cargo.lock | 2 +- database/Cargo.toml | 2 +- database/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c00b65..aac3881 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1710,7 +1710,6 @@ dependencies = [ "fs-err", "im", "itertools 0.13.0", - "log", "reth-libmdbx", "snap", "std_ext", @@ -1718,6 +1717,7 @@ dependencies = [ "tempfile", "test-case", "thiserror", + "tracing", "unwrap_none", ] diff --git a/database/Cargo.toml b/database/Cargo.toml index b08f2c1..ada8949 100644 --- a/database/Cargo.toml +++ b/database/Cargo.toml @@ -13,11 +13,11 @@ fs-err = { workspace = true } im = { workspace = true } itertools = { workspace = true } libmdbx = { workspace = true } -log = { workspace = true } snap = { workspace = true } std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } unwrap_none = { workspace = true } [dev-dependencies] diff --git a/database/src/lib.rs b/database/src/lib.rs index 54eace9..7c65bfd 100644 --- a/database/src/lib.rs +++ b/database/src/lib.rs @@ -10,7 +10,7 @@ use bytesize::ByteSize; use im::OrdMap; use itertools::Either; use libmdbx::{DatabaseFlags, Environment, Geometry, WriteFlags}; -use log::info; +use tracing::info; use snap::raw::{Decoder, Encoder}; use std_ext::ArcExt as _; use tap::Pipe as _; From 69f3fd58a51cfbf65a9c0a63574a5c5eebf230bd Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 16:40:40 +0200 Subject: [PATCH 11/25] feat: replace all log with tracing in eth1 module --- Cargo.lock | 2 +- eth1/Cargo.toml | 2 +- eth1/src/download_manager.rs | 2 +- eth1/src/eth1_chain.rs | 2 +- eth1/src/genesis.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aac3881..1ece93d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2253,7 +2253,6 @@ dependencies = [ "futures", "genesis", "itertools 0.13.0", - "log", "prometheus_metrics", "reqwest", "ssz", @@ -2261,6 +2260,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", + "tracing", "tynm", "types", "url", diff --git a/eth1/Cargo.toml b/eth1/Cargo.toml index f1a48c4..31ae8d8 100644 --- a/eth1/Cargo.toml +++ b/eth1/Cargo.toml @@ -17,7 +17,6 @@ fs-err = { workspace = true } futures = { workspace = true } genesis = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } reqwest = { workspace = true } ssz = { workspace = true } @@ -25,6 +24,7 @@ std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } +tracing = { workspace = true } tynm = { workspace = true } types = { workspace = true } url = { workspace = true } diff --git a/eth1/src/download_manager.rs b/eth1/src/download_manager.rs index da5f877..fe8a87e 100644 --- a/eth1/src/download_manager.rs +++ b/eth1/src/download_manager.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::{Context as _, Result}; use eth1_api::{Eth1Api, Eth1ApiToMetrics, Eth1Block}; use futures::channel::mpsc::UnboundedSender; -use log::{info, warn}; +use tracing::{info, warn}; use prometheus_metrics::Metrics; use reqwest::Client; use std_ext::ArcExt as _; diff --git a/eth1/src/eth1_chain.rs b/eth1/src/eth1_chain.rs index b328f89..462a97f 100644 --- a/eth1/src/eth1_chain.rs +++ b/eth1/src/eth1_chain.rs @@ -8,7 +8,7 @@ use futures::{ channel::mpsc::UnboundedSender, stream::{Stream, TryStreamExt as _}, }; -use log::{error, info}; +use tracing::{error, info}; use prometheus_metrics::Metrics; use reqwest::Client; use std_ext::ArcExt as _; diff --git a/eth1/src/genesis.rs b/eth1/src/genesis.rs index f515044..86cc232 100644 --- a/eth1/src/genesis.rs +++ b/eth1/src/genesis.rs @@ -5,7 +5,7 @@ use chrono::{Local, TimeZone as _}; use eth1_api::{DepositEvent, Eth1Block}; use futures::stream::{Stream, TryStreamExt as _}; use genesis::Incremental; -use log::info; +use tracing::info; use ssz::{SszRead as _, SszWrite as _}; use thiserror::Error; use types::{ From bc412e24035efccb367156c19557a3021eb7a91f Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 16:42:58 +0200 Subject: [PATCH 12/25] feat: replace all log with tracing in eth1_api module --- Cargo.lock | 2 +- eth1_api/Cargo.toml | 2 +- eth1_api/src/eth1_api.rs | 2 +- eth1_api/src/eth1_execution_engine.rs | 2 +- eth1_api/src/execution_service.rs | 2 +- eth1_api/src/messages.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ece93d..458df68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2285,7 +2285,6 @@ dependencies = [ "hex-literal", "httpmock", "jwt-simple", - "log", "memoffset", "panics", "prometheus_metrics", @@ -2299,6 +2298,7 @@ dependencies = [ "test-case", "thiserror", "tokio", + "tracing", "typenum", "types", "unwrap_none", diff --git a/eth1_api/Cargo.toml b/eth1_api/Cargo.toml index 6431d57..71deffa 100644 --- a/eth1_api/Cargo.toml +++ b/eth1_api/Cargo.toml @@ -21,7 +21,6 @@ futures = { workspace = true } hex = { workspace = true } hex-literal = { workspace = true } jwt-simple = { workspace = true } -log = { workspace = true } memoffset = { workspace = true } panics = { workspace = true } prometheus_metrics = { workspace = true } @@ -33,6 +32,7 @@ static_assertions = { workspace = true } std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } typenum = { workspace = true } types = { workspace = true } web3 = { workspace = true } diff --git a/eth1_api/src/eth1_api.rs b/eth1_api/src/eth1_api.rs index 476b7c3..de9acdb 100644 --- a/eth1_api/src/eth1_api.rs +++ b/eth1_api/src/eth1_api.rs @@ -11,7 +11,7 @@ use execution_engine::{ ForkChoiceUpdatedResponse, PayloadAttributes, PayloadId, PayloadStatusV1, }; use futures::{channel::mpsc::UnboundedSender, lock::Mutex, Future}; -use log::warn; +use tracing::warn; use prometheus_metrics::Metrics; use reqwest::{header::HeaderMap, Client, Url}; use serde::{de::DeserializeOwned, Deserialize}; diff --git a/eth1_api/src/eth1_execution_engine.rs b/eth1_api/src/eth1_execution_engine.rs index c07390c..0df9d8a 100644 --- a/eth1_api/src/eth1_execution_engine.rs +++ b/eth1_api/src/eth1_execution_engine.rs @@ -5,7 +5,7 @@ use derive_more::Constructor; use either::Either; use execution_engine::{ExecutionEngine, PayloadAttributes, PayloadId, PayloadStatusV1}; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::{info, warn}; +use tracing::{info, warn}; use tokio::runtime::{Builder, Handle}; use types::{ combined::{ExecutionPayload, ExecutionPayloadParams}, diff --git a/eth1_api/src/execution_service.rs b/eth1_api/src/execution_service.rs index 0827d89..c77425d 100644 --- a/eth1_api/src/execution_service.rs +++ b/eth1_api/src/execution_service.rs @@ -6,7 +6,7 @@ use either::Either; use execution_engine::{ForkChoiceUpdatedResponse, PayloadAttributes, PayloadStatusV1}; use fork_choice_control::Wait; use futures::{channel::mpsc::UnboundedReceiver, StreamExt as _}; -use log::warn; +use tracing::warn; use types::{ combined::{ExecutionPayload, ExecutionPayloadParams}, nonstandard::Phase, diff --git a/eth1_api/src/messages.rs b/eth1_api/src/messages.rs index 02f0276..da433ef 100644 --- a/eth1_api/src/messages.rs +++ b/eth1_api/src/messages.rs @@ -2,7 +2,7 @@ use anyhow::Result; use either::Either; use execution_engine::{PayloadAttributes, PayloadId, PayloadStatusV1}; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::debug; +use tracing::debug; use types::{ combined::{ExecutionPayload, ExecutionPayloadParams}, nonstandard::Phase, From a84660cf869c9401c513c35d9fee43e03290a488 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 17:17:32 +0200 Subject: [PATCH 13/25] feat: replace all log with tracing in fork_choice_control module --- Cargo.lock | 2 +- fork_choice_control/Cargo.toml | 2 +- fork_choice_control/src/checkpoint_sync.rs | 2 +- fork_choice_control/src/messages.rs | 2 +- fork_choice_control/src/mutator.rs | 2 +- fork_choice_control/src/storage.rs | 2 +- fork_choice_control/src/storage_back_sync.rs | 2 +- fork_choice_control/src/storage_tool.rs | 2 +- fork_choice_control/src/tasks.rs | 2 +- fork_choice_control/src/thread_pool.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 458df68..0de4f15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2620,7 +2620,6 @@ dependencies = [ "helper_functions", "http_api_utils", "itertools 0.13.0", - "log", "mime", "nonzero_ext", "num_cpus", @@ -2639,6 +2638,7 @@ dependencies = [ "tap", "test-generator", "thiserror", + "tracing", "transition_functions", "tynm", "types", diff --git a/fork_choice_control/Cargo.toml b/fork_choice_control/Cargo.toml index 0f12d8d..4b70686 100644 --- a/fork_choice_control/Cargo.toml +++ b/fork_choice_control/Cargo.toml @@ -26,7 +26,6 @@ genesis = { workspace = true } helper_functions = { workspace = true } http_api_utils = { workspace = true } itertools = { workspace = true } -log = { workspace = true } mime = { workspace = true } nonzero_ext = { workspace = true } num_cpus = { workspace = true } @@ -42,6 +41,7 @@ std_ext = { workspace = true } strum = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } tynm = { workspace = true } types = { workspace = true } diff --git a/fork_choice_control/src/checkpoint_sync.rs b/fork_choice_control/src/checkpoint_sync.rs index 3957dac..b35bffa 100644 --- a/fork_choice_control/src/checkpoint_sync.rs +++ b/fork_choice_control/src/checkpoint_sync.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use anyhow::{bail, Result}; use helper_functions::misc; use http_api_utils::{BlockId, StateId}; -use log::info; +use tracing::info; use mime::APPLICATION_OCTET_STREAM; use reqwest::{header::ACCEPT, Client, StatusCode, Url}; use ssz::SszRead; diff --git a/fork_choice_control/src/messages.rs b/fork_choice_control/src/messages.rs index 5dbd459..65e1453 100644 --- a/fork_choice_control/src/messages.rs +++ b/fork_choice_control/src/messages.rs @@ -13,7 +13,7 @@ use fork_choice_store::{ ChainLink, Store, }; use helper_functions::{accessors, misc}; -use log::debug; +use tracing::debug; use serde::Serialize; use tap::Pipe as _; use types::{ diff --git a/fork_choice_control/src/mutator.rs b/fork_choice_control/src/mutator.rs index ea781c8..41a1343 100644 --- a/fork_choice_control/src/mutator.rs +++ b/fork_choice_control/src/mutator.rs @@ -39,7 +39,7 @@ use fork_choice_store::{ use futures::channel::{mpsc::Sender as MultiSender, oneshot::Sender as OneshotSender}; use helper_functions::{accessors, misc, predicates, verifier::NullVerifier}; use itertools::{Either, Itertools as _}; -use log::{debug, error, info, warn}; +use tracing::{debug, error, info, warn}; use prometheus_metrics::Metrics; use ssz::SszHash as _; use std_ext::ArcExt as _; diff --git a/fork_choice_control/src/storage.rs b/fork_choice_control/src/storage.rs index e3f7667..91f92fc 100644 --- a/fork_choice_control/src/storage.rs +++ b/fork_choice_control/src/storage.rs @@ -9,7 +9,7 @@ use fork_choice_store::{ChainLink, Store}; use genesis::AnchorCheckpointProvider; use helper_functions::{accessors, misc}; use itertools::Itertools as _; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use nonzero_ext::nonzero; use reqwest::{Client, Url}; use ssz::{Ssz, SszRead, SszReadDefault as _, SszWrite}; diff --git a/fork_choice_control/src/storage_back_sync.rs b/fork_choice_control/src/storage_back_sync.rs index 2868116..560b11e 100644 --- a/fork_choice_control/src/storage_back_sync.rs +++ b/fork_choice_control/src/storage_back_sync.rs @@ -5,7 +5,7 @@ use arithmetic::U64Ext as _; use features::Feature; use genesis::AnchorCheckpointProvider; use helper_functions::misc; -use log::{info, warn}; +use tracing::{info, warn}; use ssz::SszHash as _; use std_ext::ArcExt as _; use transition_functions::combined; diff --git a/fork_choice_control/src/storage_tool.rs b/fork_choice_control/src/storage_tool.rs index 549bed8..6df66e2 100644 --- a/fork_choice_control/src/storage_tool.rs +++ b/fork_choice_control/src/storage_tool.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; use anyhow::Result; use genesis::AnchorCheckpointProvider; -use log::info; +use tracing::info; use ssz::{SszHash as _, SszRead, SszWrite as _}; use std_ext::ArcExt as _; use thiserror::Error; diff --git a/fork_choice_control/src/tasks.rs b/fork_choice_control/src/tasks.rs index 35292c5..812d977 100644 --- a/fork_choice_control/src/tasks.rs +++ b/fork_choice_control/src/tasks.rs @@ -17,7 +17,7 @@ use helper_functions::{ accessors, misc, verifier::{MultiVerifier, NullVerifier}, }; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use types::{ combined::SignedBeaconBlock, diff --git a/fork_choice_control/src/thread_pool.rs b/fork_choice_control/src/thread_pool.rs index f091cc2..3a6cbd4 100644 --- a/fork_choice_control/src/thread_pool.rs +++ b/fork_choice_control/src/thread_pool.rs @@ -17,7 +17,7 @@ use anyhow::Result; use derivative::Derivative; use derive_more::From; use execution_engine::ExecutionEngine; -use log::debug; +use tracing::debug; use parking_lot::{Condvar, Mutex}; use std_ext::ArcExt as _; use types::preset::Preset; From 50af7a764c2eaca64b0d5465c47c2c5865405d57 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 17:34:36 +0200 Subject: [PATCH 14/25] feat: replace all log with tracing in http_api module --- Cargo.lock | 2 +- http_api/Cargo.toml | 2 +- http_api/src/standard.rs | 2 +- http_api/src/task.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0de4f15..5ce7e3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3550,7 +3550,6 @@ dependencies = [ "itertools 0.13.0", "keymanager", "liveness_tracker", - "log", "mediatype", "metrics", "mime", @@ -3582,6 +3581,7 @@ dependencies = [ "tokio", "tokio-stream", "tower-http", + "tracing", "transition_functions", "try_from_iterator", "typenum", diff --git a/http_api/Cargo.toml b/http_api/Cargo.toml index bcf7d6a..4df98e0 100644 --- a/http_api/Cargo.toml +++ b/http_api/Cargo.toml @@ -26,7 +26,6 @@ helper_functions = { workspace = true } http_api_utils = { workspace = true } itertools = { workspace = true } liveness_tracker = { workspace = true } -log = { workspace = true } mediatype = { workspace = true } metrics = { workspace = true } mime = { workspace = true } @@ -49,6 +48,7 @@ thiserror = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } tower-http = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } try_from_iterator = { workspace = true } typenum = { workspace = true } diff --git a/http_api/src/standard.rs b/http_api/src/standard.rs index f39d9d8..e46d36f 100644 --- a/http_api/src/standard.rs +++ b/http_api/src/standard.rs @@ -33,7 +33,7 @@ use helper_functions::{accessors, misc}; use http_api_utils::{BlockId, StateId}; use itertools::{izip, Either, Itertools as _}; use liveness_tracker::ApiToLiveness; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, Origin, PoolAdditionOutcome, SyncCommitteeAggPool, }; diff --git a/http_api/src/task.rs b/http_api/src/task.rs index 42078ac..ed5ba7c 100644 --- a/http_api/src/task.rs +++ b/http_api/src/task.rs @@ -16,7 +16,7 @@ use futures::{ use genesis::AnchorCheckpointProvider; use http_api_utils::ApiMetrics; use liveness_tracker::ApiToLiveness; -use log::{debug, info}; +use tracing::{debug, info}; use metrics::ApiToMetrics; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, PoolToApiMessage, SyncCommitteeAggPool, From 0b63a361ee2c04d6a8c4177f1ad5972617add2b0 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 17:38:26 +0200 Subject: [PATCH 15/25] feat: replace all log with tracing in http_api_utils module --- Cargo.lock | 1 - http_api_utils/Cargo.toml | 1 - http_api_utils/src/logging.rs | 2 +- http_api_utils/src/middleware.rs | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ce7e3c..4169307 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3600,7 +3600,6 @@ dependencies = [ "hex-literal", "http-body-util", "itertools 0.13.0", - "log", "mime", "parse-display", "prometheus_metrics", diff --git a/http_api_utils/Cargo.toml b/http_api_utils/Cargo.toml index dae1dab..c785016 100644 --- a/http_api_utils/Cargo.toml +++ b/http_api_utils/Cargo.toml @@ -12,7 +12,6 @@ axum = { workspace = true } features = { workspace = true } http-body-util = { workspace = true } itertools = { workspace = true } -log = { workspace = true } mime = { workspace = true } parse-display = { workspace = true } prometheus_metrics = { workspace = true } diff --git a/http_api_utils/src/logging.rs b/http_api_utils/src/logging.rs index 4fa9402..7e7dd2a 100644 --- a/http_api_utils/src/logging.rs +++ b/http_api_utils/src/logging.rs @@ -8,7 +8,7 @@ use axum::{ response::Response, }; use features::Feature; -use log::{info, warn}; +use tracing::{info, warn}; use tracing::Span; use crate::{misc::ApiMetrics, ApiError}; diff --git a/http_api_utils/src/middleware.rs b/http_api_utils/src/middleware.rs index 810d3a6..2374f9a 100644 --- a/http_api_utils/src/middleware.rs +++ b/http_api_utils/src/middleware.rs @@ -13,7 +13,7 @@ use axum::{ Extension, }; use http_body_util::BodyExt as _; -use log::info; +use tracing::info; use mime::{APPLICATION_JSON, TEXT_EVENT_STREAM}; use crate::{error::Error, misc::Direction}; From 27229c59bf9185bfcd2e24b13f4ca0a41658fa74 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 17:42:04 +0200 Subject: [PATCH 16/25] feat: replace all log with tracing in keymanager module --- Cargo.lock | 2 +- keymanager/Cargo.toml | 2 +- keymanager/src/keystores.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4169307..f326fa5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4305,7 +4305,6 @@ dependencies = [ "futures", "hex-literal", "itertools 0.13.0", - "log", "reqwest", "serde", "serde_json", @@ -4316,6 +4315,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", + "tracing", "types", "uuid", "validator_key_cache", diff --git a/keymanager/Cargo.toml b/keymanager/Cargo.toml index 35ec218..798a886 100644 --- a/keymanager/Cargo.toml +++ b/keymanager/Cargo.toml @@ -15,7 +15,6 @@ eip_2335 = { workspace = true } fs-err = { workspace = true } futures = { workspace = true } itertools = { workspace = true } -log = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } @@ -25,6 +24,7 @@ std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } types = { workspace = true } uuid = { workspace = true } validator_key_cache = { workspace = true } diff --git a/keymanager/src/keystores.rs b/keymanager/src/keystores.rs index 626ee9b..878aad0 100644 --- a/keymanager/src/keystores.rs +++ b/keymanager/src/keystores.rs @@ -9,7 +9,7 @@ use bls::{PublicKeyBytes, SecretKey}; use eip_2335::Keystore; use futures::lock::{MappedMutexGuard, Mutex, MutexGuard}; use itertools::Itertools as _; -use log::{info, warn}; +use tracing::{info, warn}; use serde::Serialize; use signer::{KeyOrigin, Signer}; use slashing_protection::{interchange_format::InterchangeFormat, SlashingProtector}; From 682d74f908039c6a8fd1e390c6215bb52c9a3dc5 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 19:27:07 +0200 Subject: [PATCH 17/25] feat: replace all log with tracing in liveness_tracker module --- Cargo.lock | 2 +- liveness_tracker/Cargo.toml | 2 +- liveness_tracker/src/lib.rs | 2 +- liveness_tracker/src/messages.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f326fa5..2033eb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4991,9 +4991,9 @@ dependencies = [ "futures", "helper_functions", "itertools 0.13.0", - "log", "operation_pools", "prometheus_metrics", + "tracing", "tynm", "types", "validator", diff --git a/liveness_tracker/Cargo.toml b/liveness_tracker/Cargo.toml index 7bf0d41..b0445e3 100644 --- a/liveness_tracker/Cargo.toml +++ b/liveness_tracker/Cargo.toml @@ -14,9 +14,9 @@ fork_choice_control = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } operation_pools = { workspace = true } prometheus_metrics = { workspace = true } +tracing = { workspace = true } tynm = { workspace = true } types = { workspace = true } validator = { workspace = true } diff --git a/liveness_tracker/src/lib.rs b/liveness_tracker/src/lib.rs index 71e0e31..84b636a 100644 --- a/liveness_tracker/src/lib.rs +++ b/liveness_tracker/src/lib.rs @@ -7,7 +7,7 @@ use fork_choice_control::Wait; use futures::{channel::mpsc::UnboundedReceiver, select, StreamExt as _}; use helper_functions::{accessors, misc}; use itertools::Itertools as _; -use log::{debug, warn}; +use tracing::{debug, warn}; use operation_pools::PoolToLivenessMessage; use prometheus_metrics::Metrics; use types::{ diff --git a/liveness_tracker/src/messages.rs b/liveness_tracker/src/messages.rs index 7be12ed..f97a918 100644 --- a/liveness_tracker/src/messages.rs +++ b/liveness_tracker/src/messages.rs @@ -1,6 +1,6 @@ use anyhow::Result; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::debug; +use tracing::debug; use types::phase0::primitives::{Epoch, ValidatorIndex}; pub enum ApiToLiveness { From afb5bcb83d630d1d8c4722da228eb6e1744fcc97 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 19:32:49 +0200 Subject: [PATCH 18/25] feat: replace all log with tracing in metrics module --- Cargo.lock | 2 +- metrics/Cargo.toml | 2 +- metrics/src/beaconchain.rs | 2 +- metrics/src/messages.rs | 2 +- metrics/src/server.rs | 2 +- metrics/src/service.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2033eb7..ce09b4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5115,7 +5115,6 @@ dependencies = [ "helper_functions", "http_api_utils", "jemalloc-ctl", - "log", "num_threads", "p2p", "prometheus", @@ -5131,6 +5130,7 @@ dependencies = [ "tokio", "tokio-stream", "tower-http", + "tracing", "transition_functions", "types", ] diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 69be48e..340d28d 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -21,7 +21,6 @@ grandine_version = { workspace = true } helper_functions = { workspace = true } http_api_utils = { workspace = true } jemalloc-ctl = { workspace = true } -log = { workspace = true } num_threads = { workspace = true } p2p = { workspace = true } prometheus = { workspace = true } @@ -37,6 +36,7 @@ thiserror = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } tower-http = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } types = { workspace = true } diff --git a/metrics/src/beaconchain.rs b/metrics/src/beaconchain.rs index 4d2a3cc..f3a590e 100644 --- a/metrics/src/beaconchain.rs +++ b/metrics/src/beaconchain.rs @@ -12,7 +12,7 @@ use chrono::DateTime; use eth1_api::{Eth1ConnectionData, Eth1Metrics}; use grandine_version::{APPLICATION_NAME, APPLICATION_VERSION}; use helper_functions::{accessors, predicates}; -use log::warn; +use tracing::warn; use p2p::metrics::PEERS_CONNECTED; use prometheus::IntGauge; use psutil::{cpu::CpuTimes, process::Process}; diff --git a/metrics/src/messages.rs b/metrics/src/messages.rs index f5a1c6f..6c858df 100644 --- a/metrics/src/messages.rs +++ b/metrics/src/messages.rs @@ -1,6 +1,6 @@ use anyhow::Result; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::debug; +use tracing::debug; use types::nonstandard::SystemStats; pub enum ApiToMetrics { diff --git a/metrics/src/server.rs b/metrics/src/server.rs index 85f6f8e..ee089e2 100644 --- a/metrics/src/server.rs +++ b/metrics/src/server.rs @@ -21,7 +21,7 @@ use fork_choice_control::Wait; use futures::channel::mpsc::UnboundedSender; use helper_functions::misc; use http_api_utils::ApiError; -use log::{info, warn}; +use tracing::{info, warn}; use prometheus::TextEncoder; use prometheus_client::registry::Registry; use prometheus_metrics::Metrics; diff --git a/metrics/src/service.rs b/metrics/src/service.rs index 8731561..edf011d 100644 --- a/metrics/src/service.rs +++ b/metrics/src/service.rs @@ -6,7 +6,7 @@ use bls::PublicKeyBytes; use directories::Directories; use eth1_api::{Eth1ApiToMetrics, Eth1Metrics, RealController}; use futures::{channel::mpsc::UnboundedReceiver, future::Either, select, StreamExt as _}; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use p2p::SyncToMetrics; use reqwest::{Client, StatusCode, Url}; use serde::Deserialize; From dbd466dff37005ce0fd9e570bb96859c22dd030f Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 19:35:52 +0200 Subject: [PATCH 19/25] feat: replace all log with tracing in operation_pools module --- Cargo.lock | 4 ++-- operation_pools/Cargo.toml | 2 +- operation_pools/src/bls_to_execution_change_pool.rs | 2 +- operation_pools/src/messages.rs | 2 +- operation_pools/src/sync_committee_agg_pool/pool.rs | 2 +- operation_pools/src/sync_committee_agg_pool/tasks.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce09b4c..71470e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5565,7 +5565,6 @@ dependencies = [ "good_lp", "helper_functions", "itertools 0.13.0", - "log", "prometheus_metrics", "rayon", "serde", @@ -5574,6 +5573,7 @@ dependencies = [ "strum", "tap", "tokio", + "tracing", "transition_functions", "try_from_iterator", "tynm", @@ -5626,7 +5626,6 @@ dependencies = [ "helper_functions", "igd-next", "itertools 0.13.0", - "log", "logging", "operation_pools", "prometheus-client", @@ -5644,6 +5643,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", + "tracing", "tynm", "typenum", "types", diff --git a/operation_pools/Cargo.toml b/operation_pools/Cargo.toml index cc819ce..cc02e88 100644 --- a/operation_pools/Cargo.toml +++ b/operation_pools/Cargo.toml @@ -21,7 +21,6 @@ futures = { workspace = true } good_lp = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } rayon = { workspace = true } serde = { workspace = true } @@ -30,6 +29,7 @@ std_ext = { workspace = true } strum = { workspace = true } tap = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } try_from_iterator = { workspace = true } tynm = { workspace = true } diff --git a/operation_pools/src/bls_to_execution_change_pool.rs b/operation_pools/src/bls_to_execution_change_pool.rs index 98cb702..f52effe 100644 --- a/operation_pools/src/bls_to_execution_change_pool.rs +++ b/operation_pools/src/bls_to_execution_change_pool.rs @@ -12,7 +12,7 @@ use futures::{ }; use helper_functions::predicates; use itertools::Itertools as _; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use transition_functions::capella; use types::{ diff --git a/operation_pools/src/messages.rs b/operation_pools/src/messages.rs index aa82fd3..121a30e 100644 --- a/operation_pools/src/messages.rs +++ b/operation_pools/src/messages.rs @@ -1,6 +1,6 @@ use eth2_libp2p::GossipId; use futures::channel::mpsc::UnboundedSender; -use log::debug; +use tracing::debug; use serde::Serialize; use types::{ altair::containers::SyncCommitteeMessage, capella::containers::SignedBlsToExecutionChange, diff --git a/operation_pools/src/sync_committee_agg_pool/pool.rs b/operation_pools/src/sync_committee_agg_pool/pool.rs index 68e51f5..1bb15eb 100644 --- a/operation_pools/src/sync_committee_agg_pool/pool.rs +++ b/operation_pools/src/sync_committee_agg_pool/pool.rs @@ -3,7 +3,7 @@ use std::{collections::HashSet, sync::Arc}; use anyhow::{anyhow, Result}; use helper_functions::accessors; use itertools::Itertools as _; -use log::debug; +use tracing::debug; use prometheus_metrics::Metrics; use std_ext::ArcExt as _; use tokio::sync::RwLock; diff --git a/operation_pools/src/sync_committee_agg_pool/tasks.rs b/operation_pools/src/sync_committee_agg_pool/tasks.rs index c69517e..b9f2ede 100644 --- a/operation_pools/src/sync_committee_agg_pool/tasks.rs +++ b/operation_pools/src/sync_committee_agg_pool/tasks.rs @@ -11,7 +11,7 @@ use helper_functions::{ signing::{SignForSingleFork as _, SignForSingleForkAtSlot as _}, verifier::{MultiVerifier, Verifier as _}, }; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use typenum::Unsigned as _; use types::{ From 34dd77d685456c1b29c52c7e91373a4f4ddc5c3f Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 21:10:56 +0200 Subject: [PATCH 20/25] feat: replace all log with tracing in prometheus_metrics module --- Cargo.lock | 4 ++-- prometheus_metrics/Cargo.toml | 2 +- prometheus_metrics/src/helpers.rs | 2 +- prometheus_metrics/src/metrics.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71470e8..79bfbf1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5626,6 +5626,7 @@ dependencies = [ "helper_functions", "igd-next", "itertools 0.13.0", + "log", "logging", "operation_pools", "prometheus-client", @@ -5643,7 +5644,6 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tracing", "tynm", "typenum", "types", @@ -6191,11 +6191,11 @@ dependencies = [ "anyhow", "features", "futures", - "log", "once_cell", "prometheus", "tokio", "tokio-stream", + "tracing", "types", ] diff --git a/prometheus_metrics/Cargo.toml b/prometheus_metrics/Cargo.toml index 5aff72e..c765aee 100644 --- a/prometheus_metrics/Cargo.toml +++ b/prometheus_metrics/Cargo.toml @@ -8,9 +8,9 @@ authors = ["Grandine "] anyhow = { workspace = true } features = { workspace = true } futures = { workspace = true } -log = { workspace = true } once_cell = { workspace = true } prometheus = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } +tracing = { workspace = true } types = { workspace = true } diff --git a/prometheus_metrics/src/helpers.rs b/prometheus_metrics/src/helpers.rs index b0cd16b..3476ad7 100644 --- a/prometheus_metrics/src/helpers.rs +++ b/prometheus_metrics/src/helpers.rs @@ -1,7 +1,7 @@ use std::time::{Duration, SystemTime}; use anyhow::Result; -use log::warn; +use tracing::warn; use prometheus::{Histogram, HistogramTimer, HistogramVec}; use types::phase0::primitives::UnixSeconds; diff --git a/prometheus_metrics/src/metrics.rs b/prometheus_metrics/src/metrics.rs index 1e5e196..33ac364 100644 --- a/prometheus_metrics/src/metrics.rs +++ b/prometheus_metrics/src/metrics.rs @@ -2,7 +2,7 @@ use core::time::Duration; use std::sync::Arc; use anyhow::Result; -use log::warn; +use tracing::warn; use once_cell::sync::OnceCell; use prometheus::{ histogram_opts, opts, Gauge, GaugeVec, Histogram, HistogramVec, IntCounter, IntCounterVec, From 5fb013da5e0c389c630961b07a897aa16ab9baa6 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 21:19:28 +0200 Subject: [PATCH 21/25] feat: replace all log with tracing in runtime module --- Cargo.lock | 2 +- runtime/Cargo.toml | 2 +- runtime/src/runtime.rs | 2 +- runtime/src/schema.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 79bfbf1..0088445 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6751,7 +6751,6 @@ dependencies = [ "http_api", "keymanager", "liveness_tracker", - "log", "metrics", "nonzero_ext", "num_cpus", @@ -6768,6 +6767,7 @@ dependencies = [ "std_ext", "thiserror", "tokio", + "tracing", "types", "validator", ] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c669dd6..870c083 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -27,7 +27,6 @@ grandine_version = { workspace = true } http_api = { workspace = true } keymanager = { workspace = true } liveness_tracker = { workspace = true } -log = { workspace = true } metrics = { workspace = true } nonzero_ext = { workspace = true } num_cpus = { workspace = true } @@ -44,5 +43,6 @@ slashing_protection = { workspace = true } std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } types = { workspace = true } validator = { workspace = true } diff --git a/runtime/src/runtime.rs b/runtime/src/runtime.rs index 7cca34b..8cf9c64 100644 --- a/runtime/src/runtime.rs +++ b/runtime/src/runtime.rs @@ -26,7 +26,7 @@ use genesis::AnchorCheckpointProvider; use http_api::{Channels as HttpApiChannels, HttpApi, HttpApiConfig}; use keymanager::KeyManager; use liveness_tracker::LivenessTracker; -use log::{info, warn}; +use tracing::{info, warn}; use metrics::{run_metrics_server, MetricsChannels, MetricsService}; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, Manager, SyncCommitteeAggPool, diff --git a/runtime/src/schema.rs b/runtime/src/schema.rs index 198e1ed..325a562 100644 --- a/runtime/src/schema.rs +++ b/runtime/src/schema.rs @@ -2,7 +2,7 @@ use std::{io::ErrorKind, path::Path}; use anyhow::{bail, ensure, Result}; use grandine_version::APPLICATION_NAME; -use log::info; +use tracing::info; use semver::{Version, VersionReq}; use serde::{Deserialize, Serialize}; use thiserror::Error; From 4bc3bc2158c07206d966463d00fff5151e1a1e68 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 21:22:09 +0200 Subject: [PATCH 22/25] feat: replace all log with tracing in signer module --- Cargo.lock | 2 +- signer/Cargo.toml | 2 +- signer/src/signer.rs | 2 +- signer/src/web3signer/api.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0088445..c045e49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7333,7 +7333,6 @@ dependencies = [ "hex-literal", "httpmock", "itertools 0.13.0", - "log", "prometheus_metrics", "rayon", "reqwest", @@ -7345,6 +7344,7 @@ dependencies = [ "std_ext", "thiserror", "tokio", + "tracing", "types", ] diff --git a/signer/Cargo.toml b/signer/Cargo.toml index 787506b..9736a3d 100644 --- a/signer/Cargo.toml +++ b/signer/Cargo.toml @@ -14,7 +14,6 @@ builder_api = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } rayon = { workspace = true } reqwest = { workspace = true } @@ -24,6 +23,7 @@ slashing_protection = { workspace = true } std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } types = { workspace = true } [dev-dependencies] diff --git a/signer/src/signer.rs b/signer/src/signer.rs index cd7d07e..5446a91 100644 --- a/signer/src/signer.rs +++ b/signer/src/signer.rs @@ -13,7 +13,7 @@ use futures::{ }; use helper_functions::misc; use itertools::{izip, Itertools as _}; -use log::{info, warn}; +use tracing::{info, warn}; use prometheus_metrics::Metrics; use rayon::iter::{IntoParallelIterator as _, ParallelIterator as _}; use reqwest::{Client, Url}; diff --git a/signer/src/web3signer/api.rs b/signer/src/web3signer/api.rs index 0297892..d6ec58f 100644 --- a/signer/src/web3signer/api.rs +++ b/signer/src/web3signer/api.rs @@ -5,7 +5,7 @@ use std::{ use anyhow::Result; use bls::{PublicKeyBytes, SignatureBytes}; -use log::warn; +use tracing::warn; use prometheus_metrics::Metrics; use reqwest::{Client, Url}; use types::{phase0::primitives::H256, preset::Preset}; From cde29c06b1a3c2fd6d6994299a6ecf7c07caac47 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 21:24:04 +0200 Subject: [PATCH 23/25] feat: replace all log with tracing in slasher module --- Cargo.lock | 2 +- slasher/Cargo.toml | 2 +- slasher/src/messages.rs | 2 +- slasher/src/slasher.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c045e49..b6515b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7399,11 +7399,11 @@ dependencies = [ "features", "futures", "helper_functions", - "log", "p2p", "serde", "ssz", "thiserror", + "tracing", "types", "unwrap_none", ] diff --git a/slasher/Cargo.toml b/slasher/Cargo.toml index aab5dd3..095fd74 100644 --- a/slasher/Cargo.toml +++ b/slasher/Cargo.toml @@ -17,11 +17,11 @@ eth1_api = { workspace = true } features = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } -log = { workspace = true } p2p = { workspace = true } serde = { workspace = true } ssz = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } types = { workspace = true } [dev-dependencies] diff --git a/slasher/src/messages.rs b/slasher/src/messages.rs index 880c48f..b55ca36 100644 --- a/slasher/src/messages.rs +++ b/slasher/src/messages.rs @@ -1,5 +1,5 @@ use futures::channel::mpsc::UnboundedSender; -use log::warn; +use tracing::warn; use types::{ phase0::{ containers::{AttesterSlashing, ProposerSlashing}, diff --git a/slasher/src/slasher.rs b/slasher/src/slasher.rs index b0ceb70..6124437 100644 --- a/slasher/src/slasher.rs +++ b/slasher/src/slasher.rs @@ -11,7 +11,7 @@ use futures::{ stream::StreamExt, }; use helper_functions::{accessors, misc}; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use p2p::P2pToSlasher; use thiserror::Error; use types::{ From d8f8f7e5aa2e79fa0f03b5b990a7e71a4c3f47ff Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 21:26:37 +0200 Subject: [PATCH 24/25] feat: replace all log with tracing in slashing_protection module --- Cargo.lock | 2 +- slashing_protection/Cargo.toml | 2 +- slashing_protection/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6515b2..eaa6808 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7423,7 +7423,6 @@ dependencies = [ "helper_functions", "hex-literal", "itertools 0.13.0", - "log", "refinery", "rusqlite", "serde", @@ -7434,6 +7433,7 @@ dependencies = [ "test-case", "test-generator", "thiserror", + "tracing", "types", ] diff --git a/slashing_protection/Cargo.toml b/slashing_protection/Cargo.toml index 5752600..8109a3b 100644 --- a/slashing_protection/Cargo.toml +++ b/slashing_protection/Cargo.toml @@ -15,7 +15,6 @@ fs-err = { workspace = true } glob = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } refinery = { workspace = true } rusqlite = { workspace = true } serde = { workspace = true } @@ -23,6 +22,7 @@ serde_json = { workspace = true } serde_utils = { workspace = true } ssz = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } types = { workspace = true } [dev-dependencies] diff --git a/slashing_protection/src/lib.rs b/slashing_protection/src/lib.rs index 3a45653..1e016b0 100644 --- a/slashing_protection/src/lib.rs +++ b/slashing_protection/src/lib.rs @@ -7,7 +7,7 @@ use derivative::Derivative; use fs_err::File; use helper_functions::{accessors, misc}; use itertools::Itertools as _; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use rusqlite::{Connection, OptionalExtension, Rows, Transaction, TransactionBehavior}; use ssz::{SszReadDefault as _, SszWrite as _}; use thiserror::Error; From 99390a4b0e86593e21ddaaaaf8d88efedea8f0b8 Mon Sep 17 00:00:00 2001 From: Karrenbelt Date: Wed, 4 Sep 2024 21:28:36 +0200 Subject: [PATCH 25/25] feat: replace all log with tracing in state_cache module --- Cargo.lock | 2 +- state_cache/Cargo.toml | 2 +- state_cache/src/state_cache.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eaa6808..5e94a02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7674,11 +7674,11 @@ version = "0.1.0" dependencies = [ "anyhow", "im", - "log", "parking_lot 0.12.3", "std_ext", "tap", "thiserror", + "tracing", "types", ] diff --git a/state_cache/Cargo.toml b/state_cache/Cargo.toml index 5cca36f..c3793c9 100644 --- a/state_cache/Cargo.toml +++ b/state_cache/Cargo.toml @@ -10,9 +10,9 @@ workspace = true [dependencies] anyhow = { workspace = true } im = { workspace = true } -log = { workspace = true } parking_lot = { workspace = true } std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } types = { workspace = true } diff --git a/state_cache/src/state_cache.rs b/state_cache/src/state_cache.rs index d2879b3..a5146ff 100644 --- a/state_cache/src/state_cache.rs +++ b/state_cache/src/state_cache.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::{anyhow, Result}; use im::{HashMap, OrdMap}; -use log::{info, warn}; +use tracing::{info, warn}; use parking_lot::{Mutex, MutexGuard}; use std_ext::ArcExt as _; use tap::Pipe as _;