Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions bin/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ op-rbuilder.workspace = true

# reth
reth-cli-util.workspace = true
reth-optimism-cli = { workspace = true, optional = true }

[build-dependencies]
vergen = { workspace = true, features = ["build", "cargo", "emit_and_set"] }
Expand All @@ -28,4 +27,3 @@ vergen-git2.workspace = true
[features]
default = [ "jemalloc" ]
jemalloc = [ "op-rbuilder/jemalloc", "reth-cli-util/jemalloc" ]
telemetry = [ "op-rbuilder/telemetry", "reth-optimism-cli" ]
6 changes: 2 additions & 4 deletions crates/builder/op-rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ reth-rpc-api.workspace = true
reth-rpc-eth-types.workspace = true
reth-optimism-rpc.workspace = true
reth-tasks.workspace = true
reth-tracing-otlp = { workspace = true, optional = true }
reth-tracing-otlp.workspace = true

alloy-primitives.workspace = true
alloy-consensus.workspace = true
Expand Down Expand Up @@ -110,7 +110,7 @@ thiserror.workspace = true
parking_lot.workspace = true
url.workspace = true
anyhow = "1"
opentelemetry = { workspace = true, optional = true }
opentelemetry.workspace = true
dashmap.workspace = true
concurrent-queue.workspace = true
hex = { workspace = true }
Expand Down Expand Up @@ -197,8 +197,6 @@ testing = [

interop = []

telemetry = [ "opentelemetry", "reth-tracing-otlp" ]

custom-engine-api = []

[[bin]]
Expand Down
6 changes: 2 additions & 4 deletions crates/builder/op-rbuilder/src/flashblocks/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,8 @@ where
let block_build_start_time = Instant::now();
let BuildArguments { mut cached_reads, config, cancel: block_cancel } = args;

// We log only every 100th block to reduce usage
let span = if cfg!(feature = "telemetry")
&& config.parent_header.number.is_multiple_of(self.config.sampling_ratio)
{
// We log only every Nth block based on sampling ratio to reduce usage
let span = if config.parent_header.number.is_multiple_of(self.config.sampling_ratio) {
span!(Level::INFO, "build_payload")
} else {
tracing::Span::none()
Expand Down
10 changes: 3 additions & 7 deletions crates/builder/op-rbuilder/src/launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,17 @@ use crate::{
pub fn launch() -> Result<()> {
let cli = Cli::parsed();

#[cfg(feature = "telemetry")]
let telemetry_args = match &cli.command {
reth_optimism_cli::commands::Commands::Node(node_command) => {
node_command.ext.telemetry.clone()
}
_ => Default::default(),
};

#[cfg(not(feature = "telemetry"))]
let cli_app = cli.configure();

#[cfg(feature = "telemetry")]
let mut cli_app = cli.configure();
#[cfg(feature = "telemetry")]
{

// Only setup telemetry if an OTLP endpoint is provided
if telemetry_args.otlp_endpoint.is_some() {
use crate::primitives::telemetry::setup_telemetry_layer;
let telemetry_layer = setup_telemetry_layer(&telemetry_args)?;
cli_app.access_tracing_layers()?.add_layer(telemetry_layer);
Expand Down
1 change: 0 additions & 1 deletion crates/builder/op-rbuilder/src/primitives/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod bundle;
pub mod reth;
#[cfg(feature = "telemetry")]
pub mod telemetry;
3 changes: 3 additions & 0 deletions crates/client/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ test-utils = [
"dep:reth-tasks",
"dep:tower",
"dep:tracing-subscriber",
"reth-chainspec/test-utils",
"reth-db/test-utils",
"reth-evm/test-utils",
"reth-node-builder/test-utils",
"reth-optimism-node/test-utils",
"reth-primitives-traits?/test-utils",
"reth-provider/test-utils",
"reth-transaction-pool/test-utils",
]

[dependencies]
Expand Down
Loading