diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d83fee4c4fbc56410898a812b571e1c3121cd9ca..dabed691c657be1b8b90b622e011944ea1f29b22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -398,126 +398,131 @@ opam:38:tezos-protocol-genesis: variables: package: tezos-protocol-genesis -opam:39:ocplib-resto-json: - <<: *opam_definition - variables: - package: ocplib-resto-json - -opam:40:tezos-protocol-updater: +opam:39:tezos-protocol-updater: <<: *opam_definition variables: package: tezos-protocol-updater -opam:41:tezos-p2p: +opam:40:tezos-p2p: <<: *opam_definition variables: package: tezos-p2p -opam:42:tezos-baking-alpha-commands: +opam:41:ocplib-resto-json: <<: *opam_definition variables: - package: tezos-baking-alpha-commands + package: ocplib-resto-json -opam:43:tezos-client-alpha-commands: +opam:42:tezos-baking-alpha-commands: <<: *opam_definition variables: - package: tezos-client-alpha-commands + package: tezos-baking-alpha-commands -opam:44:tezos-client-base-unix: +opam:43:tezos-client-base-unix: <<: *opam_definition variables: package: tezos-client-base-unix -opam:45:tezos-client-genesis: +opam:44:tezos-client-genesis: <<: *opam_definition variables: package: tezos-client-genesis -opam:46:ocplib-ezresto: - <<: *opam_definition - variables: - package: ocplib-ezresto - -opam:47:tezos-embedded-protocol-alpha: +opam:45:tezos-embedded-protocol-alpha: <<: *opam_definition variables: package: tezos-embedded-protocol-alpha -opam:48:tezos-embedded-protocol-demo: +opam:46:tezos-embedded-protocol-demo: <<: *opam_definition variables: package: tezos-embedded-protocol-demo -opam:49:tezos-embedded-protocol-genesis: +opam:47:tezos-embedded-protocol-genesis: <<: *opam_definition variables: package: tezos-embedded-protocol-genesis -opam:50:tezos-shell: +opam:48:tezos-shell: <<: *opam_definition variables: package: tezos-shell -opam:51:tezos-endorser-alpha-commands: +opam:49:tezos-client-alpha-commands: <<: *opam_definition variables: - package: tezos-endorser-alpha-commands + package: tezos-client-alpha-commands -opam:52:tezos-client: +opam:50:ocplib-ezresto: <<: *opam_definition variables: - package: tezos-client + package: ocplib-ezresto -opam:53:ocplib-ezresto-directory: +opam:51:tezos-baking-alpha-services: <<: *opam_definition variables: - package: ocplib-ezresto-directory + package: tezos-baking-alpha-services -opam:54:tezos-accuser-alpha: +opam:52:tezos-accuser-alpha: <<: *opam_definition variables: package: tezos-accuser-alpha -opam:55:tezos-endorser-alpha: +opam:53:tezos-baker-alpha: <<: *opam_definition variables: - package: tezos-endorser-alpha + package: tezos-baker-alpha -opam:56:tezos-accuser-alpha-commands: +opam:54:ocplib-json-typed-browser: <<: *opam_definition variables: - package: tezos-accuser-alpha-commands + package: ocplib-json-typed-browser -opam:57:tezos-baker-alpha: +opam:55:tezos-protocol-demo: <<: *opam_definition variables: - package: tezos-baker-alpha + package: tezos-protocol-demo -opam:58:tezos-protocol-demo: +opam:56:tezos-node: <<: *opam_definition variables: - package: tezos-protocol-demo + package: tezos-node -opam:59:tezos-signer: +opam:57:tezos-signer: <<: *opam_definition variables: package: tezos-signer -opam:60:tezos-node: +opam:58:tezos-endorser-alpha-commands: <<: *opam_definition variables: - package: tezos-node + package: tezos-endorser-alpha-commands -opam:61:ocplib-json-typed-browser: +opam:59:tezos-client: <<: *opam_definition variables: - package: ocplib-json-typed-browser + package: tezos-client + +opam:60:tezos-endorser-alpha: + <<: *opam_definition + variables: + package: tezos-endorser-alpha + +opam:61:tezos-accuser-alpha-commands: + <<: *opam_definition + variables: + package: tezos-accuser-alpha-commands opam:62:tezos-baker-alpha-commands: <<: *opam_definition variables: package: tezos-baker-alpha-commands +opam:63:ocplib-ezresto-directory: + <<: *opam_definition + variables: + package: ocplib-ezresto-directory + ##END_OPAM## diff --git a/src/proto_alpha/lib_delegate/client_baking_blocks.ml b/src/proto_alpha/lib_delegate/client_baking_blocks.ml index d40cc2c55b2d681cc1d9fc3854323c7093448312..dbaad5f63c2edb39a1a015d07f8b06e33ea764d6 100644 --- a/src/proto_alpha/lib_delegate/client_baking_blocks.ml +++ b/src/proto_alpha/lib_delegate/client_baking_blocks.ml @@ -61,19 +61,22 @@ let info cctxt ?(chain = `Main) block = cctxt ~chain ~block () >>=? fun shell_header -> raw_info cctxt ~chain hash shell_header -let monitor_valid_blocks cctxt ?chains ?protocols ~next_protocols () = +let monitor_valid_blocks cctxt ?(report=ignore) ?chains ?protocols ~next_protocols () = Monitor_services.valid_blocks cctxt ?chains ?protocols ?next_protocols () >>=? fun (block_stream, _stop) -> return (Lwt_stream.map_s - (fun ((chain, block), { Tezos_base.Block_header.shell }) -> - raw_info cctxt ~chain:(`Hash chain) block shell) + (fun ((chain, block), data) -> + report (block, data) ; + raw_info cctxt ~chain:(`Hash chain) block data.Tezos_base.Block_header.shell) block_stream) -let monitor_heads cctxt ~next_protocols chain = +let monitor_heads cctxt ?(report=ignore) ~next_protocols chain = Monitor_services.heads cctxt ?next_protocols chain >>=? fun (block_stream, _stop) -> return (Lwt_stream.map_s - (fun (block, { Tezos_base.Block_header.shell }) -> raw_info cctxt ~chain block shell) + (fun (block, data) -> + report (block, data) ; + raw_info cctxt ~chain block data.Tezos_base.Block_header.shell) block_stream) let blocks_from_current_cycle cctxt ?(chain = `Main) block ?(offset = 0l) () = diff --git a/src/proto_alpha/lib_delegate/client_baking_blocks.mli b/src/proto_alpha/lib_delegate/client_baking_blocks.mli index b92795bda58117dcf6dbeb19615c37a1dbf18f78..4d988ac7cb1036a3118d3fd3058ab701c632a729 100644 --- a/src/proto_alpha/lib_delegate/client_baking_blocks.mli +++ b/src/proto_alpha/lib_delegate/client_baking_blocks.mli @@ -47,6 +47,7 @@ val info: val monitor_valid_blocks: #Proto_alpha.rpc_context -> + ?report:(Block_hash.t * Tezos_base.Block_header.t -> unit) -> ?chains:Chain_services.chain list -> ?protocols:Protocol_hash.t list -> next_protocols:Protocol_hash.t list option -> @@ -54,6 +55,7 @@ val monitor_valid_blocks: val monitor_heads: #Proto_alpha.rpc_context -> + ?report:(Block_hash.t * Tezos_base.Block_header.t -> unit) -> next_protocols:Protocol_hash.t list option -> Chain_services.chain -> block_info tzresult Lwt_stream.t tzresult Lwt.t diff --git a/src/proto_alpha/lib_delegate/client_baking_denunciation.ml b/src/proto_alpha/lib_delegate/client_baking_denunciation.ml index 6b00e84b934907c0d6cde6e5c513bd82028c139c..162cc49682ff55c8168619ae1f945bb2209743bd 100644 --- a/src/proto_alpha/lib_delegate/client_baking_denunciation.ml +++ b/src/proto_alpha/lib_delegate/client_baking_denunciation.ml @@ -113,6 +113,7 @@ let process_endorsements (cctxt : #Proto_alpha.full) state ~chain lwt_log_notice Tag.DSL.(fun f -> f "Double endorsement evidence injected %a" -% t event "double_endorsement_denounced" + -% t signed_operation_tag bytes -% a Operation_hash.Logging.tag op_hash) >>= fun () -> return @@ HLevel.replace state.endorsements_table level (Delegate_Map.add delegate new_endorsement map) @@ -166,6 +167,7 @@ let process_block (cctxt : #Proto_alpha.full) state ~chain (header : Alpha_block lwt_log_notice Tag.DSL.(fun f -> f "Double baking evidence injected %a" -% t event "double_baking_denounced" + -% t signed_operation_tag bytes -% a Operation_hash.Logging.tag op_hash) >>= fun () -> return @@ HLevel.replace state.blocks_table level (Delegate_Map.add baker hash map) diff --git a/src/proto_alpha/lib_delegate/client_baking_endorsement.ml b/src/proto_alpha/lib_delegate/client_baking_endorsement.ml index 4759717a5b86ef27ecaba2090c450330e08d386f..f899677da374201a67ed481da32b3f711a55da42 100644 --- a/src/proto_alpha/lib_delegate/client_baking_endorsement.ml +++ b/src/proto_alpha/lib_delegate/client_baking_endorsement.ml @@ -137,6 +137,7 @@ let endorse_for_delegate cctxt block delegate = -% a Block_hash.Logging.tag hash -% a level_tag level -% s Client_keys.Logging.tag name + -% t Signature.Public_key_hash.Logging.tag delegate -% a Operation_hash.Logging.tag oph) >>= fun () -> return_unit diff --git a/src/proto_alpha/lib_delegate/client_baking_forge.ml b/src/proto_alpha/lib_delegate/client_baking_forge.ml index 3f09c777f39ac0053fa17737c66640146f0e585b..372ca3a18fddb67242cec04d0ddcb7bbec62971c 100644 --- a/src/proto_alpha/lib_delegate/client_baking_forge.ml +++ b/src/proto_alpha/lib_delegate/client_baking_forge.ml @@ -135,6 +135,12 @@ let inject_block src_sk shell_header priority seed_nonce_hash >>=? fun signed_header -> Shell_services.Injection.block cctxt ?force ~chain signed_header operations >>=? fun block_hash -> + lwt_log_info Tag.DSL.(fun f -> + f "Client_baking_forge.inject_block: inject %a" + -% t event "inject_baked_block" + -% a Block_hash.Logging.tag block_hash + -% t signed_header_tag signed_header + -% t operations_tag operations) >>= fun () -> return block_hash type error += diff --git a/src/proto_alpha/lib_delegate/client_baking_revelation.ml b/src/proto_alpha/lib_delegate/client_baking_revelation.ml index 068d0010ad6cf2698279a56a782b8c51d3c31d2c..f80421179f308f1fd42d7e1ee697f627aac9d397 100644 --- a/src/proto_alpha/lib_delegate/client_baking_revelation.ml +++ b/src/proto_alpha/lib_delegate/client_baking_revelation.ml @@ -34,7 +34,16 @@ let inject_seed_nonce_revelation rpc_config ?(chain = `Main) block ?async nonces Alpha_services.Forge.seed_nonce_revelation rpc_config (chain, block) ~branch ~level ~nonce () >>=? fun bytes -> let bytes = Signature.concat bytes Signature.zero in - Shell_services.Injection.operation rpc_config ?async ~chain bytes) + Shell_services.Injection.operation rpc_config ?async ~chain bytes >>=? fun oph -> + lwt_debug Tag.DSL.(fun f -> + f "Revealing nonce %a from level %a at chain %a, block %a with operation %a" + -% t event "reveal_nonce" + -% a Logging.nonce_tag nonce + -% a Logging.level_tag level + -% a Logging.chain_tag chain + -% a Logging.block_tag block + -% a Operation_hash.Logging.tag oph) >>= fun () -> + return oph) nonces >>=? fun ophs -> return ophs diff --git a/src/proto_alpha/lib_delegate/client_daemon.ml b/src/proto_alpha/lib_delegate/client_daemon.ml index b8cacf2addf0db09842abf267a29512e988044a1..f897cf5ed06122f040bc6e91e8cd6e1e1804b9ec 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.ml +++ b/src/proto_alpha/lib_delegate/client_daemon.ml @@ -23,6 +23,8 @@ (* *) (*****************************************************************************) +include Tezos_stdlib.Logging.Make_semantic(struct let name = "client.daemon" end) + let await_bootstrapped_node (cctxt: #Proto_alpha.full) = (* Waiting for the node to be synchronized *) cctxt#message "Waiting for the node to be synchronized with its \ diff --git a/src/proto_alpha/lib_delegate/logging.ml b/src/proto_alpha/lib_delegate/logging.ml index 191f0fff2608ce28a485627a07bc275449d84479..3b8247f775c34b3315cd6aab688f06e6db6c624d 100644 --- a/src/proto_alpha/lib_delegate/logging.ml +++ b/src/proto_alpha/lib_delegate/logging.ml @@ -35,6 +35,8 @@ let current_slots_tag = Tag.def ~doc:"Number of baking slots that can be baked a let future_slots_tag = Tag.def ~doc:"Number of baking slots in the foreseeable future but not yet bakeable" "future_slots" Format.pp_print_int let timespan_tag = Tag.def ~doc:"Time in seconds" "timespan" (fun fmt i -> Format.fprintf fmt "%Lds" i) +let signed_header_tag = Tag.def ~doc:"Signed header" "signed_header" MBytes.pp_hex +let signed_operation_tag = Tag.def ~doc:"Signed operation" "signed_operation" MBytes.pp_hex let operations_tag = Tag.def ~doc:"Block Operations" "operations" (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf "+") @@ -48,8 +50,13 @@ let denounced_endorsements_slots_tag = Tag.def ~doc:"Endorsement Slots" "denounc let denouncement_source_tag = Tag.def ~doc:"Denounce Source" "source" Format.pp_print_text let level_tag = Tag.def ~doc:"Level" "level" Raw_level.pp +let nonce_tag = Tag.def ~doc:"Nonce" "nonce" Data_encoding.Json.(fun ppf nonce -> pp ppf (construct Nonce.encoding nonce)) +let chain_tag = Tag.def ~doc:"Chain selector" "chain" Format.(fun ppf chain -> pp_print_string ppf @@ Block_services.chain_to_string chain) +let block_tag = Tag.def ~doc:"Block selector" "block" Format.(fun ppf block -> pp_print_string ppf @@ Block_services.to_string block) let worker_tag = Tag.def ~doc:"Worker in which event occurred" "worker" Format.pp_print_text +let operation_tag = Tag.def ~doc:"Operation" "operation" Tezos_base.Operation.pp + let conflicting_endorsements_tag = Tag.def ~doc:"Two conflicting endorsements signed by the same key" "conflicting_endorsements" Format.( fun ppf (a,b) -> fprintf ppf "%a / %a" Operation_hash.pp (Operation.hash a) Operation_hash.pp (Operation.hash b)) diff --git a/src/proto_alpha/lib_delegate/logging.mli b/src/proto_alpha/lib_delegate/logging.mli index 868594ee9c551071cb4013c4ebdffcb742bc9ee2..b653daf02195751b01372d4fc56923dc1ac00665 100644 --- a/src/proto_alpha/lib_delegate/logging.mli +++ b/src/proto_alpha/lib_delegate/logging.mli @@ -32,14 +32,20 @@ val current_slots_tag : int Tag.def val future_slots_tag : int Tag.def val timespan_tag : int64 Tag.def -val operations_tag : Proto_alpha.Alpha_context.Operation.raw list list Tag.def +val signed_header_tag : MBytes.t Tag.def +val signed_operation_tag : MBytes.t Tag.def +val operations_tag : Tezos_base.Operation.t list list Tag.def val bake_op_count_tag : int Tag.def val endorsement_slot_tag : int Tag.def val endorsement_slots_tag : int list Tag.def val denounced_endorsements_slots_tag : int list Tag.def val denouncement_source_tag : string Tag.def val level_tag : Proto_alpha.Alpha_context.Raw_level.t Tag.def +val nonce_tag : Proto_alpha.Alpha_context.Nonce.t Tag.def +val chain_tag : Block_services.chain Tag.def +val block_tag : Block_services.block Tag.def val worker_tag : string Tag.def +val operation_tag : Tezos_base.Operation.t Tag.def open Proto_alpha.Alpha_context val conflicting_endorsements_tag : (Kind.endorsement operation * Kind.endorsement operation) Tag.def diff --git a/src/proto_alpha/lib_delegate/tezos-baking-alpha.opam b/src/proto_alpha/lib_delegate/tezos-baking-alpha.opam index 87e71ee1c03735bffe8376855ae7ba9418cbac88..fbcdb76282e87b992a992b88564d3d591945f1c2 100644 --- a/src/proto_alpha/lib_delegate/tezos-baking-alpha.opam +++ b/src/proto_alpha/lib_delegate/tezos-baking-alpha.opam @@ -13,9 +13,12 @@ depends: [ "tezos-protocol-environment" "tezos-protocol-alpha" "tezos-shell-services" + "tezos-baking-alpha-services" "tezos-client-base" "tezos-client-commands" "tezos-client-alpha" + "tezos-rpc-http" + "tezos-stdlib-unix" "tezos-node" { test } "tezos-client-genesis" { test } "tezos-client-base-unix" { test } diff --git a/src/proto_alpha/lib_delegate_services/dune b/src/proto_alpha/lib_delegate_services/dune new file mode 100644 index 0000000000000000000000000000000000000000..ba7e68257a045d11606701197d7c071c62d9afbd --- /dev/null +++ b/src/proto_alpha/lib_delegate_services/dune @@ -0,0 +1,18 @@ +(library + (name tezos_baking_alpha_services) + (public_name tezos-baking-alpha-services) + (libraries tezos-base + tezos-protocol-environment + tezos-protocol-alpha + tezos-client-base + tezos-client-alpha) + (flags (:standard -w +27@8 + -safe-string + -open Tezos_base__TzPervasives + -open Tezos_client_base + -open Tezos_client_alpha))) + +(alias + (name runtest_indent) + (deps (glob_files *.ml{,i})) + (action (run bash %{libexec:tezos-stdlib:test-ocp-indent.sh} %{deps}))) diff --git a/src/proto_alpha/lib_delegate_services/event_queues.ml b/src/proto_alpha/lib_delegate_services/event_queues.ml new file mode 100644 index 0000000000000000000000000000000000000000..4a2ddc915f15d519d70440b1b47411436143a2f7 --- /dev/null +++ b/src/proto_alpha/lib_delegate_services/event_queues.ml @@ -0,0 +1,145 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Proto_alpha + +module type EVENT = sig + type t + val name: string + val capacity: int + val encoding: t Data_encoding.t +end + +module Error_event = struct + let name = "errors" + let capacity = 20 + type t = { + message: string option ; + trace: error list ; + } + let encoding = let open Data_encoding in + conv + (fun { message ; trace } -> + ( message , trace )) + (fun ( message , trace ) -> + { message ; trace }) + (obj2 + (opt "message" string) + (req "trace" (list error_encoding))) +end + +module Baked_event = struct + let name = "baked" + let capacity = 20 + type t = { + hash: Block_hash.t ; + signed_header: MBytes.t ; + operations: Tezos_base.Operation.t list list; + } + let encoding = let open Data_encoding in + conv + (fun { hash ; signed_header ; operations } -> + ( hash , signed_header , operations )) + (fun ( hash , signed_header , operations ) -> + { hash ; signed_header ; operations }) + (obj3 + (req "hash" Block_hash.encoding) + (req "signed_header" bytes) + (req "operations" (list (list (dynamic_size Tezos_base.Operation.encoding))))) +end + +module Revelation_event = struct + let name = "revealed" + let capacity = 20 + type t = { + nonce: Alpha_context.Nonce.t ; + level: Alpha_context.Raw_level.t ; + oph: Operation_hash.t ; + } + let encoding = let open Data_encoding in + conv + (fun { nonce ; level ; oph } -> + ( nonce , level , oph )) + (fun ( nonce , level , oph ) -> + { nonce ; level ; oph }) + (obj3 + (req "nonce" Alpha_context.Nonce.encoding) + (req "level" Alpha_context.Raw_level.encoding) + (req "oph" Operation_hash.encoding)) +end + +module Endorsement_event = struct + let name = "endorsed" + let capacity = 20 + type t = { + hash: Block_hash.t ; + level: Alpha_context.Raw_level.t ; + delegate: Signature.Public_key_hash.t ; + name: string ; + oph: Operation_hash.t ; + } + let encoding = let open Data_encoding in + conv + (fun { hash ; level ; delegate ; name ; oph } -> + ( hash , level , delegate , name , oph )) + (fun ( hash , level , delegate , name , oph ) -> + { hash ; level ; delegate ; name ; oph }) + (obj5 + (req "hash" Block_hash.encoding) + (req "level" Alpha_context.Raw_level.encoding) + (req "delegate" Signature.Public_key_hash.encoding) + (req "name" string) + (req "oph" Operation_hash.encoding)) +end + +module Accusation_event = struct + let name = "accused" + let capacity = 20 + type t = { + sin : string ; + oph : Operation_hash.t ; + raw : MBytes.t ; + } + let encoding = let open Data_encoding in + conv + (fun { sin ; oph ; raw } -> ( sin , oph , raw )) + (fun ( sin , oph , raw ) -> { sin ; oph ; raw }) + (obj3 + (req "sin" string) + (req "oph" Operation_hash.encoding) + (req "raw" bytes)) +end + +module Block_event = struct + type t = Block_hash.t * Block_header.t + let encoding = let open Data_encoding in + dynamic_size + (merge_objs + (obj1 + (req "hash" Block_hash.encoding)) + Block_header.encoding) + let capacity = 20 + let name = "seen" +end diff --git a/src/proto_alpha/lib_delegate_services/event_queues.mli b/src/proto_alpha/lib_delegate_services/event_queues.mli new file mode 100644 index 0000000000000000000000000000000000000000..edf19e5857d1802cccccd5f707fb4adae43e37ec --- /dev/null +++ b/src/proto_alpha/lib_delegate_services/event_queues.mli @@ -0,0 +1,82 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +open Proto_alpha + +(** Parameters defining an inspectable, named stream of events. *) +module type EVENT = sig + type t + val name: string + val capacity: int + val encoding: t Data_encoding.t +end + +module Error_event : sig + type t = { + message: string option ; + trace: error list ; + } + include EVENT with type t := t +end + +module Baked_event : sig + type t = { + hash: Block_hash.t ; + signed_header: MBytes.t ; + operations: Tezos_base.Operation.t list list; + } + include EVENT with type t := t +end + +module Revelation_event : sig + type t = { + nonce: Alpha_context.Nonce.t ; + level: Alpha_context.Raw_level.t ; + oph : Operation_hash.t ; + } + include EVENT with type t := t +end + +module Endorsement_event : sig + type t = { + hash: Block_hash.t ; + level: Alpha_context.Raw_level.t ; + delegate: Signature.Public_key_hash.t ; + name: string ; + oph: Operation_hash.t ; + } + include EVENT with type t := t +end + +module Accusation_event : sig + type t = { + sin: string ; + oph: Operation_hash.t ; + raw: MBytes.t ; + } + include EVENT with type t := t +end + +module Block_event : EVENT with type t = Block_hash.t * Block_header.t diff --git a/src/proto_alpha/lib_delegate_services/tezos-baking-alpha-services.opam b/src/proto_alpha/lib_delegate_services/tezos-baking-alpha-services.opam new file mode 100644 index 0000000000000000000000000000000000000000..5c14f97d384440073fbff0215483ba530415acbc --- /dev/null +++ b/src/proto_alpha/lib_delegate_services/tezos-baking-alpha-services.opam @@ -0,0 +1,23 @@ +opam-version: "1.2" +version: "dev" +maintainer: "contact@tezos.com" +authors: [ "Tezos devteam" ] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "ocamlfind" { build } + "dune" { build & = "1.0.1" } + "tezos-base" + "tezos-protocol-environment" + "tezos-protocol-alpha" + "tezos-client-base" + "tezos-client-alpha" +] +build: [ + [ "dune" "build" "-p" name "-j" jobs ] +] +build-test: [ + [ "dune" "runtest" "-p" name "-j" jobs ] +]