edr
edr copied to clipboard
Refactor tracing and add support for call/create gas cost calculation
Problem
The way debug_trace
is implemented currently is not ideal and doesn't have support for gas cost of calls and creates. The problem is that the current implementation just adopts the REVM TracerEIp3155
implementation that operates conceptually on the opcode level. It already requires some hackery to make this approach work for calls/creates, and it breaks down for call gas cost calculation. A better approach would be to start a new trace for each call/create and then flatten the results to the format that EIP-3155 prescribes. To achieve this, it need a refactoring of rethnet_evm::trace
& rethnet_evm::debug_trace
to have a single trace collector that collects all the info needed for trace
and debug_trace
and then have methods that output it in the desired formats.
Definition of done
One implementation for collecting traces that allows granular configuration of what needs to be collected (for efficiency) and methods to output the collected traces in the desired formats. Support for call/create gas cost calculation should also be added.