-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(evm): use completely separated storage sections in multifork #2301
feat(evm): use completely separated storage sections in multifork #2301
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean, anything else we should test beyond storage values?
cc @hexonaut, @aureliusbtc & @mds1 for any user testing we can get before merging in case we're introducing any edge cases here.
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
5392d84
to
55a4d6d
Compare
I'm getting a non-descript "revert" error in this test at this line with this PR (previously working): https://github.com/makerdao/xdomain/blob/add-optimism/packages/dss-bridge/src/tests/domains/optimism/OptimismIntegration.t.sol#L292 |
@gakonst I think this is good to merge, but maybe we should wait until I updated all the docs, also need another round of revm debugging to figure out how to enable diagnostics for calls on non-existent errors. But from a functionality point of view it is complete and can be merged |
Ack - reviewing today. Want to give some thinking on whether we can do this without the persist cheats |
@gakonst figured out the problem with diagnostics, now we return meaningful revert reasons if someone calls a contract that only exists on another fork: foundry/forge/src/multi_runner.rs Lines 1210 to 1213 in df7ecd8
|
I'm going to revise all multifork docs next. Should we hold off on merging until tonight's night is built so we can ship it with tomorrow's nightly? |
Yep - let's give this one final pass and merge/ship tomorrow. I'd try to clarify to the reader how to think about all the forkign cheatcodes, which ones are the "most common" ones and which ones require deeper understanding. |
…undry-rs#2301) * refactor: completely separate fork states * refactor: turn fuzz wrapper into cow * refactor: add subroutine to trait * feat: track subroutine * copy sender and receiver * test: extend fork test * fix: initialize accounts on setup * test: add create select test * Update evm/src/executor/backend/fuzz.rs Co-authored-by: Georgios Konstantopoulos <me@gakonst.com> * update docs * fix: clone cheat code address and add traces * test: add another test * introduce persistent accounts * feat: add persistent cheatcodes * add persistent tests * test: add persistent test * feat: add revert error multifork diagnostic * feat: better diagnostic * docs * feat: fork revert diagnostic * test: remove uncommented left over Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Motivation
with #1715 we added multifork support, with some assumptions/limitations:
this has turned out to be an undesired and potential pitfall.
This rewrites how storage is tracked:
sender
and thecontract
remains persistent across swaps: e.g: changes to the test contract's own variables are persistent when selecting another forkSolution
forkId -> ForkDB
pairsSubroutine
when selecting forksFuzzWrapper
which is now aCow<Backend>