-
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
Add --skip-simulation
and --gas-estimate-multiplier
cli options to forge script
command
#2524
Add --skip-simulation
and --gas-estimate-multiplier
cli options to forge script
command
#2524
Conversation
3baee7d
to
6b44708
Compare
6cea2cc
to
f1fe4e3
Compare
f1fe4e3
to
502a2be
Compare
--skip-simulation
and --gas-estimate-multiplier
cli options to forge script
command
@onbjerg: Any feedback / review on this would be greatly appreciated 🙏 |
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.
Minor nits, otherwise it looks good to me :) Sorry for the slow turnaround, notifications have been blowing up 📱
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.
lgtm
pending smol nits @ckoopmann
…o `forge script` (foundry-rs#2524) * Add skip-simulation flag to bypass on-chain simulation * Add gas-estimate-multiplier cli argument * chore: nits Co-authored-by: Oliver Nordbjerg <[email protected]>
Motivation
In some edge cases the on-chain simulation currently blocks users from running certain types of transactions, even though they would work fine when submitted on chain.
See #2522
For cases like these it'd be great if the user could bypass on-chain simulation.
Solution
Add command line parameter
--skip-simulation
that the user can set to disable on chain simulation.When skipping simulation the gas costs will be estimated through the rpc-provider individually before each transaction submission.
When testing that new functionality the transactions ran out of gas and failed so I added the parameter
--gas-estimate-multiplier
to manually adjust the factor by which gas estimates are inflated (or reduced).Default value for this is
130
(meaning gas estimates will be multiplied by 1.3) which was the value previously hardcoded for estimations coming from the on-chain simulation.For consistency this default will also be applied to the provider estimate in the case the respective chain has a different gas calculation, which was previously used as returned by the provider (see this change), this should be the only change to the existing behaviour (when the user uses none of the new arguments).