From 38f6b44e895634190658f8d84fa95223f560d36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Wed, 18 Dec 2024 15:00:58 +0100 Subject: [PATCH 1/2] Bin/Node: Prevent stall connections --- src/bin_dal_node/daemon.ml | 5 +++++ src/lib_dal_node/gossipsub/gossipsub.ml | 2 ++ src/lib_dal_node/gossipsub/gossipsub.mli | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/src/bin_dal_node/daemon.ml b/src/bin_dal_node/daemon.ml index aadf959e352d..42ae12abe15e 100644 --- a/src/bin_dal_node/daemon.ml +++ b/src/bin_dal_node/daemon.ml @@ -1277,6 +1277,11 @@ let run ~data_dir ~configuration_override = p2p_limits ~network_name in + let (_ : Lwt_exit.clean_up_callback_id) = + (* This is important to prevent stall connections. *) + Lwt_exit.register_clean_up_callback ~loc:__LOC__ (fun _exit_status -> + Gossipsub.Transport_layer.shutdown transport_layer) + in (* Get the current L1 head and its DAL plugin and parameters. *) let* header = Shell_services.Blocks.Header.shell_header cctxt () in let head_level = header.Block_header.level in diff --git a/src/lib_dal_node/gossipsub/gossipsub.ml b/src/lib_dal_node/gossipsub/gossipsub.ml index 5bb7763d3886..b9feb70de058 100644 --- a/src/lib_dal_node/gossipsub/gossipsub.ml +++ b/src/lib_dal_node/gossipsub/gossipsub.ml @@ -90,6 +90,8 @@ module Transport_layer = struct return_unit) additional_points + let shutdown p2p = P2p.shutdown p2p + let connect p2p ?timeout point = let open Lwt_result_syntax in match P2p.connect_handler p2p with diff --git a/src/lib_dal_node/gossipsub/gossipsub.mli b/src/lib_dal_node/gossipsub/gossipsub.mli index 3957724ddfe1..aff50c6c985e 100644 --- a/src/lib_dal_node/gossipsub/gossipsub.mli +++ b/src/lib_dal_node/gossipsub/gossipsub.mli @@ -92,6 +92,10 @@ module Transport_layer : sig P2p_limits.t -> t tzresult Lwt.t + (** [shutdown t] shutdowns the transport layer and ensures that + active connections are closed. *) + val shutdown : t -> unit Lwt.t + (** [activate ?additional_points t] activates the given transport layer [t]. It is a wrapper on top of {!P2p.activate}. If some [additional_points] are given, they are added to [t]'s known points. *) -- GitLab From acf9ea7a3ae89638cfc2f240ccaf37ef2160ebe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Thir=C3=A9?= Date: Fri, 20 Dec 2024 11:02:09 +0100 Subject: [PATCH 2/2] CHANGES: Update the CHANGES --- CHANGES.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index d2981971abd6..0b2722763d01 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -180,6 +180,14 @@ Data Availability Layer (DAL) DAL node ~~~~~~~~ +- **Feature** The DAL node stores now a peers.json file in its + directory when it is shutdown with SIGINT. This file is read if it + exists when starting the DAL node to restore previous known + connections quickly. + +- **Bugfix** When shutting down the DAL node using SIGINT, it does a + best effort to shutdown properly its running P2P connections + - The DAL node supports a ``config update`` command to update an existing configuration. It takes the same arguments as for the other commands. (MR :gl:`!15759`) @@ -212,6 +220,7 @@ Protocol https://gitlab.com/tezos/tezos/-/issues/7629. (MR :gl:`!15830`) - A warning has been introduced in case it is observed that the DAL node lags behind the L1 node. (MR :gl:`!15756`) + - **Change** The DAL node store version has been upgraded from 1 to 2. The DAL node store will automatically upgrade without requiring any user action. For users running the DAL node with the -- GitLab