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

Support state overrides in eth_call #2513

Closed
BlinkyStitt opened this issue Mar 21, 2022 · 6 comments · Fixed by #4316
Closed

Support state overrides in eth_call #2513

BlinkyStitt opened this issue Mar 21, 2022 · 6 comments · Fixed by #4316
Assignees
Labels
status:ready This issue is ready to be worked on type:feature Feature request

Comments

@BlinkyStitt
Copy link

Geth has support for "state overrides" that make eth_call even more powerful than it already is.

Geth's docs go into detail: https://geth.ethereum.org/docs/rpc/ns-eth#3-object---state-override-set.

Ganache is likely to merge their PR before the next version: trufflesuite/ganache#2565

A similar change in hardhat would bring it to feature parity.

Brownie already supports state overrides, and I am working on a PR that uses them so that multicall is available on any block on any chain without needing to deploy anything.

@github-actions
Copy link
Contributor

This issue is also being tracked on Linear.

We use Linear to manage our development process, but we keep the conversations on Github.

LINEAR-ID: a56be32e-3dd4-453e-b177-afdf5fc6bd7b

@BlinkyStitt
Copy link
Author

As-is, if you try to set the override argument in eth_call, the error is: ValueError: {'code': -32602, 'message': 'Expected between 1 and 2 arguments and got 3'}

@github-actions
Copy link
Contributor

This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 27, 2022
@fvictorio
Copy link
Member

Still relevant, although we probably won't be able to work on this at least for some months.

@github-actions github-actions bot removed the Stale label Apr 28, 2022
@fvictorio fvictorio removed their assignment Dec 27, 2022
@fvictorio fvictorio added status:blocked Blocked by other issues or external reasons type:feature Feature request blocked-reason:needs-edr labels Dec 28, 2022
@fvictorio fvictorio moved this to Blocked in Hardhat Dec 31, 2022
@drortirosh
Copy link

Any chance state overrides in eth_call is implemented in the near future?
It is already available in ganache, foundry/anvil, and of course on production nodes (geth, erigon, bor, etc)

@fvictorio fvictorio moved this from Blocked to To-do in Hardhat Aug 3, 2023
@fvictorio fvictorio added status:ready This issue is ready to be worked on and removed status:blocked Blocked by other issues or external reasons blocked-reason:needs-edr labels Aug 3, 2023
@fvictorio
Copy link
Member

We'll be working on this soon.

To do:

  • Add support for state overrides in eth_call. The implementation shouldn't be too hard: we should accept this parameter and then, before making the call, iterate over it and use the state manager to update those fields.
  • Add tests for this. This will probably take more effort than the implementation itself. It will likely mean adding some example contracts specific for these tests. I can help with this since it's not straightforward.

@ChristopherDedominici ChristopherDedominici moved this from To-do to In Progress in Hardhat Aug 14, 2023
@ChristopherDedominici ChristopherDedominici linked a pull request Aug 22, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in Hardhat Aug 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready This issue is ready to be worked on type:feature Feature request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants