Skip to content

Proto/Michelson: gas improvements for the CONTRACT instruction

Context

This MR makes the CONTRACT instruction cheaper and safer by

  • moving a Gas.consume to the appropriate branch (as discussed in #1413 (closed))
  • removing a context read for originated contracts (instead of checking for existence first and then fetching the script we now only fetch the script)
  • removing a gas overapproximation hack in the case of type error.

Typechecking in the contract case is similarly improved.

  • check the test coverage of this piece of code (before and after the change)
  • add tests if needed

Manually testing the MR

See added tests and updated regtest outputs.

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.
  • Select as Assignee the next person who should take action on that MR
Edited by Mehdi Bouaziz

Merge request reports

Loading