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 = {
context_hash : Tezos_crypto.Context_hash.t;
timestamp : Tezos_base.Time.Protocol.t;
message : string option;
max_operations_ttl : int;
last_allowed_fork_level : Stdlib.Int32.t;
Oldest block for which reorganizations can happen
*)}
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
val update_testchain_status :
Tezos_context.Context.t ->
predecessor_hash:Tezos_crypto.Block_hash.t ->
Tezos_base.Time.Protocol.t ->
Tezos_context.Context.t Lwt.t
val check_proto_environment_version_increasing :
Tezos_crypto.Block_hash.t ->
Tezos_base.Protocol.env_version ->
Tezos_base.Protocol.env_version ->
(unit, Tezos_error_monad.TzCore.error list) Stdlib.result
check_proto_environment_version_increasing hash before after
returns successfully if the environment version stays the same or increases from before
to after
. Otherwise, an Invalid_protocol_environment_transition
error is returned.
val init_test_chain :
Tezos_context.Context.t ->
Tezos_base.Block_header.t ->
(Tezos_base.Block_header.t, Tezos_error_monad.TzCore.error list)
Stdlib.result
Lwt.t
init_test_chain
must only be called on a forking block.
val operation_metadata_encoding : operation_metadata Data_encoding.t
type ops_metadata =
| No_metadata_hash of operation_metadata list list
| Metadata_hash of (operation_metadata * Tezos_crypto.Operation_metadata_hash.t)
list
list
type result = {
validation_store : validation_store;
block_metadata : bytes * Tezos_crypto.Block_metadata_hash.t option;
ops_metadata : ops_metadata;
}
val result_encoding : result Data_encoding.t
val preapply_result_encoding :
(Tezos_base.Block_header.shell_header
* Tezos_error_monad.TzCore.error Tezos_shell_services.Preapply_result.t list)
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 out-of-date
type apply_environment = {
max_operations_ttl : int;
time to live of an operation
*)chain_id : Tezos_crypto.Chain_id.t;
chain_id of the current branch
*)predecessor_block_header : Tezos_base.Block_header.t;
header of the predecessor block being validated
*)predecessor_context : Tezos_context.Context.t;
context associated to the predecessor block
*)predecessor_block_metadata_hash : Tezos_crypto.Block_metadata_hash.t option;
hash of block header metadata of the predecessor block
*)predecessor_ops_metadata_hash : Tezos_crypto.Operation_metadata_list_list_hash.t
option;
hash of operation metadata of the predecessor block
*)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 : int option;
size limit for operation metadata that should be written on disk
*)}
val apply :
?cached_result:(apply_result * Tezos_context.Context.t) ->
apply_environment ->
cache:Environment_context.Context.source_of_cache ->
Tezos_base.Block_header.t ->
Tezos_base.Operation.t list list ->
(apply_result, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
apply env header ops
gets the protocol P
of the context of the predecessor block and calls successively: 1. P.begin_application
2. P.apply
3. P.finalize_block
val precheck :
chain_id:Tezos_crypto.Chain_id.t ->
predecessor_block_header:Tezos_base.Block_header.t ->
predecessor_block_hash:Tezos_crypto.Block_hash.t ->
predecessor_context:Tezos_context.Context.t ->
cache:Environment_context.Context.source_of_cache ->
Tezos_base.Block_header.t ->
Tezos_base.Operation.t list list ->
(unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
precheck chain_id ~predecessor_block_header
~predecessor_block_hash ~predecessor_context ~cache header ops
gets the protocol P
of the context of the predecessor block and calls successively: 1. P.begin_partial_application
2. P.apply
3. P.finalize_block
val preapply :
chain_id:Tezos_crypto.Chain_id.t ->
user_activated_upgrades:Tezos_base.User_activated.upgrades ->
user_activated_protocol_overrides:
Tezos_base.User_activated.protocol_overrides ->
operation_metadata_size_limit:int option ->
timestamp:Tezos_base.Time.Protocol.t ->
protocol_data:bytes ->
live_blocks:Tezos_crypto.Block_hash.Set.t ->
live_operations:Tezos_crypto.Operation_hash.Set.t ->
predecessor_context:Tezos_context.Context.t ->
predecessor_shell_header:Tezos_base.Block_header.shell_header ->
predecessor_hash:Tezos_crypto.Block_hash.t ->
predecessor_max_operations_ttl:int ->
predecessor_block_metadata_hash:Tezos_crypto.Block_metadata_hash.t option ->
predecessor_ops_metadata_hash:
Tezos_crypto.Operation_metadata_list_list_hash.t option ->
Tezos_base.Operation.t list list ->
((Tezos_base.Block_header.shell_header
* Tezos_error_monad.TzCore.error Tezos_shell_services.Preapply_result.t
list)
* (apply_result * Tezos_context.Context.t),
Tezos_error_monad.TzCore.error list)
Stdlib.result
Lwt.t