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

clarify what the malformed WASM test is testing #87

Closed
gballet opened this issue Sep 4, 2018 · 4 comments
Closed

clarify what the malformed WASM test is testing #87

gballet opened this issue Sep 4, 2018 · 4 comments

Comments

@gballet
Copy link
Member

gballet commented Sep 4, 2018

In order to find the proper interpreter, the go-ethereum client tells wagon to load the WASM contract; if it succeeds then the file is assumed to be an eWASM file, otherwise it is assumed to be an EVM contract. The "malformed ewasm" test assumes that wagon should accept a malformed ewasm as long as the header signature is present.

The way I see it, EVMC/hera should not load the file either and consider it to be an EVM file. Please clarify what the criteria are to select an interpreter based on a binary blob (just having the \0asm signature? Ability to fully load the file?) @axic

@axic
Copy link
Member

axic commented Sep 4, 2018

In EVMC (Aleth), this is driven by the VM as opposed to the client.

Whatever VM is selected by the user is invoked for every single input. An EVMC execution may come back with EVMC_REJECTED, which means the VM rejected execution of that contract.

A concrete example in Aleth:

  • for every input Hera is invoked
  • for wasm input it just does whatever it does
  • for evm input it returns EVMC_REJECTED and aleth invokes the EVM interpreter (however, if Hera is not run with evm1mode=fallback, then instead of EVMC_REJECTED it will return a failure code and Aleth will not try to execute it via the EVM interpret)

The test suite is currently implicitly assumed to be ran without evm1mode=fallback, that is all input is consumed by the wasm VM.

@chfast
Copy link
Collaborator

chfast commented Sep 4, 2018

Simple change we could do in EVMC is to along the name and version to return a set of features (similarly to OpenCL, CPU features, etc). Here it could be {evm, ewasm, interpreter, jit}.
This however will not fully work for Hera which is able to execute EVM conditionally only when proper options are specified.

@axic
Copy link
Member

axic commented Oct 25, 2018

@gballet can we close this issue/

@gballet
Copy link
Member Author

gballet commented Oct 28, 2018

It's been clarified and geth+wagon now models the behavior of geth+evmc/hera

@gballet gballet closed this as completed Oct 28, 2018
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

No branches or pull requests

3 participants