alloy-rs / evm

EVM abstraction layer

Repository from Github https://github.comalloy-rs/evmRepository from Github https://github.comalloy-rs/evm

[Feature] Migrate reth's revm_utils to evm

mattsse opened this issue · comments

Describe the feature you would like

We started introducing some tracing helpers in this crate

we can do the same for caller_gas_allowance

https://github.com/paradigmxyz/reth/blob/110cb84bdcffe311faf80ae11c1959de79367b52/crates/rpc/rpc-eth-types/src/revm_utils.rs#L31-L31

apply_block_overrides and helper trait

https://github.com/paradigmxyz/reth/blob/110cb84bdcffe311faf80ae11c1959de79367b52/crates/rpc/rpc-eth-types/src/revm_utils.rs#L219-L219

and apply_state_overrides

https://github.com/paradigmxyz/reth/blob/110cb84bdcffe311faf80ae11c1959de79367b52/crates/rpc/rpc-eth-types/src/revm_utils.rs#L264-L264

we can use EthApiError in these functions, so we need to introduce dedicated error types for InvalidBytecode and BothStateAndStateDiffInOverride

since this requires rpc types, we should feature gate this with a new feature rpc-util that then enables the optional alloy-rpc-types-eth dependency

These can go into a new rpc_utils.rs file in the evm crate

Additional context

No response