Proto: Global Table of Constants

Daniel Hines requested to merge marigold/tezos:dh/gtom into master


This MR implements the table of constants feature described in the corresponding TZIP. The TZIP discusses the motivations for the change. The succeeds the previous one at !2474 (closed)


There are three main contributions in the MR:

  • A new Global_constants module to that represents a table mapping hashes of Micheline values as Script_expr_hash.t to actual Micheline values.
  • A new manager operation register_global_constant is added for setting values in this table.
  • Three new Michelson primitives for referencing constants are added D_Constant, T_constant, and I_CONSTANT.
  • A function substitute : Alpha_context.t -> Script.expr -> Script.expr tzresult Lwt.t is added for transforming a Michelson expressions with constants into their fully expanded form.
  • Before transactions are applied, substitute is called on a contract's script, ensuring is fully expanded before type elaboration.

Manually testing the MR


  • 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 for everything else).
  • Select suitable reviewers using the Reviewers field below.
Edited by Yann Regis-Gianas

Merge request reports