Enable system call to be traced by inspector - #323
Conversation
When using ExEx to replay a full block including the pre/post execution steps, system calls weren't inspected before if inspector was enabled. One thing I'm unusure of the impact is about other inspector out there, would they be affected?
mattsse
left a comment
There was a problem hiding this comment.
this is a bit tricky, because afaik they dont appear as part of the block level tracing return values, so this could potentially end up including them.
but maybe not if we can make this work in the block level tracer
so I think this change seems fine, but we could perhaps consider adding an additional setting
wdyt @klkvr
That is my reasoning also, I feel that Geth don't trace system calls via I think this would be an hidden changes. I'm using
Would be interested to know more, I saw it but unsure if it's ready to try/improve it. Currently using ExEx than creating a So if |
|
i think we should make sure that any reth rpc callsites explicitly disable inspection before pre/post execution hooks before making this change |
|
@klkvr Ok no problem. I've noted https://github.com/paradigmxyz/reth/blob/26a37f3c00649a0b8f5381b2b9a8b42a312c5d5f/crates/rpc/rpc-eth-api/src/helpers/trace.rs as you main points. Probably others in Is there other repositories I should inspect? |
The streamingfast [patch.crates-io] for alloy-evm was dropped during
the merge because no sf/v0.34.0 branch existed and pulse needs 0.34
for its erigon3 feature set. Without it, firehose's Inspector hooks
miss state changes from EIP-4788 (beacon-root contract) and EIP-2935
(block-hashes contract) system calls — those calls happen, but the
inspector never sees them.
Doesn't matter for PulseChain right now (Cancun not activated, so
those system calls don't fire) but is needed for Ethereum mainnet
firehose. We need eth support per the project goals, so the patch
has to come back.
The patch itself is 8 lines: route system_call_with_caller through
inspect_system_call_with_caller when an inspector is attached.
Ported cleanly from streamingfast/evm sf/v0.33.0 onto alloy-evm
v0.34.0 (the source-region didn't change between 0.33 and 0.34).
Hosted at github.com/valve-tech/evm branch valve/v0.34.0, pinned by
commit hash so cargo gets reproducible builds.
Runtime gating is built in: `if self.inspect { route_through_inspector }
else { vanilla }`. With no tracer initialized, the patched alloy-evm
behaves identically to the unpatched version. So "activate vs not"
is automatic — no Cargo feature flag needed; tracer initialization
at runtime is the switch.
Upstream tracking: alloy-rs/evm#323. When
that lands and propagates to a tagged release, this patch becomes
redundant and we can drop the [patch.crates-io] entry.
Records the system-call inspector patch dependency, the reth v2.3 fix (valve-tech/evm valve/v0.36.0), the upstream blocker (alloy-rs/evm#323 open, gated on guarding reth RPC callsites), and what to re-check before dropping the fork.
v2.4.0 (2026-07-14) bumps alloy-evm 0.36->0.37 (lock resolves 0.37.1) and revm 40->41, which would silently drop our valve/v0.36.0 patch and kill firehose system-call tracing. Pre-built and verified valve-tech/evm branch valve/v0.37.1 (cherry-pick clean, builds against revm 41.0.0). Records the v2.4.0 bump requirements (the #26330 PayloadValidator signature change and the ParallelSparseTrie removals both land on code we modify), the revmc JIT firehose-fidelity risk, a repeatable per-bump patch recipe, and the 2026-07-15 fold-back re-review verdict (alloy-rs/evm#323 still open, upstream 0.37.x still un-inspected -> keep the fork).
Motivation
When using ExEx to replay a full block including the pre/post execution steps, system calls weren't inspected before if inspector was enabled.
Solution
Just like
transact_rawdoes, if theEthEvmis in inspect mode,transact_system_callnow check ifself.inspectis set and call the inspect variant ofinspect_system_call_with_caller.Open Questions
One thing I'm unusure of the impact is about other inspector out there, would they be affected?
Maybe
self.inspectcould be switch off beforetransact_system_callis called in the current code and restored after to keep current behavior.PR Checklist
Waiting on initial feedback.