package octez-shell-libs

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

Block_validator_process is used to validate new blocks. This validation can be

  • internal: the same processus is used to run the node and to validate blocks
  • external: another processus is used to validate blocks This module also ensures the liveness of the operations (see Block_validation:check_liveness).
type validator_environment = {
  1. user_activated_upgrades : Tezos_base.User_activated.upgrades;
    (*

    user activated upgrades

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

    user activated protocol overrides

    *)
  3. operation_metadata_size_limit : Tezos_shell_services.Shell_limits.operation_metadata_size_limit;
    (*

    size limit for operation metadata that should be written on disk

    *)
}
type validator_kind =
  1. | Internal : validator_environment * Tezos_store.Store.Chain.chain_store -> validator_kind
  2. | External : {
    1. parameters : Tezos_validation.External_validation.parameters;
    2. process_path : string;
    } -> validator_kind

For performances reasons, it may be interesting to use another processus (from the OS) to validate blocks (External). However, in that case, only one processus has a write access to the context. Currently informations are exchanged via the file system.

type simple_kind =
  1. | External_process
  2. | Single_process
type t

Internal representation of the block validator process

val kind : t -> simple_kind
val close : t -> unit Lwt.t

close vp closes the given vp. In the case of an External validator process, we first ask the validator to shutdown. If it is still running after 5 seconds, we notice that the block validation process is unresponsive and we force its termination (using a registered Lwt_exit.clean_up_callback).

apply_block bvp predecessor header ops checks the liveness of the operations and then call Block_validation.apply

should_precheck when set, triggers the block prechecking before applying it, see Block_validation.apply.

If simulate is true, the context resulting from the application will not be committed to disk. Set to false by default.

preapply_block bvp chain_store ~predecessor ~protocol_data ~timestamp ops is a wrapper for Block_validation.preapply.

val context_garbage_collection : t -> Tezos_context_ops.Context_ops.index -> Tezos_base.TzPervasives.Context_hash.t -> gc_lockfile_path:string -> unit Tezos_base.TzPervasives.tzresult Lwt.t

context_garbage_collection bvp context_index context_hash removes contexts that are below context_hash in the context tree.

context_split bvp context_index splits the context storage layout into a new chunk.

init_test_chain must only be called on a forking block.

OCaml

Innovation. Community. Security.