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

estimate_gas doesn't reflect changes in mirror-node #2379

Open
Tracked by #2380
konstantinabl opened this issue Apr 22, 2024 · 0 comments · May be fixed by #2409
Open
Tracked by #2380

estimate_gas doesn't reflect changes in mirror-node #2379

konstantinabl opened this issue Apr 22, 2024 · 0 comments · May be fixed by #2409
Assignees
Labels
bug Something isn't working limechain

Comments

@konstantinabl
Copy link
Collaborator

konstantinabl commented Apr 22, 2024

Description

The mirror node endpoint contracts/call used to return estimation only for read-only smart contract calls. However, this has changed and now we can also get estimations for transfers, account creations etc. The changes are not reflected in the estimateGas method

Steps to reproduce

  1. Call eth_estimateGas with a transaction transferring value between two accounts
  2. You will not get the base cost of 21000 (0x5208)

Refactoring suggestions

We can keep the try/catch in our code and implement a retry mechanism. In case the mirror node is not available, we can retry the call for N number of attempts.
If there is still no response we can do the following:

  1. For contract deploy the intrinsicGasCost method, from the precheck file, can be used
  2. For contract call return some hardcoded value (TBD)
  3. For anything else the base cost - 21000

Hedera network

other

Version

0.46.0

Operating system

None

@konstantinabl konstantinabl added the bug Something isn't working label Apr 22, 2024
@victor-yanev victor-yanev self-assigned this Apr 24, 2024
@victor-yanev victor-yanev linked a pull request Apr 25, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working limechain
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

3 participants