Skip to content

[#305] Fix handling of the default entrypoint in SELF

Ivan Gromakovskii requested to merge gromak/#305-default-entrypoint into master

Description

Problem: it turned out that SELF %default instruction is permitted in Michelson. It's semantically equivalent to the SELF instruction (with no entrypoint reference), but is not entirely equivalent in binary format (that forms the blockchain). Specifically, SELF %default is more expensive to typecheck and consumes more storage size. Hence, we should distinguish them.

Solution:

  1. Update EpName invariants and permit "default" there.
  2. Define isDefEpName as a better way to check whether EpName refers to the default entrypoint. Document the DefEpName pattern.
  3. Define epNameFromSelfAnn to construct EpName from SELF annotation. Use it in SELF typechecking.

And there are some other small changes.

Related issue(s)

Resolves #305 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Ivan Gromakovskii

Merge request reports