MIR: interpreter gas consumption
Context
This MR implements gas consumption in the interpreter.
Gas costs are mostly copied from Octez; however, a lot of costs charged by Octez are not directly related to the interpretation and/or are not applicable to the prototype interpreter, and thus omitted. Some examples:
- typecheck input and storage; Octez does this in the interpreter
- find entrypoint: we don't support entrypoints yet
- collect lazy storage (
big_maps,sapling_state, etc) -- we don't support lazy storage yet (note there is an associated gas cost even if lazy storage isn't used by the contract) - extract lazy storage diff (same as above)
- ticket handling -- we don't handle tickets yet
- cost of serialization (including "unparsing") -- we're not doing that yet either
This is based on top of !10017 (merged), however, !10083 (merged) is also merged in, as gas primitives are defined there. Please only review commits starting from MIR: Return Result from interpret (inclusive)
Manually testing the MR
cargo test
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Nikolay Yakimov