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

EVMC precompiles #259

Open
chfast opened this issue Apr 29, 2019 · 3 comments
Open

EVMC precompiles #259

chfast opened this issue Apr 29, 2019 · 3 comments

Comments

@chfast
Copy link
Member

chfast commented Apr 29, 2019

Implementation

The EVMC precompiles module has to implement EVMC VM API what boils down the execute() method.

In the execute() it receives the message with all the information needed to compute the result, which includes:

  • gas limit (the cost have to subtracted),
  • the address (to identify the precompile contract),
  • the input.
    Other fields are not relevant and can be ignored.
    The result is returned from the execute() function. The result includes:
  • status code (SUCCESS, OUT_OF_GAS, etc)
  • the output,
  • the amount of gas left.

The EVMC precompiles can ignore the Host interface (i.e. methods for state query and modification) entirely. This also means that Clients do not have to implement it if they only want to use EVMC precompiles. This should make EVMC integration easier.

Integration

Precompiles capability, Host driven

  1. Extend EVMC capabilities set with "precompiles".
  2. Assume EIP-1352 is ready.
  3. When a client is to execute a call within precomiles address range, it sends it to the "precompiles" VM.
@chfast
Copy link
Member Author

chfast commented May 9, 2019

Currently there is no "full" way to bypass Host when executing precompiles because they might be executed with CALL having vaue and EVMC does not provide a way to modify account balances.

@chfast
Copy link
Member Author

chfast commented May 9, 2019

Informational EIP proposed: ethereum/EIPs#2003.

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

2 participants
@chfast and others