Skip to content

feat(simulation): add CALL and CREATE trace outcomes - #959

Open
crystalt wants to merge 2 commits into
crystal/fix-create-revert-capturefrom
crystal/trace-call-create-outcomes
Open

feat(simulation): add CALL and CREATE trace outcomes#959
crystalt wants to merge 2 commits into
crystal/fix-create-revert-capturefrom
crystal/trace-call-create-outcomes

Conversation

@crystalt

@crystalt crystalt commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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 TraceEntry type should be updated before it begins consuming CREATE-specific fields, since to and selector can be absent for CREATE entries.


Note

Medium Risk
Changes the simulate_unsignedUserOp trace JSON contract (to/selector optional, new required fields) and touches core inspector/RPC assembly; mis-association of frame outcomes could mislead security checks that rely on trace[].method.

Overview
Simulation trace responses are richer and breaking for clients that assumed every entry had a required to and selector string.

Each TraceEntry now includes kind (call / delegateCall / create / create2, etc.), depth, per-frame outcome (success / revert / halt), and optional revertReason. to and selector are optional (omitted for CREATE frames until a successful deploy sets to).

SimulationInspector records CREATE/CREATE2 in the trace (not only CALL-family ops), ties each pending frame to its trace row via trace_index, and fills outcomes in call_end / create_end. take_trace_entries returns Result instead of panicking on incomplete or mismatched frames; simulate_unsignedUserOp surfaces 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 / TraceOutcome and extend TraceEntry to support CREATE-family frames and per-frame outcomes (including optional to/selector/revertReason where appropriate).
  • Update SimulationInspector to associate each pending frame with its trace row (trace_index), record outcomes on frame end hooks, and return a Result instead 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants