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

Interface metering and source of truth for gas left #18

Open
s1na opened this issue Apr 10, 2019 · 2 comments
Open

Interface metering and source of truth for gas left #18

s1na opened this issue Apr 10, 2019 · 2 comments

Comments

@s1na
Copy link
Collaborator

s1na commented Apr 10, 2019

In runevm there are two sources of truth for the remaining gas during a transaction. One stored by the host, and one by parity's interpreter.

This would be no problem if runevm were to meter everything and only do a consumeGas at the end to let the host know how much gas it has spent. But some hosts (e.g. hera) meter EEI methods themselves, which means the gas costs stored by the interpreter and the host diverges.

I was wondering what others think about these alternatives, and whether there are better approaches I'm not seeing:

  • Disable interface metering in hosts (e.g. add a flag to hera for this), add the methods mentioned in evm2wasm specific EEI methods ewasm/design#138 to the EEI, and do complete metering in runevm.
  • Keep interface metering in hosts and to keep the gas costs in sync (necessary for e.g. EIP150):
    • do a consumeGas after instructions which don't call an EEI method
    • do a getGasLeft after instructions which do call an EEI method
@axic
Copy link
Owner

axic commented Apr 11, 2019

Hera has an option to disable metering entirely. That was meant to be used with evm2wasm or runevm. In that case everything should be metered by runevm.

@axic
Copy link
Owner

axic commented Apr 11, 2019

Probably the best approach is to also make it optional in runevm for now.

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