diff --git a/CHANGES.rst b/CHANGES.rst index 93f93de0d176f678f60de92288a847a5ed777ef7..dab05209e73fa7934696665ed8eec5010b1a70d4 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 ------------- diff --git a/src/bin_dal_node/daemon.ml b/src/bin_dal_node/daemon.ml index 3fcf4f5b7b4be2b9a3e3c066f8bef2ca8ea54f55..684a3e905c6350c1e5ae5959f380126d188ee843 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 0e8c41317cfbc04b20221288b0d0aa1d8c310fc0..b150dd904bba5a8ef3b67d317f2818bf79cb06c6 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