debug_traceBlockByHash
JSON-RPC method returns detailed trace information for all transactions in a specific block. This method provides comprehensive debugging information for an entire block, including call traces, gas usage, and execution details for each transaction, making it essential for block-level analysis, forensic investigations, and bulk transaction debugging.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
- Block hash (string, required): The hash of the block to trace
- Tracer configuration (object, required): Configuration options for the tracer
Tracer configuration options
tracer
(string): The type of tracer to use"callTracer"
: Provides detailed call trace information for each transaction"prestateTracer"
: Shows state before each transaction execution"4byteTracer"
: Tracks function selector usage across all transactions
Response
The method returns an array of detailed trace information for all transactions in the specified block.Response structure
Block trace data:- Array of transaction traces, each containing:
type
— The type of call (CALL, DELEGATECALL, STATICCALL, CREATE, etc.)from
— The address that initiated the callto
— The address that received the callvalue
— The value transferred in the callgas
— The amount of gas allocated for the callgasUsed
— The amount of gas actually consumedinput
— The input data for the calloutput
— The output data returned by the callcalls
— Array of sub-calls made during execution
Usage example
Basic implementation
Example request
Shell
Use cases
Thedebug_traceBlockByHash
method is essential for applications that need to:
- Block analysis: Analyze entire blocks for patterns, gas usage, and execution details
- Forensic investigation: Investigate suspicious blocks and transaction patterns
- Performance monitoring: Monitor block execution performance and gas efficiency
- MEV analysis: Analyze Maximum Extractable Value opportunities across entire blocks
- Security auditing: Audit blocks for security issues and attack patterns
- Compliance monitoring: Monitor blocks for regulatory compliance and reporting
- Analytics platforms: Build comprehensive blockchain analytics and reporting tools
- Research tools: Support academic and commercial blockchain research
- Debugging tools: Debug complex multi-transaction scenarios and dependencies
- Gas optimization: Analyze gas usage patterns across multiple transactions
- Network monitoring: Monitor network health and transaction execution patterns
- Arbitrage detection: Identify arbitrage opportunities across block transactions
- Front-running analysis: Detect and analyze front-running patterns in blocks
- Protocol analysis: Analyze protocol behavior across multiple transactions
- Risk assessment: Assess risks and patterns in block execution
- Educational tools: Create educational content about blockchain execution patterns
Body
application/json