Skip to content
Open
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
9 changes: 9 additions & 0 deletions crates/rpc/src/eth/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ use tracing::{Instrument, debug, trace_span};
use trevm::{EstimationResult, MIN_TRANSACTION_GAS, revm::context::result::ExecutionResult};

/// Args for `eth_estimateGas` and `eth_call`.
///
/// **Note on default block parameters:**
/// - `eth_call` defaults to `latest` - used for inspecting current chain state
/// - `eth_estimateGas` defaults to `pending` - used for estimating new transactions with newest header info
/// - `eth_createAccessList` (when implemented) would default to `pending` - same rationale as estimateGas
#[derive(Debug, Deserialize)]
pub(super) struct TxParams(
TransactionRequest,
Expand Down Expand Up @@ -424,6 +429,8 @@ where
Host: FullNodeComponents,
Signet: Pnt,
{
// eth_call defaults to `latest` for current state inspection
// (differs from eth_estimateGas which uses `pending` for new transactions)
let id = block.unwrap_or(BlockId::latest());

// this span is verbose yo.
Expand Down Expand Up @@ -526,6 +533,8 @@ where
Host: FullNodeComponents,
Signet: Pnt,
{
// eth_estimateGas defaults to `pending` for new transaction estimation
// (differs from eth_call which uses `latest` for current state inspection)
let id = block.unwrap_or(BlockId::pending());

// this span is verbose yo.
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ where
.route("signTransaction", not_supported)
.route("signTypedData", not_supported)
.route("getProof", not_supported)
// eth_createAccessList would use `pending` when implemented (like estimateGas)
.route("createAccessList", not_supported)
.route("newPendingTransactionFilter", not_supported)
}
Loading