From 5d6ea1957458cfa765048b5d03cf823f02db74c8 Mon Sep 17 00:00:00 2001 From: Gabriel Moise Date: Wed, 2 Jul 2025 11:39:34 +0100 Subject: [PATCH 1/3] Tezt: Replace protocol accuser with agnostic accuser binary --- tezt/lib_tezos/accuser.ml | 7 +-- tezt/lib_tezos/accuser.mli | 8 +-- tezt/lib_tezos/constant.ml | 27 +++++---- tezt/lib_tezos/protocol.ml | 17 ------ tezt/lib_tezos/protocol.mli | 8 --- .../runtime-dependency-tags.out | 1 - tezt/remote_tests/double_bake.ml | 2 +- tezt/tests/adaptive_issuance.ml | 4 +- tezt/tests/cloud/tezos.ml | 6 +- tezt/tests/double_bake.ml | 4 +- tezt/tests/double_consensus.ml | 56 ++++++++----------- tezt/tests/voting.ml | 4 +- 12 files changed, 56 insertions(+), 88 deletions(-) diff --git a/tezt/lib_tezos/accuser.ml b/tezt/lib_tezos/accuser.ml index 5140b8257269..ba02d7d4cde6 100644 --- a/tezt/lib_tezos/accuser.ml +++ b/tezt/lib_tezos/accuser.ml @@ -60,8 +60,8 @@ let set_ready accuser = let handle_raw_stdout accuser line = if line =~ rex "^Waiting for protocol .+ to start...$" then set_ready accuser -let create ~protocol ?(path = Uses.path (Protocol.accuser protocol)) ?name - ?color ?event_pipe ?base_dir ?runner ?preserved_levels node = +let create ?(path = Uses.path Constant.octez_accuser) ?name ?color ?event_pipe + ?base_dir ?runner ?preserved_levels node = let name = match name with None -> fresh_name () | Some name -> name in let base_dir = match base_dir with None -> Temp.dir name | Some dir -> dir @@ -126,13 +126,12 @@ let wait_for_ready accuser = resolver :: accuser.persistent_state.pending_ready ; check_event accuser "Accuser started." promise -let init ~protocol ?path ?name ?color ?event_pipe ?event_level ?base_dir ?runner +let init ?path ?name ?color ?event_pipe ?event_level ?base_dir ?runner ?preserved_levels node = let* () = Node.wait_for_ready node in let accuser = create ?path - ~protocol ?name ?color ?event_pipe diff --git a/tezt/lib_tezos/accuser.mli b/tezt/lib_tezos/accuser.mli index 46a0d4b2ba5b..f3ebdbcd7474 100644 --- a/tezt/lib_tezos/accuser.mli +++ b/tezt/lib_tezos/accuser.mli @@ -35,8 +35,7 @@ type event = {name : string; value : JSON.t; timestamp : float} This function just creates the [t] value, it does not call [run]. - [path] provides the path to the accuser binary, the default being the one - derived from the [protocol]. + [path] provides the path to the accuser binary. The standard output and standard error output of the accuser will be logged with prefix [name] and color [color]. @@ -58,7 +57,6 @@ type event = {name : string; value : JSON.t; timestamp : float} [preserved_levels] is the number of effective levels kept in the accuser's memory*) val create : - protocol:Protocol.t -> ?path:string -> ?name:string -> ?color:Log.Color.t -> @@ -134,8 +132,7 @@ val log_events : ?max_length:int -> t -> unit does not want to wait for the node to be ready, it is necessary to use [create] and then [run]. - [path] is the path to accuser binary. By default, it is chosen - from the [protocol] and is assumed to be at the root. + [path] is the path to accuser binary. The standard output and standard error output of the accuser will be logged with prefix [name] and color [color]. @@ -160,7 +157,6 @@ val log_events : ?max_length:int -> t -> unit [preserved_levels] is the number of effective levels kept in the accuser's memory *) val init : - protocol:Protocol.t -> ?path:string -> ?name:string -> ?color:Log.Color.t -> diff --git a/tezt/lib_tezos/constant.ml b/tezt/lib_tezos/constant.ml index d1108954dfd5..e6b8940c56cc 100644 --- a/tezt/lib_tezos/constant.ml +++ b/tezt/lib_tezos/constant.ml @@ -89,20 +89,30 @@ let _teztale_snitch = Uses.make ~tag:"teztale_snitch" ~path:"./octez-teztale-snitch" () (* TODO: Remove these once the binaries are completely removed from - [released-executables]. (issue : https://gitlab.com/tezos/tezos/-/issues/7763) *) + [released-executables] or [experimental-executables]. + (issue : https://gitlab.com/tezos/tezos/-/issues/7763) *) -let octez_baker_quebec = - Uses.make ~tag:"baker_psquebec" ~path:"./octez-baker-PsQuebec" () - -let octez_baker_rio = +let _octez_baker_rio = Uses.make ~tag:"baker_psriotum" ~path:"./octez-baker-PsRiotum" () -let octez_baker_seoul = +let _octez_baker_seoul = Uses.make ~tag:"baker_ptseoulo" ~path:"./octez-baker-PtSeouLo" () -let octez_baker_alpha = +let _octez_baker_alpha = Uses.make ~tag:"baker_alpha" ~path:"./octez-baker-alpha" () +let octez_agnostic_baker = + Uses.make ~tag:"agnostic_baker" ~path:"./octez-baker" () + +let _octez_accuser_rio = + Uses.make ~tag:"accuser_psriotum" ~path:"./octez-accuser-PsRiotum" () + +let _octez_accuser_seoul = + Uses.make ~tag:"accuser_ptseoulo" ~path:"./octez-accuser-PtSeouLo" () + +let _octez_accuser_alpha = + Uses.make ~tag:"accuser_alpha" ~path:"./octez-accuser-alpha" () + let octez_accuser = Uses.make ~tag:"accuser" ~path:"./octez-accuser" () let yes_wallet = @@ -164,9 +174,6 @@ module WASM = struct Uses.make ~tag:"tx_kernel_dal" ~path:"tx_kernel_dal.wasm" () end -let octez_agnostic_baker = - Uses.make ~tag:"agnostic_baker" ~path:"./octez-baker" () - let octez_p2p_node = Uses.make ~tag:"p2p_node" diff --git a/tezt/lib_tezos/protocol.ml b/tezt/lib_tezos/protocol.ml index e5cc9c6e8c30..8d128eeca3d8 100644 --- a/tezt/lib_tezos/protocol.ml +++ b/tezt/lib_tezos/protocol.ml @@ -80,23 +80,6 @@ let parameter_file ?(constants = default_constants) protocol = let name = constants_to_string constants in sf "src/%s/parameters/%s-parameters.json" (directory protocol) name -let daemon_name = function Alpha -> "alpha" | p -> String.sub (hash p) 0 8 - -let protocol_dependent_uses ~tag ~path = - let make protocol = - let protocol = daemon_name protocol in - Uses.make - ~tag:(tag ^ String.lowercase_ascii protocol) - ~path:(path ^ protocol) - () - in - (* Make sure [Uses.lookup] knows about all executables even before tests - actually registers themselves. *) - let _ = List.map make all in - make - -let accuser = protocol_dependent_uses ~tag:"accuser_" ~path:"./octez-accuser-" - let encoding_prefix = function | Alpha -> "alpha" | p -> sf "%03d-%s" (number p) (String.sub (hash p) 0 8) diff --git a/tezt/lib_tezos/protocol.mli b/tezt/lib_tezos/protocol.mli index 9e5ce4965e56..579112dcaf30 100644 --- a/tezt/lib_tezos/protocol.mli +++ b/tezt/lib_tezos/protocol.mli @@ -85,14 +85,6 @@ val protocol_zero_hash : string directory of the protocol, relative to the root of the repository. *) val parameter_file : ?constants:constants -> t -> string -(** Get the path of the accuser of a protocol, such as ["./octez-accuser-alpha"]. *) -val accuser : t -> Uses.t - -(** Get the part of the daemon name that is specific to a protocol (e.g. ["PtEdo2Zk"]). - - This should not be used for anything except to compute the name of executables. *) -val daemon_name : t -> string - (** Get the part which is added at the beginning of all encoding names. *) val encoding_prefix : t -> string diff --git a/tezt/lib_wrapper/expected/tezt_wrapper.ml/runtime-dependency-tags.out b/tezt/lib_wrapper/expected/tezt_wrapper.ml/runtime-dependency-tags.out index d06d56ee55dc..e7eb95d96cc6 100644 --- a/tezt/lib_wrapper/expected/tezt_wrapper.ml/runtime-dependency-tags.out +++ b/tezt/lib_wrapper/expected/tezt_wrapper.ml/runtime-dependency-tags.out @@ -14,7 +14,6 @@ accuser_ptseoulo: octez-accuser-PtSeouLo accuser_alpha: octez-accuser-alpha admin_client: octez-admin-client agnostic_baker: octez-baker -baker_psquebec: octez-baker-PsQuebec baker_psriotum: octez-baker-PsRiotum baker_ptseoulo: octez-baker-PtSeouLo baker_alpha: octez-baker-alpha diff --git a/tezt/remote_tests/double_bake.ml b/tezt/remote_tests/double_bake.ml index a872cd5c6848..de7e29244287 100644 --- a/tezt/remote_tests/double_bake.ml +++ b/tezt/remote_tests/double_bake.ml @@ -113,7 +113,7 @@ let double_bake = in let endpoint_3 = Client.(Node node_3) in let* client_3 = Client.init ~endpoint:endpoint_3 () in - let* accuser_3 = Accuser.init ~protocol node_3 in + let* accuser_3 = Accuser.init node_3 in let denunciation = wait_for_denunciation accuser_3 in let denunciation_injection = wait_for_denunciation_injection node_3 client_3 denunciation diff --git a/tezt/tests/adaptive_issuance.ml b/tezt/tests/adaptive_issuance.ml index c2dad5c14c17..e1d049e98f04 100644 --- a/tezt/tests/adaptive_issuance.ml +++ b/tezt/tests/adaptive_issuance.ml @@ -307,7 +307,7 @@ let test_staking = "rewards"; "slashing"; ] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> let overrides = (* TODO: https://gitlab.com/tezos/tezos/-/issues/7576 use a @@ -894,7 +894,7 @@ let test_staking = log_step 16 "Run Node 3, bake one block and wait for the accuser to be ready." ; let* node_3 = Node.init [Synchronisation_threshold 0; Private_mode] in let* client_3 = Client.init ~endpoint:(Node node_3) () in - let* accuser_3 = Accuser.init ~protocol node_3 in + let* accuser_3 = Accuser.init node_3 in let denunciation_injection = wait_for_denunciation_injection node_3 client_3 accuser_3 in diff --git a/tezt/tests/cloud/tezos.ml b/tezt/tests/cloud/tezos.ml index 95f13426680d..962d28bd8ea3 100644 --- a/tezt/tests/cloud/tezos.ml +++ b/tezt/tests/cloud/tezos.ml @@ -580,8 +580,8 @@ module Accuser = struct include Accuser module Agent = struct - let init ?(group = "L1") ?name ~protocol - ?(path = Uses.path (Protocol.accuser protocol)) node cloud agent = + let init ?(group = "L1") ?name ?(path = Uses.path Constant.octez_accuser) + node cloud agent = let* path = Agent.copy agent ~source:path in let* () = Cloud.register_binary @@ -592,7 +592,7 @@ module Accuser = struct () in let runner = Agent.runner agent in - init ?name ~event_level:`Notice ?runner ~path ~protocol node + init ?name ~event_level:`Notice ?runner ~path node end end diff --git a/tezt/tests/double_bake.ml b/tezt/tests/double_bake.ml index 1c6ab3f93ebb..0a3f8c23fe46 100644 --- a/tezt/tests/double_bake.ml +++ b/tezt/tests/double_bake.ml @@ -137,7 +137,7 @@ let double_bake = ~__FILE__ ~title:"double baking with accuser" ~tags:[team; "double"; "baking"; "accuser"; "node"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> let log_step counter msg = let color = Log.Color.(bold ++ FG.blue) in @@ -206,7 +206,7 @@ let double_bake = log_step 4 "Run Node 3, bake one block and wait for the accuser to be ready." ; let* node_3 = Node.init [Synchronisation_threshold 0; Private_mode] in let* client_3 = Client.init ~endpoint:(Node node_3) () in - let* accuser_3 = Accuser.init ~protocol node_3 in + let* accuser_3 = Accuser.init node_3 in let denunciation_injection = wait_for_denunciation_injection node_3 client_3 accuser_3 in diff --git a/tezt/tests/double_consensus.ml b/tezt/tests/double_consensus.ml index d0f77292debe..ee43bab927f1 100644 --- a/tezt/tests/double_consensus.ml +++ b/tezt/tests/double_consensus.ml @@ -92,7 +92,7 @@ let double_consensus_init let* node, client = Client.init_with_protocol ?parameter_file ~protocol `Client () in - let* accuser = Accuser.init ~event_level:`Debug ~protocol node in + let* accuser = Accuser.init ~event_level:`Debug node in let* () = repeat 5 (fun () -> Client.bake_for_and_wait client) in Log.info "Recover available slots for %s." Constant.bootstrap1.alias ; let* slots = @@ -198,7 +198,7 @@ let double_attestation_wrong_block_payload_hash = ~title:"double attestation using wrong block_payload_hash" ~tags: [team; "double"; "attestation"; "accuser"; "block_payload_hash"; "node"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> double_consensus_wrong_block_payload_hash attest_utils protocol @@ -210,7 +210,7 @@ let double_preattestation_wrong_block_payload_hash = [ team; "double"; "preattestation"; "accuser"; "block_payload_hash"; "node"; ] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> double_consensus_wrong_block_payload_hash preattest_utils protocol @@ -265,7 +265,7 @@ let double_attestation_wrong_branch = ~__FILE__ ~title:"double attestation using wrong branch" ~tags:[team; "double"; "attestation"; "accuser"; "branch"; "node"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> double_consensus_wrong_branch attest_utils protocol let double_preattestation_wrong_branch = @@ -273,7 +273,7 @@ let double_preattestation_wrong_branch = ~__FILE__ ~title:"double preattestation using wrong branch" ~tags:[team; "double"; "preattestation"; "accuser"; "branch"; "node"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> double_consensus_wrong_branch preattest_utils protocol let consensus_operation_too_old_waiter accuser = @@ -284,14 +284,14 @@ let operation_too_old = ~__FILE__ ~title:"operation too old" ~tags:[team; "accuser"; "old"; "operation"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> let* node, client = Client.init_with_protocol ~protocol `Client () in let* accuser = (* We set the preserved_levels to 0 to ensure that an operation for the previous level is accepted by the mempool and discarded by the accuser. *) - Accuser.init ~preserved_levels:0 ~event_level:`Debug ~protocol node + Accuser.init ~preserved_levels:0 ~event_level:`Debug node in let* () = repeat 2 (fun () -> Client.bake_for_and_wait client) in Log.info "Inject valid attestation." ; @@ -347,12 +347,10 @@ let operation_too_far_in_future = ~__FILE__ ~title:"operation too far in the future" ~tags:[team; "accuser"; "future"; "operation"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> let* node, client = Client.init_with_protocol ~protocol `Client () in - let* accuser = - Accuser.init ~preserved_levels:2 ~event_level:`Debug ~protocol node - in + let* accuser = Accuser.init ~preserved_levels:2 ~event_level:`Debug node in let* () = repeat 2 (fun () -> Client.bake_for_and_wait client) in Log.info "Inject valid attestation." ; let waiter = Node.wait_for_request ~request:`Inject node in @@ -523,7 +521,7 @@ let attestation_and_aggregation_wrong_payload_hash = ~title:"attestation and aggregation wrong payload hash" ~tags:[team; "attestation"; "aggregation"] ~supports:Protocol.(From_protocol 023) - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> let consensus_rights_delay = 1 in let* parameter_file = @@ -544,10 +542,9 @@ let attestation_and_aggregation_wrong_payload_hash = Client.init_with_protocol `Client ~protocol ~parameter_file () in let* _ = Node.wait_for_level node 1 in - (* Run accusers (simulates a network were multiple denunciations are received + (* Run accuser (simulates a network were multiple denunciations are received simultaneously) *) - let* _accuser1 = Accuser.init ~protocol node in - let* _accuser2 = Accuser.init ~protocol node in + let* _accuser = Accuser.init node in (* Set a BLS consensus key for some bootstrap accounts *) let* ck1 = Client.update_fresh_consensus_key ~algo:"bls" bootstrap1 client in let* ck2 = Client.update_fresh_consensus_key ~algo:"bls" bootstrap2 client in @@ -632,7 +629,7 @@ let double_aggregation_wrong_payload_hash = ~title:"double aggregation wrong payload hash" ~tags:[team; "double"; "aggregation"] ~supports:Protocol.(From_protocol 023) - ~uses:(fun protocol -> [Protocol.accuser protocol]) + ~uses:(fun _protocol -> [Constant.octez_accuser]) @@ fun protocol -> let consensus_rights_delay = 1 in let* parameter_file = @@ -669,9 +666,8 @@ let double_aggregation_wrong_payload_hash = let* () = Client.Admin.connect_address ~peer:node1 client2 in let* () = Client.Admin.connect_address ~peer:node2 client1 in let* _ = Node.wait_for_level node2 1 in - (* Run accusers *) - let* _accuser1 = Accuser.init ~protocol node1 in - let* _accuser2 = Accuser.init ~protocol node2 in + (* Run accuser *) + let* _accuser = Accuser.init node1 in (* Set BLS consensus key for some bootstrap accounts *) let* ck1 = Client.update_fresh_consensus_key ~algo:"bls" bootstrap1 client1 in let* ck2 = Client.update_fresh_consensus_key ~algo:"bls" bootstrap2 client1 in @@ -794,27 +790,23 @@ let accusers_migration_test ~migrate_from ~migrate_to = (Protocol.tag migrate_to)) ~tags: [team; "migration"; Protocol.tag migrate_from; Protocol.tag migrate_to] - ~uses:[Protocol.accuser migrate_from; Protocol.accuser migrate_to] + ~uses:[Constant.octez_accuser] @@ fun () -> let* client, node = Protocol_migration.user_migratable_node_init ~migration_level ~migrate_to () in let* () = Client.activate_protocol ~protocol:migrate_from client in - Log.info "Initialise accusers for the two protocols" ; - let* accuser1 = - Accuser.init ~protocol:migrate_from ~event_level:`Debug node - in - let accuser1_processed_block = accuser_processed_block accuser1 in - let accuser1_stop = daemon_stop accuser1 in - let* accuser2 = Accuser.init ~protocol:migrate_to ~event_level:`Debug node in - let accuser2_processed_block = accuser_processed_block accuser2 in + Log.info "Initialise accuser" ; + let* accuser = Accuser.init ~event_level:`Debug node in + let accuser_processed_block = accuser_processed_block accuser in + let accuser_stop = daemon_stop accuser in Log.info "Bake %d levels" (migration_level - 1) ; let* () = repeat (migration_level - 1) (fun () -> let* () = Client.bake_for_and_wait client in - accuser1_processed_block) + accuser_processed_block) in Log.info @@ -824,7 +816,7 @@ let accusers_migration_test ~migrate_from ~migrate_to = let* () = Client.bake_for_and_wait client in Log.info "After migration, old protocol accuser should have stopped" ; - let* () = accuser1_stop in + let* () = accuser_stop in Log.info "Bake a few more levels into the new protocol" ; let* () = @@ -837,9 +829,9 @@ let accusers_migration_test ~migrate_from ~migrate_to = client in let* () = Client.bake_for_and_wait client in - accuser2_processed_block) + accuser_processed_block) in - let* () = Accuser.terminate accuser2 in + let* () = Accuser.terminate accuser in unit let register_migration ~migrate_from ~migrate_to = diff --git a/tezt/tests/voting.ml b/tezt/tests/voting.ml index 23e5bfde41d8..192f39543cbd 100644 --- a/tezt/tests/voting.ml +++ b/tezt/tests/voting.ml @@ -888,7 +888,7 @@ let test_user_activated_protocol_override_baker_vote ~from_protocol ~to_protocol "from_" ^ Protocol.tag from_protocol; "to_" ^ Protocol.tag to_protocol; ] - ~uses:[Protocol.accuser to_protocol; Constant.octez_agnostic_baker] + ~uses:[Constant.octez_accuser; Constant.octez_agnostic_baker] @@ fun () -> let node_arguments = [Node.Synchronisation_threshold 0] in let to_protocol_hash = Protocol.hash to_protocol in @@ -1223,7 +1223,7 @@ let test_user_activated_protocol_override_baker_vote ~from_protocol ~to_protocol (* We also start an accuser for the [to_protocol] protocol. After the protocol switch, we verify that it starts registering blocks. *) - let to_protocol_accuser = Accuser.create ~protocol:to_protocol node in + let to_protocol_accuser = Accuser.create node in let to_protocol_accuser_received_block = Accuser.wait_for to_protocol_accuser -- GitLab From c76ab4f26f8ccc611f9b73ee4a5aed6478304e14 Mon Sep 17 00:00:00 2001 From: Gabriel Moise Date: Thu, 24 Apr 2025 12:52:20 +0300 Subject: [PATCH 2/3] Tezt: Fix tests where agnostic accuser would not know the protocol --- tezt/remote_tests/double_bake.ml | 2 ++ tezt/tests/adaptive_issuance.ml | 2 ++ tezt/tests/double_bake.ml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tezt/remote_tests/double_bake.ml b/tezt/remote_tests/double_bake.ml index de7e29244287..7ef703e78328 100644 --- a/tezt/remote_tests/double_bake.ml +++ b/tezt/remote_tests/double_bake.ml @@ -113,6 +113,8 @@ let double_bake = in let endpoint_3 = Client.(Node node_3) in let* client_3 = Client.init ~endpoint:endpoint_3 () in + (* Need to know the protocol for the agnostic accuser to start. *) + let* () = Client.activate_protocol ~protocol client_3 in let* accuser_3 = Accuser.init node_3 in let denunciation = wait_for_denunciation accuser_3 in let denunciation_injection = diff --git a/tezt/tests/adaptive_issuance.ml b/tezt/tests/adaptive_issuance.ml index e1d049e98f04..841ff29f6702 100644 --- a/tezt/tests/adaptive_issuance.ml +++ b/tezt/tests/adaptive_issuance.ml @@ -894,6 +894,8 @@ let test_staking = log_step 16 "Run Node 3, bake one block and wait for the accuser to be ready." ; let* node_3 = Node.init [Synchronisation_threshold 0; Private_mode] in let* client_3 = Client.init ~endpoint:(Node node_3) () in + (* Need to know the protocol for the agnostic accuser to start. *) + let* () = Client.activate_protocol ~protocol client_3 in let* accuser_3 = Accuser.init node_3 in let denunciation_injection = wait_for_denunciation_injection node_3 client_3 accuser_3 diff --git a/tezt/tests/double_bake.ml b/tezt/tests/double_bake.ml index 0a3f8c23fe46..8a4530d67f5d 100644 --- a/tezt/tests/double_bake.ml +++ b/tezt/tests/double_bake.ml @@ -206,6 +206,8 @@ let double_bake = log_step 4 "Run Node 3, bake one block and wait for the accuser to be ready." ; let* node_3 = Node.init [Synchronisation_threshold 0; Private_mode] in let* client_3 = Client.init ~endpoint:(Node node_3) () in + (* Need to know the protocol for the agnostic accuser to start. *) + let* () = Client.activate_protocol ~protocol client_3 in let* accuser_3 = Accuser.init node_3 in let denunciation_injection = wait_for_denunciation_injection node_3 client_3 accuser_3 -- GitLab From ef82cbbc789deaeb5834266fc97862c3e54d2113 Mon Sep 17 00:00:00 2001 From: Gabriel Moise Date: Thu, 1 May 2025 15:41:40 +0100 Subject: [PATCH 3/3] Tezt: Remove protocol status from agnostic baker --- tezt/lib_tezos/agnostic_baker.ml | 4 ---- tezt/lib_tezos/agnostic_baker.mli | 6 ------ tezt/tests/agnostic_baker_test.ml | 7 ++----- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/tezt/lib_tezos/agnostic_baker.ml b/tezt/lib_tezos/agnostic_baker.ml index a0dcb92b3a5c..6fed64b76c65 100644 --- a/tezt/lib_tezos/agnostic_baker.ml +++ b/tezt/lib_tezos/agnostic_baker.ml @@ -18,10 +18,6 @@ let liquidity_baking_vote_of_string_opt = function | "pass" -> Some Pass | _ -> None -type protocol_status = Active | Frozen | Ignore - -let protocol_status = function Protocol.Alpha -> Ignore | _ -> Active - (* This is hard-coded after the same value from [Daemon] module from [src/lib_agnostic_baker]. *) let extra_levels_for_old_baker = 3 diff --git a/tezt/lib_tezos/agnostic_baker.mli b/tezt/lib_tezos/agnostic_baker.mli index 7344da7aeb8b..a8b95c9e5b90 100644 --- a/tezt/lib_tezos/agnostic_baker.mli +++ b/tezt/lib_tezos/agnostic_baker.mli @@ -78,12 +78,6 @@ val liquidity_baking_vote_of_string_opt : string -> liquidity_baking_vote option Returns the path to the file that was written. *) val liquidity_baking_votefile : ?path:string -> liquidity_baking_vote -> string -(** Protocol status values. *) -type protocol_status = Active | Frozen | Ignore - -(** Returns the protocol status given the full protocol value. *) -val protocol_status : Protocol.t -> protocol_status - (** Number of extra levels to keep the old baker alive before shutting it down. This extra time is used to avoid halting the chain in cases such as reorganization or high round migration blocks. *) diff --git a/tezt/tests/agnostic_baker_test.ml b/tezt/tests/agnostic_baker_test.ml index 6d85078e84cf..6b57df0768a7 100644 --- a/tezt/tests/agnostic_baker_test.ml +++ b/tezt/tests/agnostic_baker_test.ml @@ -272,11 +272,8 @@ let test_keep_alive = let register ~protocols = test_keep_alive protocols let register_migration ~migrate_from ~migrate_to = - (* We want to migrate only from Active protocols *) - if Agnostic_baker.protocol_status migrate_from = Active then ( - migrate ~migrate_from ~migrate_to ~use_remote_signer:false ; - migrate ~migrate_from ~migrate_to ~use_remote_signer:true) - else () + migrate ~migrate_from ~migrate_to ~use_remote_signer:false ; + migrate ~migrate_from ~migrate_to ~use_remote_signer:true let register_protocol_independent () = test_start_and_stop () ; -- GitLab