diff --git a/src/bin_tps_evaluation/benchmark_tps_command.ml b/src/bin_tps_evaluation/benchmark_tps_command.ml index 1ef2bb5b58940ffcfdb215022d47184abf019b8c..997bc2bd4968299cbe9cfc0ea4815e9a59132240 100644 --- a/src/bin_tps_evaluation/benchmark_tps_command.ml +++ b/src/bin_tps_evaluation/benchmark_tps_command.ml @@ -206,7 +206,7 @@ let run_benchmark ~lift_protocol_limits ~provided_tps_of_injection ~blocks_total give very little Tez to the extra bootstraps, the default bootstraps will dominate in terms of stake. *) let delegates = make_delegates Constants.default_bootstraps_count in - let _baker = Baker.init ~protocol ~delegates node client in + let _baker = Agnostic_baker.init ~delegates node client in Log.info "Originating smart contracts" ; let* () = Client.stresstest_originate_smart_contracts originating_bootstrap client @@ -297,7 +297,7 @@ let register () = ~tags:[Dashboard.Test.benchmark_tps] ~timeout:(Long_test.Minutes 60) ~executors:Long_test.[x86_executor1] - ~uses:[Tezt_wrapper.Uses.octez_baker_alpha] + ~uses:[Tezt_wrapper.Uses.octez_experimental_agnostic_baker] (fun () -> let lift_protocol_limits = Cli.get_bool ~default:false "lift-protocol-limits" diff --git a/src/bin_tps_evaluation/gas_tps_command.ml b/src/bin_tps_evaluation/gas_tps_command.ml index aff5fc1487ca4556d499a4363a079fde8249504d..e8a29d316d6f1becf7d763589f28b66ebf34b11a 100644 --- a/src/bin_tps_evaluation/gas_tps_command.ml +++ b/src/bin_tps_evaluation/gas_tps_command.ml @@ -51,7 +51,7 @@ let estimate_gas_tps ~average_block_path () = let* average_block = Average_block.load average_block_path in let* () = Average_block.check_for_unknown_smart_contracts average_block in let delegates = make_delegates Constants.default_bootstraps_count in - let* baker = Baker.init ~protocol ~delegates node client in + let* baker = Agnostic_baker.init ~delegates node client in Log.info "Originating smart contracts" ; let* () = Client.stresstest_originate_smart_contracts originating_bootstrap client @@ -70,7 +70,7 @@ let estimate_gas_tps ~average_block_path () = in Log.info "Gas TPS: %d" gas_tps ; let* _ = Node.kill node in - let* _ = Baker.kill baker in + let* _ = Agnostic_baker.terminate baker in Lwt.return @@ {average_block; transaction_costs; average_transaction_cost; gas_tps} @@ -82,7 +82,7 @@ let register () = ~tags:[Dashboard.Test.gas_tps] ~timeout:(Long_test.Minutes 60) ~executors:Long_test.[x86_executor1] - ~uses:[Tezt_wrapper.Uses.octez_baker_alpha] + ~uses:[Tezt_wrapper.Uses.octez_experimental_agnostic_baker] (fun () -> let average_block_path = Cli.get ~default:None (fun s -> Some (Some s)) "average-block" diff --git a/src/lib_octogram/tezos.ml b/src/lib_octogram/tezos.ml index 55adcffd8e2ed57b53c74ff2b07685b1bb868ce3..5bb36f3f0b9e691f742c578f63c53de4aa365cf5 100644 --- a/src/lib_octogram/tezos.ml +++ b/src/lib_octogram/tezos.ml @@ -62,12 +62,12 @@ end let () = Agent_state.register_key (module Octez_node_key) -type _ key += Octez_baker_k : string -> Baker.t key +type _ key += Octez_baker_k : string -> Agnostic_baker.t key module Octez_baker_key = struct type t = string - type r = Baker.t + type r = Agnostic_baker.t let proj : type a. a key -> (t * (a, r) eq) option = function | Octez_baker_k name -> Some (name, Eq) @@ -2592,13 +2592,13 @@ module Start_octez_baker = struct let run state { name; - protocol; base_dir; node_uri; node_data_dir; delegates; dal_node_uri; baker_path; + _; } = let client = Agent_state.http_client state in (* Get the L1 node's data-dir and RPC endpoint. *) @@ -2636,10 +2636,9 @@ module Start_octez_baker = struct in (* Create a baker state. *) let octez_baker = - Baker.create_from_uris + Agnostic_baker.create_from_uris ?name ?path:baker_path - ~protocol ~base_dir ~node_data_dir ~node_rpc_endpoint @@ -2648,10 +2647,10 @@ module Start_octez_baker = struct () in (* Register the baker state. *) - let name = Baker.name octez_baker in + let name = Agnostic_baker.name octez_baker in Agent_state.add (Octez_baker_k name) octez_baker state ; (* Start the baker. *) - let* () = Baker.run octez_baker in + let* () = Agnostic_baker.run octez_baker in return {name} let on_completion ~on_new_service:_ ~on_new_metrics_source:_ (_ : r) = () diff --git a/tezt/lib_cloud/dockerfiles/dal.Dockerfile b/tezt/lib_cloud/dockerfiles/dal.Dockerfile index 8e99125669e0e8973d539adc2392b1fa3549252a..9a0bf299dae9802b838df533b6e070a7be53f965 100644 --- a/tezt/lib_cloud/dockerfiles/dal.Dockerfile +++ b/tezt/lib_cloud/dockerfiles/dal.Dockerfile @@ -64,9 +64,7 @@ ARG BINARIES_DESTINATION_PATH COPY ./octez-node $BINARIES_DESTINATION_PATH/octez-node COPY ./octez-dal-node $BINARIES_DESTINATION_PATH/octez-dal-node COPY ./octez-client $BINARIES_DESTINATION_PATH/octez-client -COPY ./octez-baker-alpha $BINARIES_DESTINATION_PATH/octez-baker-alpha -COPY ./octez-baker-PsQuebec $BINARIES_DESTINATION_PATH/octez-baker-PsQuebec -COPY ./octez-baker-PsRiotum $BINARIES_DESTINATION_PATH/octez-baker-PsRiotum +COPY ./octez-experimental-agnostic-baker $BINARIES_DESTINATION_PATH/octez-experimental-agnostic-baker COPY ./octez-smart-rollup-node $BINARIES_DESTINATION_PATH/octez-smart-rollup-node COPY ./smart-rollup-installer $BINARIES_DESTINATION_PATH/smart-rollup-installer COPY ./octez-evm-node $BINARIES_DESTINATION_PATH/octez-evm-node diff --git a/tezt/lib_cloud/dockerfiles/macosx.Dockerfile b/tezt/lib_cloud/dockerfiles/macosx.Dockerfile index 97f748c39920393e40285f4125691a2d5350e571..350228754306d727b8e2bf1fa45f6ae1ec7b116d 100644 --- a/tezt/lib_cloud/dockerfiles/macosx.Dockerfile +++ b/tezt/lib_cloud/dockerfiles/macosx.Dockerfile @@ -23,7 +23,7 @@ FROM step2 ARG COMMIT RUN git fetch --depth 1 origin $COMMIT RUN git checkout $COMMIT -RUN eval $(opam env) && make octez-node octez-dal-node octez-client octez-baker-alpha +RUN eval $(opam env) && make octez-node octez-dal-node octez-client octez-experimental-agnostic-baker USER root diff --git a/tezt/lib_tezos/vdf.ml b/tezt/lib_tezos/vdf.ml index aa5a9f286237fe8475008b025a302eb7966e4a96..abd02f93debbf2bf8dccde4a16f604f3fd43027d 100644 --- a/tezt/lib_tezos/vdf.ml +++ b/tezt/lib_tezos/vdf.ml @@ -67,7 +67,7 @@ let create ~protocol ?name ?color ?event_pipe ?runner node = let name = match name with None -> fresh_name () | Some name -> name in let vdf_baker = create - ~path:(Uses.path (Protocol.baker protocol)) + ~path:(Uses.path Constant.octez_experimental_agnostic_baker) ?name:(Some name) ?color ?event_pipe 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 07377d12759fbafe0734a6e464458c17392e7c52..425ab2fbd8d03a2b3befd835ba929c6a0047ce57 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 @@ -21,7 +21,7 @@ dac_node: octez-dac-node dal_node: octez-dal-node dsn_node: octez-dsn-node evm_node: octez-evm-node -experimental_agnostic_baker: octez-experimental-agnostic-baker +agnostic_baker: octez-experimental-agnostic-baker node: octez-node protocol_compiler: octez-protocol-compiler signer: octez-signer diff --git a/tezt/lib_wrapper/tezt_wrapper.ml b/tezt/lib_wrapper/tezt_wrapper.ml index e8c51efbbda8cf76260bfc52b812f6953eab80c7..4a987cd22966f312125c5608075e94ad236e1bdc 100644 --- a/tezt/lib_wrapper/tezt_wrapper.ml +++ b/tezt/lib_wrapper/tezt_wrapper.ml @@ -57,7 +57,8 @@ module Uses = struct let octez_admin_client = make ~tag:"admin_client" ~path:"./octez-admin-client" () - let octez_baker_alpha = make ~tag:"baker_alpha" ~path:"./octez-baker-alpha" () + let octez_experimental_agnostic_baker = + make ~tag:"agnostic_baker" ~path:"./octez-experimental-agnostic-baker" () let register_meta_test () = Regression.register diff --git a/tezt/lib_wrapper/tezt_wrapper.mli b/tezt/lib_wrapper/tezt_wrapper.mli index e457f93ea439bb35107100e019c185e378614e0d..e66d26153403ae6dba911eb98781b9d2683ce1e4 100644 --- a/tezt/lib_wrapper/tezt_wrapper.mli +++ b/tezt/lib_wrapper/tezt_wrapper.mli @@ -81,8 +81,8 @@ module Uses : sig (** ["./octez-admin-client"], with tag ["admin_client"]. *) val octez_admin_client : t - (** ["./octez-baker-alpha"], with tag ["baker_alpha"]. *) - val octez_baker_alpha : t + (** ["./octez-experimental-agnostic-baker"], with tag ["agnostic_baker"]. *) + val octez_experimental_agnostic_baker : t (** Register a test that generates: {[ diff --git a/tezt/long_tests/tenderbake.ml b/tezt/long_tests/tenderbake.ml index 81d3f59257355b269a4edd5da1f42a6d7048af2d..ae991814dc6ef5713de26b704d8890a4bcfbeb84 100644 --- a/tezt/long_tests/tenderbake.ml +++ b/tezt/long_tests/tenderbake.ml @@ -180,7 +180,8 @@ end module Sandbox = struct type state = { - mutable daemons : (Node.t * Baker.t option * Client.t option) array; + mutable daemons : + (Node.t * Agnostic_baker.t option * Client.t option) array; mutable delegates : Account.key Inf.t; } @@ -218,8 +219,10 @@ module Sandbox = struct | node, _, _ -> let* client = Client.init ~endpoint:(Client.Node node) () in let delegates = [get_delegate st] in - let baker = Baker.create ~protocol node client ~delegates in - let* () = if run_baker then Baker.run baker else Lwt.return_unit in + let baker = Agnostic_baker.create node client ~delegates in + let* () = + if run_baker then Agnostic_baker.run baker else Lwt.return_unit + in st.daemons.(h) <- (node, Some baker, Some client) ; return (client, baker) @@ -233,7 +236,7 @@ module Sandbox = struct (Invalid_argument (sf "remove_baker_from_node: node %d has no baker" h)) | node, Some baker, client_opt -> - let* () = Baker.terminate baker in + let* () = Agnostic_baker.terminate baker in st.daemons.(h) <- (node, None, client_opt) ; return baker @@ -247,14 +250,16 @@ module Sandbox = struct let add_node_with_baker ?(run_baker = true) (st : state) = let* handle, node = add_node st in let* client, baker = add_baker_to_node ~run_baker st handle in - Log.info "Creating baker #%d (%s)" handle (Baker.name baker) ; + Log.info "Creating baker #%d (%s)" handle (Agnostic_baker.name baker) ; return (handle, node, client, baker) let terminate (st : state) = Lwt_list.iter_p (fun (node, baker_opt, _) -> let* () = Node.terminate node - and* () = Option.fold ~none:unit ~some:Baker.terminate baker_opt in + and* () = + Option.fold ~none:unit ~some:Agnostic_baker.terminate baker_opt + in unit) (Array.to_list st.daemons) end @@ -321,7 +326,7 @@ module Rounds = struct ~title:test ~tags:["tenderbake"; "basic"] ~team - ~uses:[Protocol.baker protocol] + ~uses:[Constant.octez_experimental_agnostic_baker] ~executors ~timeout:(Long_test.Seconds (repeat * 8 * timeout)) @@ fun () -> @@ -355,7 +360,7 @@ module Rounds = struct Log.info "Setting up nodes in ring topology" ; Cluster.ring nodes ; let* () = Cluster.start ~wait_connections:true nodes in - let* () = Lwt_list.iter_p Baker.run bakers in + let* () = Lwt_list.iter_p Agnostic_baker.run bakers in let* parameter_file = write_parameter_file @@ -478,7 +483,7 @@ module Long_dynamic_bake = struct ~title:(test topology) ~tags:["tenderbake"; "dynamic"; string_of_topology topology] ~team - ~uses:[Protocol.baker protocol] + ~uses:[Constant.octez_experimental_agnostic_baker] ~executors ~timeout:(Long_test.Seconds (repeat * 8 * timeout)) @@ fun () -> @@ -522,7 +527,7 @@ module Long_dynamic_bake = struct let* () = Cluster.start ~wait_connections:true nodes in Log.info "Starting bakers" ; - let* () = Lwt_list.iter_p Baker.run bakers in + let* () = Lwt_list.iter_p Agnostic_baker.run bakers in Log.info "Activating protocol" ; let* () = @@ -548,7 +553,7 @@ module Long_dynamic_bake = struct "Cycle %d (head level %d): killed baker %s from handle #%d" cycle head_level - (Baker.name killed_baker) + (Agnostic_baker.name killed_baker) dead_baker_handle' ; let revive_delay = 1.0 in @@ -563,7 +568,7 @@ module Long_dynamic_bake = struct "Cycle %d (head level %d): added baker %s to handle #%d" cycle head_level - (Baker.name new_baker) + (Agnostic_baker.name new_baker) dead_baker_handle ; (* set the next baker to die *) diff --git a/tezt/manual_tests/baker_test.ml b/tezt/manual_tests/baker_test.ml index 4ec2a8a206eb8d952ef288bfcb65a36ccc17500f..af826c4abc040758be06aa56f15c33d4885acd06 100644 --- a/tezt/manual_tests/baker_test.ml +++ b/tezt/manual_tests/baker_test.ml @@ -25,9 +25,9 @@ (* Testing ------- - Component: Baker + Component: Agnostic Baker Invocation: dune exec tezt/manual_tests/main.exe -- --file baker_test.ml - Subject: Ensure that the baker behave properly + Subject: Ensure that the agnostic baker behaves properly *) let craft_heavy_operation source branch contract_hash client = @@ -111,8 +111,8 @@ let baker_early_preattestation_test = Protocol.register_test ~__FILE__ ~title:"Test baker early pre-attestation" - ~tags:["node"; "baker"; "early"; "preattestation"] - ~uses:(fun protocol -> [Protocol.baker protocol]) + ~tags:["node"; "agnostic_baker"; "early"; "preattestation"] + ~uses:(fun _protocol -> [Constant.octez_experimental_agnostic_baker]) ~supports:(Protocol.From_protocol 16) @@ fun protocol -> Log.info @@ -184,12 +184,11 @@ let baker_early_preattestation_test = pp_list baker1_delegates_alias ; let* baker1 = - Baker.init + Agnostic_baker.init ~delegates: (List.map (fun (bootstrap : Account.key) -> bootstrap.public_key_hash) baker1_delegates) - ~protocol node1 client1 in @@ -200,7 +199,7 @@ let baker_early_preattestation_test = pp_list baker2_delegates_alias ; let* baker2 = - Baker.init + Agnostic_baker.init ~event_sections_levels: [ ( String.concat @@ -214,7 +213,6 @@ let baker_early_preattestation_test = (List.map (fun (bootstrap : Account.key) -> bootstrap.public_key_hash) baker2_delegates) - ~protocol node2 client2 in @@ -250,10 +248,10 @@ let baker_early_preattestation_test = Log.info "Ensure that the test is in an state where %s propose at round 0 for level \ %d and %d. And that %s propose at level %d round 1. " - (Baker.name baker1) + (Agnostic_baker.name baker1) prev_lvl test_lvl - (Baker.name baker2) + (Agnostic_baker.name baker2) test_lvl ; let* baking_rights_prev_lvl = recover_baking_rights ~max_round:1 client1 prev_lvl @@ -281,10 +279,10 @@ let baker_early_preattestation_test = Log.info "Ensure that %s as reached the EQC at level %d round 0 and is locked on a \ payload before starting to inject costly manager operations" - (Baker.name baker2) + (Agnostic_baker.name baker2) prev_lvl ; let is_proposed = ref false in - let baker_on_event resolver Baker.{name; value; timestamp = _} = + let baker_on_event resolver Agnostic_baker.{name; value; timestamp = _} = match name with | "new_valid_proposal.v0" -> let level = JSON.(value |-> "level" |> as_int) in @@ -297,7 +295,7 @@ let baker_early_preattestation_test = | _ -> () in let baker_t, baker_u = Lwt.task () in - Baker.on_event baker2 (baker_on_event baker_u) ; + Agnostic_baker.on_event baker2 (baker_on_event baker_u) ; let* () = baker_t in Log.info @@ -327,16 +325,16 @@ let baker_early_preattestation_test = Log.info "Stop the %s once these operations are included in the %s mempool." - (Baker.name baker1) + (Agnostic_baker.name baker1) (Node.name node1) ; - let* () = Baker.stop baker1 in + let* () = Agnostic_baker.stop baker1 in Log.info "Wait for %s to propose a block at level:%d round 1." - (Baker.name baker2) + (Agnostic_baker.name baker2) prev_lvl ; let is_proposed = ref false in - let baker_on_event resolver Baker.{name; value; timestamp = _} = + let baker_on_event resolver Agnostic_baker.{name; value; timestamp = _} = match name with | "new_valid_proposal.v0" -> let level = JSON.(value |-> "level" |> as_int) in @@ -349,12 +347,12 @@ let baker_early_preattestation_test = | _ -> () in let baker_t, baker_u = Lwt.task () in - Baker.on_event baker2 (baker_on_event baker_u) ; + Agnostic_baker.on_event baker2 (baker_on_event baker_u) ; let* () = baker_t in let baker_on_event ?(log = false) (status : status ref) preattestations_resolver pqc_resolver attestations_resolver - Baker.{name; value; timestamp = _} = + Agnostic_baker.{name; value; timestamp = _} = match name with | "new_valid_proposal.v0" -> let block = JSON.(value |-> "block" |> as_string) in @@ -442,7 +440,7 @@ let baker_early_preattestation_test = let preattestation_t1, preattestation_u1 = Lwt.task () in let pqc_t1, pqc_u1 = Lwt.task () in let attestations_t1, attestations_u1 = Lwt.task () in - Baker.on_event + Agnostic_baker.on_event baker1 (baker_on_event ~log:true status1 preattestation_u1 pqc_u1 attestations_u1) ; @@ -452,16 +450,16 @@ let baker_early_preattestation_test = let preattestation_t2, preattestation_u2 = Lwt.task () in let pqc_t2, pqc_u2 = Lwt.task () in let attestations_t2, attestations_u2 = Lwt.task () in - Baker.on_event + Agnostic_baker.on_event baker2 (baker_on_event status2 preattestation_u2 pqc_u2 attestations_u2) ; Log.info "Continue %s and wait for it to propose a block at level:%d that contains \ the gas consuming manager operations." - (Baker.name baker1) + (Agnostic_baker.name baker1) test_lvl ; - let* _baker = Baker.continue baker1 in + let* _baker = Agnostic_baker.continue baker1 in let preattestation_should_be_validated = Protocol.(number protocol > 16) in @@ -481,7 +479,7 @@ let baker_early_preattestation_test = let* mempool2 = get_preattestation_mempool client2 in Log.info "%s have proposed, both baker have pre-attested for their delegates%s" - (Baker.name baker1) + (Agnostic_baker.name baker1) (if preattestation_should_be_validated then " and the pqc is reached. Ensure that the pre-attestations are injected \ in the nodes as validated operation" diff --git a/tezt/manual_tests/dal.ml b/tezt/manual_tests/dal.ml index 5a4eb11e2acd644c55f966fc5126c9409cb7681f..9579200c5dd8148f82cc45d591e91e1d6847db8b 100644 --- a/tezt/manual_tests/dal.ml +++ b/tezt/manual_tests/dal.ml @@ -401,8 +401,8 @@ let baker_scenario ?baker_sk ~airdropper_alias client dal_node l1_node = (* Manually stake a part of the baker's balance after it is declared as delegate. *) let* () = stake_or_unstake_half_balance client ~baker_alias in - let baker = Baker.create ~protocol:Protocol.Alpha ~dal_node l1_node client in - let* () = Baker.run baker in + let baker = Agnostic_baker.create ~dal_node l1_node client in + let* () = Agnostic_baker.run baker in Lwt_unix.sleep Float.max_float (** A slots injector test parameterized by a network. Typically, to run a slot @@ -457,7 +457,7 @@ let baker_test ~network = ~__FILE__ ~title:(sf "Join %s and bake" network) ~tags:[Tag.tezos2; "dal"; "baker"; network] - ~uses:[Protocol.baker Alpha] + ~uses:[Constant.octez_experimental_agnostic_baker] @@ fun () -> let baker_sk = Cli.get_string_opt "baker-sk" in let dal_bootstrap_peers = diff --git a/tezt/tests/baker_test.ml b/tezt/tests/baker_test.ml index 0e3ac1a59466a02d22a0dfde0705f2ec3032f782..8339855cb9c90de31cbd06b4e6a4d5e299c33c3f 100644 --- a/tezt/tests/baker_test.ml +++ b/tezt/tests/baker_test.ml @@ -508,7 +508,7 @@ let simple_attestations_aggregation = ~title:"Simple attestations aggregation" ~tags:[team; "baker"; "attestation"; "aggregation"] ~supports:Protocol.(From_protocol 023) - ~uses:(fun protocol -> [Protocol.baker protocol]) + ~uses:(fun _protocol -> [Constant.octez_experimental_agnostic_baker]) @@ fun protocol -> log_step 1 "Initialize a node and a client with protocol" ; let consensus_rights_delay = 1 in @@ -611,7 +611,7 @@ let simple_attestations_aggregation = let () = check_aggregate ~expected_committee aggregate_json in log_step 14 "Start a baker and bake until level 12" ; (* Testing the baker automaton *) - let* _baker = Baker.init ~protocol ~delegates node client in + let* _baker = Agnostic_baker.init ~delegates node client in let* _ = Node.wait_for_level node 12 in log_step 15 "Fetch latest block consensus operations" ; let* consensus_operations = diff --git a/tezt/tests/cloud/dal.ml b/tezt/tests/cloud/dal.ml index c796934632bbdcb71aa5c5f7e7ad3c224ce8db74..72f9b396bbfc21b008227cece2f4eda8a770873b 100644 --- a/tezt/tests/cloud/dal.ml +++ b/tezt/tests/cloud/dal.ml @@ -487,7 +487,7 @@ type bootstrap = { type baker = { node : Node.t; dal_node : Dal_node.t option; - baker : Baker.t; + baker : Agnostic_baker.t; account : Account.key; stake : int; } @@ -2378,10 +2378,9 @@ let init_baker ?stake cloud (configuration : configuration) ~bootstrap teztale ~alias:account.alias in let* baker = - Baker.Agent.init + Agnostic_baker.Agent.init ~name:(Format.asprintf "baker-%d" i) ~delegates:[account.Account.alias] - ~protocol:configuration.protocol ~client ?dal_node node @@ -3587,7 +3586,7 @@ let register (module Cli : Scenarios_cli.Dal) = [ "octez-dal-node"; "octez-client"; - Tezt_wrapper.Uses.path (Protocol.baker configuration.protocol); + Tezt_wrapper.Uses.path Constant.octez_experimental_agnostic_baker; ] @ (if Cli.etherlink then ["evm_kernel.wasm"; "octez-evm-node"; "octez-smart-rollup-node"] diff --git a/tezt/tests/cloud/layer1.ml b/tezt/tests/cloud/layer1.ml index 18a46cf82731bf84fe1b779a924dd994d4c3b04f..dc16b4ef02164ed664eb432d9359f95e579311c6 100644 --- a/tezt/tests/cloud/layer1.ml +++ b/tezt/tests/cloud/layer1.ml @@ -30,8 +30,6 @@ module Network = struct let to_octez_network_options (t : t) = Network.to_octez_network_options (t :> Network.public) - let default_protocol (t : t) = Network.default_protocol (t :> Network.t) - let block_time = function `Ghostnet -> 5 | `Mainnet -> 8 (** Next protocol for both Mainnet and Ghostnet - needs to be updated manually. *) @@ -324,12 +322,6 @@ type stresstest_conf = {pkh : string; pk : string; tps : int; seed : int} must match the number of delegates. This scenario will launch one node per delegate (i.e. more than 300 nodes if testing on mainnet). - - [agnostic_bakers] specifies which bakers will use the agnostic baker - binary and which will use the protocol-dependent one(s). - - e.g: [0,2] means that the first and last bakers will be agnostic, while - the second one will be protocol dependent (if we have 3 bakers in total). - - [maintenance_delay]: number of level which will be multiplied by the position in the list of the bakers to define the store merge delay. We want it to be the same for two runs with same parameters (not @@ -343,7 +335,6 @@ type stresstest_conf = {pkh : string; pk : string; tps : int; seed : int} *) type 'network configuration0 = { stake : int list; - agnostic_bakers : int list; network : 'network; snapshot : string; stresstest : stresstest_conf option; @@ -360,12 +351,10 @@ type bootstrap = { client : Client.t; } -type baker_kind = Classic of Baker.t | Agnostic of Agnostic_baker.t - type baker = { agent : Agent.t; node : Node.t; - kind : baker_kind; + baker : Agnostic_baker.t; accounts : string list; } @@ -384,7 +373,7 @@ type 'network t = { stresstesters : stresstester list; } -let init_baker_i i (configuration : configuration) cloud ~peers ~use_agnostic +let init_baker_i i (configuration : configuration) cloud ~peers (accounts : baker_account list) (agent, node, name) = let delay = i * configuration.maintenance_delay in let* client = @@ -399,70 +388,28 @@ let init_baker_i i (configuration : configuration) cloud ~peers ~use_agnostic ~migration_offset:configuration.migration_offset (agent, node, name) in - let* baker_kind = - if use_agnostic then ( - toplog "init_baker: Initialize agnostic baker" ; - let name = name ^ "-agnostic-baker" in - let* agnostic_baker = - Agnostic_baker.Agent.init - ~env:yes_crypto_env - ~name - ~delegates:(List.map (fun ({pkh; _} : baker_account) -> pkh) accounts) - ~client - node - cloud - agent - in - let* () = Agnostic_baker.wait_for_ready agnostic_baker in - toplog "init_baker: %s is ready!" name ; - Lwt.return @@ Agnostic agnostic_baker) - else ( - toplog "init_baker: Initialize baker" ; - let name = name ^ "-baker" in - let* baker = - let protocol = Network.default_protocol configuration.network in - Baker.Agent.init - ~env:yes_crypto_env - ~name - ~delegates:(List.map (fun ({pkh; _} : baker_account) -> pkh) accounts) - ~protocol - ~client - node - cloud - agent - in - let* () = Baker.wait_for_ready baker in - toplog "init_baker: %s is ready!" name ; - (* If case of a migration scenario, we also need to start the next protocol baker binary. *) - let* () = - if configuration.migration_offset == None then Lwt.return_unit - else ( - toplog "init_baker_next: Initialize next baker" ; - let name = name ^ "-next" in - let* next_baker = - let protocol = Network.migrate_to configuration.network in - Baker.Agent.init - ~env:yes_crypto_env - ~name - ~delegates: - (List.map (fun ({pkh; _} : baker_account) -> pkh) accounts) - ~protocol - ~client - node - cloud - agent - in - let* () = Baker.wait_for_ready next_baker in - toplog "init_baker_next: %s is ready!" name ; - Lwt.return_unit) - in - Lwt.return @@ Classic baker) + let* baker = + toplog "init_baker: Initialize agnostic baker" ; + let name = name ^ "-agnostic-baker" in + let* agnostic_baker = + Agnostic_baker.Agent.init + ~env:yes_crypto_env + ~name + ~delegates:(List.map (fun ({pkh; _} : baker_account) -> pkh) accounts) + ~client + node + cloud + agent + in + let* () = Agnostic_baker.wait_for_ready agnostic_baker in + toplog "init_baker: %s is ready!" name ; + Lwt.return agnostic_baker in Lwt.return { agent; node; - kind = baker_kind; + baker; accounts = List.map (fun ({pkh; _} : baker_account) -> pkh) accounts; } @@ -740,14 +687,7 @@ let init ~(configuration : configuration) cloud next_agent = (fun i accounts -> let ((_, node, _) as agent) = List.nth baker_agents i in let peers = List.filter (( <> ) (Node.point_str node)) peers in - init_baker_i - i - ~peers - ~use_agnostic:(List.mem i configuration.agnostic_bakers) - configuration - cloud - accounts - agent) + init_baker_i i ~peers configuration cloud accounts agent) distribution in let* stresstesters = @@ -974,7 +914,6 @@ let parse_conf encoding file = let register (module Cli : Scenarios_cli.Layer1) = let configuration = let stake = Option.value ~default:[] Cli.stake in - let agnostic_bakers = Option.value ~default:[] Cli.agnostic_bakers in let network : Network.t option = match Cli.network with | `Mainnet -> Some `Mainnet @@ -988,15 +927,7 @@ let register (module Cli : Scenarios_cli.Layer1) = let maintenance_delay = Option.value ~default:0 Cli.maintenance_delay in let snapshot = Option.value ~default:"" Cli.snapshot in let migration_offset = Cli.migration_offset in - { - stake; - agnostic_bakers; - network; - stresstest; - maintenance_delay; - snapshot; - migration_offset; - } + {stake; network; stresstest; maintenance_delay; snapshot; migration_offset} in let vms_conf = Option.map (parse_conf vms_conf_encoding) Cli.vms_config in toplog "Parsing CLI done" ; diff --git a/tezt/tests/cloud/scenarios_cli.ml b/tezt/tests/cloud/scenarios_cli.ml index 7f9987b5c997aaaab6c98bfd782367357e184849..4d62b80990e70aadabe8fa90fb10f580a38038e3 100644 --- a/tezt/tests/cloud/scenarios_cli.ml +++ b/tezt/tests/cloud/scenarios_cli.ml @@ -422,8 +422,6 @@ module type Layer1 = sig val stake : int list option - val agnostic_bakers : int list option - val stresstest : (string * string * int * int) option val maintenance_delay : int option @@ -487,19 +485,6 @@ module Layer1 () = struct (Clap.list_of_int ~dummy:[] "stake") () - let agnostic_bakers = - Clap.optional - ~section - ~long:"agnostic-bakers" - ~placeholder:",,,..." - ~description: - "By default all the bakers run in the experiment will use protocol \ - specific octez binaries. This list contains the indices of the bakers \ - that are going to be agnostic, meaning that they will use the \ - agnostic-baker binary, instead of the protocol specific one." - (Clap.list_of_int ~dummy:[] "agnostic-bakers") - () - let stresstest = let typ = let parse string = diff --git a/tezt/tests/cloud/tezos.ml b/tezt/tests/cloud/tezos.ml index fb41c2cad6775db73b03b04696d1c7b045d71827..486b2cd719798c0ca3631e57ab493a186c42c205 100644 --- a/tezt/tests/cloud/tezos.ml +++ b/tezt/tests/cloud/tezos.ml @@ -377,38 +377,6 @@ module Client = struct end end -module Baker = struct - include Baker - - module Agent = struct - let init ?(group = "L1") ?env ?name ~delegates ~protocol - ?(path = Uses.path (Protocol.baker protocol)) ~client ?dal_node - ?dal_node_timeout_percentage node cloud agent = - let* path = Agent.copy agent ~source:path in - let* () = - Cloud.register_binary - cloud - ~agents:[agent] - ~group - ~name:(Filename.basename path) - () - in - let runner = Agent.runner agent in - init - ?env - ?name - ~event_level:`Notice - ?runner - ~path - ~delegates - ~protocol - ?dal_node - ?dal_node_timeout_percentage - node - client - end -end - module Agnostic_baker = struct include Agnostic_baker diff --git a/tezt/tests/vdf_test.ml b/tezt/tests/vdf_test.ml index 29b8ff92afed2cec8290bb6a2241e67912f30363..65acbd7069b59f3763b77609c16f20bee46313a8 100644 --- a/tezt/tests/vdf_test.ml +++ b/tezt/tests/vdf_test.ml @@ -243,7 +243,7 @@ let vdf_cycles : Protocol.t list -> unit = ~__FILE__ ~title:"VDF daemon" ~tags:[team; "vdf"] - ~uses:(fun protocol -> [Protocol.baker protocol]) + ~uses:(fun _protocol -> [Constant.octez_experimental_agnostic_baker]) @@ fun protocol -> let n_cycles = 2 in let* node, client, blocks_per_cycle, nonce_revelation_threshold = @@ -343,7 +343,7 @@ let vdf_cancel : Protocol.t list -> unit = ~__FILE__ ~title:"Cancelling VDF computation" ~tags:[team; "vdf"] - ~uses:(fun protocol -> [Protocol.baker protocol]) + ~uses:(fun _protocol -> [Constant.octez_experimental_agnostic_baker]) @@ fun protocol -> (* Override the `vdf_difficulty` constant in order ensure that * a VDF computation started in the last block of a cycle will not be finished