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

Investigate gas estimation discrepancy between 0.5 and 0.6 #50

Open
arhag opened this issue Sep 19, 2023 · 1 comment
Open

Investigate gas estimation discrepancy between 0.5 and 0.6 #50

arhag opened this issue Sep 19, 2023 · 1 comment

Comments

@arhag
Copy link
Member

arhag commented Sep 19, 2023

Gas estimated by EOS EVM Node is lower than what will actually be consumed when executing the EVM transaction (either by EOS EVM Contract or EOS EVM Node).

Example: https://explorer.testnet.evm.eosnetwork.com/tx/0x5f6c24668a4a8f3509002754d46f7718470f47a929002a0acb57d57aeccf479c/raw-trace

EDIT: We confirmed this was because the estimation request was sent to EOS EVM Node verison 0.5. The problem seems to be fixed in 0.6, but now the question is to understand why since that fix was not planned by us.

@arhag arhag added the bug Something isn't working label Sep 19, 2023
@arhag arhag added this to EOS EVM Sep 19, 2023
@github-project-automation github-project-automation bot moved this to Todo in EOS EVM Sep 19, 2023
@arhag arhag added this to the EVM Node 0.6.x milestone Sep 19, 2023
@arhag
Copy link
Member Author

arhag commented Sep 20, 2023

We confirmed that the gas estimation from EOS EVM Node v0.6.0-rc1 is not mismatched with the gas expectations of EOS EVM Contract v0.6.0-rc1. The problem was that we were getting gas estimations from the old 0.5 version of the node, which is different than what the 0.6 version estimates, but then sending the transaction with that estimate to the new 0.6 version of EOS EVM Contract.

The upstream silkworm changes that were brought in for the 0.6 release changed the gas estimation code, so it is not too surprising for the gas estimate to change from 0.5 to 0.6.

What is a bit surprising though is that we had not noticed a discrepancy between gas estimates from EOS EVM Node and what the EOS EVM Contract expected (to the point of rejecting the transaction) until recently, and yet the fix to that discrepancy appears to have conveniently landed with the v0.6.0-rc1 of EOS EVM Node. And this happened due to the decision to bring upstream silkworm changes in for the 0.6.0 release which was independent of the trustless bridge enhancements that are being exercised by the example EVM transaction referenced above which had the gas discrepancy issue.

That may just be a lucky coincidence, but it may be worth exploring further.

@arhag arhag removed the bug Something isn't working label Sep 21, 2023
@arhag arhag changed the title Incorrect gas estimation Investigate gas estimation discrepancy between 0.5 and 0.6 Sep 21, 2023
@arhag arhag removed this from the EVM Node 0.6.x milestone Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant