feat: simulates transactions in forge and exposes state diff and sim info#72
Merged
stevieraykatz merged 3 commits intobase:mainfrom Apr 11, 2024
Merged
feat: simulates transactions in forge and exposes state diff and sim info#72stevieraykatz merged 3 commits intobase:mainfrom
stevieraykatz merged 3 commits intobase:mainfrom
Conversation
…info To facilitate the following features: 1. State diff assertions using state diffs from foundry. 2. Exposing transaction simulation payloads for simulating with external tools such as Tenderly. 3. Failing when a simulation or execution reverts or does not result in any state changes. The below changes were made: 1. The postCheck hook takes state diff and simulation payload inputs. 2. The postCheck hook is mutable to enable ffi calls to further validate the transaction results. 3. Anytime a transaction is executed, whether simulated or broadcast, the state diff is recorded and returned to the caller. 4. The postCheck hook is always run after a transaction, whether simulated or broadcast. 5. Booleans returned from methods have been removed, as the methods will now revert if a transaction fails so they are no longer needed.
maurelian
reviewed
Apr 10, 2024
stevieraykatz
approved these changes
Apr 10, 2024
2 tasks
This was referenced Apr 16, 2024
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.
To facilitate the following features:
The below changes were made:
We had to copy out logic from the base repo in order to execute a simulation in foundry and make assertions on the state diff, as you can see here: ethereum-optimism/superchain-ops@815a5c4
I'd still need to test this branch and make sure no changes were missed, and that it works properly to let us simplify that linked commit, but I wanted to open this draft PR to get feedback on the architecture from a high level and see if you'd be open to merging this PR.— Edit: I've now tested this in the upstream ethereum-optimism/superchain-ops#130 and it seems to be working!