mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add support for wrapping the allocator with tracy (#10874)
This commit is contained in:
@ -14,9 +14,8 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-provider = { 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-api.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
@ -25,7 +24,10 @@ reth-primitives = { workspace = true, features = ["alloy-compat"] }
|
||||
reth-tracing.workspace = true
|
||||
|
||||
# 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-transport.workspace = true
|
||||
alloy-transport-http.workspace = true
|
||||
@ -34,7 +36,6 @@ alloy-transport-ipc.workspace = true
|
||||
alloy-pubsub.workspace = true
|
||||
alloy-json-rpc.workspace = true
|
||||
alloy-rpc-client.workspace = true
|
||||
alloy-consensus.workspace = true
|
||||
alloy-eips.workspace = true
|
||||
|
||||
# reqwest
|
||||
@ -50,7 +51,6 @@ tracing.workspace = true
|
||||
|
||||
# io
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
||||
# async
|
||||
tokio = { workspace = true, features = [
|
||||
@ -59,7 +59,6 @@ tokio = { workspace = true, features = [
|
||||
"time",
|
||||
"rt-multi-thread",
|
||||
] }
|
||||
tokio-util.workspace = true
|
||||
futures.workspace = true
|
||||
async-trait.workspace = true
|
||||
|
||||
@ -71,10 +70,6 @@ clap = { workspace = true, features = ["derive", "env"] }
|
||||
# for writing data
|
||||
csv = "1.3.0"
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
tikv-jemallocator = { workspace = true, optional = true }
|
||||
libc = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
reth-tracing.workspace = true
|
||||
|
||||
@ -83,8 +78,9 @@ default = ["jemalloc"]
|
||||
|
||||
asm-keccak = ["reth-primitives/asm-keccak"]
|
||||
|
||||
jemalloc = ["dep:tikv-jemallocator"]
|
||||
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"]
|
||||
jemalloc = ["reth-cli-util/jemalloc"]
|
||||
jemalloc-prof = ["reth-cli-util/jemalloc-prof"]
|
||||
tracy-allocator = ["reth-cli-util/tracy-allocator"]
|
||||
|
||||
min-error-logs = ["tracing/release_max_level_error"]
|
||||
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-trace-logs = ["tracing/release_max_level_trace"]
|
||||
|
||||
optimism = [
|
||||
"reth-primitives/optimism",
|
||||
"reth-provider/optimism",
|
||||
"reth-node-core/optimism",
|
||||
]
|
||||
optimism = ["reth-primitives/optimism", "reth-node-core/optimism"]
|
||||
|
||||
# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
|
||||
ethereum = []
|
||||
|
||||
@ -3,10 +3,16 @@
|
||||
//! 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.
|
||||
|
||||
// We use jemalloc for performance reasons.
|
||||
#[cfg(all(feature = "jemalloc", unix))]
|
||||
#![doc(
|
||||
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]
|
||||
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 bench;
|
||||
|
||||
@ -91,9 +91,6 @@ clap = { workspace = true, features = ["derive", "env"] }
|
||||
backon.workspace = true
|
||||
similar-asserts.workspace = true
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
tikv-jemallocator = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
reth-discv4.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"]
|
||||
|
||||
jemalloc = ["dep:tikv-jemallocator", "reth-node-core/jemalloc", "reth-node-metrics/jemalloc"]
|
||||
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"]
|
||||
jemalloc = [
|
||||
"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-warn-logs = ["tracing/release_max_level_warn"]
|
||||
|
||||
@ -146,7 +146,6 @@ pub mod transaction_pool {
|
||||
|
||||
/// Re-export of `reth_rpc_*` crates.
|
||||
pub mod rpc {
|
||||
|
||||
/// Re-exported from `reth_rpc_builder`.
|
||||
pub mod builder {
|
||||
pub use reth_rpc_builder::*;
|
||||
@ -190,8 +189,5 @@ pub mod rpc {
|
||||
#[doc(inline)]
|
||||
pub use reth_cli_runner::{tokio_runtime, CliContext, CliRunner};
|
||||
|
||||
#[cfg(all(feature = "jemalloc", unix))]
|
||||
use tikv_jemallocator as _;
|
||||
|
||||
// for rendering diagrams
|
||||
use aquamarine as _;
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
#![allow(missing_docs)]
|
||||
|
||||
// We use jemalloc for performance reasons.
|
||||
#[cfg(all(feature = "jemalloc", unix))]
|
||||
#[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;
|
||||
use clap::{Args, 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;
|
||||
|
||||
/// Parameters for configuring the engine
|
||||
#[derive(Debug, Clone, Args, PartialEq, Eq, Default)]
|
||||
@ -18,12 +19,6 @@ pub struct EngineArgs {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
// Enable backtraces unless a RUST_BACKTRACE value has already been explicitly provided.
|
||||
|
||||
Reference in New Issue
Block a user