From 1bb1db373d19b920c21d2303c3d006bed1db1160 Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Fri, 10 Jan 2025 11:34:29 +0100 Subject: [PATCH] evm/tezt: fix batcher order test flakyness The catchup was triggered when the rollup node was restarted but the test want it to happens when the next L1 level is baked. This fixes that by not creating enough blueprint to trigger a blueprint. The diff is that now the rollup node has the missing blueprints when catching up and so can inject more at once. --- etherlink/tezt/tests/evm_sequencer.ml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/etherlink/tezt/tests/evm_sequencer.ml b/etherlink/tezt/tests/evm_sequencer.ml index 98ae12536bc5..d5a27672bec5 100644 --- a/etherlink/tezt/tests/evm_sequencer.ml +++ b/etherlink/tezt/tests/evm_sequencer.ml @@ -9292,14 +9292,17 @@ let test_node_correctly_uses_batcher_heap = in Log.info "Produce more blocks to create a blueprints lag." ; let* () = - (* Produces L2 blocks to grow the blueprint lag. *) - repeat (2 * max_blueprints_lag) (fun () -> + (* Produces L2 blocks to grow the blueprint lag but not enough to + trigger a catchup. *) + repeat (max_blueprints_lag - 2) (fun () -> let*@ _txn = produce_block sequencer in unit) in Log.info "Restart the rollup node." ; let* () = Sc_rollup_node.run ~event_level:`Debug sc_rollup_node sc_rollup_address [] + and* () = + Evm_node.wait_for_rollup_node_follower_connection_acquired sequencer in Log.info "Continue to produce blocks to fills the batcher queue." ; let* () = @@ -9354,11 +9357,12 @@ let test_node_correctly_uses_batcher_heap = in let*@ rollup_level = Rpc.block_number proxy in + (* Check that the proxy is at least about the expected catchup. *) Check.( - (Int32.to_int rollup_level = before_level + max_blueprints_catchup) + (Int32.to_int rollup_level >= before_level + max_blueprints_catchup) ~__LOC__ int - ~error_msg:"Check proxy head failed. Found %L, expected %R") ; + ~error_msg:"Check proxy head failed. Found %L, expected >= %R") ; let l1_level_blueprints_processed_finalized = l1_level_blueprints_processed + 2 @@ -9393,10 +9397,10 @@ let test_node_correctly_uses_batcher_heap = and* _ = wait_for_catchup_l1_level_finalized in Check.( - (!finalized_blueprint_ref = Some (before_level + max_blueprints_catchup)) + (!finalized_blueprint_ref >= Some (before_level + max_blueprints_catchup)) ~__LOC__ (option int) - ~error_msg:"Finalized blueprint check failed. Found %L, expected %R") ; + ~error_msg:"Finalized blueprint check failed. Found %L, expected >= %R") ; unit let test_init_config_mainnet network = -- GitLab