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

Remove buffer gas added in the gas consumption of EVM.dryRun #6844

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

m-Peter
Copy link
Collaborator

@m-Peter m-Peter commented Dec 31, 2024

Closes: #6843
Relevant issue: #6301

The buffer gas added in EVM.dryRun, was a best-effort solution, to find the minimum required gas, that would make a transaction succeed. The calculation was based on top of the actual gas used for a given transaction. However, this did have some issues, and it would fail for certain cases.

With the implementation of the local state index on EVM Gateway, we have completely reworked the eth_estimateGas endpoint, and it uses the same logic as Geth, to calculate the minimum required gas needed for a transaction to succeed.

With that change deployed, we no longer need to add any buffer gas to the result of EVM.dryRun. And this can in fact cause confusion to developers, as it is always a bit higher that the gas usage they would get from tracing the same transaction / contract call.

@codecov-commenter
Copy link

codecov-commenter commented Dec 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 41.18%. Comparing base (72adf9e) to head (0b7c592).

Files with missing lines Patch % Lines
fvm/evm/emulator/emulator.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6844   +/-   ##
=======================================
  Coverage   41.18%   41.18%           
=======================================
  Files        2109     2109           
  Lines      185660   185626   -34     
=======================================
- Hits        76460    76457    -3     
+ Misses     102788   102756   -32     
- Partials     6412     6413    +1     
Flag Coverage Δ
unittests 41.18% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m-Peter m-Peter force-pushed the mpeter/dry-run-remove-buffer-gas branch from 99d8c10 to 0b7c592 Compare January 6, 2025 10:34
@janezpodhostnik
Copy link
Contributor

The code looks good, but I'm not too familiar with why we have this and why we can now remove it.

Could you please add some text describing this in the PR description?

@m-Peter
Copy link
Collaborator Author

m-Peter commented Jan 6, 2025

The code looks good, but I'm not too familiar with why we have this and why we can now remove it.

Could you please add some text describing this in the PR description?

Good point 👌 Updated the description #6844 (comment)

Copy link
Contributor

@janezpodhostnik janezpodhostnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flow EVM] Remove buffer gas applied in EVM.dryRun
3 participants