From f69508a69544c5ea7b120f60bf94efe5b3971548 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Wed, 30 Apr 2025 10:48:27 +0200 Subject: [PATCH] Baker: move [check_node_version] in agnostic library --- manifest/product_octez.ml | 1 + src/lib_agnostic_baker/command_run.ml | 80 ++++++++++++++++++ src/lib_agnostic_baker/dune | 6 +- src/lib_agnostic_baker/errors.ml | 82 +++++++++++++++++- src/lib_agnostic_baker/events.ml | 35 ++++++++ .../lib_delegate/baking_commands.ml | 83 +------------------ .../lib_delegate/baking_errors.ml | 83 ------------------- .../lib_delegate/baking_events.ml | 33 -------- .../lib_delegate/baking_commands.ml | 83 +------------------ src/proto_alpha/lib_delegate/baking_errors.ml | 83 ------------------- src/proto_alpha/lib_delegate/baking_events.ml | 33 -------- 11 files changed, 209 insertions(+), 393 deletions(-) diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml index f23c1351f22d..f3758bf27849 100644 --- a/manifest/product_octez.ml +++ b/manifest/product_octez.ml @@ -5689,6 +5689,7 @@ let octez_agnostic_baker_lib = octez_client_commands |> open_; octez_profiler |> open_; octez_stdlib_unix |> open_; + octez_shell_services |> open_; ] (* PROTOCOL PACKAGES *) diff --git a/src/lib_agnostic_baker/command_run.ml b/src/lib_agnostic_baker/command_run.ml index f2486f5df849..eada3c274a19 100644 --- a/src/lib_agnostic_baker/command_run.ml +++ b/src/lib_agnostic_baker/command_run.ml @@ -5,6 +5,8 @@ (* *) (*****************************************************************************) +open Errors + let may_lock_pidfile pidfile_opt f = match pidfile_opt with | None -> f () @@ -14,3 +16,81 @@ let may_lock_pidfile pidfile_opt f = (`Fail (Exn (Failure ("Failed to create the pidfile: " ^ pidfile)))) ~filename:pidfile f + +let check_node_version cctxt bypass allowed = + let open Lwt_result_syntax in + (* Parse and check allowed versions *) + let*? allowed = + let open Result_syntax in + Option.map_e + (fun allowed -> + match + Tezos_version_parser.version_commit (Lexing.from_string allowed) + with + | None -> tzfail (Node_version_malformatted allowed) + | Some x -> return x) + allowed + in + let is_allowed node_version + (node_commit_info : Tezos_version.Octez_node_version.commit_info option) = + match allowed with + | None -> false + | Some (v, c) -> ( + let c = + Option.map + (fun commit_hash -> + Tezos_version.Octez_node_version.{commit_hash; commit_date = ""}) + c + in + match + Tezos_version.Octez_node_version.partially_compare + v + c + node_version + node_commit_info + with + | None -> false + | Some x -> x = 0) + in + if bypass then + let*! () = Events.(emit node_version_check_bypass ()) in + return_unit + else + let baker_version = Tezos_version_value.Current_git_info.octez_version in + let (baker_commit_info + : Tezos_version.Octez_node_version.commit_info option) = + Some + { + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + in + let* node_version = Version_services.version cctxt in + let*! () = + Events.( + emit + node_version_check + ( node_version.version, + node_version.commit_info, + baker_version, + baker_commit_info )) + in + if is_allowed node_version.version node_version.commit_info then return_unit + else + match + Tezos_version.Octez_node_version.partially_compare + baker_version + baker_commit_info + node_version.version + node_version.commit_info + with + | Some r when r <= 0 -> return_unit + | _ -> + tzfail + (Node_version_incompatible + { + node_version = node_version.version; + node_commit_info = node_version.commit_info; + baker_version; + baker_commit_info; + }) diff --git a/src/lib_agnostic_baker/dune b/src/lib_agnostic_baker/dune index 8675d50e9fc5..71c5978e6781 100644 --- a/src/lib_agnostic_baker/dune +++ b/src/lib_agnostic_baker/dune @@ -14,7 +14,8 @@ octez-node-config octez-shell-libs.client-commands octez-libs.octez-profiler - octez-libs.stdlib-unix) + octez-libs.stdlib-unix + octez-shell-libs.shell-services) (preprocess (pps octez-libs.ppx_profiler)) (preprocessor_deps (env_var TEZOS_PPX_PROFILER)) (flags @@ -26,4 +27,5 @@ -open Tezos_client_base_unix -open Tezos_client_commands -open Tezos_profiler - -open Tezos_stdlib_unix)) + -open Tezos_stdlib_unix + -open Tezos_shell_services)) diff --git a/src/lib_agnostic_baker/errors.ml b/src/lib_agnostic_baker/errors.ml index e065c615d06f..d13f5d0ec2eb 100644 --- a/src/lib_agnostic_baker/errors.ml +++ b/src/lib_agnostic_baker/errors.ml @@ -12,6 +12,13 @@ type error += | Cannot_decode_node_data of string | Missing_current_agent of string | Agent_process_error of string + | Node_version_incompatible of { + node_version : Tezos_version_parser.t; + node_commit_info : Tezos_version.Octez_node_version.commit_info option; + baker_version : Tezos_version_parser.t; + baker_commit_info : Tezos_version.Octez_node_version.commit_info option; + } + | Node_version_malformatted of string let () = Error_monad.register_error_kind @@ -63,4 +70,77 @@ let () = Format.fprintf ppf "Error in the underlying %s process" agent) Data_encoding.(obj1 (req "agent" string)) (function Agent_process_error agent -> Some agent | _ -> None) - (fun agent -> Agent_process_error agent) + (fun agent -> Agent_process_error agent) ; + register_error_kind + `Temporary + ~id:"agnostic_agent.node_version_incompatible" + ~title:"Node version is incompatible" + ~description:"The node version is incompatible with this baker" + ~pp:(fun + fmt + ((node_version, node_commit_info, baker_version, baker_commit_info) : + Tezos_version_parser.t + * Tezos_version.Octez_node_version.commit_info option + * Tezos_version_parser.t + * Tezos_version.Octez_node_version.commit_info option) + -> + Format.fprintf + fmt + "@[Node version is %a (%a) but it is expected to be more recent than \ + %a (%a).@ This check can be bypassed at your own risk with the flag \ + --node-version-check-bypass or the argument --node-version-allowed \ + %a%a .@]" + Tezos_version.Version.pp + node_version + (Format.pp_print_option + ~none:(fun ppf () -> Format.pp_print_string ppf "none") + Tezos_version.Octez_node_version.commit_info_pp_short) + node_commit_info + Tezos_version.Version.pp + baker_version + (Format.pp_print_option + ~none:(fun ppf () -> Format.pp_print_string ppf "none") + Tezos_version.Octez_node_version.commit_info_pp_short) + baker_commit_info + Tezos_version.Version.pp_arg + node_version + (Format.pp_print_option + ~none:(fun _ppf () -> ()) + (fun ppf -> + Format.fprintf + ppf + ":%a" + Tezos_version.Octez_node_version.commit_info_pp_short)) + node_commit_info) + Data_encoding.( + obj4 + (req "node_version" Tezos_version.Octez_node_version.version_encoding) + (opt + "node_commit_info" + Tezos_version.Octez_node_version.commit_info_encoding) + (req "baker_version" Tezos_version.Octez_node_version.version_encoding) + (opt + "baker_commit_info" + Tezos_version.Octez_node_version.commit_info_encoding)) + (function + | Node_version_incompatible + {node_version; node_commit_info; baker_version; baker_commit_info} -> + Some (node_version, node_commit_info, baker_version, baker_commit_info) + | _ -> None) + (fun (node_version, node_commit_info, baker_version, baker_commit_info) -> + Node_version_incompatible + {node_version; node_commit_info; baker_version; baker_commit_info}) ; + register_error_kind + `Temporary + ~id:"agnostic_agent.node_version_malformatted" + ~title:"Node version in command argument is malformatted" + ~description:"The node version provided in command argument is malformatted" + ~pp:(fun fmt version -> + Format.fprintf + fmt + "The node version provided in command argument: '%s' is a malformatted \ + version" + version) + Data_encoding.(obj1 (req "provided_version" string)) + (function Node_version_malformatted v -> Some v | _ -> None) + (fun v -> Node_version_malformatted v) diff --git a/src/lib_agnostic_baker/events.ml b/src/lib_agnostic_baker/events.ml index 2830f2b3524e..700ee545d8d9 100644 --- a/src/lib_agnostic_baker/events.ml +++ b/src/lib_agnostic_baker/events.ml @@ -117,3 +117,38 @@ let cannot_connect = ~msg:"Cannot connect to node. {message}" ~pp1:Format.pp_print_string ("message", Data_encoding.string) + +(* Warning *) +let node_version_check_bypass = + declare_0 + ~section + ~name:"node_version_check_bypass" + ~level:Warning + ~msg:"Compatibility between node version and baker version by passed" + () + +(* Debug *) +let node_version_check = + declare_4 + ~section + ~name:"node_version_check" + ~level:Debug + ~msg: + "Checking compatibility between node version {node_version} \ + ({node_commit}) and baker version {baker_version} ({baker_commit})" + ~pp1:Tezos_version.Version.pp_simple + ("node_version", Tezos_version.Octez_node_version.version_encoding) + ~pp2: + (Format.pp_print_option + Tezos_version.Octez_node_version.commit_info_pp_short) + ( "node_commit", + Data_encoding.option Tezos_version.Octez_node_version.commit_info_encoding + ) + ~pp3:Tezos_version.Version.pp_simple + ("baker_version", Tezos_version.Octez_node_version.version_encoding) + ~pp4: + (Format.pp_print_option + Tezos_version.Octez_node_version.commit_info_pp_short) + ( "baker_commit", + Data_encoding.option Tezos_version.Octez_node_version.commit_info_encoding + ) diff --git a/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml b/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml index 94f1cd53011c..bdf596dae1a4 100644 --- a/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml +++ b/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml @@ -37,84 +37,6 @@ let pidfile_arg = ~placeholder:"filename" (Tezos_clic.parameter (fun _ s -> return s)) -let check_node_version cctxt bypass allowed = - let open Lwt_result_syntax in - (* Parse and check allowed versions *) - let*? allowed = - let open Result_syntax in - Option.map_e - (fun allowed -> - match - Tezos_version_parser.version_commit (Lexing.from_string allowed) - with - | None -> tzfail (Node_version_malformatted allowed) - | Some x -> return x) - allowed - in - let is_allowed node_version - (node_commit_info : Tezos_version.Octez_node_version.commit_info option) = - match allowed with - | None -> false - | Some (v, c) -> ( - let c = - Option.map - (fun commit_hash -> - Tezos_version.Octez_node_version.{commit_hash; commit_date = ""}) - c - in - match - Tezos_version.Octez_node_version.partially_compare - v - c - node_version - node_commit_info - with - | None -> false - | Some x -> x = 0) - in - if bypass then - let*! () = Events.(emit node_version_check_bypass ()) in - return_unit - else - let baker_version = Tezos_version_value.Current_git_info.octez_version in - let (baker_commit_info - : Tezos_version.Octez_node_version.commit_info option) = - Some - { - commit_hash = Tezos_version_value.Current_git_info.commit_hash; - commit_date = Tezos_version_value.Current_git_info.committer_date; - } - in - let* node_version = Version_services.version cctxt in - let*! () = - Events.( - emit - node_version_check - ( node_version.version, - node_version.commit_info, - baker_version, - baker_commit_info )) - in - if is_allowed node_version.version node_version.commit_info then return_unit - else - match - Tezos_version.Octez_node_version.partially_compare - baker_version - baker_commit_info - node_version.version - node_version.commit_info - with - | Some r when r <= 0 -> return_unit - | _ -> - tzfail - (Node_version_incompatible - { - node_version = node_version.version; - node_commit_info = node_version.commit_info; - baker_version; - baker_commit_info; - }) - let http_headers_env_variable = "TEZOS_CLIENT_REMOTE_OPERATIONS_POOL_HTTP_HEADERS" @@ -762,7 +684,10 @@ let run_baker ?(recommend_agnostic_baker = true) else Lwt.return_unit in let* () = - check_node_version cctxt node_version_check_bypass node_version_allowed + Octez_agnostic_baker.Command_run.check_node_version + cctxt + node_version_check_bypass + node_version_allowed in let*! per_block_vote_file = if per_block_vote_file = None then diff --git a/src/proto_022_PsRiotum/lib_delegate/baking_errors.ml b/src/proto_022_PsRiotum/lib_delegate/baking_errors.ml index 1ebc51e5a8f6..0e82fa8574ce 100644 --- a/src/proto_022_PsRiotum/lib_delegate/baking_errors.ml +++ b/src/proto_022_PsRiotum/lib_delegate/baking_errors.ml @@ -25,16 +25,6 @@ type error += Node_connection_lost -type error += - | Node_version_incompatible of { - node_version : Tezos_version_parser.t; - node_commit_info : Tezos_version.Octez_node_version.commit_info option; - baker_version : Tezos_version_parser.t; - baker_commit_info : Tezos_version.Octez_node_version.commit_info option; - } - -type error += Node_version_malformatted of string - type error += Cannot_load_local_file of string type error += Broken_locked_values_invariant @@ -61,79 +51,6 @@ let () = Data_encoding.empty (function Node_connection_lost -> Some () | _ -> None) (fun () -> Node_connection_lost) ; - register_error_kind - `Temporary - ~id:"Baking_commands.node_version_incompatible" - ~title:"Node version is incompatible" - ~description:"The node version is incompatible with this baker" - ~pp:(fun - fmt - ((node_version, node_commit_info, baker_version, baker_commit_info) : - Tezos_version_parser.t - * Tezos_version.Octez_node_version.commit_info option - * Tezos_version_parser.t - * Tezos_version.Octez_node_version.commit_info option) - -> - Format.fprintf - fmt - "@[Node version is %a (%a) but it is expected to be more recent than \ - %a (%a).@ This check can be bypassed at your own risk with the flag \ - --node-version-check-bypass or the argument --node-version-allowed \ - %a%a .@]" - Tezos_version.Version.pp - node_version - (Format.pp_print_option - ~none:(fun ppf () -> Format.pp_print_string ppf "none") - Tezos_version.Octez_node_version.commit_info_pp_short) - node_commit_info - Tezos_version.Version.pp - baker_version - (Format.pp_print_option - ~none:(fun ppf () -> Format.pp_print_string ppf "none") - Tezos_version.Octez_node_version.commit_info_pp_short) - baker_commit_info - Tezos_version.Version.pp_arg - node_version - (Format.pp_print_option - ~none:(fun _ppf () -> ()) - (fun ppf -> - Format.fprintf - ppf - ":%a" - Tezos_version.Octez_node_version.commit_info_pp_short)) - node_commit_info) - Data_encoding.( - obj4 - (req "node_version" Tezos_version.Octez_node_version.version_encoding) - (opt - "node_commit_info" - Tezos_version.Octez_node_version.commit_info_encoding) - (req "baker_version" Tezos_version.Octez_node_version.version_encoding) - (opt - "baker_commit_info" - Tezos_version.Octez_node_version.commit_info_encoding)) - (function - | Node_version_incompatible - {node_version; node_commit_info; baker_version; baker_commit_info} -> - Some (node_version, node_commit_info, baker_version, baker_commit_info) - | _ -> None) - (fun (node_version, node_commit_info, baker_version, baker_commit_info) -> - Node_version_incompatible - {node_version; node_commit_info; baker_version; baker_commit_info}) ; - register_error_kind - `Temporary - ~id:"Baking_commands.node_version_malformatted" - ~title:"Node version in command argument is malformatted" - ~description:"The node version provided in command argument is malformatted" - ~pp:(fun fmt version -> - Format.fprintf - fmt - "The node version provided in command argument: '%s' is a malformatted \ - version" - version) - Data_encoding.(obj1 (req "provided_version" string)) - (function Node_version_malformatted v -> Some v | _ -> None) - (fun v -> Node_version_malformatted v) ; register_error_kind `Temporary ~id:"Baking_scheduling.cannot_load_local_file" diff --git a/src/proto_022_PsRiotum/lib_delegate/baking_events.ml b/src/proto_022_PsRiotum/lib_delegate/baking_events.ml index ffb9d2bb00b2..d721f2f668ea 100644 --- a/src/proto_022_PsRiotum/lib_delegate/baking_events.ml +++ b/src/proto_022_PsRiotum/lib_delegate/baking_events.ml @@ -39,39 +39,6 @@ module Commands = struct let section = section @ ["commands"] - let node_version_check_bypass = - declare_0 - ~section - ~name:"node_version_check_bypass" - ~level:Warning - ~msg:"Compatibility between node version and baker version by passed" - () - - let node_version_check = - declare_4 - ~section - ~name:"node_version_check" - ~level:Debug - ~msg: - "Checking compatibility between node version {node_version} \ - ({node_commit}) and baker version {baker_version} ({baker_commit})" - ~pp1:Tezos_version.Version.pp_simple - ("node_version", Tezos_version.Octez_node_version.version_encoding) - ~pp2: - (Format.pp_print_option - Tezos_version.Octez_node_version.commit_info_pp_short) - ( "node_commit", - Data_encoding.option - Tezos_version.Octez_node_version.commit_info_encoding ) - ~pp3:Tezos_version.Version.pp_simple - ("baker_version", Tezos_version.Octez_node_version.version_encoding) - ~pp4: - (Format.pp_print_option - Tezos_version.Octez_node_version.commit_info_pp_short) - ( "baker_commit", - Data_encoding.option - Tezos_version.Octez_node_version.commit_info_encoding ) - let no_dal_node_provided = declare_0 ~section diff --git a/src/proto_alpha/lib_delegate/baking_commands.ml b/src/proto_alpha/lib_delegate/baking_commands.ml index e16c824b512e..a468b3b0666e 100644 --- a/src/proto_alpha/lib_delegate/baking_commands.ml +++ b/src/proto_alpha/lib_delegate/baking_commands.ml @@ -37,84 +37,6 @@ let pidfile_arg = ~placeholder:"filename" (Tezos_clic.parameter (fun _ s -> return s)) -let check_node_version cctxt bypass allowed = - let open Lwt_result_syntax in - (* Parse and check allowed versions *) - let*? allowed = - let open Result_syntax in - Option.map_e - (fun allowed -> - match - Tezos_version_parser.version_commit (Lexing.from_string allowed) - with - | None -> tzfail (Node_version_malformatted allowed) - | Some x -> return x) - allowed - in - let is_allowed node_version - (node_commit_info : Tezos_version.Octez_node_version.commit_info option) = - match allowed with - | None -> false - | Some (v, c) -> ( - let c = - Option.map - (fun commit_hash -> - Tezos_version.Octez_node_version.{commit_hash; commit_date = ""}) - c - in - match - Tezos_version.Octez_node_version.partially_compare - v - c - node_version - node_commit_info - with - | None -> false - | Some x -> x = 0) - in - if bypass then - let*! () = Events.(emit node_version_check_bypass ()) in - return_unit - else - let baker_version = Tezos_version_value.Current_git_info.octez_version in - let (baker_commit_info - : Tezos_version.Octez_node_version.commit_info option) = - Some - { - commit_hash = Tezos_version_value.Current_git_info.commit_hash; - commit_date = Tezos_version_value.Current_git_info.committer_date; - } - in - let* node_version = Version_services.version cctxt in - let*! () = - Events.( - emit - node_version_check - ( node_version.version, - node_version.commit_info, - baker_version, - baker_commit_info )) - in - if is_allowed node_version.version node_version.commit_info then return_unit - else - match - Tezos_version.Octez_node_version.partially_compare - baker_version - baker_commit_info - node_version.version - node_version.commit_info - with - | Some r when r <= 0 -> return_unit - | _ -> - tzfail - (Node_version_incompatible - { - node_version = node_version.version; - node_commit_info = node_version.commit_info; - baker_version; - baker_commit_info; - }) - let http_headers_env_variable = "TEZOS_CLIENT_REMOTE_OPERATIONS_POOL_HTTP_HEADERS" @@ -772,7 +694,10 @@ let run_baker ?(recommend_agnostic_baker = true) else Lwt.return_unit in let* () = - check_node_version cctxt node_version_check_bypass node_version_allowed + Octez_agnostic_baker.Command_run.check_node_version + cctxt + node_version_check_bypass + node_version_allowed in let*! per_block_vote_file = if per_block_vote_file = None then diff --git a/src/proto_alpha/lib_delegate/baking_errors.ml b/src/proto_alpha/lib_delegate/baking_errors.ml index a83d8ee3c315..b01327c556f4 100644 --- a/src/proto_alpha/lib_delegate/baking_errors.ml +++ b/src/proto_alpha/lib_delegate/baking_errors.ml @@ -25,16 +25,6 @@ type error += Node_connection_lost -type error += - | Node_version_incompatible of { - node_version : Tezos_version_parser.t; - node_commit_info : Tezos_version.Octez_node_version.commit_info option; - baker_version : Tezos_version_parser.t; - baker_commit_info : Tezos_version.Octez_node_version.commit_info option; - } - -type error += Node_version_malformatted of string - type error += Cannot_load_local_file of string type error += Broken_locked_values_invariant @@ -61,79 +51,6 @@ let () = Data_encoding.empty (function Node_connection_lost -> Some () | _ -> None) (fun () -> Node_connection_lost) ; - register_error_kind - `Temporary - ~id:"Baking_commands.node_version_incompatible" - ~title:"Node version is incompatible" - ~description:"The node version is incompatible with this baker" - ~pp:(fun - fmt - ((node_version, node_commit_info, baker_version, baker_commit_info) : - Tezos_version_parser.t - * Tezos_version.Octez_node_version.commit_info option - * Tezos_version_parser.t - * Tezos_version.Octez_node_version.commit_info option) - -> - Format.fprintf - fmt - "@[Node version is %a (%a) but it is expected to be more recent than \ - %a (%a).@ This check can be bypassed at your own risk with the flag \ - --node-version-check-bypass or the argument --node-version-allowed \ - %a%a .@]" - Tezos_version.Version.pp - node_version - (Format.pp_print_option - ~none:(fun ppf () -> Format.pp_print_string ppf "none") - Tezos_version.Octez_node_version.commit_info_pp_short) - node_commit_info - Tezos_version.Version.pp - baker_version - (Format.pp_print_option - ~none:(fun ppf () -> Format.pp_print_string ppf "none") - Tezos_version.Octez_node_version.commit_info_pp_short) - baker_commit_info - Tezos_version.Version.pp_arg - node_version - (Format.pp_print_option - ~none:(fun _ppf () -> ()) - (fun ppf -> - Format.fprintf - ppf - ":%a" - Tezos_version.Octez_node_version.commit_info_pp_short)) - node_commit_info) - Data_encoding.( - obj4 - (req "node_version" Tezos_version.Octez_node_version.version_encoding) - (opt - "node_commit_info" - Tezos_version.Octez_node_version.commit_info_encoding) - (req "baker_version" Tezos_version.Octez_node_version.version_encoding) - (opt - "baker_commit_info" - Tezos_version.Octez_node_version.commit_info_encoding)) - (function - | Node_version_incompatible - {node_version; node_commit_info; baker_version; baker_commit_info} -> - Some (node_version, node_commit_info, baker_version, baker_commit_info) - | _ -> None) - (fun (node_version, node_commit_info, baker_version, baker_commit_info) -> - Node_version_incompatible - {node_version; node_commit_info; baker_version; baker_commit_info}) ; - register_error_kind - `Temporary - ~id:"Baking_commands.node_version_malformatted" - ~title:"Node version in command argument is malformatted" - ~description:"The node version provided in command argument is malformatted" - ~pp:(fun fmt version -> - Format.fprintf - fmt - "The node version provided in command argument: '%s' is a malformatted \ - version" - version) - Data_encoding.(obj1 (req "provided_version" string)) - (function Node_version_malformatted v -> Some v | _ -> None) - (fun v -> Node_version_malformatted v) ; register_error_kind `Temporary ~id:"Baking_scheduling.cannot_load_local_file" diff --git a/src/proto_alpha/lib_delegate/baking_events.ml b/src/proto_alpha/lib_delegate/baking_events.ml index b2a41166f26c..ee81bfb3186f 100644 --- a/src/proto_alpha/lib_delegate/baking_events.ml +++ b/src/proto_alpha/lib_delegate/baking_events.ml @@ -39,39 +39,6 @@ module Commands = struct let section = section @ ["commands"] - let node_version_check_bypass = - declare_0 - ~section - ~name:"node_version_check_bypass" - ~level:Warning - ~msg:"Compatibility between node version and baker version by passed" - () - - let node_version_check = - declare_4 - ~section - ~name:"node_version_check" - ~level:Debug - ~msg: - "Checking compatibility between node version {node_version} \ - ({node_commit}) and baker version {baker_version} ({baker_commit})" - ~pp1:Tezos_version.Version.pp_simple - ("node_version", Tezos_version.Octez_node_version.version_encoding) - ~pp2: - (Format.pp_print_option - Tezos_version.Octez_node_version.commit_info_pp_short) - ( "node_commit", - Data_encoding.option - Tezos_version.Octez_node_version.commit_info_encoding ) - ~pp3:Tezos_version.Version.pp_simple - ("baker_version", Tezos_version.Octez_node_version.version_encoding) - ~pp4: - (Format.pp_print_option - Tezos_version.Octez_node_version.commit_info_pp_short) - ( "baker_commit", - Data_encoding.option - Tezos_version.Octez_node_version.commit_info_encoding ) - let no_dal_node_provided = declare_0 ~section -- GitLab