2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2017-11-14 03:36:14 +04:00
|
|
|
(* Copyright (c) 2014 - 2017. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2017-11-19 17:38:36 +04:00
|
|
|
(* See `src/environment/v1/updater.mli` for documentation. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-10-27 20:53:07 +04:00
|
|
|
val compile: Protocol_hash.t -> Protocol.t -> bool Lwt.t
|
|
|
|
val activate: Context.t -> Protocol_hash.t -> Context.t Lwt.t
|
|
|
|
val fork_test_network:
|
|
|
|
Context.t -> protocol:Protocol_hash.t -> expiration:Time.t -> Context.t Lwt.t
|
|
|
|
|
|
|
|
val init: string -> unit
|
|
|
|
|
2017-10-09 12:55:12 +04:00
|
|
|
type validation_result = {
|
2017-04-10 14:14:11 +04:00
|
|
|
context: Context.t ;
|
2017-04-19 21:21:23 +04:00
|
|
|
fitness: Fitness.t ;
|
2017-04-10 14:14:11 +04:00
|
|
|
message: string option ;
|
2017-11-19 17:38:36 +04:00
|
|
|
max_operation_data_length: int ;
|
|
|
|
max_number_of_operations: int list ;
|
2017-04-18 13:29:14 +04:00
|
|
|
max_operations_ttl: int ;
|
2017-04-10 14:14:11 +04:00
|
|
|
}
|
|
|
|
|
2017-10-09 12:55:12 +04:00
|
|
|
type rpc_context = {
|
2017-04-14 02:07:01 +04:00
|
|
|
block_hash: Block_hash.t ;
|
2017-04-19 21:21:23 +04:00
|
|
|
block_header: Block_header.t ;
|
2017-04-14 02:07:01 +04:00
|
|
|
operation_hashes: unit -> Operation_hash.t list list Lwt.t ;
|
2017-04-19 21:21:23 +04:00
|
|
|
operations: unit -> Operation.t list list Lwt.t ;
|
2017-04-10 14:14:11 +04:00
|
|
|
context: Context.t ;
|
|
|
|
}
|
|
|
|
|
2017-10-09 12:55:12 +04:00
|
|
|
module type RAW_PROTOCOL = sig
|
|
|
|
type error = ..
|
2017-10-27 20:53:07 +04:00
|
|
|
type 'a tzresult = ('a, error list) result
|
2017-10-09 12:55:12 +04:00
|
|
|
val max_block_length: int
|
2017-11-19 17:38:36 +04:00
|
|
|
type operation
|
2017-10-09 12:55:12 +04:00
|
|
|
val parse_operation:
|
|
|
|
Operation_hash.t -> Operation.t -> operation tzresult
|
|
|
|
val compare_operations: operation -> operation -> int
|
|
|
|
type validation_state
|
|
|
|
val current_context: validation_state -> Context.t tzresult Lwt.t
|
|
|
|
val precheck_block:
|
|
|
|
ancestor_context: Context.t ->
|
|
|
|
ancestor_timestamp: Time.t ->
|
|
|
|
Block_header.t ->
|
|
|
|
unit tzresult Lwt.t
|
|
|
|
val begin_application:
|
|
|
|
predecessor_context: Context.t ->
|
|
|
|
predecessor_timestamp: Time.t ->
|
|
|
|
predecessor_fitness: Fitness.t ->
|
|
|
|
Block_header.t ->
|
|
|
|
validation_state tzresult Lwt.t
|
|
|
|
val begin_construction:
|
|
|
|
predecessor_context: Context.t ->
|
|
|
|
predecessor_timestamp: Time.t ->
|
|
|
|
predecessor_level: Int32.t ->
|
|
|
|
predecessor_fitness: Fitness.t ->
|
|
|
|
predecessor: Block_hash.t ->
|
|
|
|
timestamp: Time.t ->
|
|
|
|
?proto_header: MBytes.t ->
|
|
|
|
unit -> validation_state tzresult Lwt.t
|
|
|
|
val apply_operation:
|
|
|
|
validation_state -> operation -> validation_state tzresult Lwt.t
|
|
|
|
val finalize_block:
|
|
|
|
validation_state -> validation_result tzresult Lwt.t
|
2017-12-09 06:51:58 +04:00
|
|
|
val rpc_services: rpc_context RPC_directory.t
|
2017-10-09 12:55:12 +04:00
|
|
|
val configure_sandbox:
|
|
|
|
Context.t -> Data_encoding.json option -> Context.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
2017-10-27 20:53:07 +04:00
|
|
|
(**/**)
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-10-27 20:53:07 +04:00
|
|
|
(* The end of this file is not exported to the protocol... *)
|
|
|
|
|
2017-10-27 22:22:44 +04:00
|
|
|
val compiler_name: string
|
|
|
|
|
2017-10-27 20:53:07 +04:00
|
|
|
module Node_protocol_environment_sigs : sig
|
|
|
|
|
|
|
|
module type V1 = sig
|
|
|
|
|
2017-10-27 23:42:44 +04:00
|
|
|
include Tezos_protocol_environment_sigs.V1.T
|
2017-10-27 20:53:07 +04:00
|
|
|
with type Format.formatter = Format.formatter
|
|
|
|
and type 'a Data_encoding.t = 'a Data_encoding.t
|
|
|
|
and type 'a Lwt.t = 'a Lwt.t
|
|
|
|
and type ('a, 'b) Pervasives.result = ('a, 'b) result
|
2017-11-27 09:13:12 +04:00
|
|
|
and type Hash.Net_id.t = Net_id.t
|
|
|
|
and type Hash.Block_hash.t = Block_hash.t
|
|
|
|
and type Hash.Operation_hash.t = Operation_hash.t
|
|
|
|
and type Hash.Operation_list_list_hash.t = Operation_list_list_hash.t
|
2017-12-05 18:19:22 +04:00
|
|
|
and type Hash.Context_hash.t = Context_hash.t
|
2017-10-27 20:53:07 +04:00
|
|
|
and type Context.t = Context.t
|
|
|
|
and type Time.t = Time.t
|
|
|
|
and type MBytes.t = MBytes.t
|
2017-11-27 09:13:12 +04:00
|
|
|
and type Tezos_data.Operation.shell_header = Operation.shell_header
|
|
|
|
and type Tezos_data.Operation.t = Operation.t
|
|
|
|
and type Tezos_data.Block_header.shell_header = Block_header.shell_header
|
|
|
|
and type Tezos_data.Block_header.t = Block_header.t
|
2017-12-09 06:51:58 +04:00
|
|
|
and type 'a RPC_directory.t = 'a RPC_directory.t
|
2017-10-27 20:53:07 +04:00
|
|
|
and type Updater.validation_result = validation_result
|
|
|
|
and type Updater.rpc_context = rpc_context
|
|
|
|
|
|
|
|
type error += Ecoproto_error of Error_monad.error list
|
|
|
|
val wrap_error : 'a Error_monad.tzresult -> 'a tzresult
|
|
|
|
|
|
|
|
end
|
2017-10-09 12:55:12 +04:00
|
|
|
|
|
|
|
end
|
2017-10-27 20:53:07 +04:00
|
|
|
|
|
|
|
module type NODE_PROTOCOL =
|
|
|
|
RAW_PROTOCOL with type error := error
|
|
|
|
and type 'a tzresult := 'a tzresult
|
|
|
|
|
|
|
|
module LiftProtocol(Name : sig val name: string end)
|
|
|
|
(Env : Node_protocol_environment_sigs.V1)
|
|
|
|
(P : Env.Updater.PROTOCOL) :
|
|
|
|
NODE_PROTOCOL with type operation := P.operation
|
2017-11-13 19:34:00 +04:00
|
|
|
and type validation_state := P.validation_state
|