-
Notifications
You must be signed in to change notification settings - Fork 498
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
Wrong gas estimation in contract calling another contract #280
Comments
I believe that's what this PR was intended to fix: #269 -- try building with feature |
Thank you @jnaviask , I thought we had this one already included but is not. I'll double check once merged on our branch |
@jnaviask that fixed the issue in way - but we ran into another problem that just stalled the EVM. So the gas estimation problem still persists. Logs from the evm trace when the problem happened:
|
This issue is likely related: rust-ethereum/evm#8 |
@albertov19 What can I do to reproduce this? Did it happen with the original contract @crystalin posted? |
@jnaviask No, it was with a more complex contract when deploying Uniswap V2. When swapping tokens. I don't a step by step way of explaining how to reproduce right now but in short:
|
Edit: Sorry, I had the wrong context when I originally wrote this. The binary search approach seems to work for this trivial contract, but fails on the complex contract as @albertov19 mentioned. The rest of this applies to reproducing the original bug (without binary search enabled). We have a PR on Moonbeam with an integration test that currently fails over this issue: moonbeam-foundation/moonbeam#244 Reproducing it in this way should be as simple as:
|
Also note that in this case, the overestimation appears to be roughly equal to:
This seems to point to the |
@albertov19 I think the fix #297 should have solved your problem, could you test ? :) |
Very old one. Close it. |
Description
The estimate Gas is (very) wrong when computing the needed gas when a contract calls another contract
Steps to Reproduce
Using those contract:
Steps:
someAction
by passing Callee's address and a number. It will execute the functionaddtwo
from the other contractExpected vs. Actual Behavior
It returns 67M gas which is way over a normal expected value.
Logs, Errors or Screenshots
Additional Information
The text was updated successfully, but these errors were encountered: