Module Mavryk_shell.Block_validator_process

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

type validator_environment = {
  1. user_activated_upgrades : Mavryk_base.User_activated.upgrades;
    (*

    user activated upgrades

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

    user activated protocol overrides

    *)
  3. operation_metadata_size_limit : Mavryk_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 * Mavryk_store.Store.Chain.chain_store -> validator_kind
  2. | External : {
    1. parameters : Mavryk_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.

precheck_block bvp chain_store ~predecessor header hash ops is a wrapper for Block_validation.precheck.

val context_garbage_collection : t -> Mavryk_context_ops.Context_ops.index -> Mavryk_base.TzPervasives.Context_hash.t -> gc_lockfile_path:string -> unit Mavryk_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.