feat: add system call inspection support for EVM tracing#146
feat: add system call inspection support for EVM tracing#146rezzmah wants to merge 11 commits intoalloy-rs:mainfrom
Conversation
| [patch.crates-io] | ||
| # Use revm at specific commit 9008e93 | ||
| revm = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-inspector = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-handler = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-context = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-context-interface = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-database = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-database-interface = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-state = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-bytecode = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } | ||
| op-revm = { git = "https://github.com/bluealloy/revm", rev = "9008e93" } No newline at end of file |
There was a problem hiding this comment.
todo use actual release for revm when its ready
crates/evm/src/eth/mod.rs
Outdated
| if self.inspect { | ||
| self.inner.inspect_system_call_with_caller(caller, contract, data) | ||
| } else { | ||
| self.inner.system_call_with_caller(caller, contract, data) | ||
| } |
There was a problem hiding this comment.
this could potentially be a bit problematic because this would make all system calls show up in tracing, which is perhaps unexpected
perhaps we should instead add an
fn inspect_system_call( to the ethevm natievely, then users of this can do the check themselves
this is currently not an issue with reth rpc tracing because systemcalls are applied separately although this is likely going to change, which would then clash with the inspect setting.
for bera, I think the ideal change would be
invoke the fn transact_system_call( or inspect_system_call directly from beraevm's transact implementation if it's a pol tx
2e1746f to
bb7ffc0
Compare
Adds a dedicated inspect_system_call method that executes system calls with inspection enabled without committing state changes. This separates the concerns of inspection and transaction execution for system calls. - Add inspect_system_call to Evm trait with documentation - Implement across all EVM types (Either, EthEvm, OpEvm) - Refactor transact_system_call to always use non-inspecting variant - Add required ResultAndState import to either.rs Update Cargo.toml Update either.rs
bb7ffc0 to
df5c8e7
Compare
|
Noting issues here Line 152 in be5c86b |
jank workaround for berachain. will need to figure out a real solution https://github.com/berachain/evm/pull/2/files#diff-65e6ca0a2d2c1d802db5fc74c5c40419664c63801269db2ba13fb3cc4aa7636cR136-R141 |
mattsse
left a comment
There was a problem hiding this comment.
hmm, the evm itself, doesnt really have a notion of inspecting transaction,
due to how this is implemented it is assumed that this is controlled by the inspector toggle.
@rezbera I believe you're using the regular eth evm right?
could we perhaps make this an EthEvm native function first before we embedd this in the trait?
|
closing as it makes more sense to just have our own Evm |
|
good call |
This PR adds system call inspection capabilities to alloy-evm by implementing the
InspectSystemCallEvmtrait and updating theSystemCallEvmimplementation. The changes enable proper tracing and debugging of system calls during EVM execution, which is essential for comprehensive transaction and block tracing functionality. The implementation uses revm's inspection framework to capture system call execution details while maintaining compatibility with existing EVM execution flows.builds on bluealloy/revm#2808