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

Allow state override on eth_estimateGas #4440

Open
HackProAIT opened this issue Oct 5, 2023 · 1 comment
Open

Allow state override on eth_estimateGas #4440

HackProAIT opened this issue Oct 5, 2023 · 1 comment
Labels
status:ready This issue is ready to be worked on type:feature Feature request

Comments

@HackProAIT
Copy link

HackProAIT commented Oct 5, 2023

Describe the feature

Currently, you can not perform an eth_estimateGas on something that isn't in the 'correct' state as the evm will, correctly, return an error. For example, on an erc20 you may wish to send an approve followed by a transfer call. You can estimate gas for the approve but not the transfer.

Implementation

Add an additional parameter to the end of the request in the same way eth_call does.
Are you willing to implement this feature? Yes

this issue gas been resolved in latest Geth version for eth_estimateGas: ethereum/go-ethereum#27800
works fine in hardhat for eth_call

Search terms

eth_estimateGas feature

@fvictorio fvictorio added this to Hardhat Oct 5, 2023
@github-project-automation github-project-automation bot moved this to Ready in Hardhat Oct 5, 2023
@fvictorio fvictorio added type:feature Feature request status:ready This issue is ready to be worked on and removed status:triaging labels Oct 5, 2023
@fvictorio
Copy link
Member

Hey @HackProAIT, thanks for this, I didn't know that geth supported state overrides in eth_estimateGas now, but it makes sense.

We are in the middle of a pretty involved refactor of the Hardhat network, so ideally we'd wait until that it's ready before implementing this. But if you think this has some urgency, we might do it before that (it should be pretty straightforward anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on type:feature Feature request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants