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 #27800

Closed
antonydenyer opened this issue Jul 28, 2023 · 1 comment · Fixed by #27845
Closed

Allow state override on eth_estimateGas #27800

antonydenyer opened this issue Jul 28, 2023 · 1 comment · Fixed by #27845

Comments

@antonydenyer
Copy link

Rationale

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

@antonydenyer antonydenyer changed the title Allow state override to eth_estimateGas Allow state override on eth_estimateGas Jul 28, 2023
@s1na
Copy link
Contributor

s1na commented Jul 31, 2023

Hi @antonydenyer. I think it makes sense to add these overrides, and probably the block overrides which have recently been added to eth_call as well.

You indicated you're willing to implement this feature. I'd personally welcome your contribution and can gladly review it.

github-merge-queue bot pushed a commit to matter-labs/zksync-era that referenced this issue Jul 22, 2024
## What ❔

- Adds state override for gas estimates

## Why ❔

- Solves #947 
- Feature parity with geth
ethereum/go-ethereum#27800

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.
- [x] Linkcheck has been run via `zk linkcheck`.

---------

Co-authored-by: Juan Rigada <62958725+Jrigada@users.noreply.github.com>
Co-authored-by: Jrigada <jrigada@est.frba.utn.edu.ar>
Co-authored-by: Danil <deniallugo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@antonydenyer @s1na and others