Skip to content

Interface metering and source of truth for gas left #18

@s1na

Description

@s1na

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions