Requirements
The examples in this guide call the debug JSON-RPC endpoints directly withcurl — no SDK or additional libraries are required. Optionally install jq to pretty-print the JSON responses:
What You Can Trace
Transaction Execution
- Step-by-step opcode execution
- Contract call hierarchy
- Gas consumption breakdown
- State changes and storage access
Contract Interactions
- Cross-contract calls and returns
- Event emission analysis
- Precompile usage tracking
- External library calls
Performance Analysis
- Gas optimization opportunities
- Bottleneck identification
- Cache hit/miss patterns
- State access efficiency
Security Analysis
- Suspicious operation detection
- Reentrancy pattern analysis
- Access control verification
- Vulnerability scanning
Available Tracing Methods
When
debug_traceBlockByNumber or debug_traceBlockByHash run with the default (struct) tracer — that is, when no custom tracer is specified — Sei can use a parallelized block trace path in which a failed transaction no longer aborts the entire block trace. Instead, each transaction produces its own per-tx entry in the result array: successful transactions include a result field, while failed transactions include an error field. This lets you inspect every transaction in a block even when one or more of them fail.This parallelized path is opt-in and gated by the node config field evm.enable_parallelized_block_trace (default false). When it is disabled, or when an explicit tracer is specified, the legacy trace path is used. Node operators can enable it by setting enable_parallelized_block_trace = true in the [evm] section of app.toml (or via the --evm.enable_parallelized_block_trace flag).debug_traceCall | Simulate and trace | Testing before execution |
| debug_traceStateAccess | State access patterns | Performance optimization |
Transaction Analysis Example
Tracing an ERC-20 transfer transaction:- Transaction Details
- Basic Trace
- Gas Analysis
Debugging Failed Transactions
Steps to analyze and resolve transaction failures:Step 1: Identify the Problem
Step 2: Trace the Execution
Step 3: Fix and Test
Common Debugging Scenarios
Transaction Reverted
Problem: Transaction failed with revert Solution: UsecallTracer to find the exact revert reason
Out of Gas
Problem: Transaction ran out of gas Solution: Use gas analysis tracer to optimize gas usageUnexpected Behavior
Problem: Transaction succeeded but wrong result Solution: Use opcode tracer for step-by-step analysisSlow Performance
Problem: Transaction uses too much gas Solution: Use state access tracer to find inefficienciesQuick Reference
Essential Commands
Common Tracers
callTracer: Contract call hierarchyopcodeTracer: Opcode-level execution- Custom JS: Custom analysis logic
Next Steps
- JavaScript Tracers - Custom analysis scripts
- Troubleshooting - Common issues and solutions
Start with
callTracer for general debugging, then use specialized tracers for specific analysis needs.