package octez-shell-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-shell-libs.shell/Tezos_shell/Block_validator_process/index.html
Module Tezos_shell.Block_validator_process
Source
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 = {
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_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.
Internal representation of the block validator process
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).
val reconfigure_event_logging :
t ->
Tezos_base_unix.Internal_event_unix.Configuration.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
val apply_block :
?simulate:bool ->
?should_precheck: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.t
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.
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.t
preapply_block bvp chain_store ~predecessor ~protocol_data ~timestamp ops
is a wrapper for Block_validation.preapply
.
val precheck_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.t
precheck_block bvp chain_store ~predecessor header hash ops
is a wrapper for Block_validation.precheck
.
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.
val context_split :
t ->
Tezos_context_ops.Context_ops.index ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
context_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.t
val 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.t
init_test_chain
must only be called on a forking block.