feat(simulation): add CALL and CREATE trace outcomes - #959
Open
crystalt wants to merge 2 commits into
Open
Conversation
crystalt
requested review from
0xForerunner,
0xOsiris,
Dzejkop,
Kemperino,
alessandromazza98,
cichaczem,
karankurbur,
kilianglas,
murph and
piohei
as code owners
August 4, 2026 02:16
Contributor
There was a problem hiding this comment.
🟡 Human review recommended
It changes an RPC JSON contract and core EVM inspector trace bookkeeping, so it merits final human review despite the added test coverage.
Pull request overview
Extends the simulate_unsignedUserOp simulation trace contract to include richer per-frame metadata (frame kind, depth, outcome, optional revert reason) and to include CREATE/CREATE2 frames alongside CALL-family frames, by enhancing SimulationInspector’s internal bookkeeping and trace assembly.
Changes:
- Add
TraceKind/TraceOutcomeand extendTraceEntryto support CREATE-family frames and per-frame outcomes (including optionalto/selector/revertReasonwhere appropriate). - Update
SimulationInspectorto associate each pending frame with its trace row (trace_index), record outcomes on frame end hooks, and return aResultinstead of panicking on internal trace inconsistencies. - Update and expand tests to validate the new trace shape and CREATE success/revert behavior, including nested outcomes.
File summaries
| File | Description |
|---|---|
| crates/rpc/src/simulate.rs | Introduces trace kind/outcome/depth/revertReason fields, adds CREATE/CREATE2 trace entries, and makes trace extraction fallible instead of panicking. |
| crates/rpc/tests/inspector_shared_buffer.rs | Updates assertions for optional to/selector and validates new trace metadata on CALL entries. |
| crates/rpc/tests/inspector_create_revert.rs | Adds CREATE trace coverage for revert/success and nested outcome association correctness. |
| crates/rpc/tests/fork_simulate.rs | Adapts fork-based trace tests to optional selector/to and asserts CREATE trace entry properties. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds frame kind, depth, outcome, and local revert reasons to simulation traces. CREATE/CREATE2 frames are now included alongside CALL frames.
Compatibility
Verified against app-backend-main’s RPC response consumer. Existing CALL fields retain their current wire shape, and app-backend does not currently inspect individual trace entries, so the added metadata and CREATE entries are additive for current usage.
The app-backend
TraceEntrytype should be updated before it begins consuming CREATE-specific fields, sincetoandselectorcan be absent for CREATE entries.Note
Medium Risk
Changes the
simulate_unsignedUserOptrace JSON contract (to/selectoroptional, new required fields) and touches core inspector/RPC assembly; mis-association of frame outcomes could mislead security checks that rely ontrace[].method.Overview
Simulation
traceresponses are richer and breaking for clients that assumed every entry had a requiredtoandselectorstring.Each
TraceEntrynow includeskind(call / delegateCall / create / create2, etc.),depth, per-frameoutcome(success/revert/halt), and optionalrevertReason.toandselectorare optional (omitted for CREATE frames until a successful deploy setsto).SimulationInspectorrecords CREATE/CREATE2 in the trace (not only CALL-family ops), ties each pending frame to its trace row viatrace_index, and fills outcomes incall_end/create_end.take_trace_entriesreturnsResultinstead of panicking on incomplete or mismatched frames;simulate_unsignedUserOpsurfaces that as an internal RPC error.Tests were updated for the new shape and add coverage for nested CREATE revert vs successful parent, successful CREATE with deployed address, and inspector error paths.
Reviewed by Cursor Bugbot for commit 721f0f6. Bugbot is set up for automated code reviews on this repo. Configure here.