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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.2.3"
version = "0.2.4"
edition = "2021"
rust-version = "1.81"
authors = ["init4"]
Expand Down Expand Up @@ -49,7 +49,7 @@ signet-zenith = { version = "0.2.0", path = "crates/zenith" }
ajj = { version = "0.3.4" }

# trevm
trevm = { version = "0.23.4", features = ["full_env_cfg"] }
trevm = { version = "0.23.7", features = ["full_env_cfg"] }

# Alloy periphery crates
alloy = { version = "=1.0.11", features = [
Expand Down
21 changes: 8 additions & 13 deletions crates/rpc/src/eth/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use reth_rpc_eth_api::{RpcBlock, RpcHeader, RpcReceipt, RpcTransaction};
use serde::Deserialize;
use signet_evm::EvmErrored;
use std::borrow::Cow;
use tracing::{trace_span, Instrument};
use tracing::{debug, trace_span, Instrument};
use trevm::revm::context::result::ExecutionResult;

/// Args for `eth_estimateGas` and `eth_call`.
Expand Down Expand Up @@ -447,10 +447,7 @@ where
}
};

tracing::span::Span::current().record("block_cfg", format!("{:?}", &block_cfg));

// Set up trevm

let trevm = response_tri!(ctx.trevm(id, &block_cfg));

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

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

tracing::span::Span::current().record("normalized_gas", format!("{:?}", request.gas));

let task = async move {
// Get the block cfg from backend, erroring if it fails
let block_cfg = match ctx.signet().block_cfg(id).await {
Expand All @@ -555,8 +554,6 @@ where
}
};

tracing::span::Span::current().record("block_cfg", format!("{:?}", &block_cfg));

let trevm = response_tri!(ctx.trevm(id, &block_cfg));

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

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

tracing::span::Span::current().record("estimate", format!("{:?}", &estimate));

match estimate {
trevm::EstimationResult::Success { estimation, .. } => {
ResponsePayload::Success(U64::from(estimation))
trevm::EstimationResult::Success { limit, .. } => {
ResponsePayload::Success(U64::from(limit))
}
trevm::EstimationResult::Revert { reason, .. } => {
ResponsePayload::internal_error_with_message_and_obj(
Expand Down