package tezos-protocol-alpha

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

This is the Michelson interpreter.

This module offers a way to execute either a Michelson script or a Michelson instruction.

Implementation details are documented in the .ml file.

type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | Reject of Alpha_context.Script.location * Alpha_context.Script.expr * Script_typed_ir.execution_trace option
type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | Overflow of Alpha_context.Script.location * Script_typed_ir.execution_trace option
type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | Runtime_contract_error : Alpha_context.Contract.t * Alpha_context.Script.expr -> Tezos_protocol_environment_alpha__Environment.Error_monad.error
type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | Bad_contract_parameter of Alpha_context.Contract.t
type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | Cannot_serialize_failure
type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | Cannot_serialize_storage
type Tezos_protocol_environment_alpha__Environment.Error_monad.error +=
  1. | Michelson_too_many_recursive_calls
type execution_result = {
  1. ctxt : Alpha_context.context;
  2. storage : Alpha_context.Script.expr;
  3. lazy_storage_diff : Alpha_context.Lazy_storage.diffs option;
  4. operations : Alpha_context.packed_internal_operation list;
}
val step : Script_typed_ir.logger option -> Alpha_context.context -> step_constants -> ('a, 's, 'r, 'f) Script_typed_ir.kdescr -> 'a -> 's -> ('r * 'f * Alpha_context.context, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val execute : ?logger:Script_typed_ir.logger -> Alpha_context.t -> Script_ir_translator.unparsing_mode -> step_constants -> script:Alpha_context.Script.t -> entrypoint:string -> parameter:Alpha_context.Script.expr -> internal:bool -> (execution_result, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t
val kstep : Script_typed_ir.logger option -> Alpha_context.context -> step_constants -> ('a, 's, 'r, 'f) Script_typed_ir.kinstr -> 'a -> 's -> ('r * 'f * Alpha_context.context, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result Lwt.t

kstep logger ctxt step_constants kinstr accu stack interprets the script represented by kinstr under the context ctxt. This will turn a stack whose topmost element is accu and remaining elements stack into a new accumulator and a new stack. This function also returns an updated context. If logger is given, kstep calls back its functions at specific points of the execution. The execution is parameterized by some step_constants.

Internal interpretation loop ============================

The following types and the following functions are exposed in the interface to allow the inference of a gas model in snoop.

Strictly speaking, they should not be considered as part of the interface since they expose implementation details that may change in the future.

module Internals : sig ... end
OCaml

Innovation. Community. Security.