Context-free Michelson translator
In the protocol, the context is currently threaded through almost all functions of the Michelson translator for little good reasons. Apart from consuming gas, the only cases which require reading the context are the elaborations of data of type big_map
, sapling_state
, and contract
; these types are however not pushable so these elaboration cases are not reachable when lambdas or scripts are elaborated nor unparsed.
This context dependency has a cost in terms of usability of Michelson outside of the protocol. In particular, it limits the client's ability to elaborate or normalize values and scripts without interacting with a node. See #1638 for an instance of this problem.
A way to avoid the context dependency is to use the Gas_monad
, which also has the nice property of not reverting gas consumption when catching errors.
Work breakdown:
-
Move easy cases of the translator !10071 (merged), performance regression detected, reverted in !10265 (merged) -
parse_data, regularity !10227 (merged) -
parse_data, atomic cases !10211 -
Move more translator functions !10200 -
Move hard cases of the translator !10182 -
Improve gas model of UNPACK #2031 !10248 -
Even more of the translator !10247