diff --git a/CHANGES.rst b/CHANGES.rst index 9cc0a5d73d6dfbf8fc1731c344d2b8f5fbbeac29..14c1d9d1d53eb52fa7916618390859e19bc7e719 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -157,6 +157,8 @@ Baker is, it has no assigned shards at the current level. (:gl:`!15846`) - A warning has been introduced in case it is observed that the DAL node lags behind the L1 node. (MR :gl:`!15756`) +- 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 26104a2d14a0a7e1e99120c9c199af1e415aceef..3539ca79c30a9e01cfebb7fb131624a8228b4ca0 100644 --- a/src/bin_dal_node/daemon.ml +++ b/src/bin_dal_node/daemon.ml @@ -1211,6 +1211,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