From e4106403567d6dad2d99369ae52a2c2beef9d0a4 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 3 Jun 2026 12:05:33 +0100 Subject: [PATCH 1/2] fix: use Display formatting for tracing fields Switch tracing fields from Debug (?) to Display (%) for Address, B256, and error types so trace output is consumer-friendly (0x-prefixed hex, human-readable error messages) rather than Rust-specific (raw bytes, enum variants). Unwrap Option gas_limit to emit a plain number instead of Some(...). Remove full struct Debug dump of config. --- crates/ev-precompiles/src/mint.rs | 10 +++++----- crates/node/src/builder.rs | 16 ++++++++-------- crates/node/src/executor.rs | 2 +- crates/node/src/payload_service.rs | 4 ++-- crates/node/src/validator.rs | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/ev-precompiles/src/mint.rs b/crates/ev-precompiles/src/mint.rs index 6a499c8a..196ad986 100644 --- a/crates/ev-precompiles/src/mint.rs +++ b/crates/ev-precompiles/src/mint.rs @@ -144,16 +144,16 @@ impl MintPrecompile { caller: Address, ) -> MintPrecompileResult<()> { if caller == self.admin { - tracing::debug!(target: "mint_precompile", ?caller, "authorization granted: admin"); + tracing::debug!(target: "mint_precompile", caller = %caller, "authorization granted: admin"); return Ok(()); } let allowlisted = Self::is_allowlisted(internals, caller)?; if allowlisted { - tracing::debug!(target: "mint_precompile", ?caller, "authorization granted: allowlist"); + tracing::debug!(target: "mint_precompile", caller = %caller, "authorization granted: allowlist"); Ok(()) } else { - tracing::warn!(target: "mint_precompile", ?caller, "authorization denied: not admin and not allowlisted"); + tracing::warn!(target: "mint_precompile", caller = %caller, "authorization denied: not admin and not allowlisted"); Err(MintPrecompileError::halt_static("unauthorized caller")) } } @@ -171,7 +171,7 @@ impl MintPrecompile { let allowlisted = !raw_value.is_zero(); tracing::debug!( target: "mint_precompile", - ?addr, + addr = %addr, slot = %key, value = %raw_value, allowlisted, @@ -215,7 +215,7 @@ impl Precompile for MintPrecompile { tracing::info!( target: "mint_precompile", - ?caller, + caller = %caller, gas = gas_limit, calldata_len = data_len, "mint precompile call invoked" diff --git a/crates/node/src/builder.rs b/crates/node/src/builder.rs index 27398d62..b3a31277 100644 --- a/crates/node/src/builder.rs +++ b/crates/node/src/builder.rs @@ -52,7 +52,7 @@ where if let Some((sink, activation)) = config.base_fee_redirect_settings() { info!( target: "ev-reth", - fee_sink = ?sink, + fee_sink = %sink, activation_height = activation, "Base fee redirect enabled via chainspec" ); @@ -69,7 +69,7 @@ where #[instrument(skip(self, attributes), fields( parent_hash = %attributes.parent_hash, tx_count = attributes.transactions.len(), - gas_limit = ?attributes.gas_limit, + gas_limit = attributes.gas_limit.unwrap_or(0), duration_ms = tracing::field::Empty, ))] pub async fn build_payload( @@ -118,7 +118,7 @@ where suggested_fee_recipient = sink; info!( target: "ev-reth", - fee_sink = ?sink, + fee_sink = %sink, block_number, "Suggested fee recipient missing; defaulting to base-fee sink" ); @@ -170,10 +170,10 @@ where match builder.execute_transaction(recovered_tx) { Ok(gas_used) => { - debug!(gas_used = ?gas_used, "transaction executed successfully"); + debug!(gas_used, "transaction executed successfully"); } Err(err) => { - tracing::warn!(error = ?err, tx_hash = %tx.tx_hash(), "transaction execution failed"); + tracing::warn!(error = %err, tx_hash = %tx.tx_hash(), "transaction execution failed"); } } } @@ -192,7 +192,7 @@ where info!( block_number = sealed_block.number, - block_hash = ?sealed_block.hash(), + block_hash = %sealed_block.hash(), tx_count = sealed_block.transaction_count(), gas_used = sealed_block.gas_used, "built block" @@ -221,13 +221,13 @@ where let config = match EvolvePayloadBuilderConfig::from_chain_spec(&chain_spec) { Ok(config) => config, Err(err) => { - tracing::warn!(target: "ev-reth", error = ?err, "Failed to parse chainspec extras"); + tracing::warn!(target: "ev-reth", error = %err, "Failed to parse chainspec extras"); return None; } }; if let Err(err) = config.validate() { - tracing::warn!(target: "ev-reth", error = ?err, "Invalid evolve payload builder configuration"); + tracing::warn!(target: "ev-reth", error = %err, "Invalid evolve payload builder configuration"); return None; } diff --git a/crates/node/src/executor.rs b/crates/node/src/executor.rs index 70dbd189..082a7360 100644 --- a/crates/node/src/executor.rs +++ b/crates/node/src/executor.rs @@ -411,7 +411,7 @@ where .map(|(sink, activation)| { info!( target = "ev-reth::executor", - fee_sink = ?sink, + fee_sink = %sink, activation_height = activation, "Base fee redirect enabled" ); diff --git a/crates/node/src/payload_service.rs b/crates/node/src/payload_service.rs index e58122e4..deb4832c 100644 --- a/crates/node/src/payload_service.rs +++ b/crates/node/src/payload_service.rs @@ -45,7 +45,7 @@ impl EvolvePayloadBuilderBuilder { /// Create a new builder with evolve args. pub fn new() -> Self { let config = EvolvePayloadBuilderConfig::new(); - info!("Created Evolve payload builder with config: {:?}", config); + info!("created evolve payload builder"); Self { config } } } @@ -138,7 +138,7 @@ where if let Some(sink) = self.config.base_fee_sink_for_block(block_number) { info!( target: "ev-reth", - fee_sink = ?sink, + fee_sink = %sink, block_number, "Suggested fee recipient missing; defaulting to base-fee sink" ); diff --git a/crates/node/src/validator.rs b/crates/node/src/validator.rs index 1bc3f81a..4d3165dc 100644 --- a/crates/node/src/validator.rs +++ b/crates/node/src/validator.rs @@ -80,7 +80,7 @@ impl PayloadValidator for EvolveEngineValidator { .map_err(|e| NewPayloadError::Other(e.into())) } Err(err) => { - debug!(error = ?err, "payload validation error"); + debug!(error = %err, "payload validation error"); // Check if this is an error we can bypass for evolve: // 1. BlockHash mismatch - ev-reth computes different hash due to custom tx types @@ -96,7 +96,7 @@ impl PayloadValidator for EvolveEngineValidator { || is_unknown_tx_type_error(&err); if should_bypass { - info!(error = ?err, "bypassing validation error for ev-reth"); + info!(error = %err, "bypassing validation error for ev-reth"); // For evolve, we trust the payload builder - parse the block with EvNode support. let ev_block = parse_evolve_payload(payload)?; Span::current().record("block_hash", tracing::field::display(ev_block.hash())); From 5a5115a1d24ba929b13e350adbb6d7dd01a12686 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 3 Jun 2026 12:29:59 +0100 Subject: [PATCH 2/2] fix: revert gas_used to Debug and use shorthand Display for addresses GasOutput is a struct without Display/Value impls, so it must stay as Debug. Use shorthand %caller/%addr syntax in mint precompile instead of redundant caller = %caller. --- crates/ev-precompiles/src/mint.rs | 10 +++++----- crates/node/src/builder.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ev-precompiles/src/mint.rs b/crates/ev-precompiles/src/mint.rs index 196ad986..fd33cdf6 100644 --- a/crates/ev-precompiles/src/mint.rs +++ b/crates/ev-precompiles/src/mint.rs @@ -144,16 +144,16 @@ impl MintPrecompile { caller: Address, ) -> MintPrecompileResult<()> { if caller == self.admin { - tracing::debug!(target: "mint_precompile", caller = %caller, "authorization granted: admin"); + tracing::debug!(target: "mint_precompile", %caller, "authorization granted: admin"); return Ok(()); } let allowlisted = Self::is_allowlisted(internals, caller)?; if allowlisted { - tracing::debug!(target: "mint_precompile", caller = %caller, "authorization granted: allowlist"); + tracing::debug!(target: "mint_precompile", %caller, "authorization granted: allowlist"); Ok(()) } else { - tracing::warn!(target: "mint_precompile", caller = %caller, "authorization denied: not admin and not allowlisted"); + tracing::warn!(target: "mint_precompile", %caller, "authorization denied: not admin and not allowlisted"); Err(MintPrecompileError::halt_static("unauthorized caller")) } } @@ -171,7 +171,7 @@ impl MintPrecompile { let allowlisted = !raw_value.is_zero(); tracing::debug!( target: "mint_precompile", - addr = %addr, + %addr, slot = %key, value = %raw_value, allowlisted, @@ -215,7 +215,7 @@ impl Precompile for MintPrecompile { tracing::info!( target: "mint_precompile", - caller = %caller, + %caller, gas = gas_limit, calldata_len = data_len, "mint precompile call invoked" diff --git a/crates/node/src/builder.rs b/crates/node/src/builder.rs index b3a31277..2a57e6c4 100644 --- a/crates/node/src/builder.rs +++ b/crates/node/src/builder.rs @@ -170,7 +170,7 @@ where match builder.execute_transaction(recovered_tx) { Ok(gas_used) => { - debug!(gas_used, "transaction executed successfully"); + debug!(gas_used = ?gas_used, "transaction executed successfully"); } Err(err) => { tracing::warn!(error = %err, tx_hash = %tx.tx_hash(), "transaction execution failed");