From 7c9805bd41f7adc9986f30899ebcc4338ba9277e Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Tue, 3 Dec 2024 14:41:15 +0100 Subject: [PATCH 1/2] DAL/Node: set the GS validation function asap --- src/bin_dal_node/daemon.ml | 6 ++++++ src/lib_dal_node/gossipsub/gs_interface.ml | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/bin_dal_node/daemon.ml b/src/bin_dal_node/daemon.ml index 3fcf4f5b7b4b..684a3e905c63 100644 --- a/src/bin_dal_node/daemon.ml +++ b/src/bin_dal_node/daemon.ml @@ -1315,6 +1315,12 @@ let run ~data_dir ~configuration_override = transport_layer cctxt in + Gossipsub.Worker.Validate_message_hook.set + (Handler.gossipsub_app_messages_validation + ctxt + cryptobox + head_level + proto_parameters) ; let is_prover_profile = Profile_manager.is_prover_profile profile_ctxt in (* Initialize amplificator if in prover profile. This forks a process and should be kept early to avoid copying opened file diff --git a/src/lib_dal_node/gossipsub/gs_interface.ml b/src/lib_dal_node/gossipsub/gs_interface.ml index 0e8c41317cfb..b150dd904bba 100644 --- a/src/lib_dal_node/gossipsub/gs_interface.ml +++ b/src/lib_dal_node/gossipsub/gs_interface.ml @@ -28,13 +28,21 @@ open Gossipsub_intf module Types = Tezos_dal_node_services.Types module Validate_message_hook = struct - (* FIXME: https://gitlab.com/tezos/tezos/-/issues/5674 + let warn_validation_function_not_set = + Internal_event.Simple.declare_0 + ~section:["dal"; "gs_interface"] + ~name:"message_validation_function_not_set" + ~msg:"The message validation function is not set" + ~level:Warning + (* FIXME: https://gitlab.com/tezos/tezos/-/issues/5674 Refactor gossipsub integration to avoid this mutable hook in the lib. *) let check_message = ref (fun ?message:_ ~message_id:_ () -> - Format.eprintf - "Gs interface: messages validatation function is not set@." ; + Internal_event.Simple.( + emit__dont_wait__use_with_care + (warn_validation_function_not_set ()) + ()) ; `Unknown) let set func = check_message := func -- GitLab From 7775990082e741ac2010cb3dbe888de6964a7e38 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Wed, 4 Dec 2024 11:16:42 +0100 Subject: [PATCH 2/2] CHANGES: add entry --- CHANGES.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 93f93de0d176..dab05209e73f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -186,9 +186,11 @@ 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`) +- Set the message validation function at node startup, fixing + https://gitlab.com/tezos/tezos/-/issues/7629. (MR :gl:`!15830`) + Miscellaneous ------------- -- GitLab