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

hevm: fix STATICCALL for precompiles #360

Merged
merged 1 commit into from
Apr 22, 2020
Merged

hevm: fix STATICCALL for precompiles #360

merged 1 commit into from
Apr 22, 2020

Conversation

MrChico
Copy link
Member

@MrChico MrChico commented Apr 22, 2020

Current semantics does the opposite of what we want for precompiles – it causes a static mode violation iff the callvalue is zero.

Example bytecode for which hevm reverts and evm (geth) succeeds:

hevm exec --gas 0xffffff --code 0x600080541515601d576001815580818283305afa15601b578081fd5b005b80818283600160025af15050
evm --code 0x600080541515601d576001815580818283305afa15601b578081fd5b005b80818283600160025af15050 --gas 0xffffff --debug run

With this patch, hevm exec still fails because of an issue related to #273 (although the faulty semantics are still apparent in dapp tests), but in combination with #353 the behaviour of hevm exec matches that of geths

@asymmetric
Copy link
Contributor

Should this have been caught by some tests?

@MrChico
Copy link
Member Author

MrChico commented Apr 22, 2020

Yeah, ideally generalstatetests. I opened an issue to track it there

@MrChico MrChico merged commit c03d520 into master Apr 22, 2020
@asymmetric asymmetric deleted the staticpre branch April 22, 2020 12:58
livnev pushed a commit that referenced this pull request Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants