Skip to content
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(forge): Better gas reporting #524

Merged
merged 2 commits into from
Jan 20, 2022
Merged

fix(forge): Better gas reporting #524

merged 2 commits into from
Jan 20, 2022

Conversation

brockelmore
Copy link
Member

This makes the reported gas in TestResult actually match closer to the execution costs and matches the trace gas usages. Basically we use gas_used - gas_refund - tx_costs, where tx_costs is calldata cost + base tx cost (21k).

@brockelmore
Copy link
Member Author

https://github.com/gakonst/foundry/blob/e6b8b0b4437fe392e558fb6d8cf5167f0f3bf676/evm-adapters/src/sputnik/evm.rs#L431

This was changed because we now remove the calldata cost of calling the test

@gakonst gakonst merged commit 1766b12 into master Jan 20, 2022
@brockelmore brockelmore deleted the brock/gas_fix branch January 20, 2022 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants