Skip to content

[TM-229] Share typecheck results in `Runtime`

Roman Melnikov requested to merge rvem/tm229-share-typecheck-results into master

Description

Problem: each TransferOp operation in Michelson.Runtime typechecks contract code. Typechecking is costly, and it makes tests take long.

Solution: Store typed representation of contract code and storage in ContractState. So that contract is typechecked only once during its originataion via OriginateOp. Also interpreter now uses typed representation of contract code, parameter and storage, which is removes (almost, if typechecker error happened during interpretation, this should be treated as a bug) chances of getting typecheck error during interpretation.

Related issue(s)

https://issues.serokell.io/issue/TM-229

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • [ ] If I added new functionality, I added tests covering it. <- Not really new functionality, just some changes in implementation, that doesn't affect any functionality.
    • 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:

Stylistic guide (mandatory)

Edited by Roman Melnikov

Merge request reports