Skip to content

Commit

Permalink
feat: add debug_traceChain
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed Jun 28, 2024
1 parent cae9729 commit d212d44
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion crates/provider/src/ext/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloy_network::Network;
use alloy_primitives::{Bytes, TxHash, B256};
use alloy_rpc_types_eth::{Block, BlockNumberOrTag, TransactionRequest};
use alloy_rpc_types_trace::geth::{
GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
};
use alloy_transport::{Transport, TransportResult};

Expand All @@ -27,6 +27,13 @@ pub trait DebugApi<N, T>: Send + Sync {
/// Returns an array of recent bad blocks that the client has seen on the network.
async fn debug_get_bad_blocks(&self) -> TransportResult<Vec<Block>>;

/// Returns the structured logs created during the execution of EVM between two blocks (excluding start) as a JSON object.
async fn debug_trace_chain(
&self,
start_exclusive: BlockNumberOrTag,
end_inclusive: BlockNumberOrTag,
) -> TransportResult<Vec<BlockTraceResult>>;

/// Reruns the transaction specified by the hash and returns the trace.
///
/// It will replay any prior transactions to achieve the same state the transaction was executed
Expand Down Expand Up @@ -134,6 +141,14 @@ where
self.client().request("debug_getBadBlocks", ()).await
}

async fn debug_trace_chain(
&self,
start_exclusive: BlockNumberOrTag,
end_inclusive: BlockNumberOrTag,
) -> TransportResult<Vec<BlockTraceResult>> {
self.client().request("debug_traceChain", (start_exclusive, end_inclusive)).await
}

async fn debug_trace_transaction(
&self,
hash: TxHash,
Expand Down

0 comments on commit d212d44

Please sign in to comment.