-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Optionally remove test gas limit in forc test
#7495
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
Conversation
|
👍 |
|
How long it takes to consume all gas? In a infinite loop, for example. If it is too long, we may need to timeout execution. |
Pull request was converted to draft
This is a drawback! Those 21_474_836_627 gas units are ~4 mins of execution time on my machine. Putting the PR into draft. I want to have the possibility to increase the gas limit without tweaking the compiler. But it looks having a CLI option would be the right way to do it. E.g., What we also need to improve is the error message in the case of running out of gas. Currently we get the infamous |
c7ca4be
forc testforc test
PR SummaryAdds
Written by Cursor Bugbot for commit 4e47b31. This will update automatically on new commits. Configure here. |
Description
This PR adds
--no-gas-limitCLI option toforc test. The option increases tx gas limit inforc testtou64::MAX, essentially removing it.The motivation for the change was the need to benchmark heavy gas consuming algorithms. E.g., a brute force prime factorization of the number 9223372021822390277 took 21_474_836_627 gas units.
The new
TestGasLimitenum provides aLimit(limit)variant which is currently unused, but added for future extensions, if we want to limit the test gas to a particular value.Checklist
Breaking*orNew Featurelabels where relevant.