-
Notifications
You must be signed in to change notification settings - Fork 873
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
Gas for Execution Cost doesn't add up #163
Comments
I found what causes the difference between the values shown and the values calculated: MSTORE is marked as "W_verylow" in the Yellowpaper (3 gas), shows 3 gas in the remix debugger, but takes up 12 gas on chain. I have released a similar contract on rinkeby, its's the third instruction and pretty obvious: http://rinkeby.etherscan.io/remix?txhash=0xb837a742727706e9b8f57f33477d3b5dfd3959f705f15f041c1ed6357178917b I'd be very happy if someone can explain it to me before closing the issue. Thank you. |
That's a bug in Remix: |
Thanks for this @yann300 . Could you elaborate under what situation would the memory need to be extended? Is it a linear increase as well? Just curious. |
this is has been fixed for sometimes. |
@yann300 appreciate it. I already forgot about the issue, been 5 years. Again, really appreciate getting back to it and referencing more information here. |
Considering the following contract:
It uses gas for input (transaction cost): 4*68 = 272 + 21000 = 21272 - this is correct in Remix. But I cannot verify the execution cost:
It uses the following instructions according to the debugger:
Which is in sum 119 gas, but the instruction details in the Remix logger shows 128.
The instruction cost is the same as shown in Appendix G in the Yellowpaper, this is something I could verify. But I cannot verify where the 9 gas are coming from.
The text was updated successfully, but these errors were encountered: