Tezos_shell.Block_validator_processBlock_validator_process is used to validate new blocks. This validation can be
Block_validation:check_liveness).type validator_environment = {user_activated_upgrades : Tezos_base.User_activated.upgrades;user activated upgrades
*)user_activated_protocol_overrides : Tezos_base.User_activated.protocol_overrides;user activated protocol overrides
*)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 = | Internal : validator_environment
* Tezos_store.Store.Chain.chain_store -> validator_kind| External : {parameters : Tezos_validation.External_validation.parameters;process_path : string;} -> validator_kindFor 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.
val init : validator_kind -> t Tezos_base.TzPervasives.tzresult Lwt.tval kind : t -> simple_kindval close : t -> unit Lwt.tclose 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).
val restart : t -> unit Tezos_base.TzPervasives.tzresult Lwt.trestart vp restarts the vp. This works only if the validator is external. This is a bad UX, but restarting the validator is not necessary if the validator is internal.
val reconfigure_event_logging :
t ->
Tezos_base_unix.Internal_event_unix.Configuration.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.tval apply_block :
?simulate:bool ->
?should_validate:bool ->
t ->
Tezos_store.Store.chain_store ->
predecessor:Tezos_store.Store.Block.t ->
Tezos_base.Block_header.t ->
Tezos_validation.Block_validation.operation list list ->
Tezos_validation.Block_validation.result Tezos_base.TzPervasives.tzresult
Lwt.tapply_block bvp predecessor header ops checks the liveness of the operations and then call Block_validation.apply
should_validate when set, triggers the block validation 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.
val preapply_block :
t ->
Tezos_store.Store.chain_store ->
predecessor:Tezos_store.Store.Block.t ->
protocol_data:bytes ->
timestamp:Tezos_base.Time.Protocol.t ->
Tezos_validation.Block_validation.operation list list ->
(Tezos_base.Block_header.shell_header
* Tezos_base.TzPervasives.error Tezos_shell_services.Preapply_result.t list)
Tezos_base.TzPervasives.tzresult
Lwt.tpreapply_block bvp chain_store ~predecessor ~protocol_data ~timestamp ops is a wrapper for Block_validation.preapply.
val validate_block :
t ->
Tezos_store.Store.chain_store ->
predecessor:Tezos_store.Store.Block.t ->
Tezos_base.Block_header.t ->
Tezos_base.TzPervasives.Block_hash.t ->
Tezos_validation.Block_validation.operation Tezos_base.TzPervasives.trace
Tezos_base.TzPervasives.trace ->
unit Tezos_base.TzPervasives.tzresult Lwt.tvalidate_block bvp chain_store ~predecessor header hash ops is a wrapper for Block_validation.validate.
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.tcontext_garbage_collection bvp context_index context_hash removes contexts that are below context_hash in the context tree.
val context_split :
t ->
Tezos_context_ops.Context_ops.index ->
unit Tezos_base.TzPervasives.tzresult Lwt.tcontext_split bvp context_index splits the context storage layout into a new chunk.
val commit_genesis :
t ->
chain_id:Tezos_base.TzPervasives.Chain_id.t ->
Tezos_base.TzPervasives.Context_hash.t Tezos_base.TzPervasives.tzresult Lwt.tval init_test_chain :
t ->
Tezos_base.TzPervasives.Chain_id.t ->
Tezos_store.Store.Block.t ->
Tezos_base.Block_header.t Tezos_base.TzPervasives.tzresult Lwt.tinit_test_chain must only be called on a forking block.