From b66a1904ce008473a9a8eec2078f463eeecd3d7a Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Mon, 20 Jan 2025 07:12:03 +0100 Subject: [PATCH] Baker/Alpha: fix delegate_without_slots event emission To check whether a baker has slots we were checking that the consensus key equals one of the delegate who has rights at the given level. And we were using their delegate keys, instead of their consensus keys. Example: baker started with consensus key ck, own_delegates contains (ck,dk) (where dk is the delegate key); the test checked ck == dk instead of ck = ck. --- src/proto_alpha/lib_delegate/baking_actions.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_delegate/baking_actions.ml b/src/proto_alpha/lib_delegate/baking_actions.ml index fcca27f9629f..dafae02d3956 100644 --- a/src/proto_alpha/lib_delegate/baking_actions.ml +++ b/src/proto_alpha/lib_delegate/baking_actions.ml @@ -956,8 +956,10 @@ let notice_delegates_without_slots all_delegates delegate_slots level = (fun {Baking_state.public_key_hash; _} -> not @@ List.exists - (fun {consensus_key_and_delegate = _, pkh_with_rights; _} -> - public_key_hash = pkh_with_rights) + (fun { + consensus_key_and_delegate = consensus_key, _pkh_with_rights; + _; + } -> public_key_hash = consensus_key.public_key_hash) (Baking_state.Delegate_slots.own_delegates delegate_slots)) all_delegates in -- GitLab