From c6c5565e381af51679127a4cbf08cf1c32ecb260 Mon Sep 17 00:00:00 2001 From: Gabriel Moise Date: Mon, 27 Jan 2025 11:27:21 +0000 Subject: [PATCH] Tezt: Fix agnostic baker migration test by adding --without-dal default Co-authored-by: Mattias Roux --- tezt/lib_tezos/agnostic_baker.ml | 22 ++++++++++++++++------ tezt/lib_tezos/agnostic_baker.mli | 8 ++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/tezt/lib_tezos/agnostic_baker.ml b/tezt/lib_tezos/agnostic_baker.ml index a61c431c6d42..e418593d4caa 100644 --- a/tezt/lib_tezos/agnostic_baker.ml +++ b/tezt/lib_tezos/agnostic_baker.ml @@ -22,6 +22,7 @@ module Parameters = struct mutable pending_ready : unit option Lwt.u list; remote_mode : bool; liquidity_baking_toggle_vote : liquidity_baking_vote option; + use_dal_node : string option; } type session_state = {mutable ready : bool} @@ -48,8 +49,8 @@ let set_ready agnostic_baker = let create_from_uris ?runner ?(path = Uses.path Constant.octez_experimental_agnostic_baker) ?name ?color ?event_pipe ?(delegates = []) ?(remote_mode = false) - ?(liquidity_baking_toggle_vote = Some Pass) ~base_dir ~node_data_dir - ~node_rpc_endpoint () = + ?(liquidity_baking_toggle_vote = Some Pass) ?use_dal_node ~base_dir + ~node_data_dir ~node_rpc_endpoint () = let agnostic_baker = create ~path @@ -66,6 +67,7 @@ let create_from_uris ?runner pending_ready = []; remote_mode; liquidity_baking_toggle_vote; + use_dal_node; } in agnostic_baker @@ -74,8 +76,8 @@ let handle_event node ({name; _} : event) = match name with "starting_daemon.v0" -> set_ready node | _ -> () let create ?runner ?path ?name ?color ?event_pipe ?(delegates = []) - ?(remote_mode = false) ?(liquidity_baking_toggle_vote = Some Pass) node - client = + ?(remote_mode = false) ?(liquidity_baking_toggle_vote = Some Pass) + ?use_dal_node node client = let agnostic_baker = create_from_uris ?runner @@ -83,6 +85,7 @@ let create ?runner ?path ?name ?color ?event_pipe ?(delegates = []) ?name ?color ?event_pipe + ?use_dal_node ~delegates ~remote_mode ~liquidity_baking_toggle_vote @@ -116,9 +119,14 @@ let run ?event_level ?event_sections_levels (agnostic_baker : t) = liquidity_baking_vote_to_string agnostic_baker.persistent_state.liquidity_baking_toggle_vote in + let use_dal_node = + match agnostic_baker.persistent_state.use_dal_node with + | None -> ["--without-dal"] + | Some endpoint -> ["--dal-node"; endpoint] + in let arguments = ["--"; "--endpoint"; node_addr; "--base-dir"; base_dir; "run"] - @ run_args @ delegates @ liquidity_baking_toggle_vote + @ run_args @ delegates @ liquidity_baking_toggle_vote @ use_dal_node in let on_terminate _ = @@ -155,7 +163,8 @@ let wait_for_ready agnostic_baker = let init ?runner ?(path = Uses.path Constant.octez_experimental_agnostic_baker) ?name ?color ?event_level ?event_pipe ?event_sections_levels - ?(delegates = []) ?remote_mode ?liquidity_baking_toggle_vote node client = + ?(delegates = []) ?remote_mode ?liquidity_baking_toggle_vote ?use_dal_node + node client = let* () = Node.wait_for_ready node in let agnostic_baker = create @@ -166,6 +175,7 @@ let init ?runner ?(path = Uses.path Constant.octez_experimental_agnostic_baker) ?event_pipe ?remote_mode ?liquidity_baking_toggle_vote + ?use_dal_node ~delegates node client diff --git a/tezt/lib_tezos/agnostic_baker.mli b/tezt/lib_tezos/agnostic_baker.mli index 9e7456be8659..dfe8d069592e 100644 --- a/tezt/lib_tezos/agnostic_baker.mli +++ b/tezt/lib_tezos/agnostic_baker.mli @@ -89,6 +89,11 @@ val liquidity_baking_vote_to_string : liquidity_baking_vote -> string then [--liquidity-baking-toggle-vote x] is passed. The default value is [Some Pass]. + [use_dal_node] is passed to the agnostic baker daemon through the + [--without-dal] or [--dal-node ] flags. If the flag is [None], the + former option is passed, otherwise if the flag is [Some ], then the + latter option is passed. The default value is [None]. + If [remote_mode] is specified, the agnostic baker will run in RPC-only mode. *) val create : @@ -100,6 +105,7 @@ val create : ?delegates:string list -> ?remote_mode:bool -> ?liquidity_baking_toggle_vote:liquidity_baking_vote option -> + ?use_dal_node:string -> Node.t -> Client.t -> t @@ -127,6 +133,7 @@ val create_from_uris : ?delegates:string list -> ?remote_mode:bool -> ?liquidity_baking_toggle_vote:liquidity_baking_vote option -> + ?use_dal_node:string -> base_dir:string -> node_data_dir:string -> node_rpc_endpoint:Endpoint.t -> @@ -180,6 +187,7 @@ val init : ?delegates:string list -> ?remote_mode:bool -> ?liquidity_baking_toggle_vote:liquidity_baking_vote option -> + ?use_dal_node:string -> Node.t -> Client.t -> t Lwt.t -- GitLab