Skip to content

Commit dbf1832

Browse files
authored
refactor: clean up some tracing mistakes we've made (#71)
* refactor: clean up some tracing mistakes we've made * fix: update trevm * fix: minor
1 parent a1e933f commit dbf1832

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.2.3"
6+
version = "0.2.4"
77
edition = "2021"
88
rust-version = "1.81"
99
authors = ["init4"]
@@ -49,7 +49,7 @@ signet-zenith = { version = "0.2.0", path = "crates/zenith" }
4949
ajj = { version = "0.3.4" }
5050

5151
# trevm
52-
trevm = { version = "0.23.4", features = ["full_env_cfg"] }
52+
trevm = { version = "0.23.7", features = ["full_env_cfg"] }
5353

5454
# Alloy periphery crates
5555
alloy = { version = "=1.0.11", features = [

crates/rpc/src/eth/endpoints.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use reth_rpc_eth_api::{RpcBlock, RpcHeader, RpcReceipt, RpcTransaction};
2929
use serde::Deserialize;
3030
use signet_evm::EvmErrored;
3131
use std::borrow::Cow;
32-
use tracing::{trace_span, Instrument};
32+
use tracing::{debug, trace_span, Instrument};
3333
use trevm::revm::context::result::ExecutionResult;
3434

3535
/// Args for `eth_estimateGas` and `eth_call`.
@@ -447,10 +447,7 @@ where
447447
}
448448
};
449449

450-
tracing::span::Span::current().record("block_cfg", format!("{:?}", &block_cfg));
451-
452450
// Set up trevm
453-
454451
let trevm = response_tri!(ctx.trevm(id, &block_cfg));
455452

456453
let mut trevm = response_tri!(trevm.maybe_apply_state_overrides(state_overrides.as_ref()))
@@ -461,7 +458,11 @@ where
461458
// modify the gas cap.
462459
let new_gas = response_tri!(trevm.cap_tx_gas());
463460
if Some(new_gas) != request.gas {
464-
tracing::span::Span::current().record("request", format!("{:?}", &request));
461+
debug!(
462+
req_gas = ?request.gas,
463+
new_gas,
464+
"capping gas for call",
465+
);
465466
}
466467

467468
let execution_result = response_tri!(trevm.call().map_err(EvmErrored::into_error)).0;
@@ -541,8 +542,6 @@ where
541542
let max_gas = ctx.signet().config().rpc_gas_cap;
542543
normalize_gas_stateless(&mut request, max_gas);
543544

544-
tracing::span::Span::current().record("normalized_gas", format!("{:?}", request.gas));
545-
546545
let task = async move {
547546
// Get the block cfg from backend, erroring if it fails
548547
let block_cfg = match ctx.signet().block_cfg(id).await {
@@ -555,8 +554,6 @@ where
555554
}
556555
};
557556

558-
tracing::span::Span::current().record("block_cfg", format!("{:?}", &block_cfg));
559-
560557
let trevm = response_tri!(ctx.trevm(id, &block_cfg));
561558

562559
// Apply state and block overrides (state overrides are fallible as
@@ -570,11 +567,9 @@ where
570567

571568
let (estimate, _) = response_tri!(trevm.estimate_gas().map_err(EvmErrored::into_error));
572569

573-
tracing::span::Span::current().record("estimate", format!("{:?}", &estimate));
574-
575570
match estimate {
576-
trevm::EstimationResult::Success { estimation, .. } => {
577-
ResponsePayload::Success(U64::from(estimation))
571+
trevm::EstimationResult::Success { limit, .. } => {
572+
ResponsePayload::Success(U64::from(limit))
578573
}
579574
trevm::EstimationResult::Revert { reason, .. } => {
580575
ResponsePayload::internal_error_with_message_and_obj(

0 commit comments

Comments
 (0)