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

Propose an ewasm subset for precompiles on the main chain #104

Open
axic opened this issue Jun 28, 2018 · 4 comments
Open

Propose an ewasm subset for precompiles on the main chain #104

axic opened this issue Jun 28, 2018 · 4 comments

Comments

@axic
Copy link
Member

axic commented Jun 28, 2018

The only features ewasm would need to expose are:

  • useGas
  • calldata access (calldatacopy/calldatasize)
  • return / revert

This could be a way to get wasm VMs implemented and experimented with in a more controlled environment on the main chain.

It is not clear whether the precompiles would have "magic gas calculation rules" or just use "a metering process" on them.

@chfast
Copy link
Collaborator

chfast commented Jun 28, 2018

BTW, can you pass reference to calldata buffer directly to the contract main function?

@axic
Copy link
Member Author

axic commented Jun 29, 2018

@poemm
Copy link
Contributor

poemm commented Jun 29, 2018

Great idea. More generally, we can discuss how to constrain Wasm and EEI to get nice properties, such as allowing "magic gas calculation".

@axic
Copy link
Member Author

axic commented Jul 30, 2018

Proposal to expose these functions from the EEI:

  • useGas
  • getCallDataSize
  • callDataCopy
  • getCaller (good for contracts like blockhash - or should be getTxOrigin?!)
  • getCallValue (not necessary, but could be useful to reject calls with value)
  • return
  • revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants