Function of these methods:
debug_traceCall: These methods execute the given call and return a number of possible traces for it.
Here are some of the differences between these methods:
You can choose to trace only the main call (the top-level call) in
debug_traceCall by setting the
onlyTopCall option to
true. This avoids extra processing if only the top-level info is required (like getting the revert reason). However, this is not possible using
trace_call as you always get back the complete trace.
You can replay a transaction in a particular block by providing the block hash in
debug_traceCall but not in
trace_call. (However, both methods accept the block number in hex format and the tags like
trace_call is accessible through Erigon while
debug_traceCall is accessible through Geth.
trace_call you can get the simple trace for a transaction (trace) and the state difference (stateDiff) in just one request by putting an array containing
stateDiff options in trace_call's second parameter (
["trace", "stateDiff"]) but by using
debug_traceCall you can either get the traces using
callTracer or the state difference using
prestateTracer in one request.
You can read more about it in the trace_call vs. debug_traceCall comparison guide by Alchemy.
As for the use cases, these methods can be used for better understanding the flow of a transaction and for debugging purposes. The traces of a transaction are not shown in the transaction receipt, so they can only be extracted by using the
You can read more about it in the EVM Traces Guide by Alchemy.