From a468e46d696a4b31dd5909a491c3587416071aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Tue, 9 Jul 2024 17:39:15 +0200 Subject: [PATCH 1/3] Etherlink/DAL/Tezt: only register DAL tests for supporting kernels --- etherlink/tezt/lib/kernel.ml | 5 +++++ etherlink/tezt/tests/evm_sequencer.ml | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/etherlink/tezt/lib/kernel.ml b/etherlink/tezt/lib/kernel.ml index f2cf3e87a999..4aefa773f317 100644 --- a/etherlink/tezt/lib/kernel.ml +++ b/etherlink/tezt/lib/kernel.ml @@ -29,3 +29,8 @@ let of_use u = else if Uses.(tag u = tag Constant.WASM.ghostnet_evm_kernel) then Ghostnet else if Uses.(tag u = tag Constant.WASM.evm_kernel) then Latest else raise (Invalid_argument "Kernel.of_use") + +let supports_dal = function + | Mainnet -> false + | Ghostnet -> false + | Latest -> true diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index c41102fc3ffa..42862519c439 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -508,14 +508,16 @@ let register_test ?sequencer_rpc_port ?sequencer_private_rpc_port kernel_tag (if enable_dal then "with dal" else "without dal") in - Protocol.register_test - ~additional_tags:(function Alpha -> [] | _ -> [Tag.slow]) - ~__FILE__ - ~uses:(fun protocol -> uses protocol @ additional_uses) - body - ~title - ~tags - protocols + (* Only register DAL tests for supporting kernels *) + if (not enable_dal) || Kernel.supports_dal kernel then + Protocol.register_test + ~additional_tags:(function Alpha -> [] | _ -> [Tag.slow]) + ~__FILE__ + ~uses:(fun protocol -> uses protocol @ additional_uses) + body + ~title + ~tags + protocols (* For each feature (threshold encryption, DAL, FA Bridge), tests may registered with the feature enabled, with the feature disabled, or both. *) -- GitLab From b451db573acb0cc14da8bea234654abc44ae7e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Wed, 24 Jul 2024 12:16:50 +0200 Subject: [PATCH 2/3] Etherlink/Tezt: Name default registrations --- etherlink/tezt/tests/evm_sequencer.ml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index 42862519c439..eb7e5e130a7a 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -534,6 +534,12 @@ type feature_test_registration = which should not run in CI. *) [@@warning "-unused-constructor"] +let default_threshold_encryption_registration = + Register_both {extra_tags_with = [Tag.ci_disabled]; extra_tags_without = []} + +let default_dal_registration = + Register_both {extra_tags_with = [Tag.ci_disabled]; extra_tags_without = []} + (* Register all variants of a test. *) let register_all ?sequencer_rpc_port ?sequencer_private_rpc_port ?genesis_timestamp ?time_between_blocks ?max_blueprints_lag @@ -544,13 +550,8 @@ let register_all ?sequencer_rpc_port ?sequencer_private_rpc_port ?maximum_allowed_ticks ?maximum_gas_per_transaction ?max_blueprint_lookahead_in_seconds ?enable_fa_bridge ?history_mode ?commitment_period ?challenge_window ?additional_uses - ?(use_threshold_encryption = - Register_both - {extra_tags_with = [Tag.ci_disabled]; extra_tags_without = []}) - ?(use_dal = - Register_both - {extra_tags_with = [Tag.ci_disabled]; extra_tags_without = []}) ~title - ~tags body protocols = + ?(use_threshold_encryption = default_threshold_encryption_registration) + ?(use_dal = default_dal_registration) ~title ~tags body protocols = let dal_cases = match use_dal with | Register_both {extra_tags_with; extra_tags_without} -> -- GitLab From bdc457e4107982c91c9bfe8c71ef8ee89f809909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Wed, 24 Jul 2024 12:21:56 +0200 Subject: [PATCH 3/3] Etherlink/DAL/Tezt: activate the relevant DAL tests --- etherlink/tezt/tests/evm_sequencer.ml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index eb7e5e130a7a..a4dc4dfc6ed4 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -540,6 +540,9 @@ let default_threshold_encryption_registration = let default_dal_registration = Register_both {extra_tags_with = [Tag.ci_disabled]; extra_tags_without = []} +let ci_enabled_dal_registration = + Register_both {extra_tags_with = []; extra_tags_without = []} + (* Register all variants of a test. *) let register_all ?sequencer_rpc_port ?sequencer_private_rpc_port ?genesis_timestamp ?time_between_blocks ?max_blueprints_lag @@ -745,6 +748,7 @@ let test_publish_blueprints = ~time_between_blocks:Nothing ~tags:["evm"; "sequencer"; "data"] ~title:"Sequencer publishes the blueprints to L1" + ~use_dal:ci_enabled_dal_registration @@ fun {sequencer; proxy; client; sc_rollup_node; _} _protocol -> let* _ = repeat 5 (fun () -> @@ -772,6 +776,7 @@ let test_sequencer_too_ahead = ~time_between_blocks:Nothing ~tags:["evm"; "max_blueprint_ahead"] ~title:"Sequencer locks production if it's too ahead" + ~use_dal:ci_enabled_dal_registration @@ fun {sequencer; sc_rollup_node; proxy; client; sc_rollup_address; _} _protocol -> let* () = bake_until_sync ~sc_rollup_node ~proxy ~sequencer ~client () in @@ -1285,6 +1290,7 @@ let test_delayed_deposit_is_included = ~da_fee:arb_da_fee_for_delayed_inbox ~tags:["evm"; "sequencer"; "delayed_inbox"; "inclusion"; "deposit"] ~title:"Delayed deposit is included" + ~use_dal:ci_enabled_dal_registration @@ fun { client; l1_contracts; @@ -2669,6 +2675,7 @@ let test_delayed_transfer_timeout = ~da_fee:arb_da_fee_for_delayed_inbox ~tags:["evm"; "sequencer"; "delayed_inbox"; "timeout"] ~title:"Delayed transaction timeout" + ~use_dal:ci_enabled_dal_registration @@ fun { client; node = _; @@ -2828,6 +2835,7 @@ let test_delayed_transfer_timeout_fails_l1_levels = ~da_fee:arb_da_fee_for_delayed_inbox ~tags:["evm"; "sequencer"; "delayed_inbox"; "timeout"; "min_levels"] ~title:"Delayed transaction timeout considers l1 level" + ~use_dal:ci_enabled_dal_registration @@ fun { client; node = _; @@ -3235,6 +3243,7 @@ let test_timestamp_from_the_future = ~time_between_blocks:Nothing ~tags:["evm"; "sequencer"; "block"; "timestamp"] ~title:"Timestamp from the future are refused" + ~use_dal:ci_enabled_dal_registration @@ fun {sequencer; proxy; sc_rollup_node; client; _} _protocol -> (* In this test the time between blocks is 1 second. *) @@ -3722,6 +3731,7 @@ let test_blueprint_is_limited_in_size = ~title: "Checks the sequencer doesn't produce blueprint bigger than the given \ maximum number of chunks" + ~use_dal:ci_enabled_dal_registration @@ fun {sc_rollup_node; client; sequencer; _} _protocol -> let txs = read_tx_from_file () |> List.map (fun (tx, _hash) -> tx) in let* requests, hashes = @@ -3804,6 +3814,7 @@ let test_blueprint_limit_with_delayed_inbox = "Checks the sequencer doesn't produce blueprint bigger than the given \ maximum number of chunks and count delayed transactions size in the \ blueprint" + ~use_dal:ci_enabled_dal_registration @@ fun {sc_rollup_node; client; sequencer; sc_rollup_address; l1_contracts; _} _protocol -> let txs = read_tx_from_file () |> List.map (fun (tx, _hash) -> tx) in -- GitLab