fix(simulation): capture CREATE revert reasons - #958
Merged
Conversation
crystalt
marked this pull request as ready for review
August 3, 2026 23:48
crystalt
requested review from
0xForerunner,
0xOsiris,
Dzejkop,
Kemperino,
alessandromazza98,
cichaczem,
karankurbur,
kilianglas,
murph and
piohei
as code owners
August 3, 2026 23:48
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the RPC simulation inspector so constructor reverts from failed contract deployments (CREATE/CREATE2) are captured as the deepest revert payload, preventing outer wrapper reverts from masking the root cause during simulation. Adds a dedicated in-memory EVM regression test to validate revert reason capture and ensure failed creates do not get recorded as contract creations.
Changes:
- Capture
InstructionResult::Revertpayloads inSimulationInspector::create_end, mirroring existingcall_endbehavior. - Update
deepest_revert_payloaddocumentation to include bothcall_endandcreate_end. - Add
inspector_create_revertregression test covering masked constructor revert payloads.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/rpc/src/simulate.rs | Extends deepest-revert capture to CREATE/CREATE2 end-hook paths and updates associated docs. |
| crates/rpc/tests/inspector_create_revert.rs | Adds a regression test ensuring constructor revert payloads are preserved even when an outer frame reverts with empty output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
karankurbur
approved these changes
Aug 6, 2026
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.
Mirrors the existing
call_endrevert capture increate_end, capturing revert data from failed contract deployments before an outer call can mask it.Test:
cargo test -p world-chain-rpc --test inspector_create_revertNote
Low Risk
Small, symmetric change to simulation inspector revert capture with an in-memory regression test; no auth, persistence, or consensus impact.
Overview
Simulation now surfaces constructor revert data when a CREATE/CREATE2 fails, not only when a nested CALL reverts.
SimulationInspector::create_endrecords the firstInstructionResult::Revertoutput intodeepest_revert_payload, matching the existingcall_endbehavior sorevert_reasononsimulate_unsignedUserOpstays the innermost payload instead of being replaced by an outer frame with empty or wrapper revert data (e.g. EntryPointFailedOp).Docs on
deepest_revert_payloadnow note bothcall_endandcreate_end. A new in-memory regression test (inspector_create_revert) uses bytecode that CREATE-reverts with0xdeadbeefthen outer-reverts with no data, asserting the inspector still returns0xdeadbeefand no committed creations.Reviewed by Cursor Bugbot for commit b63c4a2. Bugbot is set up for automated code reviews on this repo. Configure here.