From ae2b0954c62a7f993afbe703370755cd2c0bb760 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Mon, 15 May 2023 17:06:10 -0700 Subject: [PATCH] perf: do not compile traces in release mode (#2652) --- Cargo.toml | 3 +++ bin/reth/Cargo.toml | 5 ++++- crates/blockchain-tree/Cargo.toml | 2 +- crates/consensus/auto-seal/Cargo.toml | 2 +- crates/consensus/beacon/Cargo.toml | 2 +- crates/interfaces/Cargo.toml | 2 +- crates/net/discv4/Cargo.toml | 2 +- crates/net/dns/Cargo.toml | 2 +- crates/net/downloaders/Cargo.toml | 2 +- crates/net/ecies/Cargo.toml | 2 +- crates/net/eth-wire/Cargo.toml | 2 +- crates/net/nat/Cargo.toml | 2 +- crates/net/network/Cargo.toml | 2 +- crates/payload/basic/Cargo.toml | 2 +- crates/payload/builder/Cargo.toml | 2 +- crates/primitives/Cargo.toml | 2 +- crates/revm/Cargo.toml | 2 +- crates/rpc/ipc/Cargo.toml | 2 +- crates/rpc/rpc-builder/Cargo.toml | 2 +- crates/rpc/rpc-engine-api/Cargo.toml | 2 +- crates/rpc/rpc/Cargo.toml | 2 +- crates/staged-sync/Cargo.toml | 2 +- crates/stages/Cargo.toml | 2 +- crates/storage/provider/Cargo.toml | 2 +- crates/tasks/Cargo.toml | 2 +- crates/tracing/Cargo.toml | 2 +- crates/transaction-pool/Cargo.toml | 2 +- crates/trie/Cargo.toml | 2 +- 28 files changed, 33 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 512063420..5bbd0ac95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,3 +60,6 @@ incremental = false [patch.crates-io] # patched for quantity U256 responses ruint = { git = "https://github.com/paradigmxyz/uint" } + +[workspace.dependencies] +tracing = { version = "^0.1.0", default-features = false } diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index f51454bd7..d72255475 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -52,7 +52,7 @@ secp256k1 = { version = "0.27.0", features = [ ] } # tracing -tracing = "0.1" +tracing = { workspace = true } # io fdlimit = "0.2.1" @@ -94,3 +94,6 @@ backon = "0.4" hex = "0.4" thiserror = "1.0" pretty_assertions = "1.3.0" + +[features] +only-info-logs = ["tracing/release_max_level_info"] diff --git a/crates/blockchain-tree/Cargo.toml b/crates/blockchain-tree/Cargo.toml index b56b4f145..29dfaf783 100644 --- a/crates/blockchain-tree/Cargo.toml +++ b/crates/blockchain-tree/Cargo.toml @@ -22,7 +22,7 @@ reth-provider = { path = "../storage/provider" } # common parking_lot = { version = "0.12"} lru = "0.10" -tracing = "0.1" +tracing = { workspace = true } # mics aquamarine = "0.3.0" diff --git a/crates/consensus/auto-seal/Cargo.toml b/crates/consensus/auto-seal/Cargo.toml index a7f232458..be5b9f493 100644 --- a/crates/consensus/auto-seal/Cargo.toml +++ b/crates/consensus/auto-seal/Cargo.toml @@ -21,7 +21,7 @@ reth-transaction-pool = { path = "../../transaction-pool" } futures-util = "0.3" tokio = { version = "1", features = ["sync", "time"] } tokio-stream = "0.1" -tracing = "0.1" +tracing = { workspace = true } [dev-dependencies] reth-interfaces = { path = "../../interfaces", features = ["test-utils"] } diff --git a/crates/consensus/beacon/Cargo.toml b/crates/consensus/beacon/Cargo.toml index e65a0e82a..7e8bbed8d 100644 --- a/crates/consensus/beacon/Cargo.toml +++ b/crates/consensus/beacon/Cargo.toml @@ -25,7 +25,7 @@ tokio-stream = "0.1.10" futures = "0.3" # misc -tracing = "0.1" +tracing = { workspace = true } thiserror = "1.0" metrics = "0.20.1" schnellru = "0.2" diff --git a/crates/interfaces/Cargo.toml b/crates/interfaces/Cargo.toml index bf5ca8975..240bf257f 100644 --- a/crates/interfaces/Cargo.toml +++ b/crates/interfaces/Cargo.toml @@ -27,7 +27,7 @@ tokio-stream = "0.1.11" # misc auto_impl = "1.0" thiserror = "1.0.37" -tracing = "0.1" +tracing = { workspace = true } rand = "0.8.5" arbitrary = { version = "1.1.7", features = ["derive"], optional = true } secp256k1 = { version = "0.27.0", default-features = false, features = [ diff --git a/crates/net/discv4/Cargo.toml b/crates/net/discv4/Cargo.toml index 5a60365db..e55a4cd1c 100644 --- a/crates/net/discv4/Cargo.toml +++ b/crates/net/discv4/Cargo.toml @@ -34,7 +34,7 @@ tokio = { version = "1", features = ["io-util", "net", "time"] } tokio-stream = "0.1" # misc -tracing = "0.1" +tracing = { workspace = true } thiserror = "1.0" hex = "0.4" rand = { version = "0.8", optional = true } diff --git a/crates/net/dns/Cargo.toml b/crates/net/dns/Cargo.toml index 437b9d1d3..c5884d010 100644 --- a/crates/net/dns/Cargo.toml +++ b/crates/net/dns/Cargo.toml @@ -35,7 +35,7 @@ async-trait = "0.1" linked_hash_set = "0.1" schnellru = "0.2" thiserror = "1.0" -tracing = "0.1" +tracing = { workspace = true } parking_lot = "0.12" serde = { version = "1.0", optional = true } serde_with = { version = "2.1.0", optional = true } diff --git a/crates/net/downloaders/Cargo.toml b/crates/net/downloaders/Cargo.toml index e81663017..93b3728cc 100644 --- a/crates/net/downloaders/Cargo.toml +++ b/crates/net/downloaders/Cargo.toml @@ -23,7 +23,7 @@ tokio = { version = "1.0", features = ["sync"] } tokio-stream = "0.1" # misc -tracing = "0.1.37" +tracing = { workspace = true } metrics = "0.20.1" rayon = "1.6.0" diff --git a/crates/net/ecies/Cargo.toml b/crates/net/ecies/Cargo.toml index ccfdaff9d..b23dc6e79 100644 --- a/crates/net/ecies/Cargo.toml +++ b/crates/net/ecies/Cargo.toml @@ -19,7 +19,7 @@ tokio-util = { version = "0.7.4", features = ["codec"] } pin-project = "1.0" educe = "0.4.19" -tracing = "0.1.37" +tracing = { workspace = true } # HeaderBytes generic-array = "0.14.6" diff --git a/crates/net/eth-wire/Cargo.toml b/crates/net/eth-wire/Cargo.toml index 1daaeea69..2b0db5d9c 100644 --- a/crates/net/eth-wire/Cargo.toml +++ b/crates/net/eth-wire/Cargo.toml @@ -26,7 +26,7 @@ tokio-util = { version = "0.7.4", features = ["io", "codec"] } futures = "0.3.24" tokio-stream = "0.1.11" pin-project = "1.0" -tracing = "0.1.37" +tracing = { workspace = true } snap = "1.0.5" smol_str = "0.1" metrics = "0.20.1" diff --git a/crates/net/nat/Cargo.toml b/crates/net/nat/Cargo.toml index d98d29228..871ee205e 100644 --- a/crates/net/nat/Cargo.toml +++ b/crates/net/nat/Cargo.toml @@ -19,7 +19,7 @@ igd = { git = "https://github.com/stevefan1999-personal/rust-igd", features = [ ] } # misc -tracing = "0.1" +tracing = { workspace = true } pin-project-lite = "0.2.9" tokio = { version = "1", features = ["time"] } thiserror = "1.0" diff --git a/crates/net/network/Cargo.toml b/crates/net/network/Cargo.toml index 61dc53aa5..eaa473458 100644 --- a/crates/net/network/Cargo.toml +++ b/crates/net/network/Cargo.toml @@ -52,7 +52,7 @@ reth-metrics-derive = { path = "../../metrics/metrics-derive" } # misc auto_impl = "1" aquamarine = "0.3.0" -tracing = "0.1" +tracing = { workspace = true } fnv = "1.0" thiserror = "1.0" parking_lot = "0.12" diff --git a/crates/payload/basic/Cargo.toml b/crates/payload/basic/Cargo.toml index 9d585cbe2..4c2b0e100 100644 --- a/crates/payload/basic/Cargo.toml +++ b/crates/payload/basic/Cargo.toml @@ -30,4 +30,4 @@ futures-core = "0.3" futures-util = "0.3" ## misc -tracing = "0.1" \ No newline at end of file +tracing = { workspace = true } \ No newline at end of file diff --git a/crates/payload/builder/Cargo.toml b/crates/payload/builder/Cargo.toml index d5856c2a7..f5028283b 100644 --- a/crates/payload/builder/Cargo.toml +++ b/crates/payload/builder/Cargo.toml @@ -30,7 +30,7 @@ futures-util = "0.3" ## misc thiserror = "1.0" sha2 = { version = "0.10", default-features = false } -tracing = "0.1.37" +tracing = { workspace = true } [features] diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index fea4d9ee4..999a2b8ca 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -37,7 +37,7 @@ secp256k1 = { version = "0.27.0", default-features = false, features = [ crc = "3" # tracing -tracing = "0.1" +tracing = { workspace = true } # tokio tokio = { version = "1", default-features = false, features = ["sync"] } diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index 1a1f8c926..87a8c977d 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -19,7 +19,7 @@ reth-consensus-common = { path = "../consensus/common" } revm = { version = "3" } # common -tracing = "0.1.37" +tracing = { workspace = true } [dev-dependencies] reth-rlp = { path = "../rlp" } diff --git a/crates/rpc/ipc/Cargo.toml b/crates/rpc/ipc/Cargo.toml index bf270ef65..72ef062c5 100644 --- a/crates/rpc/ipc/Cargo.toml +++ b/crates/rpc/ipc/Cargo.toml @@ -24,7 +24,7 @@ tower = "0.4" # misc jsonrpsee = { version = "0.18", features = ["server", "client"] } serde_json = "1.0" -tracing = "0.1.37" +tracing = { workspace = true } bytes = "1.4" thiserror = "1.0.37" diff --git a/crates/rpc/rpc-builder/Cargo.toml b/crates/rpc/rpc-builder/Cargo.toml index d8760fb72..86dc98ac2 100644 --- a/crates/rpc/rpc-builder/Cargo.toml +++ b/crates/rpc/rpc-builder/Cargo.toml @@ -30,7 +30,7 @@ hyper = "0.14" strum = { version = "0.24", features = ["derive"] } serde = { version = "1.0", features = ["derive"] } thiserror = "1.0" -tracing = "0.1" +tracing = { workspace = true } [dev-dependencies] reth-tracing = { path = "../../tracing" } diff --git a/crates/rpc/rpc-engine-api/Cargo.toml b/crates/rpc/rpc-engine-api/Cargo.toml index 9a4c467ff..16a8934f1 100644 --- a/crates/rpc/rpc-engine-api/Cargo.toml +++ b/crates/rpc/rpc-engine-api/Cargo.toml @@ -24,7 +24,7 @@ async-trait = "0.1" thiserror = "1.0.37" jsonrpsee-types = "0.18" jsonrpsee-core = "0.18" -tracing = "0.1" +tracing = { workspace = true } [dev-dependencies] reth-interfaces = { path = "../../interfaces", features = ["test-utils"] } diff --git a/crates/rpc/rpc/Cargo.toml b/crates/rpc/rpc/Cargo.toml index b39ecd680..4f04da01d 100644 --- a/crates/rpc/rpc/Cargo.toml +++ b/crates/rpc/rpc/Cargo.toml @@ -56,7 +56,7 @@ serde_json = "1.0" thiserror = "1.0" hex = "0.4" rand = "0.8.5" -tracing = "0.1" +tracing = { workspace = true } tracing-futures = "0.2" schnellru = "0.2" futures = "0.3.26" diff --git a/crates/staged-sync/Cargo.toml b/crates/staged-sync/Cargo.toml index 31460b24b..561218194 100644 --- a/crates/staged-sync/Cargo.toml +++ b/crates/staged-sync/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1.0.91" walkdir = "2.3.2" eyre = "0.6.8" shellexpand = "3.0.0" -tracing = "0.1.37" +tracing = { workspace = true } # crypto rand = { version = "0.8", optional = true } diff --git a/crates/stages/Cargo.toml b/crates/stages/Cargo.toml index f2337a52b..ef4e361ef 100644 --- a/crates/stages/Cargo.toml +++ b/crates/stages/Cargo.toml @@ -31,7 +31,7 @@ futures-util = "0.3.25" pin-project = "1.0.12" # observability -tracing = "0.1.36" +tracing = { workspace = true } metrics = "0.20.1" # misc diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index ebb2a7727..6ccaffb54 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -20,7 +20,7 @@ tokio = { version = "1.21", features = ["sync", "macros", "rt-multi-thread"] } tokio-stream = { version = "0.1", features = ["sync"] } # tracing -tracing = "0.1" +tracing = { workspace = true } # misc thiserror = "1.0.37" diff --git a/crates/tasks/Cargo.toml b/crates/tasks/Cargo.toml index 64609ef8b..57338ff81 100644 --- a/crates/tasks/Cargo.toml +++ b/crates/tasks/Cargo.toml @@ -15,7 +15,7 @@ tracing-futures = "0.2" futures-util = "0.3" ## misc -tracing = { version = "0.1", default-features = false } +tracing = { workspace = true, default-features = false } thiserror = "1.0" dyn-clone = "1.0" diff --git a/crates/tracing/Cargo.toml b/crates/tracing/Cargo.toml index 016b14ada..c82bf7a6b 100644 --- a/crates/tracing/Cargo.toml +++ b/crates/tracing/Cargo.toml @@ -8,7 +8,7 @@ readme = "README.md" description = "tracing helpers" [dependencies] -tracing = { version = "0.1", default-features = false } +tracing = { workspace = true, default-features = false } tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt"] } tracing-appender = "0.2" tracing-journald = "0.3" diff --git a/crates/transaction-pool/Cargo.toml b/crates/transaction-pool/Cargo.toml index 3fe5d139b..d5ac34af9 100644 --- a/crates/transaction-pool/Cargo.toml +++ b/crates/transaction-pool/Cargo.toml @@ -36,7 +36,7 @@ reth-metrics-derive = { path = "../metrics/metrics-derive" } # misc aquamarine = "0.3.0" thiserror = "1.0" -tracing = "0.1" +tracing = { workspace = true } serde = { version = "1.0", features = ["derive", "rc"], optional = true } fnv = "1.0.7" bitflags = "1.3" diff --git a/crates/trie/Cargo.toml b/crates/trie/Cargo.toml index 75ecc4c4b..07a8f01f3 100644 --- a/crates/trie/Cargo.toml +++ b/crates/trie/Cargo.toml @@ -20,7 +20,7 @@ reth-db = { path = "../storage/db" } tokio = { version = "1.21.2", default-features = false, features = ["sync"] } # tracing -tracing = "0.1" +tracing = { workspace = true } # misc hex = "0.4"