Skip to content

Proto/Michelson: simplify serialize_ty_for_error

Context

Thanks to !3630 (merged), we can now use the uncarbonated unparsing of types for errors. This is OK as long as those errors are caught only once per smart contract run (let's say gas is paid as part of the flat rate of operations).

This allows to get rid of an artificial dependency on the context at several places in the elaborator.

There are several motivations:

  • not depending on the (whole) context when we don't have to, to reduce the effect surface
  • not consuming CPU for producing errors that will be thrown away and for which gas may be miscounted
  • adapting to the forthcoming change of record_trace_eval (!3589 (merged))

Getting rid of unsafe_embed is only a nice side effect.

Manually testing the MR

CI

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