package tezos-validation

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

This module is a proxy for the shell of the protocol (for the application part). The main function of this module is apply whichs calls the one of the protocol.

type validation_store = {
  1. context_hash : Tezos_crypto.Context_hash.t;
  2. timestamp : Tezos_base.Time.Protocol.t;
  3. message : string option;
  4. max_operations_ttl : int;
  5. last_allowed_fork_level : Stdlib.Int32.t;
    (*

    Oldest block for which reorganizations can happen

    *)
}
val may_patch_protocol : user_activated_upgrades:Tezos_base.User_activated.upgrades -> user_activated_protocol_overrides: Tezos_base.User_activated.protocol_overrides -> level:Stdlib.Int32.t -> Tezos_protocol_environment.validation_result -> Tezos_protocol_environment.validation_result Lwt.t
val update_testchain_status : Tezos_context.Context.t -> predecessor_hash:Tezos_crypto.Block_hash.t -> Tezos_base.Time.Protocol.t -> Tezos_context.Context.t Lwt.t
val check_proto_environment_version_increasing : Tezos_crypto.Block_hash.t -> Tezos_base.Protocol.env_version -> Tezos_base.Protocol.env_version -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result

check_proto_environment_version_increasing hash before after returns successfully if the environment version stays the same or increases from before to after. Otherwise, an Invalid_protocol_environment_transition error is returned.

init_test_chain must only be called on a forking block.

type operation_metadata =
  1. | Metadata of Stdlib.Bytes.t
  2. | Too_large_metadata
val operation_metadata_encoding : operation_metadata Data_encoding.t
type ops_metadata =
  1. | No_metadata_hash of operation_metadata list list
  2. | Metadata_hash of (operation_metadata * Tezos_crypto.Operation_metadata_hash.t) list list
type result = {
  1. validation_store : validation_store;
  2. block_metadata : bytes * Tezos_crypto.Block_metadata_hash.t option;
  3. ops_metadata : ops_metadata;
}
type apply_result = {
  1. result : result;
  2. cache : Environment_context.Context.cache;
}
val result_encoding : result Data_encoding.t
val check_liveness : live_blocks:Tezos_crypto.Block_hash.Set.t -> live_operations:Tezos_crypto.Operation_hash.Set.t -> Tezos_crypto.Block_hash.t -> Tezos_base.Operation.t list list -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result

check_liveness live_blocks live_operations hash ops checks there is no duplicate operation and that is not out-of-date

type apply_environment = {
  1. max_operations_ttl : int;
    (*

    time to live of an operation

    *)
  2. chain_id : Tezos_crypto.Chain_id.t;
    (*

    chain_id of the current branch

    *)
  3. predecessor_block_header : Tezos_base.Block_header.t;
    (*

    header of the predecessor block being validated

    *)
  4. predecessor_context : Tezos_context.Context.t;
    (*

    context associated to the predecessor block

    *)
  5. predecessor_block_metadata_hash : Tezos_crypto.Block_metadata_hash.t option;
    (*

    hash of block header metadata of the predecessor block

    *)
  6. predecessor_ops_metadata_hash : Tezos_crypto.Operation_metadata_list_list_hash.t option;
    (*

    hash of operation metadata of the predecessor block

    *)
  7. user_activated_upgrades : Tezos_base.User_activated.upgrades;
    (*

    user activated upgrades

    *)
  8. user_activated_protocol_overrides : Tezos_base.User_activated.protocol_overrides;
    (*

    user activated protocol overrides

    *)
  9. operation_metadata_size_limit : int option;
    (*

    size limit for operation metadata that should be written on disk

    *)
}
val default_operation_metadata_size_limit : int option

Default size limit for operation metadata

apply env header ops gets the protocol P of the context of the predecessor block and calls successively: 1. P.begin_application 2. P.apply 3. P.finalize_block

val precheck : chain_id:Tezos_crypto.Chain_id.t -> predecessor_block_header:Tezos_base.Block_header.t -> predecessor_block_hash:Tezos_crypto.Block_hash.t -> predecessor_context:Tezos_context.Context.t -> cache:Environment_context.Context.source_of_cache -> Tezos_base.Block_header.t -> Tezos_base.Operation.t list list -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

precheck chain_id ~predecessor_block_header ~predecessor_block_hash ~predecessor_context ~cache header ops gets the protocol P of the context of the predecessor block and calls successively: 1. P.begin_partial_application 2. P.apply 3. P.finalize_block

val preapply : chain_id:Tezos_crypto.Chain_id.t -> user_activated_upgrades:Tezos_base.User_activated.upgrades -> user_activated_protocol_overrides: Tezos_base.User_activated.protocol_overrides -> operation_metadata_size_limit:int option -> timestamp:Tezos_base.Time.Protocol.t -> protocol_data:bytes -> live_blocks:Tezos_crypto.Block_hash.Set.t -> live_operations:Tezos_crypto.Operation_hash.Set.t -> predecessor_context:Tezos_context.Context.t -> predecessor_shell_header:Tezos_base.Block_header.shell_header -> predecessor_hash:Tezos_crypto.Block_hash.t -> predecessor_max_operations_ttl:int -> predecessor_block_metadata_hash:Tezos_crypto.Block_metadata_hash.t option -> predecessor_ops_metadata_hash: Tezos_crypto.Operation_metadata_list_list_hash.t option -> Tezos_base.Operation.t list list -> ((Tezos_base.Block_header.shell_header * Tezos_error_monad.TzCore.error Tezos_shell_services.Preapply_result.t list) * (apply_result * Tezos_context.Context.t), Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.