diff --git a/etherlink/tezt/tests/evm_rollup.ml b/etherlink/tezt/tests/evm_rollup.ml index 34f5e748d4a2ec61c1bda8970066003523d50034..dafa67ac5c92358029bbaaac4b2e2e5bc8a788f7 100644 --- a/etherlink/tezt/tests/evm_rollup.ml +++ b/etherlink/tezt/tests/evm_rollup.ml @@ -305,11 +305,20 @@ let setup_evm_kernel ?additional_config ?(setup_kernel_root_hash = true) ?tx_pool_timeout_limit ?tx_pool_addr_limit ?tx_pool_tx_per_addr_limit ?max_number_of_chunks ?(setup_mode = Setup_proxy) ?(force_install_kernel = true) ?whitelist ?maximum_allowed_ticks - ?restricted_rpcs ?enable_dal ?dal_slots protocol = + ?restricted_rpcs ?(enable_dal = false) ?dal_slots protocol = let _, kernel_installee = Kernel.to_uses_and_tags kernel in let* node, client = setup_l1 ?commitment_period ?challenge_window ?timestamp protocol in + let* dal_node = + if enable_dal then + let dal_node = Dal_node.create ~node () in + let* () = Dal_node.init_config ?producer_profiles:dal_slots dal_node in + let* () = Dal_node.run ~wait_ready:true dal_node in + some dal_node + else none + in + let client = Client.with_dal_node client ?dal_node in let* l1_contracts = match admin with | Some admin -> @@ -367,7 +376,7 @@ let setup_evm_kernel ?additional_config ?(setup_kernel_root_hash = true) sequencer_governance)) ?maximum_allowed_ticks ~output:output_config - ?enable_dal + ~enable_dal ?dal_slots () in @@ -481,6 +490,7 @@ let register_test ~title ~tags ?(kernels = Kernel.all) ?additional_config ?admin Constant.octez_evm_node; Constant.smart_rollup_installer; ] + @ (if enable_dal then [Constant.octez_dal_node] else []) @ additional_uses in Protocol.register_test diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index d8484fa6c194cbe6508573fbb768093bfe81aed6..ce2cc67c273737f518ac384a8671c73e9d1263b3 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -185,6 +185,15 @@ let setup_sequencer ~mainnet_compat ?genesis_timestamp ?time_between_blocks ?timestamp:genesis_timestamp protocol in + let* dal_node = + if enable_dal then + let dal_node = Dal_node.create ~node () in + let* () = Dal_node.init_config ?producer_profiles:dal_slots dal_node in + let* () = Dal_node.run ~wait_ready:true dal_node in + some dal_node + else none + in + let client = Client.with_dal_node client ?dal_node in let* l1_contracts = setup_l1_contracts client in let sc_rollup_node = Sc_rollup_node.create @@ -434,9 +443,10 @@ let register_test ~mainnet_compat ?genesis_timestamp ?time_between_blocks ?(dal_slots = if enable_dal then Some [4] else None) body ~title ~tags protocols = let additional_uses = - if threshold_encryption then - Constant.octez_dsn_node :: kernel :: additional_uses - else kernel :: additional_uses + (if threshold_encryption then [Constant.octez_dsn_node] else []) + @ [kernel] + @ (if enable_dal then [Constant.octez_dal_node] else []) + @ additional_uses in let body protocol = let* sequencer_setup = diff --git a/tezt/lib_tezos/client.ml b/tezt/lib_tezos/client.ml index 8f5846cf9c6c6d9b1aa6612d9f844dd2d50259c5..ac150c834ecc609b01775647634eb4f7b4567223 100644 --- a/tezt/lib_tezos/client.ml +++ b/tezt/lib_tezos/client.ml @@ -63,6 +63,7 @@ type t = { mutable additional_bootstraps : Account.key list; mutable mode : mode; runner : Runner.t option; + dal_node : Dal_node.t option; } type stresstest_gas_estimation = { @@ -90,6 +91,10 @@ let get_mode t = t.mode let set_mode mode t = t.mode <- mode +let get_dal_node t = t.dal_node + +let with_dal_node ?dal_node t = {t with dal_node} + let endpoint_wait_for ?where endpoint event filter = match endpoint with | Node node -> Node.wait_for ?where node event filter @@ -141,16 +146,26 @@ let address ?(hostname = false) ?from peer = let create_with_mode ?runner ?(path = Uses.path Constant.octez_client) ?(admin_path = Uses.path Constant.octez_admin_client) ?name - ?(color = Log.Color.FG.blue) ?base_dir mode = + ?(color = Log.Color.FG.blue) ?base_dir ?dal_node mode = let name = match name with None -> fresh_name () | Some name -> name in let base_dir = match base_dir with None -> Temp.dir ?runner name | Some dir -> dir in let additional_bootstraps = [] in - {path; admin_path; name; color; base_dir; additional_bootstraps; mode; runner} + { + path; + admin_path; + name; + color; + base_dir; + additional_bootstraps; + mode; + runner; + dal_node; + } let create ?runner ?path ?admin_path ?name ?color ?base_dir ?endpoint - ?media_type () = + ?media_type ?dal_node () = create_with_mode ?runner ?path @@ -158,6 +173,7 @@ let create ?runner ?path ?admin_path ?name ?color ?base_dir ?endpoint ?name ?color ?base_dir + ?dal_node (Client (endpoint, media_type)) let base_dir_arg client = ["--base-dir"; client.base_dir] @@ -763,6 +779,12 @@ let empty_mempool_file ?(filename = "mempool.json") () = write_file mempool ~contents:mempool_str ; mempool +let dal_node_arg dal_node_endpoint client = + match (dal_node_endpoint, client.dal_node) with + | Some endpoint, _ -> ["--dal-node"; endpoint] + | None, Some dal_node -> ["--dal-node"; Dal_node.rpc_endpoint dal_node] + | None, None -> [] + let spawn_bake_for ?endpoint ?protocol ?(keys = [Constant.bootstrap1.alias]) ?minimal_fees ?minimal_nanotez_per_gas_unit ?minimal_nanotez_per_byte ?(minimal_timestamp = true) ?mempool ?(ignore_node_mempool = false) ?count @@ -788,7 +810,7 @@ let spawn_bake_for ?endpoint ?protocol ?(keys = [Constant.bootstrap1.alias]) @ optional_arg "count" string_of_int count @ (match force with None | Some false -> [] | Some true -> ["--force"]) @ optional_arg "context" Fun.id context_path - @ optional_arg "dal-node" Fun.id dal_node_endpoint + @ dal_node_arg dal_node_endpoint client @ optional_arg "adaptive-issuance-vote" ai_vote_to_string ai_vote @ optional_switch "record_state" state_recorder) @@ -2843,7 +2865,7 @@ let write_sources_file ~min_agreement ~uris client = Lwt_io.fprintf oc "%s" @@ Ezjsonm.value_to_string obj) let init_light ?path ?admin_path ?name ?color ?base_dir ?(min_agreement = 0.66) - ?event_level ?event_sections_levels ?(nodes_args = []) () = + ?event_level ?event_sections_levels ?(nodes_args = []) ?dal_node () = let filter_node_arg = function | Node.Connections _ | Synchronisation_threshold _ -> None | x -> Some x @@ -2865,6 +2887,7 @@ let init_light ?path ?admin_path ?name ?color ?base_dir ?(min_agreement = 0.66) ?name ?color ?base_dir + ?dal_node (Light (min_agreement, List.map (fun n -> Node n) nodes)) in let* () = @@ -2957,7 +2980,7 @@ let get_parameter_file ?additional_bootstrap_accounts ?default_accounts_balance let init_with_node ?path ?admin_path ?name ?node_name ?color ?base_dir ?event_level ?event_sections_levels ?(nodes_args = Node.[Connections 0; Synchronisation_threshold 0]) - ?(keys = Constant.all_secret_keys) ?rpc_external tag () = + ?(keys = Constant.all_secret_keys) ?rpc_external ?dal_node tag () = match tag with | (`Client | `Proxy) as mode -> let* node = @@ -2975,13 +2998,21 @@ let init_with_node ?path ?admin_path ?name ?node_name ?color ?base_dir | `Proxy -> Proxy endpoint in let client = - create_with_mode ?path ?admin_path ?name ?color ?base_dir mode + create_with_mode ?path ?admin_path ?name ?color ?base_dir ?dal_node mode in Account.write keys ~base_dir:client.base_dir ; return (node, client) | `Light -> let* client, node1, _ = - init_light ?path ?admin_path ?name ?color ?base_dir ~nodes_args () + init_light + ?path + ?admin_path + ?name + ?color + ?base_dir + ?dal_node + ~nodes_args + () in return (node1, client) @@ -2989,7 +3020,7 @@ let init_with_protocol ?path ?admin_path ?name ?node_name ?color ?base_dir ?event_level ?event_sections_levels ?nodes_args ?additional_bootstrap_account_count ?additional_revealed_bootstrap_account_count ?default_accounts_balance - ?parameter_file ?timestamp ?keys ?rpc_external tag ~protocol () = + ?parameter_file ?timestamp ?keys ?rpc_external ?dal_node tag ~protocol () = let* node, client = init_with_node ?path @@ -3003,6 +3034,7 @@ let init_with_protocol ?path ?admin_path ?name ?node_name ?color ?base_dir ?nodes_args ?keys ?rpc_external + ?dal_node tag () in diff --git a/tezt/lib_tezos/client.mli b/tezt/lib_tezos/client.mli index ae5d49e22853fc0dfa45bec77243eae3eb7e37e1..ac38453dfe186c1e182fe52b0baddd53f6abfce5 100644 --- a/tezt/lib_tezos/client.mli +++ b/tezt/lib_tezos/client.mli @@ -133,6 +133,7 @@ val create : ?base_dir:string -> ?endpoint:endpoint -> ?media_type:media_type -> + ?dal_node:Dal_node.t -> unit -> t @@ -144,6 +145,7 @@ val create_with_mode : ?name:string -> ?color:Log.Color.t -> ?base_dir:string -> + ?dal_node:Dal_node.t -> mode -> t @@ -156,6 +158,13 @@ val get_mode : t -> mode a new client from scratch. *) val set_mode : mode -> t -> unit +(** Get a client's Dal node. *) +val get_dal_node : t -> Dal_node.t option + +(** [with_dal_node t dal_node] returns the client [t] with its + Dal node updated to [dal_node]. *) +val with_dal_node : ?dal_node:Dal_node.t -> t -> t + (** Write the [--sources] file used by the light mode. *) val write_sources_file : min_agreement:float -> uris:string list -> t -> unit Lwt.t @@ -2484,6 +2493,7 @@ val init_with_node : ?nodes_args:Node.argument list -> ?keys:Account.key list -> ?rpc_external:bool -> + ?dal_node:Dal_node.t -> [`Client | `Light | `Proxy] -> unit -> (Node.t * t) Lwt.t @@ -2519,6 +2529,7 @@ val init_with_protocol : ?timestamp:timestamp -> ?keys:Account.key list -> ?rpc_external:bool -> + ?dal_node:Dal_node.t -> [`Client | `Light | `Proxy] -> protocol:Protocol.t -> unit -> @@ -2559,6 +2570,7 @@ val init_light : ?event_level:Daemon.Level.default_level -> ?event_sections_levels:(string * Daemon.Level.level) list -> ?nodes_args:Node.argument list -> + ?dal_node:Dal_node.t -> unit -> (t * Node.t * Node.t) Lwt.t