diff --git a/crates/revm/revm-inspectors/src/tracing/builder/geth.rs b/crates/revm/revm-inspectors/src/tracing/builder/geth.rs index 36845840b349..b6cbc7c005f1 100644 --- a/crates/revm/revm-inspectors/src/tracing/builder/geth.rs +++ b/crates/revm/revm-inspectors/src/tracing/builder/geth.rs @@ -4,9 +4,8 @@ use crate::tracing::{ types::{CallTraceNode, CallTraceStepStackItem}, TracingInspectorConfig, }; -use reth_primitives::{Address, JsonU256, H256, U256}; +use reth_primitives::{Address, H256}; use reth_rpc_types::trace::geth::*; - use std::collections::{BTreeMap, HashMap, VecDeque}; /// A type for creating geth style traces @@ -85,7 +84,7 @@ impl GethTraceBuilder { pub fn geth_traces( &self, // TODO(mattsse): This should be the total gas used, or gas used by last CallTrace? - receipt_gas_used: U256, + receipt_gas_used: u64, opts: GethDefaultTracingOptions, ) -> DefaultFrame { if self.nodes.is_empty() { @@ -102,7 +101,7 @@ impl GethTraceBuilder { DefaultFrame { // If the top-level trace succeeded, then it was a success failed: !main_trace.success, - gas: JsonU256(receipt_gas_used), + gas: receipt_gas_used, return_value: main_trace.output.clone().into(), struct_logs, } diff --git a/crates/rpc/rpc-types/src/eth/trace/geth/mod.rs b/crates/rpc/rpc-types/src/eth/trace/geth/mod.rs index b9d7e0576d8d..fe59d1742dc1 100644 --- a/crates/rpc/rpc-types/src/eth/trace/geth/mod.rs +++ b/crates/rpc/rpc-types/src/eth/trace/geth/mod.rs @@ -1,8 +1,8 @@ +//! Geth tracing types #![allow(missing_docs)] use crate::{state::StateOverride, BlockOverrides}; -/// Geth tracing types -use reth_primitives::{Bytes, JsonU256, H256, U256}; +use reth_primitives::{Bytes, H256, U256}; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; @@ -41,7 +41,7 @@ pub struct BlockTraceResult { #[serde(rename_all = "camelCase")] pub struct DefaultFrame { pub failed: bool, - pub gas: JsonU256, + pub gas: u64, pub return_value: Bytes, pub struct_logs: Vec, } diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index 8df58480661a..bc426518f218 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -9,7 +9,7 @@ use crate::{ }; use async_trait::async_trait; use jsonrpsee::core::RpcResult; -use reth_primitives::{Block, BlockId, BlockNumberOrTag, Bytes, TransactionSigned, H256, U256}; +use reth_primitives::{Block, BlockId, BlockNumberOrTag, Bytes, TransactionSigned, H256}; use reth_provider::{BlockProviderIdExt, HeaderProvider, ReceiptProviderIdExt, StateProviderBox}; use reth_revm::{ database::{State, SubState}, @@ -317,7 +317,7 @@ where self.inner.eth_api.inspect_call_at(call, at, state_overrides, &mut inspector).await?; let gas_used = res.result.gas_used(); - let frame = inspector.into_geth_builder().geth_traces(U256::from(gas_used), config); + let frame = inspector.into_geth_builder().geth_traces(gas_used, config); Ok(frame.into()) } @@ -549,7 +549,7 @@ fn trace_transaction( let (res, _) = inspect(db, env, &mut inspector)?; let gas_used = res.result.gas_used(); - let frame = inspector.into_geth_builder().geth_traces(U256::from(gas_used), config); + let frame = inspector.into_geth_builder().geth_traces(gas_used, config); Ok((frame.into(), res.state)) }