-
Notifications
You must be signed in to change notification settings - Fork 61
feat: add system call inspection support for EVM tracing #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
InspectSystemCallEvm
trait and updating theSystemCallEvm
implementation. 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