paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.95k stars 1.19k forks source link

Improve `debug_traceBlock` performance #11066

Closed mattsse closed 2 weeks ago

mattsse commented 1 month ago

Describe the feature

currently, trace_block is a loop over transactions and that invoke trace_transaction:

https://github.com/paradigmxyz/reth/blob/08bdec9efa26c6a97a2c0467469727b61c9b5dfc/crates/rpc/rpc/src/debug.rs#L107-L118

note how this clones the opts:

https://github.com/paradigmxyz/reth/blob/08bdec9efa26c6a97a2c0467469727b61c9b5dfc/crates/rpc/rpc/src/debug.rs#L119-L119

this results in some overhead:

https://docs.rs/revm-inspectors/latest/revm_inspectors/tracing/struct.TracingInspector.html#method.geth_builder

TODO

this could perhaps be done with a helper type for block tracing that keeps the TracingInspector or similar

Additional context

No response

JosepBove commented 1 month ago

I can take this

JosepBove commented 1 month ago

Ready for review