From 89ffec4b8d5cf3584c75c2564fab18a73d013a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Wed, 24 Jul 2024 09:56:31 +0200 Subject: [PATCH 1/2] Etherlink/Sequencer/Tests: add enable_dal to setup This is to allow to write tests behaving differently when the DAL feature-flag is enabled. --- etherlink/tezt/tests/evm_sequencer.ml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index 93cd7b940afc..dc6b87074679 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -83,6 +83,7 @@ type sequencer_setup = { l1_contracts : l1_contracts; boot_sector : string; kernel : Uses.t; + enable_dal : bool; } let setup_l1_contracts ?(dictator = Constant.bootstrap2) client = @@ -362,6 +363,7 @@ let setup_sequencer ?sequencer_rpc_port ?sequencer_private_rpc_port sc_rollup_node; boot_sector = output; kernel; + enable_dal; } let send_transaction (transaction : unit -> 'a Lwt.t) sequencer : 'a Lwt.t = @@ -2686,9 +2688,7 @@ let test_delayed_transfer_timeout = sc_rollup_node; sequencer; proxy; - observer = _; - boot_sector = _; - kernel = _; + _; } _protocol -> (* Kill the sequencer *) @@ -2846,9 +2846,7 @@ let test_delayed_transfer_timeout_fails_l1_levels = sc_rollup_node; sequencer; proxy; - observer = _; - boot_sector = _; - kernel = _; + _; } _protocol -> (* Kill the sequencer *) @@ -3106,9 +3104,7 @@ let test_delayed_inbox_flushing = sc_rollup_node; sequencer; proxy; - observer = _; - boot_sector = _; - kernel = _; + _; } _protocol -> (* Kill the sequencer *) -- GitLab From 81d9afec67f0246498bd0148272404128600e6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cauderlier?= Date: Wed, 24 Jul 2024 15:14:43 +0200 Subject: [PATCH 2/2] Etherlink/Sequencer/Tests: increase timeouts for DAL latency This is a preparation for DAL integration in Etherlink. We need to increase the timeouts in order to wait enough blocks for the blueprints to be sent through the DAL. The added latency is: - possibly one block for the rollup node to inject on the DAL, - 8 blocks of lag to let DAL attesters attest the DAL slot (this is a DAL protocol parameter called "attestation_lag"), - 1 extra block before the slot can be imported Moreover, in !13883, the sequencer sends at most one blueprint per L1 level on the DAL so, to catch up, a proxy EVM node which is N L2 levels behind the sequencer needs N extra L1 levels. Since the tests relevant to the DAL usually have a sequencer 5 levels ahead, we increase the timeouts by 15 levels (from 5 to 20). --- etherlink/tezt/lib/helpers.ml | 2 +- etherlink/tezt/tests/evm_sequencer.ml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/etherlink/tezt/lib/helpers.ml b/etherlink/tezt/lib/helpers.ml index d63fdc2c0ffc..d928493ffe11 100644 --- a/etherlink/tezt/lib/helpers.ml +++ b/etherlink/tezt/lib/helpers.ml @@ -195,7 +195,7 @@ let sequencer_upgrade ~sc_rollup_address ~sequencer_admin in Client.bake_for_and_wait ~keys:[] client -let bake_until ?__LOC__ ?(timeout_in_blocks = 5) ?(timeout = 30.) ~bake +let bake_until ?__LOC__ ?(timeout_in_blocks = 20) ?(timeout = 30.) ~bake ~result_f () = let res = ref None in let rec go counter_block = diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index dc6b87074679..3faf54663a30 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -3242,7 +3242,7 @@ let test_timestamp_from_the_future = ~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 -> + @@ fun {sequencer; proxy; sc_rollup_node; client; enable_dal; _} _protocol -> (* In this test the time between blocks is 1 second. *) (* Producing a block 4:50 minutes after the L1 timestamp will be accepted. We @@ -3264,8 +3264,11 @@ let test_timestamp_from_the_future = Tezos_base.Time.Protocol.(add current_l1_timestamp 330L |> to_notation) in let*@ (_ : int) = produce_block ~timestamp:refused_timestamp sequencer in + (* We wait more in case of DAL because 5 blocks are not enough to + send the blueprint through the DAL. *) + let number_of_blocks_to_wait = if enable_dal then 20 else 5 in let* _ = - repeat 5 (fun () -> + repeat number_of_blocks_to_wait (fun () -> let* _l1_lvl = next_rollup_node_level ~sc_rollup_node ~client in unit) in -- GitLab