From 758ab4dd1183b0358a0dff730565d585ebd45e58 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Wed, 4 Dec 2024 11:01:44 +0100 Subject: [PATCH 1/2] Baker/DAL: emit event when delegate not in committee --- src/proto_020_PsParisC/lib_delegate/baking_actions.ml | 4 +++- src/proto_020_PsParisC/lib_delegate/baking_events.ml | 9 +++++++++ src/proto_021_PsQuebec/lib_delegate/baking_actions.ml | 4 +++- src/proto_021_PsQuebec/lib_delegate/baking_events.ml | 9 +++++++++ src/proto_alpha/lib_delegate/baking_actions.ml | 4 +++- src/proto_alpha/lib_delegate/baking_events.ml | 9 +++++++++ 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/proto_020_PsParisC/lib_delegate/baking_actions.ml b/src/proto_020_PsParisC/lib_delegate/baking_actions.ml index a93b021ec3f8..917dd451db2f 100644 --- a/src/proto_020_PsParisC/lib_delegate/baking_actions.ml +++ b/src/proto_020_PsParisC/lib_delegate/baking_actions.ml @@ -425,7 +425,9 @@ let process_dal_rpc_result state delegate level round = return_none | `RPC_result (Ok res) -> ( match res with - | Tezos_dal_node_services.Types.Not_in_committee -> return_none + | Tezos_dal_node_services.Types.Not_in_committee -> + let*! () = Events.(emit not_in_dal_committee (delegate, level)) in + return_none | Attestable_slots {slots; published_level} -> let number_of_slots = state.global_state.constants.parametric.dal.number_of_slots diff --git a/src/proto_020_PsParisC/lib_delegate/baking_events.ml b/src/proto_020_PsParisC/lib_delegate/baking_events.ml index 3583a81f623d..f1e1f60cf144 100644 --- a/src/proto_020_PsParisC/lib_delegate/baking_events.ml +++ b/src/proto_020_PsParisC/lib_delegate/baking_events.ml @@ -885,6 +885,15 @@ module Actions = struct issue." () + let not_in_dal_committee = + declare_2 + ~section + ~name:"not_in_dal_committee" + ~level:Notice + ~msg:"{delegate} has no assigned DAL shards at level {attestation_level}" + ("delegate", Signature.Public_key_hash.encoding) + ("attestation_level", Data_encoding.int32) + let synchronizing_round = declare_1 ~section diff --git a/src/proto_021_PsQuebec/lib_delegate/baking_actions.ml b/src/proto_021_PsQuebec/lib_delegate/baking_actions.ml index bd03a170e2ed..1abeb7c18eab 100644 --- a/src/proto_021_PsQuebec/lib_delegate/baking_actions.ml +++ b/src/proto_021_PsQuebec/lib_delegate/baking_actions.ml @@ -427,7 +427,9 @@ let process_dal_rpc_result state delegate level round = return_none | `RPC_result (Ok res) -> ( match res with - | Tezos_dal_node_services.Types.Not_in_committee -> return_none + | Tezos_dal_node_services.Types.Not_in_committee -> + let*! () = Events.(emit not_in_dal_committee (delegate, level)) in + return_none | Attestable_slots {slots; published_level} -> let number_of_slots = state.global_state.constants.parametric.dal.number_of_slots diff --git a/src/proto_021_PsQuebec/lib_delegate/baking_events.ml b/src/proto_021_PsQuebec/lib_delegate/baking_events.ml index 2af25ddcea35..42c97ef65371 100644 --- a/src/proto_021_PsQuebec/lib_delegate/baking_events.ml +++ b/src/proto_021_PsQuebec/lib_delegate/baking_events.ml @@ -885,6 +885,15 @@ module Actions = struct issue." () + let not_in_dal_committee = + declare_2 + ~section + ~name:"not_in_dal_committee" + ~level:Notice + ~msg:"{delegate} has no assigned DAL shards at level {attestation_level}" + ("delegate", Signature.Public_key_hash.encoding) + ("attestation_level", Data_encoding.int32) + let synchronizing_round = declare_1 ~section diff --git a/src/proto_alpha/lib_delegate/baking_actions.ml b/src/proto_alpha/lib_delegate/baking_actions.ml index cfc52997caa4..6c909301079a 100644 --- a/src/proto_alpha/lib_delegate/baking_actions.ml +++ b/src/proto_alpha/lib_delegate/baking_actions.ml @@ -435,7 +435,9 @@ let process_dal_rpc_result state delegate level round = return_none | `RPC_result (Ok res) -> ( match res with - | Tezos_dal_node_services.Types.Not_in_committee -> return_none + | Tezos_dal_node_services.Types.Not_in_committee -> + let*! () = Events.(emit not_in_dal_committee (delegate, level)) in + return_none | Attestable_slots {slots; published_level} -> let number_of_slots = state.global_state.constants.parametric.dal.number_of_slots diff --git a/src/proto_alpha/lib_delegate/baking_events.ml b/src/proto_alpha/lib_delegate/baking_events.ml index 2af25ddcea35..42c97ef65371 100644 --- a/src/proto_alpha/lib_delegate/baking_events.ml +++ b/src/proto_alpha/lib_delegate/baking_events.ml @@ -885,6 +885,15 @@ module Actions = struct issue." () + let not_in_dal_committee = + declare_2 + ~section + ~name:"not_in_dal_committee" + ~level:Notice + ~msg:"{delegate} has no assigned DAL shards at level {attestation_level}" + ("delegate", Signature.Public_key_hash.encoding) + ("attestation_level", Data_encoding.int32) + let synchronizing_round = declare_1 ~section -- GitLab From 07d0923aab5e78f0efde7d7231e30b37d0964d5e Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Wed, 4 Dec 2024 11:13:39 +0100 Subject: [PATCH 2/2] CHANGES: add entry --- CHANGES.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index bd71bf6c4d7f..f403c6c42a4d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -147,9 +147,14 @@ DAL node (``0.0.0.0:11733``). The new default value is ``None``, so no metrics are exported by default. - - **Breaking change** Removed the baker daemon's ``--dal-node-timeout-percentage`` argument. (MR :gl:`!15554`) +Baker +~~~~~ + +- Emit event at Notice level when the delegate is not in the DAL committee, that + is, it has no assigned shards at the current level. (:gl:`!15846`) + Miscellaneous ------------- -- GitLab