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

Host functions to support EVM #182

Closed
arhag opened this issue May 3, 2022 · 1 comment · Fixed by #316
Closed

Host functions to support EVM #182

arhag opened this issue May 3, 2022 · 1 comment · Fixed by #316
Assignees

Comments

@arhag
Copy link
Member

arhag commented May 3, 2022

Host functions enabling specific cryptographic operations need to be added as a protocol feature in Mandel to support the EVM runtime (and especially the EVM precompiles):

We can also consider adding a variation of the host function to do ECSDA public key recovery which returns uncompressed public keys and which does not abort the transaction if the signature is bad. This would allow the EVM runtime to support the precompile ECRecover address 0x01 in way that allows the runtime to be more compliant and more performant. However, this additional host function is not necessary for Mandel 3.1 since we can leverage the existing recover_key host function. That may be the approach to go with for the time being in the interest in time as well as to consider an alternative way to provide this functionality that is more general than another recovery key host function, e.g. providing add and multiply primitives instead for that elliptic curve.

Another host function is needed to support the EVM runtime which should be considered as part of a separate protocol feature:

  • Get current block height/number. (Supports EVM NUMBER opcode.)

It is possible to get the current block height through a roundabout way without a protocol feature. An updated system contract can keep track of the last block height using the onblock action which is given the previous block header each block. However, that approach is not guaranteed to be reliable and it would be simpler to just add a new host function in a release where many other protocol features are being included.

@heifner
Copy link
Member

heifner commented May 3, 2022

Related:
EOSIO/eos#10831
EOSIO/eos#6718

This was referenced Jun 9, 2022
@arhag arhag linked a pull request Jun 9, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants