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 estimateGas being not accurate #4678

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Fix estimateGas being not accurate #4678

merged 1 commit into from
Apr 3, 2024

Conversation

yann300
Copy link
Contributor

@yann300 yann300 commented Apr 3, 2024

using runTxInVm for the gas estimation isn't accurate because it doesn't take in account block.number, block.timestamp, etc...
to test, run:

contract test {
 uint number;
 function set() public {
   number = block.timestamp;
 }
}

The fix make the estimateGas to also use runBlockinVm, and implement a way to rollback the state proposed by ethereumjs team.

@yann300 yann300 requested a review from Aniket-Engg April 3, 2024 06:44
Copy link

netlify bot commented Apr 3, 2024

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit ca23719
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/660cfab8b640a40008f7e523
😎 Deploy Preview https://deploy-preview-4678--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yann300 yann300 changed the title Fix estimateGas Fix estimateGas being not accurate Apr 3, 2024
@Aniket-Engg Aniket-Engg merged commit 2e62de3 into master Apr 3, 2024
32 checks passed
@Aniket-Engg Aniket-Engg deleted the fix_timestamp branch April 3, 2024 08:47
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.

2 participants