Skip to content

hevm: fix STATICCALL for precompiles#360

Merged
MrChico merged 1 commit into
masterfrom
staticpre
Apr 22, 2020
Merged

hevm: fix STATICCALL for precompiles#360
MrChico merged 1 commit into
masterfrom
staticpre

Conversation

@MrChico

@MrChico MrChico commented Apr 22, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

Should this have been caught by some tests?

@MrChico

MrChico commented Apr 22, 2020

Copy link
Copy Markdown
Member Author

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