paradigmxyz / reth

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

Extend EthApi with execution helpers #11122

Open mattsse opened 1 week ago

mattsse commented 1 week ago

Describe the feature

ref #10974

currently the ethApi impl only tracks the EvmConfig:

https://github.com/paradigmxyz/reth/blob/bb27f37cc703789eb41bb084892d44f770868e7d/crates/rpc/rpc/src/eth/core.rs#L216-L217

it would be beneficial to have additional execution related helpers,

this could serve as the entry point that abstracts away transaction/block execution for tracing, pending block building etc. This would also decouple execution further from eth API impl, which I believe @tcoratger would also appreciate.

what we need first, is a solution to #10974, an instance that wraps EvmConfig and knows how to execute a block.

Which can be something like: https://github.com/paradigmxyz/reth/pull/11074

then we can also integrate the payload builder so we can easily build a pending block

The end goal would probably look like something that doesn't require EvmConfig at all.

Additional context

No response

0x00101010 commented 1 week ago

Hey @mattsse,

I have this PR that basically injects BlockExecutor into DebugApi for debug_execution_witess purposes, upon reading your issue here, it looks like my approach might not be the best in terms of clean interface.

Would love to get your thoughts on if the PR and if this should be tackled at another layer.