Basic debugging
Fetch and analyze a transaction from the network:- Fetches the transaction envelope from the Stellar RPC
- Retrieves the ledger state at the time of execution
- Re-executes the transaction locally in a simulation environment
- Displays detailed execution traces and diagnostic events
Network options
- Testnet
- Mainnet
- Futurenet
Debug transactions on the Stellar testnet:
Offline debugging
Debug transactions without network access by providing a raw XDR envelope:- You want to analyze transactions without RPC access
- You’re working with locally simulated transactions
- You need to debug transactions from archived data
Offline debugging requires the transaction envelope XDR but may have limited ledger state information compared to network-connected debugging.
Understanding the output
When you debug a transaction, Erst provides:Execution trace
A step-by-step breakdown of contract execution:Diagnostic events
Detailed event information from the Stellar host environment:- Contract calls and returns
- Host function invocations
- Authorization checks
- Storage operations
- Errors and panics
Error location
When an error occurs, Erst pinpoints the exact location:Advanced debugging workflows
Analyze the execution trace
Use the interactive trace viewer to explore the full execution path:See Interactive trace viewer for details.
Review diagnostic events
Examine contract calls, host functions, and authorization events to understand what happened.
Check source mapping
If your contract was compiled with debug symbols, Erst will show the exact line in your Rust code that failed.
See Source mapping for details.
Cross-contract debugging
Erst automatically tracks calls across multiple contracts and highlights contract boundaries:Cross-contract calls are clearly marked in the trace with visual indicators showing when execution moves from one contract to another.
Debugging with different verbosity levels
Control the amount of detail in the output:Common debugging scenarios
Authorization failures
When a transaction fails due to missing authorization:require_authorrequire_auth_for_args- Authorization-related error messages
- Missing signatures
Storage errors
When contracts fail to read or write storage:get_contract_dataorput_contract_dataevents- “not found” or “missing” error messages
- Empty storage state
Arithmetic overflows
When calculations fail due to overflow:- WASM trap instructions (i32.add, i64.mul, etc.)
- “overflow” or “panic” messages
- Large numeric values
Comparing network results
Compare execution between different networks:- Protocol version differences
- Network-specific state
- Environment configuration issues
Next steps
- Learn about the Interactive trace viewer for deep exploration
- Set up Source mapping to see Rust source code locations
- Use Performance profiling to identify bottlenecks
- Enable Offline analysis for debugging without network access