Skip to content

Proto/Michelson: unaccounted gas consumption does not fail

What

Prevent the gas consumption in the Michelson interpreter from failing when gas is unaccounted.

Why

This commit aligns the semantics of unaccounted gas consumption in the Michelson interpreter with the ones of raw_context and of the gas monad. Without it, the interpreter can fail on gas consumption in unaccounted mode, thus making the exact value of the context's remaining_operation_gas field observable.

How

Add a function in the Local_gas_counter module telling if gas is limited or not. Call it when we are about to raise gas exhaustion errors in the interpreter to rather continue the execution in case of unlimited gas. Some refactoring was needed to keep the interpreter tailrec, I strongly recommend patdiff to review the first two commits.

Manually testing the MR

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, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Raphaël Cauderlier

Merge request reports