Normalise JSON-RPC format for rpcDebugTrace
Hardhat is currently reformatting the rpcDebugTrace call, see:
https://github.com/NomicFoundation/hardhat/blob/024d72b09c6edefb00c012e9514a0948c255d0ab/v-next/hardhat/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.ts#L176-L212
It seems that EDR JSON-RPC rpcDebugTrace calls return a custom format, possibly due to trying to implement https://eips.ethereum.org/EIPS/eip-3155. This is not the JSON-RPC trace format, it’s intended to be used by EVM testing (as in testing the EVM itself) infrastructure.
We should move the normalisation that Hardhat does back into EDR and make sure we work with most external tools/libs/etc. We can follow geth's approach to do so.
Most of the info about debug_traceCall is here, but note that they use a js lib, not the raw rpc, in the snippets.
To be able to port it with confidence, we should create a few test cases using geth, and making sure we match their format.
@nebasuke I would like to work on this one.
Hey @AmosAidoo, That would be great!
If you want to work on it, please go ahead. We're unlikely to try and do this for at least a few months.