You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to estimate the gas used using --gas-report -vvvv --isolate but I have noticed confusing output.
I've created a repo that you can clone to reproduce the same tests.
Run the test using: forge test --gas-report -vvvv --isolate
Issues:
The fuzz test shows a different result [PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 75638, ~: 57224) than the gas report result setNumber| 103747 | 103747 | 103747 | 103747 | 1 . For instance, the gas report shows an average of 103747 while the fuzz test shows 75638.
Why the fuzz test shows 1 # calls in the gas report table while there were 256 runs?
The gas show in the trace for Counter's setNumber doesn't tell if it's the average, median or maximum. It would have been handy to get all of them. [77244] Counter::setNumber(35111896637628685440013362 [3.511e25])
Additional question:
Is it possible to include internal transactions in the gas report? In this example, My test calls ContractA's increment/setNumber functions, which call Counter's increment/setNumber functions. The gas report shows only the gas for ContractA functions.
The text was updated successfully, but these errors were encountered:
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (3df3e0c 2024-03-04T00:19:46.775990000Z)
What command(s) is the bug in?
forge test --gas-report -vvvv --isolate
Operating System
macOS (Apple Silicon)
Describe the bug
Hi,
I'd like to estimate the gas used using
--gas-report -vvvv --isolate
but I have noticed confusing output.forge test --gas-report -vvvv --isolate
Issues:
The fuzz test shows a different result
[PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 75638, ~: 57224)
than the gas report resultsetNumber| 103747 | 103747 | 103747 | 103747 | 1
. For instance, the gas report shows an average of103747
while the fuzz test shows75638
.Why the fuzz test shows 1 # calls in the gas report table while there were 256 runs?
The gas show in the trace for Counter's setNumber doesn't tell if it's the average, median or maximum. It would have been handy to get all of them.
[77244] Counter::setNumber(35111896637628685440013362 [3.511e25])
Additional question:
increment/setNumber
functions, which call Counter'sincrement/setNumber
functions. The gas report shows only the gas for ContractA functions.The text was updated successfully, but these errors were encountered: