From ddd51d398d602c65465c7095955010dbddcce040 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Mon, 26 May 2025 11:41:54 +0200 Subject: [PATCH 1/2] Tezt/Cloud/DAL: export Network.to_public --- tezt/tests/cloud/network.ml | 4 ++++ tezt/tests/cloud/network.mli | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tezt/tests/cloud/network.ml b/tezt/tests/cloud/network.ml index 1bdc691c624e..f39bb25dedcf 100644 --- a/tezt/tests/cloud/network.ml +++ b/tezt/tests/cloud/network.ml @@ -10,6 +10,10 @@ type public = type t = [public | `Sandbox] +let to_public = function + | `Sandbox -> failwith "Sandbox is not public" + | #public as p -> p + let to_string = function | `Mainnet -> "mainnet" | `Ghostnet -> "ghostnet" diff --git a/tezt/tests/cloud/network.mli b/tezt/tests/cloud/network.mli index 68f02ffa44ff..e510d9c6024a 100644 --- a/tezt/tests/cloud/network.mli +++ b/tezt/tests/cloud/network.mli @@ -21,7 +21,9 @@ type public = type t = [public | `Sandbox] -(** ["mainnet" | "ghostnet" | "nextnet-%s" | "weeklynet-%s" | "sandbox"] *) +val to_public : t -> public + +(** ["mainnet" | "ghostnet" | "rionet" | "nextnet-%s" | "weeklynet-%s" | "sandbox"] *) val to_string : t -> string (** Known protocol used by the network *) -- GitLab From 38ef9acbcdf5f268821ae48a06b8a355c10c840f Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Mon, 26 May 2025 11:42:14 +0200 Subject: [PATCH 2/2] Tezt/Cloud/DAL: also include Rionet when determining the default L1 endpoint --- tezt/tests/cloud/dal.ml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tezt/tests/cloud/dal.ml b/tezt/tests/cloud/dal.ml index b216d705908e..d83bce9d09f5 100644 --- a/tezt/tests/cloud/dal.ml +++ b/tezt/tests/cloud/dal.ml @@ -126,9 +126,9 @@ module Node = struct ~name network cloud agent = toplog "Inititializing an L1 node for %s" name ; match network with - | (`Mainnet | `Ghostnet | `Nextnet _ | `Weeklynet _ | `Rionet) as network - -> ( - (* For public networks deployments, we listen on all interfaces on both + | #Network.public -> ( + let network = Network.to_public network in + (* for public networks deployments, we listen on all interfaces on both ipv4 and ipv6 *) let net_addr = "[::]" in match data_dir with @@ -239,7 +239,7 @@ module Node = struct let* () = Node.wait_for_synchronisation ~statuses:["synced"] node in toplog "Node is bootstrapped" ; Lwt.return node) - | `Sandbox -> ( + | _ (* private network *) -> ( (* For sandbox deployments, we only listen on local interface, hence no connection could be made to us from outside networks *) let net_addr = "127.0.0.1" in @@ -3200,7 +3200,7 @@ let obtain_some_node_rpc_endpoint agent network (bootstrap : bootstrap) (bakers : baker list) (producers : producer list) (observers : observer list) etherlink = match (agent, network) with - | None, (`Mainnet | `Ghostnet | `Nextnet _ | `Weeklynet _) -> ( + | None, #Network.public -> ( match (bakers, producers, observers, etherlink) with | baker :: _, _, _, _ -> Node.as_rpc_endpoint baker.node | [], producer :: _, _, _ -> Node.as_rpc_endpoint producer.node @@ -3276,7 +3276,8 @@ let init ~(configuration : configuration) etherlink_configuration cloud configuration ?etherlink_configuration bootstrap_agent - | (`Ghostnet | `Nextnet _ | `Mainnet | `Weeklynet _ | `Rionet) as network -> + | #Network.public -> + let network = Network.to_public configuration.network in init_public_network cloud configuration -- GitLab