Skip to content

Commit

Permalink
feat: add debug_traceBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed Jun 28, 2024
1 parent d212d44 commit e2a4aac
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/provider/src/ext/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ pub trait DebugApi<N, T>: Send + Sync {
end_inclusive: BlockNumberOrTag,
) -> TransportResult<Vec<BlockTraceResult>>;

/// The debug_traceBlock method will return a full stack trace of all invoked opcodes of all transaction that were included in this block.
///
/// This expects an RLP-encoded block.
///
/// # Note
///
/// The parent of this block must be present, or it will fail.
async fn debug_trace_block(
&self,
rlp_block: &[u8],
trace_options: GethDebugTracingOptions,
) -> TransportResult<Vec<TraceResult>>;

/// 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 @@ -149,6 +162,14 @@ where
self.client().request("debug_traceChain", (start_exclusive, end_inclusive)).await
}

async fn debug_trace_block(
&self,
rlp_block: &[u8],
trace_options: GethDebugTracingOptions,
) -> TransportResult<Vec<TraceResult>> {
self.client().request("debug_traceBlock", (rlp_block, trace_options)).await
}

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

0 comments on commit e2a4aac

Please sign in to comment.