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;
message : string option;
max_operations_ttl : int;
last_allowed_fork_level : Stdlib.Int32.t;
}
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 ->
Tezos_base.Block_header.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.
type result = {
validation_store : validation_store;
block_metadata : Stdlib.Bytes.t;
ops_metadata : Stdlib.Bytes.t list list;
block_metadata_hash : Tezos_crypto.Block_metadata_hash.t option;
ops_metadata_hashes : Tezos_crypto.Operation_metadata_hash.t list list option;
}
val result_encoding : result 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
*)}
val apply :
apply_environment ->
Tezos_base.Block_header.t ->
Tezos_base.Operation.t list list ->
(result, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t
apply env header ops
get the protocol P
of the context of the predecessor block and calls successively: 1. P.begin_application
2. P.apply
3. P.finalize_block