ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.14k stars 19.95k forks source link

Tracker for live tracing v1.1.0 proposals #30356

Open s1na opened 2 weeks ago

s1na commented 2 weeks ago

Here are ideas on improving the live tracing interface that were raised by Tenderly:

### Tasks
- [ ] State revert events: when a call reverts, it would help to get events for balance nonce etc revertals. Then tracers will not have to implement journaling. The same would apply to logs.
- [ ] In a similar vein, emit an event with a list of blocks that are reorged out.
- [ ] Extract headers for the blocks requested via BLOCKHASH opcode. Either a special hook for OpBlockHash or alternatively add a way for tracers to query blocks via their hash.
- [ ] Add GetCodeHash to `tracing.StateDB` to complete the set of account info.
- [ ] Add `tracing.StateDB` as a parameter to `OnSystemCallStart`.
- [ ] Add state read hooks: `OnBalanceRead`, `OnNonceRead`, etc. (incl. storage)

Another item on the wishlist is a testing framework for the live tracers. It should be possible to prototype something via the SimulatedBackend so that you run the tracer against a predefined chain and can compare the output.

s1na commented 2 weeks ago

WIP branch: https://github.com/s1na/go-ethereum/tree/tracing/v1.1