Skip to content

Proto/Gas: operation gas limit gets entirely consumed in the block

Context

The main motivation behind this MR is that we want to move to a model where bakers can determine the validity of a block without executing any smart contract inside that block. The problem was that gas consumed in the block was exactly the gas consumed by its operations, which requires executing them to obtain the final block gas level.

This MR solves this problem by changing the gas consumption to always reduce the block gas level by the operation gas limit for every operation.

Manually testing the MR

dune exec src/proto_alpha/lib_protocol/test/main.exe -- test "^gas levels$"

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.rst for the protocol and the environment, the Development Version section of CHANGES.md for everything else).
  • Select suitable reviewers using the Reviewers field below.
Edited by Mehdi Bouaziz

Merge request reports