feat: add support for wrapping the allocator with tracy (#10874)

This commit is contained in:
DaniPopes
2024-09-13 18:12:33 +02:00
committed by GitHub
parent 12e8af4a24
commit 87e5e0929f
13 changed files with 204 additions and 73 deletions

127
Cargo.lock generated
View File

@ -3213,6 +3213,19 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9"
[[package]]
name = "generator"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbb949699c3e4df3a183b1d2142cb24277057055ed23c68ed58894f76c517223"
dependencies = [
"cfg-if",
"libc",
"log",
"rustversion",
"windows 0.58.0",
]
[[package]] [[package]]
name = "generic-array" name = "generic-array"
version = "0.14.7" version = "0.14.7"
@ -4550,6 +4563,19 @@ version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "loom"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
dependencies = [
"cfg-if",
"generator",
"scoped-tls",
"tracing",
"tracing-subscriber",
]
[[package]] [[package]]
name = "lru" name = "lru"
version = "0.12.4" version = "0.12.4"
@ -5162,7 +5188,6 @@ dependencies = [
"reth-optimism-cli", "reth-optimism-cli",
"reth-optimism-rpc", "reth-optimism-rpc",
"reth-provider", "reth-provider",
"tikv-jemallocator",
] ]
[[package]] [[package]]
@ -6190,7 +6215,6 @@ dependencies = [
"serde_json", "serde_json",
"similar-asserts", "similar-asserts",
"tempfile", "tempfile",
"tikv-jemallocator",
"tokio", "tokio",
"tracing", "tracing",
] ]
@ -6300,7 +6324,6 @@ dependencies = [
name = "reth-bench" name = "reth-bench"
version = "1.0.6" version = "1.0.6"
dependencies = [ dependencies = [
"alloy-consensus",
"alloy-eips", "alloy-eips",
"alloy-json-rpc", "alloy-json-rpc",
"alloy-provider", "alloy-provider",
@ -6316,23 +6339,18 @@ dependencies = [
"csv", "csv",
"eyre", "eyre",
"futures", "futures",
"libc",
"reqwest", "reqwest",
"reth-cli-runner", "reth-cli-runner",
"reth-db", "reth-cli-util",
"reth-node-api", "reth-node-api",
"reth-node-core", "reth-node-core",
"reth-primitives", "reth-primitives",
"reth-provider",
"reth-rpc-types", "reth-rpc-types",
"reth-rpc-types-compat", "reth-rpc-types-compat",
"reth-tracing", "reth-tracing",
"serde", "serde",
"serde_json",
"thiserror", "thiserror",
"tikv-jemallocator",
"tokio", "tokio",
"tokio-util",
"tower 0.4.13", "tower 0.4.13",
"tracing", "tracing",
] ]
@ -6514,12 +6532,15 @@ version = "1.0.6"
dependencies = [ dependencies = [
"alloy-eips", "alloy-eips",
"alloy-primitives", "alloy-primitives",
"cfg-if",
"eyre", "eyre",
"libc", "libc",
"rand 0.8.5", "rand 0.8.5",
"reth-fs-util", "reth-fs-util",
"secp256k1", "secp256k1",
"thiserror", "thiserror",
"tikv-jemallocator",
"tracy-client",
] ]
[[package]] [[package]]
@ -9352,6 +9373,12 @@ dependencies = [
"hashbrown 0.13.2", "hashbrown 0.13.2",
] ]
[[package]]
name = "scoped-tls"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.2.0" version = "1.2.0"
@ -10154,9 +10181,9 @@ dependencies = [
[[package]] [[package]]
name = "tikv-jemalloc-ctl" name = "tikv-jemalloc-ctl"
version = "0.5.4" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "619bfed27d807b54f7f776b9430d4f8060e66ee138a28632ca898584d462c31c" checksum = "f21f216790c8df74ce3ab25b534e0718da5a1916719771d3fec23315c99e468b"
dependencies = [ dependencies = [
"libc", "libc",
"paste", "paste",
@ -10165,9 +10192,9 @@ dependencies = [
[[package]] [[package]]
name = "tikv-jemalloc-sys" name = "tikv-jemalloc-sys"
version = "0.5.4+5.3.0-patched" version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
@ -10175,9 +10202,9 @@ dependencies = [
[[package]] [[package]]
name = "tikv-jemallocator" name = "tikv-jemallocator"
version = "0.5.4" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca" checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865"
dependencies = [ dependencies = [
"libc", "libc",
"tikv-jemalloc-sys", "tikv-jemalloc-sys",
@ -10576,6 +10603,27 @@ dependencies = [
"tracing-serde", "tracing-serde",
] ]
[[package]]
name = "tracy-client"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "373db47331c3407b343538df77eea2516884a0b126cdfb4b135acfd400015dd7"
dependencies = [
"loom",
"once_cell",
"rustc-demangle",
"tracy-client-sys",
]
[[package]]
name = "tracy-client-sys"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49cf0064dcb31c99aa1244c1b93439359e53f72ed217eef5db50abd442241e9a"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "triehash" name = "triehash"
version = "0.8.4" version = "0.8.4"
@ -11056,6 +11104,16 @@ dependencies = [
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
[[package]]
name = "windows"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"
dependencies = [
"windows-core 0.58.0",
"windows-targets 0.52.6",
]
[[package]] [[package]]
name = "windows-core" name = "windows-core"
version = "0.52.0" version = "0.52.0"
@ -11071,12 +11129,25 @@ version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"
dependencies = [ dependencies = [
"windows-implement", "windows-implement 0.57.0",
"windows-interface", "windows-interface 0.57.0",
"windows-result 0.1.2", "windows-result 0.1.2",
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
[[package]]
name = "windows-core"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
dependencies = [
"windows-implement 0.58.0",
"windows-interface 0.58.0",
"windows-result 0.2.0",
"windows-strings",
"windows-targets 0.52.6",
]
[[package]] [[package]]
name = "windows-implement" name = "windows-implement"
version = "0.57.0" version = "0.57.0"
@ -11088,6 +11159,17 @@ dependencies = [
"syn 2.0.77", "syn 2.0.77",
] ]
[[package]]
name = "windows-implement"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
]
[[package]] [[package]]
name = "windows-interface" name = "windows-interface"
version = "0.57.0" version = "0.57.0"
@ -11099,6 +11181,17 @@ dependencies = [
"syn 2.0.77", "syn 2.0.77",
] ]
[[package]]
name = "windows-interface"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
]
[[package]] [[package]]
name = "windows-registry" name = "windows-registry"
version = "0.2.0" version = "0.2.0"

View File

@ -470,6 +470,7 @@ bitflags = "2.4"
boyer-moore-magiclen = "0.2.16" boyer-moore-magiclen = "0.2.16"
bytes = "1.5" bytes = "1.5"
clap = "4" clap = "4"
cfg-if = "1.0"
const_format = { version = "0.2.32", features = ["rust_1_64"] } const_format = { version = "0.2.32", features = ["rust_1_64"] }
dashmap = "6.0" dashmap = "6.0"
derive_more = { version = "1", features = ["full"] } derive_more = { version = "1", features = ["full"] }
@ -482,7 +483,9 @@ humantime-serde = "1.1"
itertools = "0.13" itertools = "0.13"
linked_hash_set = "0.1" linked_hash_set = "0.1"
modular-bitfield = "0.11.2" modular-bitfield = "0.11.2"
notify = { version = "6.1.1", default-features = false, features = ["macos_fsevent"] } notify = { version = "6.1.1", default-features = false, features = [
"macos_fsevent",
] }
nybbles = "0.2.1" nybbles = "0.2.1"
once_cell = "1.19" once_cell = "1.19"
parking_lot = "0.12" parking_lot = "0.12"
@ -576,4 +579,7 @@ serial_test = "3"
similar-asserts = "1.5.0" similar-asserts = "1.5.0"
tempfile = "3.8" tempfile = "3.8"
test-fuzz = "5" test-fuzz = "5"
tikv-jemallocator = { version = "0.5.0" }
tikv-jemalloc-ctl = "0.6"
tikv-jemallocator = "0.6"
tracy-client = "0.17.3"

View File

@ -14,9 +14,8 @@ workspace = true
[dependencies] [dependencies]
# reth # reth
reth-provider = { workspace = true }
reth-cli-runner.workspace = true reth-cli-runner.workspace = true
reth-db = { workspace = true, features = ["mdbx"] } reth-cli-util.workspace = true
reth-node-core.workspace = true reth-node-core.workspace = true
reth-node-api.workspace = true reth-node-api.workspace = true
reth-rpc-types.workspace = true reth-rpc-types.workspace = true
@ -25,7 +24,10 @@ reth-primitives = { workspace = true, features = ["alloy-compat"] }
reth-tracing.workspace = true reth-tracing.workspace = true
# alloy # alloy
alloy-provider = { workspace = true, features = ["engine-api", "reqwest-rustls-tls"], default-features = false } alloy-provider = { workspace = true, features = [
"engine-api",
"reqwest-rustls-tls",
], default-features = false }
alloy-rpc-types-engine.workspace = true alloy-rpc-types-engine.workspace = true
alloy-transport.workspace = true alloy-transport.workspace = true
alloy-transport-http.workspace = true alloy-transport-http.workspace = true
@ -34,7 +36,6 @@ alloy-transport-ipc.workspace = true
alloy-pubsub.workspace = true alloy-pubsub.workspace = true
alloy-json-rpc.workspace = true alloy-json-rpc.workspace = true
alloy-rpc-client.workspace = true alloy-rpc-client.workspace = true
alloy-consensus.workspace = true
alloy-eips.workspace = true alloy-eips.workspace = true
# reqwest # reqwest
@ -50,7 +51,6 @@ tracing.workspace = true
# io # io
serde.workspace = true serde.workspace = true
serde_json.workspace = true
# async # async
tokio = { workspace = true, features = [ tokio = { workspace = true, features = [
@ -59,7 +59,6 @@ tokio = { workspace = true, features = [
"time", "time",
"rt-multi-thread", "rt-multi-thread",
] } ] }
tokio-util.workspace = true
futures.workspace = true futures.workspace = true
async-trait.workspace = true async-trait.workspace = true
@ -71,10 +70,6 @@ clap = { workspace = true, features = ["derive", "env"] }
# for writing data # for writing data
csv = "1.3.0" csv = "1.3.0"
[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
libc = "0.2"
[dev-dependencies] [dev-dependencies]
reth-tracing.workspace = true reth-tracing.workspace = true
@ -83,8 +78,9 @@ default = ["jemalloc"]
asm-keccak = ["reth-primitives/asm-keccak"] asm-keccak = ["reth-primitives/asm-keccak"]
jemalloc = ["dep:tikv-jemallocator"] jemalloc = ["reth-cli-util/jemalloc"]
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"] jemalloc-prof = ["reth-cli-util/jemalloc-prof"]
tracy-allocator = ["reth-cli-util/tracy-allocator"]
min-error-logs = ["tracing/release_max_level_error"] min-error-logs = ["tracing/release_max_level_error"]
min-warn-logs = ["tracing/release_max_level_warn"] min-warn-logs = ["tracing/release_max_level_warn"]
@ -92,11 +88,7 @@ min-info-logs = ["tracing/release_max_level_info"]
min-debug-logs = ["tracing/release_max_level_debug"] min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"] min-trace-logs = ["tracing/release_max_level_trace"]
optimism = [ optimism = ["reth-primitives/optimism", "reth-node-core/optimism"]
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-node-core/optimism",
]
# no-op feature flag for switching between the `optimism` and default functionality in CI matrices # no-op feature flag for switching between the `optimism` and default functionality in CI matrices
ethereum = [] ethereum = []

View File

@ -3,10 +3,16 @@
//! This is a tool that converts existing blocks into a stream of blocks for benchmarking purposes. //! This is a tool that converts existing blocks into a stream of blocks for benchmarking purposes.
//! These blocks are then fed into reth as a stream of execution payloads. //! These blocks are then fed into reth as a stream of execution payloads.
// We use jemalloc for performance reasons. #![doc(
#[cfg(all(feature = "jemalloc", unix))] html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#[global_allocator] #[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
pub mod authenticated_transport; pub mod authenticated_transport;
pub mod bench; pub mod bench;

View File

@ -91,9 +91,6 @@ clap = { workspace = true, features = ["derive", "env"] }
backon.workspace = true backon.workspace = true
similar-asserts.workspace = true similar-asserts.workspace = true
[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
[dev-dependencies] [dev-dependencies]
reth-discv4.workspace = true reth-discv4.workspace = true
tempfile.workspace = true tempfile.workspace = true
@ -105,8 +102,13 @@ dev = ["reth-cli-commands/dev"]
asm-keccak = ["reth-node-core/asm-keccak", "reth-primitives/asm-keccak"] asm-keccak = ["reth-node-core/asm-keccak", "reth-primitives/asm-keccak"]
jemalloc = ["dep:tikv-jemallocator", "reth-node-core/jemalloc", "reth-node-metrics/jemalloc"] jemalloc = [
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"] "reth-cli-util/jemalloc",
"reth-node-core/jemalloc",
"reth-node-metrics/jemalloc",
]
jemalloc-prof = ["reth-cli-util/jemalloc"]
tracy-allocator = ["reth-cli-util/tracy-allocator"]
min-error-logs = ["tracing/release_max_level_error"] min-error-logs = ["tracing/release_max_level_error"]
min-warn-logs = ["tracing/release_max_level_warn"] min-warn-logs = ["tracing/release_max_level_warn"]

View File

@ -146,7 +146,6 @@ pub mod transaction_pool {
/// Re-export of `reth_rpc_*` crates. /// Re-export of `reth_rpc_*` crates.
pub mod rpc { pub mod rpc {
/// Re-exported from `reth_rpc_builder`. /// Re-exported from `reth_rpc_builder`.
pub mod builder { pub mod builder {
pub use reth_rpc_builder::*; pub use reth_rpc_builder::*;
@ -190,8 +189,5 @@ pub mod rpc {
#[doc(inline)] #[doc(inline)]
pub use reth_cli_runner::{tokio_runtime, CliContext, CliRunner}; pub use reth_cli_runner::{tokio_runtime, CliContext, CliRunner};
#[cfg(all(feature = "jemalloc", unix))]
use tikv_jemallocator as _;
// for rendering diagrams // for rendering diagrams
use aquamarine as _; use aquamarine as _;

View File

@ -1,12 +1,13 @@
#![allow(missing_docs)] #![allow(missing_docs)]
// We use jemalloc for performance reasons.
#[cfg(all(feature = "jemalloc", unix))]
#[global_allocator] #[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
/// clap [Args] for Engine related arguments. use clap::{Args, Parser};
use clap::Args; use reth::{args::utils::DefaultChainSpecParser, cli::Cli};
use reth_node_builder::EngineNodeLauncher;
use reth_node_ethereum::{node::EthereumAddOns, EthereumNode};
use reth_provider::providers::BlockchainProvider2;
/// Parameters for configuring the engine /// Parameters for configuring the engine
#[derive(Debug, Clone, Args, PartialEq, Eq, Default)] #[derive(Debug, Clone, Args, PartialEq, Eq, Default)]
@ -18,12 +19,6 @@ pub struct EngineArgs {
} }
fn main() { fn main() {
use clap::Parser;
use reth::{args::utils::DefaultChainSpecParser, cli::Cli};
use reth_node_builder::EngineNodeLauncher;
use reth_node_ethereum::{node::EthereumAddOns, EthereumNode};
use reth_provider::providers::BlockchainProvider2;
reth_cli_util::sigsegv_handler::install(); reth_cli_util::sigsegv_handler::install();
// Enable backtraces unless a RUST_BACKTRACE value has already been explicitly provided. // Enable backtraces unless a RUST_BACKTRACE value has already been explicitly provided.

View File

@ -18,12 +18,21 @@ reth-fs-util.workspace = true
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-eips.workspace = true alloy-eips.workspace = true
secp256k1 = { workspace = true, features = ["rand"] }
rand.workspace = true
# misc # misc
thiserror.workspace = true cfg-if.workspace = true
eyre.workspace = true eyre.workspace = true
rand.workspace = true
secp256k1 = { workspace = true, features = ["rand"] }
thiserror.workspace = true
tracy-client = { workspace = true, optional = true, features = ["demangle"] }
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
libc = "0.2" libc = "0.2"
[features]
jemalloc = ["dep:tikv-jemallocator"]
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"]
tracy-allocator = ["dep:tracy-client"]

View File

@ -0,0 +1,35 @@
//! Custom allocator implementation.
// We use jemalloc for performance reasons.
cfg_if::cfg_if! {
if #[cfg(all(feature = "jemalloc", unix))] {
type AllocatorInner = tikv_jemallocator::Jemalloc;
} else {
type AllocatorInner = std::alloc::System;
}
}
cfg_if::cfg_if! {
if #[cfg(feature = "tracy-allocator")] {
type AllocatorWrapper = tracy_client::ProfiledAllocator<AllocatorInner>;
const fn new_allocator_wrapper() -> AllocatorWrapper {
AllocatorWrapper::new(AllocatorInner {}, 100)
}
} else {
type AllocatorWrapper = AllocatorInner;
const fn new_allocator_wrapper() -> AllocatorWrapper {
AllocatorInner {}
}
}
}
#[cfg(feature = "tracy-allocator")]
tracy_client::register_demangler!();
/// Custom allocator.
pub type Allocator = AllocatorWrapper;
/// Creates a new [custom allocator][Allocator].
pub const fn new_allocator() -> Allocator {
new_allocator_wrapper()
}

View File

@ -8,6 +8,8 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
pub mod allocator;
/// Helper function to load a secret key from a file. /// Helper function to load a secret key from a file.
pub mod load_secret_key; pub mod load_secret_key;
pub use load_secret_key::get_secret_key; pub use load_secret_key::get_secret_key;

View File

@ -28,7 +28,7 @@ tracing.workspace = true
eyre.workspace = true eyre.workspace = true
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
tikv-jemalloc-ctl = { version = "0.5.0", optional = true } tikv-jemalloc-ctl = { workspace = true, optional = true, features = ["stats"] }
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]
procfs = "0.16.0" procfs = "0.16.0"
@ -45,6 +45,5 @@ workspace = true
[features] [features]
jemalloc = ["dep:tikv-jemalloc-ctl"] jemalloc = ["dep:tikv-jemalloc-ctl"]
[build-dependencies] [build-dependencies]
vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] } vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] }

View File

@ -18,17 +18,15 @@ reth-node-optimism.workspace = true
clap = { workspace = true, features = ["derive", "env"] } clap = { workspace = true, features = ["derive", "env"] }
[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
[lints] [lints]
workspace = true workspace = true
[features] [features]
default = ["jemalloc"] default = ["jemalloc"]
jemalloc = ["dep:tikv-jemallocator"] jemalloc = ["reth-cli-util/jemalloc"]
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"] jemalloc-prof = ["reth-cli-util/jemalloc-prof"]
tracy-allocator = ["reth-cli-util/tracy-allocator"]
asm-keccak = ["reth-optimism-cli/asm-keccak", "reth-node-optimism/asm-keccak"] asm-keccak = ["reth-optimism-cli/asm-keccak", "reth-node-optimism/asm-keccak"]

View File

@ -10,10 +10,8 @@ use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};
use reth_optimism_rpc::SequencerClient; use reth_optimism_rpc::SequencerClient;
use reth_provider::providers::BlockchainProvider2; use reth_provider::providers::BlockchainProvider2;
// We use jemalloc for performance reasons
#[cfg(all(feature = "jemalloc", unix))]
#[global_allocator] #[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
fn main() { fn main() {
reth_cli_util::sigsegv_handler::install(); reth_cli_util::sigsegv_handler::install();