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. message : string option;
  3. max_operations_ttl : int;
  4. last_allowed_fork_level : Stdlib.Int32.t;
}
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

init_test_chain must only be called on a forking block.

type result = {
  1. validation_store : validation_store;
  2. block_metadata : Stdlib.Bytes.t;
  3. ops_metadata : Stdlib.Bytes.t list list;
  4. block_metadata_hash : Tezos_crypto.Block_metadata_hash.t option;
  5. ops_metadata_hashes : Tezos_crypto.Operation_metadata_hash.t list list option;
  6. forking_testchain : bool;
}
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 outdate

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_storage.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

    *)
}

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

OCaml

Innovation. Community. Security.