diff --git a/CHANGES.rst b/CHANGES.rst index d2981971abd6a0e54166c3022fb6901fad1f5c8a..0b2722763d01acc59b7f94be6857686a8975ad66 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 diff --git a/src/bin_dal_node/daemon.ml b/src/bin_dal_node/daemon.ml index aadf959e352d1bfb064812fcb85fdd823db7488f..42ae12abe15e97586401da793013faa7d2526d45 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 5bb7763d3886f6196f703a3b8cf6d36f50735693..b9feb70de058be9bad8794e81dce668b0131eb49 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 3957724ddfe1e026ae2477b306fc8ad66e8a6b32..aff50c6c985e9edad9c25c17d5760ab8cc79b6db 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. *)