-
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
fix: script simulation with default sender #9042
Conversation
Possibly fixing #2002 too |
I don't think so. This sounds like an issue with gas estimation on optimism? looks like people are getting around it by using it could be addressed by enforcing foundry/crates/cli/src/utils/cmd.rs Line 163 in 8905af3
though this might affect UX cc @mds1, assume you're running scripts on OP networks quite often and know about hacks that are required |
Most scripts I run these days are actually on L1, so I don't have much insight unfortunately. I will see if someone else has more insight than I do here |
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.
makes sense, lgtm!
@zerosnacks @yash-atreya mind to check before merging? thank you! |
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.
Fix LGTM
Initially thought that setting the nonce to a constant u64::MAX / 2
might result in duplicate nonces / replacement transactions but considering the state is committed directly and synchronously this should not be an issue
* add test * fix: ensure correct sender nonce when dry-running script in fork * fix test * Fix test --------- Co-authored-by: grandizzy <[email protected]>
Motivation
Closes #8960
Right now, when simulating a script without providing a
--sender
arg, we will use the default sender both for script contract deployment andsetUp
/run
. This will result in sender nonce being higher than an actual on-chain nonce. For certain scripts, this might result in mismatched addresses and failure during on-chain simulation, if incorrect addresses end up in calldata.Solution
Fix contains 2 parts: