From e5411f3cdb2ec25ca23f5a3b4487a2c8abc72ad1 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Mon, 1 Sep 2025 13:31:44 +0200 Subject: [PATCH 1/3] Tezt/Cloud: A baker that DAL-attest is still a baker --- tezt/tests/cloud/agent_kind.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tezt/tests/cloud/agent_kind.ml b/tezt/tests/cloud/agent_kind.ml index 65cf8ade7127..770182c45e1e 100644 --- a/tezt/tests/cloud/agent_kind.ml +++ b/tezt/tests/cloud/agent_kind.ml @@ -21,7 +21,7 @@ type t = let name_of = function | Bootstrap -> "bootstrap" - | Baker i -> Format.asprintf "attester-%d" i + | Baker i -> Format.asprintf "baker-%d" i | Producer i -> Format.asprintf "dal-producer-%d" i | Observer (`Index i) -> Format.asprintf "dal-observer-%d" i | Observer (`Pkh pkh) -> -- GitLab From 1fd552fc71999144ad1fddadd5b53dd2ec712925 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Mon, 1 Sep 2025 11:37:53 +0200 Subject: [PATCH 2/3] Tezt/Cloud/l1: use agent_kind --- tezt/tests/cloud/agent_kind.ml | 2 ++ tezt/tests/cloud/agent_kind.mli | 1 + tezt/tests/cloud/dal.ml | 3 ++- tezt/tests/cloud/layer1.ml | 38 ++++++++++++++------------------- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/tezt/tests/cloud/agent_kind.ml b/tezt/tests/cloud/agent_kind.ml index 770182c45e1e..e8ed1333534e 100644 --- a/tezt/tests/cloud/agent_kind.ml +++ b/tezt/tests/cloud/agent_kind.ml @@ -18,6 +18,7 @@ type t = | Etherlink_producer of int | Echo_rollup_operator | Echo_rollup_dal_observer of {slot_index : int} + | Stresstest of int let name_of = function | Bootstrap -> "bootstrap" @@ -36,6 +37,7 @@ let name_of = function | Echo_rollup_operator -> "echo-rollup-operator" | Echo_rollup_dal_observer {slot_index} -> Format.sprintf "echo-rollup-dal-node-%d" slot_index + | Stresstest i -> Format.sprintf "stresstest-%d" i type daemon = | Baker_l1_node of int diff --git a/tezt/tests/cloud/agent_kind.mli b/tezt/tests/cloud/agent_kind.mli index d8249f60c88a..235a52feedc6 100644 --- a/tezt/tests/cloud/agent_kind.mli +++ b/tezt/tests/cloud/agent_kind.mli @@ -32,6 +32,7 @@ type t = | Echo_rollup_operator (** The main rollup operator for the Echo rollup. *) | Echo_rollup_dal_observer of {slot_index : int} (** A DAL observer node for the Echo rollup, indexed by slot. *) + | Stresstest of int (** [name_of agent] returns the standard name associated with a given [agent]. Used for consistent naming of VMs, logs and artifacts. *) diff --git a/tezt/tests/cloud/dal.ml b/tezt/tests/cloud/dal.ml index 695aaf390c3d..5e7e1280d1d0 100644 --- a/tezt/tests/cloud/dal.ml +++ b/tezt/tests/cloud/dal.ml @@ -1457,7 +1457,8 @@ let register (module Cli : Scenarios_cli.Dal) = | Echo_rollup_operator -> default_vm_configuration ~name | Etherlink_operator -> default_vm_configuration ~name | Etherlink_producer _ -> default_vm_configuration ~name - | Reverse_proxy -> default_vm_configuration ~name) + | Reverse_proxy -> default_vm_configuration ~name + | Stresstest _ -> default_vm_configuration ~name) vms in let endpoint, resolver_endpoint = Lwt.wait () in diff --git a/tezt/tests/cloud/layer1.ml b/tezt/tests/cloud/layer1.ml index b293dbe69f21..25f02b18a031 100644 --- a/tezt/tests/cloud/layer1.ml +++ b/tezt/tests/cloud/layer1.ml @@ -21,6 +21,7 @@ open Scenarios_helpers open Tezos open Yes_crypto +open Agent_kind (** A baker account is its delegate account and its consensus key account *) type baker_account = {delegate : Account.key; consensus : Account.key} @@ -43,8 +44,6 @@ let nb_stresstester network tps = let n2 = tps * Network.block_time network / stresstest_max_pkh_pre_node in max 1 (max n1 n2) -let agent_name_bootstrap : rex = rex "bootstrap-(\\d+)" - let agent_name_stresstest : rex = rex "stresstest-(\\d+)" let agent_name_baker : rex = rex "baker-(\\d+)" @@ -59,10 +58,6 @@ let extract_agent_index (r : rex) agent = let match_agent_name r agent = Agent.name agent =~ r -let make_agent_name = - let index = rex "\\(\\\\d\\+\\)" in - fun r i -> replace_string index ~by:(string_of_int i) (show_rex r) - module Node = struct open Snapshot_helpers include Node @@ -840,9 +835,7 @@ let init ~(configuration : configuration) cloud = peer list known when initializing. *) let* ((bootstrap_agent, bootstrap_node, bootstrap_name) as bootstrap) = let agent = - List.find - (fun a -> match_agent_name agent_name_bootstrap a) - (Cloud.agents cloud) + List.find (fun a -> Agent.name a = name_of Bootstrap) (Cloud.agents cloud) in create_node agent cloud in @@ -1332,7 +1325,7 @@ let register (module Cli : Scenarios_cli.Layer1) = in let vms () = let* vms = - let init n = List.init n (fun i -> `Baker i) in + let init n = List.init n (fun i -> Baker i) in let* bakers = match configuration.stake with | Scenarios_cli.Auto -> @@ -1344,40 +1337,41 @@ let register (module Cli : Scenarios_cli.Layer1) = | Scenarios_cli.Manual stake -> Lwt.return (init (List.length stake)) in Lwt.return - @@ `Bootstrap + @@ Bootstrap :: (bakers @ (match configuration.dal_node_producers with | Some dal_node_producers -> - List.map (fun i -> `Producer i) dal_node_producers + List.map (fun i -> Producer i) dal_node_producers | None -> []) @ match configuration.stresstest with | None -> [] | Some {tps; _} -> let n = nb_stresstester configuration.network tps in - List.init n (fun i -> `Stresstest i)) + List.init n (fun i -> Stresstest i)) in Lwt.return @@ List.map (fun kind -> match kind with - | `Bootstrap -> - make_vm_conf ~name:(make_agent_name agent_name_bootstrap 0) + | Bootstrap -> + make_vm_conf ~name:(name_of Bootstrap) @@ Option.bind vms_conf (fun {bootstrap; _} -> bootstrap) - | `Stresstest j -> - make_vm_conf ~name:(make_agent_name agent_name_stresstest j) + | Stresstest j -> + make_vm_conf ~name:(name_of (Stresstest j)) @@ Option.bind vms_conf (fun {stresstester; _} -> stresstester) - | `Baker i -> - make_vm_conf ~name:(make_agent_name agent_name_baker i) + | Baker i -> + make_vm_conf ~name:(name_of (Baker i)) @@ Option.bind vms_conf (function | {bakers = Some bakers; _} -> List.nth_opt bakers i | {bakers = None; _} -> None) - | `Producer i -> - make_vm_conf ~name:(Format.sprintf "dal-node-producer-%d" i) + | Producer i -> + make_vm_conf ~name:(name_of_daemon (Producer_dal_node i)) @@ Option.bind vms_conf (function | {producers = Some producers; _} -> List.nth_opt producers i - | {producers = None; _} -> None)) + | {producers = None; _} -> None) + | _ -> assert false) vms in Cloud.register -- GitLab From ae0e00092edaf21694bcd060e116980cb2ac7032 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Mon, 1 Sep 2025 12:06:43 +0200 Subject: [PATCH 3/3] Tezt/Cloud/l1: update layer1 experiment documentation --- tezt/tests/cloud/layer1.mli | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tezt/tests/cloud/layer1.mli b/tezt/tests/cloud/layer1.mli index 8bf6de5d7352..510f6332f1cd 100644 --- a/tezt/tests/cloud/layer1.mli +++ b/tezt/tests/cloud/layer1.mli @@ -26,7 +26,7 @@ converts its yes‑wallet, and then runs an agnostic baker over that node. 4. Stresstest nodes - Potentially launch one or more stresstest nodes that generate transactions at - the target TPS against the private network. + the target TPS against the private network. 5. Metrics & Monitoring - Every node (bootstrap, bakers, stresstesters) is registered as a Prometheus scrape target if `--prometheus` is set. @@ -45,8 +45,7 @@ {[ # fetch a rolling snapshot: wget -O ghostnet.snapshot https://snapshots.tzinit.org/ghostnet/rolling - - dune exec tezt/tests/cloud/main.exe -- cloud l1 -v --log-file /tmp/log \ + dune exec tezt/tests/cloud/main.exe -- LAYER1 -v --log-file /tmp/log \ --stake 1,1 \ --network ghostnet \ --stresstest 100/1 \ @@ -56,7 +55,7 @@ --prometheus \ --grafana \ --website \ - --snapshot ./ghostnet.snapshot + --snapshot file:./ghostnet.snapshot ]} As you can read using the help of [--help], [--stresstest] is: -- GitLab