Skip to main content

Module rpc_trace

Module rpc_trace 

Source
Expand description

Conversion from geth callTracer output into a CallTraceArena.

This lets traces fetched over RPC (via debug_traceCall / debug_traceTransaction with the callTracer) be decoded and rendered with the same machinery used for locally executed traces. callTracer does not record opcode-level steps, so CallTrace::steps is left empty; everything the call-tree view needs (calls, value, gas, logs, revert reasons) is preserved.

Also hosts the shared classification of the RPC rejections a debug_trace* request can hit, so cast call --debug-trace-call and cast run --debug-trace-transaction surface the same actionable hints.

Re-exportsΒ§

use alloy_primitives::Address; πŸ”’
use alloy_primitives::Bytes; πŸ”’
use alloy_primitives::LogData; πŸ”’
use alloy_primitives::U256; πŸ”’
use alloy_rpc_types::trace::geth::CallConfig; πŸ”’
use alloy_rpc_types::trace::geth::CallFrame; πŸ”’
use alloy_rpc_types::trace::geth::CallLogFrame; πŸ”’
use alloy_transport::TransportError; πŸ”’
use foundry_evm::traces::CallKind; πŸ”’
use foundry_evm::traces::CallLog; πŸ”’
use foundry_evm::traces::CallTrace; πŸ”’
use foundry_evm::traces::CallTraceArena; πŸ”’
use foundry_evm::traces::CallTraceNode; πŸ”’
use foundry_evm::traces::TraceMemberOrder; πŸ”’
use revm::interpreter::InstructionResult; πŸ”’

FunctionsΒ§

call_frame_to_arena
Builds a CallTraceArena from a geth callTracer [CallFrame] tree, overriding the root frame’s address with root_address when the tracer omitted it.
call_kind πŸ”’
Maps a callTracer call type string to a CallKind, ignoring case: geth reports DELEGATECALL, ZKsync delegateCall.
call_log πŸ”’
Maps a geth callTracer log frame to a CallLog.
call_tracer_config
Returns the callTracer config for remote traces: every nested call, with its logs.
is_method_not_found_error
Returns whether an RPC transport error reports JSON-RPC method-not-found.
is_missing_state_error
Returns true if err looks like a missing-historical-state rejection, hit whenever a debug_trace* request targets a block whose state a full node has pruned.
is_missing_state_message
Returns true if message reads like a node rejecting a request for state it has pruned.
push_frame πŸ”’
Pushes frame and all of its children into nodes, returning the index of the pushed node.
status_from_frame πŸ”’
Maps a callTracer frame to the InstructionResult used for the rendered [status] label.