From e9af8519f51e5f6d399304cf4efaf991c2bcc9ba Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Tue, 3 Mar 2026 11:01:11 +0100 Subject: [PATCH 1/4] chore: make tokio console optional --- CHANGELOG.md | 2 ++ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91ef719e49f1..9ee2f33d512f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ ### Breaking +- [#6680](https://github.com/ChainSafe/forest/pull/6680) Made the `tokio-console` feature optional and disabled by default. Users relying on this feature must now explicitly compile Forest with `--features tokio-console` to enable it. + ### Added ### Changed diff --git a/Cargo.toml b/Cargo.toml index 41e9578a22f6..ce7c1707df5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -320,7 +320,7 @@ lto = "fat" # These should be refactored (probably removed) in #2984 [features] -default = ["jemalloc", "tokio-console", "tracing-loki", "tracing-chrome", "sqlite"] +default = ["jemalloc", "tracing-loki", "tracing-chrome", "sqlite"] test = [] # default feature set for unit tests slim = ["rustalloc"] cargo-test = [] # group of tests that is recommended to run with `cargo test` instead of `nextest` From 9fd7901331d0a7c383b1d360a12718d0e4db22d1 Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Tue, 3 Mar 2026 11:20:06 +0100 Subject: [PATCH 2/4] chore!: remove `tracing-chrome` feature --- AGENTS.md | 3 +-- CHANGELOG.md | 2 ++ Cargo.lock | 12 ------------ Cargo.toml | 14 ++++++-------- src/cli/main.rs | 2 +- src/cli_shared/logger/mod.rs | 33 ++------------------------------- src/daemon/main.rs | 2 +- 7 files changed, 13 insertions(+), 55 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 95fe74ab2e2b..037f6f0a26d2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -357,7 +357,7 @@ lldb target/debugging/forest ## Cargo Features -- **`default`** - `jemalloc`, `tokio-console`, `tracing-loki`, `tracing-chrome` +- **`default`** - `jemalloc`, `tracing-loki` - **`test`** - Default feature set for unit tests - **`slim`** - Minimal feature set (uses rustalloc) - **`jemalloc`** - Use jemalloc allocator (production default) @@ -365,7 +365,6 @@ lldb target/debugging/forest - **`system-alloc`** - Use system allocator (for memory profiling) - **`tokio-console`** - Enable tokio-console integration - **`tracing-loki`** - Send telemetry to Loki -- **`tracing-chrome`** - Chrome tracing support - **`no-f3-sidecar`** - Disable F3 sidecar build - **`cargo-test`** - Group of tests that is recommended to run with `cargo test` instead of `nextest` - **`doctest-private`** - Enable doctests for private items diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee2f33d512f..be3459ed72ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ ### Removed +- [#6681](https://github.com/ChainSafe/forest/pull/6681) Removed `tracing-chrome` feature and all related code as it was deemed unused. If you didn't set `CHROME_TRACE_FILE` manually before, you shouldn't be affected by this change. If you were using this feature, reach out. + ### Fixed ## Forest v0.32.3 "Unimpressive Serenity" diff --git a/Cargo.lock b/Cargo.lock index 4b7f44f48a7e..ab8b30026020 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3420,7 +3420,6 @@ dependencies = [ "tower-http", "tracing", "tracing-appender", - "tracing-chrome", "tracing-loki", "tracing-subscriber", "unsigned-varint 0.8.0", @@ -10126,17 +10125,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "tracing-chrome" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0a738ed5d6450a9fb96e86a23ad808de2b727fd1394585da5cdd6788ffe724" -dependencies = [ - "serde_json", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "tracing-core" version = "0.1.36" diff --git a/Cargo.toml b/Cargo.toml index ce7c1707df5f..bc62e7aa35ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -230,7 +230,6 @@ zstd = "0.13" console-subscriber = { version = "0.5", features = ["parking_lot"], optional = true } sqlx = { version = "0.8", default-features = false, features = ["sqlite", "runtime-tokio", "macros"], optional = true } tikv-jemallocator = { version = "0.6", optional = true } -tracing-chrome = { version = "0.7", optional = true } tracing-loki = { version = "0.2", default-features = false, features = ["compat-0-2-1", "rustls"], optional = true } [target.'cfg(unix)'.dependencies] @@ -320,13 +319,13 @@ lto = "fat" # These should be refactored (probably removed) in #2984 [features] -default = ["jemalloc", "tracing-loki", "tracing-chrome", "sqlite"] -test = [] # default feature set for unit tests +default = ["jemalloc", "tracing-loki", "sqlite"] +test = [] # default feature set for unit tests slim = ["rustalloc"] -cargo-test = [] # group of tests that is recommended to run with `cargo test` instead of `nextest` -doctest-private = [] # see lib.rs::doctest_private -benchmark-private = ["dep:criterion"] # see lib.rs::benchmark_private -interop-tests-private = [] # see lib.rs::interop_tests_private +cargo-test = [] # group of tests that is recommended to run with `cargo test` instead of `nextest` +doctest-private = [] # see lib.rs::doctest_private +benchmark-private = ["dep:criterion"] # see lib.rs::benchmark_private +interop-tests-private = [] # see lib.rs::interop_tests_private sqlite = ["dep:sqlx"] # Allocator. Use at most one of these. @@ -336,7 +335,6 @@ system-alloc = [] # Use the platform allocator (for memory pr tokio-console = ["dep:console-subscriber"] tracing-loki = ["dep:tracing-loki"] -tracing-chrome = ["dep:tracing-chrome"] no-f3-sidecar = [] diff --git a/src/cli/main.rs b/src/cli/main.rs index b46831dd235e..62c8fc00b0cd 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -28,7 +28,7 @@ where let client = rpc::Client::default_or_from_env(token.as_deref())?; - let (_bg_tasks, _guards) = logger::setup_logger(&crate::cli_shared::cli::CliOpts::default()); + let _bg_tasks = logger::setup_logger(&crate::cli_shared::cli::CliOpts::default()); cmd.run(client).await } diff --git a/src/cli_shared/logger/mod.rs b/src/cli_shared/logger/mod.rs index d21f705821fc..41283e336cc1 100644 --- a/src/cli_shared/logger/mod.rs +++ b/src/cli_shared/logger/mod.rs @@ -11,16 +11,9 @@ use crate::utils::misc::LoggingColor; type BackgroundTask = Pin + Send>>; -#[derive(Default)] -pub struct Guards { - #[cfg(feature = "tracing-chrome")] - tracing_chrome: Option, -} - #[allow(unused_mut)] -pub fn setup_logger(opts: &CliOpts) -> (Vec, Guards) { +pub fn setup_logger(opts: &CliOpts) -> Vec { let mut background_tasks: Vec = vec![]; - let mut guards = Guards::default(); let mut layers: Vec + Send + Sync>> = // console logger vec![Box::new( @@ -88,30 +81,8 @@ pub fn setup_logger(opts: &CliOpts) -> (Vec, Guards) { } } - // Go to to browse trace files. - // You may want to call ChromeLayerBuilder::trace_style as appropriate - if let Some(_chrome_trace_file) = std::env::var_os("CHROME_TRACE_FILE") { - #[cfg(not(feature = "tracing-chrome"))] - tracing::warn!( - "`tracing-chrome` is unavailable, forest binaries need to be recompiled with `tracing-chrome` feature" - ); - - #[cfg(feature = "tracing-chrome")] - { - let (layer, guard) = match _chrome_trace_file.is_empty() { - true => tracing_chrome::ChromeLayerBuilder::new().build(), - false => tracing_chrome::ChromeLayerBuilder::new() - .file(_chrome_trace_file) - .build(), - }; - - guards.tracing_chrome = Some(guard); - layers.push(Box::new(layer)); - } - } - tracing_subscriber::registry().with(layers).init(); - (background_tasks, guards) + background_tasks } // Log warnings to stderr diff --git a/src/daemon/main.rs b/src/daemon/main.rs index c08ed0798e01..c6cdacebe790 100644 --- a/src/daemon/main.rs +++ b/src/daemon/main.rs @@ -35,7 +35,7 @@ where // Run forest as a daemon if no other subcommands are used. Otherwise, run the // subcommand. - let (background_tasks, _guards) = logger::setup_logger(&opts); + let background_tasks = logger::setup_logger(&opts); if let Some(path) = &path { match path { From a64f805beb006ca119f5309938ae984ccba2087a Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Tue, 3 Mar 2026 12:11:21 +0100 Subject: [PATCH 3/4] remove cargo features from AGENTS.md --- AGENTS.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 037f6f0a26d2..468fe3f65c8f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -355,22 +355,6 @@ lldb target/debugging/forest - `FULLNODE_API_INFO` - RPC endpoint and authentication token - `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT` - Disable F3 sidecar build (for debugging profile) -## Cargo Features - -- **`default`** - `jemalloc`, `tracing-loki` -- **`test`** - Default feature set for unit tests -- **`slim`** - Minimal feature set (uses rustalloc) -- **`jemalloc`** - Use jemalloc allocator (production default) -- **`rustalloc`** - Use Rust standard allocator -- **`system-alloc`** - Use system allocator (for memory profiling) -- **`tokio-console`** - Enable tokio-console integration -- **`tracing-loki`** - Send telemetry to Loki -- **`no-f3-sidecar`** - Disable F3 sidecar build -- **`cargo-test`** - Group of tests that is recommended to run with `cargo test` instead of `nextest` -- **`doctest-private`** - Enable doctests for private items -- **`benchmark-private`** - Enable benchmark suite -- **`interop-tests-private`** - Enable interop tests - ## Build Profiles - **`dev`** - Fast compile, line-table-only debug info, opt-level=1 for deps From 6bf2cb6ab91b35dbed822e0f11d5ac5168f0deec Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Tue, 3 Mar 2026 12:12:17 +0100 Subject: [PATCH 4/4] colon --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be3459ed72ab..08b7304df76b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ ### Breaking -- [#6680](https://github.com/ChainSafe/forest/pull/6680) Made the `tokio-console` feature optional and disabled by default. Users relying on this feature must now explicitly compile Forest with `--features tokio-console` to enable it. +- [#6680](https://github.com/ChainSafe/forest/pull/6680): Made the `tokio-console` feature optional and disabled by default. Users relying on this feature must now explicitly compile Forest with `--features tokio-console` to enable it. ### Added @@ -35,7 +35,7 @@ ### Removed -- [#6681](https://github.com/ChainSafe/forest/pull/6681) Removed `tracing-chrome` feature and all related code as it was deemed unused. If you didn't set `CHROME_TRACE_FILE` manually before, you shouldn't be affected by this change. If you were using this feature, reach out. +- [#6681](https://github.com/ChainSafe/forest/pull/6681): Removed `tracing-chrome` feature and all related code as it was deemed unused. If you didn't set `CHROME_TRACE_FILE` manually before, you shouldn't be affected by this change. If you were using this feature, reach out. ### Fixed