From a848f961921f4c54e29535909e863e44f6c4d38c Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Wed, 4 Dec 2024 11:01:44 +0100 Subject: [PATCH 1/3] 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 f81e10cdec87..7da52063ad06 100644 --- a/src/proto_020_PsParisC/lib_delegate/baking_actions.ml +++ b/src/proto_020_PsParisC/lib_delegate/baking_actions.ml @@ -474,7 +474,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 3e1a03068479..54cf06abf989 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 d544ced05ab4..90cbfa113784 100644 --- a/src/proto_021_PsQuebec/lib_delegate/baking_actions.ml +++ b/src/proto_021_PsQuebec/lib_delegate/baking_actions.ml @@ -476,7 +476,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 b6098d68c87b..334fc83fefae 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 617def10e474..a141ef812d42 100644 --- a/src/proto_alpha/lib_delegate/baking_actions.ml +++ b/src/proto_alpha/lib_delegate/baking_actions.ml @@ -484,7 +484,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 b6098d68c87b..334fc83fefae 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 8045b7facb94edd52c0a1ba818f0bc835ecf5983 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Wed, 4 Dec 2024 11:03:01 +0100 Subject: [PATCH 2/3] Baker/DAL: remove unused event --- src/proto_alpha/lib_delegate/baking_events.ml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/proto_alpha/lib_delegate/baking_events.ml b/src/proto_alpha/lib_delegate/baking_events.ml index 334fc83fefae..fde49c5171c2 100644 --- a/src/proto_alpha/lib_delegate/baking_events.ml +++ b/src/proto_alpha/lib_delegate/baking_events.ml @@ -875,16 +875,6 @@ module Actions = struct ("attestation_level", Data_encoding.int32) ("round", Round.encoding) - let warning_dal_timeout_old_round = - declare_0 - ~section - ~name:"warning_dal_timeout_old_round" - ~level:Warning - ~msg: - "The DAL timeout computed was for an old round. Please report this \ - issue." - () - let not_in_dal_committee = declare_2 ~section -- GitLab From 6a635eb2995cc03b775b074a66ec221e10f52ae8 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Wed, 4 Dec 2024 11:13:39 +0100 Subject: [PATCH 3/3] CHANGES: add entry --- CHANGES.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8924dcd34caa..ac2815c4e13e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -186,7 +186,6 @@ DAL node - Fixed file descriptor leak in resto affecting connections to the L1 node. (MR :gl:`!15322`) - - **Breaking change** The baker daemon ``--dal-node-timeout-percentage`` argument has been removed. (MR :gl:`!15554`) @@ -197,5 +196,11 @@ Protocol is not valid when the feature flag for DAL incentives is turned off. (MR :gl:`!15677`) +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