diff --git a/docs/releases/version-22.rst b/docs/releases/version-22.rst index f85051563bf5dcadbdebf5a59132e6ffa926ceb4..ca686e33d188f8dda0a4d1370138518d87863ac5 100644 --- a/docs/releases/version-22.rst +++ b/docs/releases/version-22.rst @@ -54,7 +54,7 @@ a new protocol is detected by the node, such as during migrations or at startup. The v22 agnostic baker is **EXPERIMENTAL ONLY** and should **NOT** be used on ``mainnet``. You can use the agnostic baker on test networks and give feedback. -You can find more information on the agnostic baker in the corresponding :src:`README ` file. +You can find more information on the agnostic baker in the corresponding :src:`README ` file. Minimal hardware specifications ------------------------------- diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml index 4d6f70b823edfff4fb26b0b3ebb77bf506e46219..ec34098af486622ed238bc9b60a0a1ce7f3069da 100644 --- a/manifest/product_octez.ml +++ b/manifest/product_octez.ml @@ -5649,13 +5649,13 @@ let _octez_scoru_wasm_fast_tests = ] ~preprocess:(staged_pps [ppx_import; ppx_deriving_show]) -let octez_agnostic_baker_lib = +let octez_baker_lib = let (PPX {preprocess; preprocessor_deps}) = ppx_profiler in public_lib "octez-baker-lib" - ~path:"src/lib_agnostic_baker" - ~internal_name:"octez_agnostic_baker" - ~synopsis:"Octez: library for Agnostic Baker" + ~path:"src/lib_baker" + ~internal_name:"octez_baker" + ~synopsis:"Octez: library for Baker" ~preprocess ~preprocessor_deps ~deps: @@ -5720,7 +5720,7 @@ module Protocol : sig val dal : t -> target option - val agnostic_baker : t -> target option + val baker : t -> target option val parameters : t -> target option @@ -5836,7 +5836,7 @@ end = struct plugin : target option; plugin_registerer : target option; dal : target option; - agnostic_baker : target option; + baker : target option; test_helpers : target option; parameters : target option; benchmarks_proto : target option; @@ -5847,10 +5847,10 @@ end = struct } let make ?client ?client_commands ?client_commands_registration - ?baking_commands_registration ?plugin ?plugin_registerer ?dal - ?agnostic_baker ?test_helpers ?parameters ?benchmarks_proto - ?octez_sc_rollup ?octez_sc_rollup_node ?octez_injector ?baking ~status - ~name ~main ~embedded () = + ?baking_commands_registration ?plugin ?plugin_registerer ?dal ?baker + ?test_helpers ?parameters ?benchmarks_proto ?octez_sc_rollup + ?octez_sc_rollup_node ?octez_injector ?baking ~status ~name ~main + ~embedded () = { status; name; @@ -5863,7 +5863,7 @@ end = struct plugin; plugin_registerer; dal; - agnostic_baker; + baker; test_helpers; parameters; benchmarks_proto; @@ -5926,7 +5926,7 @@ end = struct let dal p = p.dal - let agnostic_baker p = p.agnostic_baker + let baker p = p.baker let parameters p = p.parameters @@ -7478,12 +7478,12 @@ let hash = Protocol.hash alcotezt; ] in - let agnostic_baker = + let baker = only_if (active && N.(number >= 021)) @@ fun () -> octez_protocol_lib - "agnostic-baker" - ~internal_name:(sf "tezos_agnostic_baker_%s" name_dash) - ~path:(path // "lib_agnostic_baker") + "baker" + ~internal_name:(sf "tezos_baker_%s" name_dash) + ~path:(path // "lib_baker") ~synopsis:"Protocol specific library for the Agnostic Baker" ~deps: [ @@ -7492,7 +7492,7 @@ let hash = Protocol.hash main |> open_; baking |> if_some |> open_; baking_commands |> if_some |> open_; - octez_agnostic_baker_lib |> open_; + octez_baker_lib |> open_; ] ~linkall:true in @@ -7824,7 +7824,7 @@ let hash = Protocol.hash ?plugin ?plugin_registerer ?dal - ?agnostic_baker + ?baker ?test_helpers ?parameters ?benchmarks_proto @@ -8551,7 +8551,7 @@ let _octez_node = ~section:"bin"; ] -let _octez_agnostic_baker = +let _octez_baker = let (PPX {preprocess; preprocessor_deps}) = ppx_profiler in let protocol_deps = let deps_for_protocol protocol = @@ -8560,15 +8560,15 @@ let _octez_agnostic_baker = | Active, V _ -> false | (Frozen | Overridden | Not_mainnet), _ | Active, (Dev | Other) -> true in - let targets = List.filter_map Fun.id [Protocol.agnostic_baker protocol] in + let targets = List.filter_map Fun.id [Protocol.baker protocol] in if is_optional then List.map optional targets else targets in List.map deps_for_protocol Protocol.all |> List.flatten in public_exe "octez-baker" - ~path:"src/bin_agnostic_baker" - ~internal_name:"main_agnostic_baker" + ~path:"src/bin_baker" + ~internal_name:"main_baker" ~synopsis:"Tezos: `octez-baker` binary for baking" ~preprocess ~preprocessor_deps @@ -8580,13 +8580,13 @@ let _octez_agnostic_baker = octez_base |> open_ ~m:"TzPervasives" |> open_; octez_base_unix |> open_; octez_client_base_unix |> open_; - octez_agnostic_baker_lib |> open_; + octez_baker_lib |> open_; octez_profiler |> open_; ] @ protocol_deps) ~linkall:true -let _octez_agnostic_accuser = +let _octez_accuser = let (PPX {preprocess; preprocessor_deps}) = ppx_profiler in let protocol_deps = let deps_for_protocol protocol = @@ -8595,15 +8595,15 @@ let _octez_agnostic_accuser = | Active, V _ -> false | (Frozen | Overridden | Not_mainnet), _ | Active, (Dev | Other) -> true in - let targets = List.filter_map Fun.id [Protocol.agnostic_baker protocol] in + let targets = List.filter_map Fun.id [Protocol.baker protocol] in if is_optional then List.map optional targets else targets in List.map deps_for_protocol Protocol.all |> List.flatten in public_exe "octez-accuser" - ~path:"src/bin_agnostic_accuser" - ~internal_name:"main_agnostic_accuser" + ~path:"src/bin_accuser" + ~internal_name:"main_accuser" ~synopsis:"Tezos: `octez-accuser` binary for denunciation" ~preprocess ~preprocessor_deps @@ -8615,7 +8615,7 @@ let _octez_agnostic_accuser = octez_base |> open_ ~m:"TzPervasives" |> open_; octez_base_unix |> open_; octez_client_base_unix |> open_; - octez_agnostic_baker_lib |> open_; + octez_baker_lib |> open_; ] @ protocol_deps) ~linkall:true diff --git a/opam/octez-baker-lib.opam b/opam/octez-baker-lib.opam index cc65dc7a4c24a06b111a858f9b44e3d99947d0d7..21ffbd7f6c82c9385cac7c0cc816af67020e4691 100644 --- a/opam/octez-baker-lib.opam +++ b/opam/octez-baker-lib.opam @@ -21,4 +21,4 @@ build: [ ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] available: os-family != "windows" -synopsis: "Octez: library for Agnostic Baker" +synopsis: "Octez: library for Baker" diff --git a/scripts/proto_manager.sh b/scripts/proto_manager.sh index 02bc2731e519581b129f1c70d82a3622aaaafcc0..255e5f92319be09a4bbd5bc95aefab2a1e15797f 100755 --- a/scripts/proto_manager.sh +++ b/scripts/proto_manager.sh @@ -776,13 +776,13 @@ function copy_source() { commit_no_hooks "src: remove proto_${protocol_source}" fi - ## update agnostic_baker + ## update baker ## add protocol as active before alpha in parameters.ml - if ! grep -q "${long_hash}" src/lib_agnostic_baker/parameters.ml; then + if ! grep -q "${long_hash}" src/lib_baker/parameters.ml; then ## look for "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" and add "${longhash};" - sed -i.old -e "/ \"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK\" /a \"${long_hash}\"; " src/lib_agnostic_baker/parameters.ml - ocamlformat -i src/lib_agnostic_baker/parameters.ml - commit "src: add protocol to agnostic_baker" + sed -i.old -e "/ \"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK\" /a \"${long_hash}\"; " src/lib_baker/parameters.ml + ocamlformat -i src/lib_baker/parameters.ml + commit "src: add protocol to baker" fi } diff --git a/src/bin_agnostic_accuser/README.md b/src/bin_accuser/README.md similarity index 100% rename from src/bin_agnostic_accuser/README.md rename to src/bin_accuser/README.md diff --git a/src/bin_agnostic_accuser/dune b/src/bin_accuser/dune similarity index 59% rename from src/bin_agnostic_accuser/dune rename to src/bin_accuser/dune index aa88c0d40ae766a4cc98b163c44d30e8473973d8..9d8c1e30d1f594e61ac0ae663ffb777efa7cfbb9 100644 --- a/src/bin_agnostic_accuser/dune +++ b/src/bin_accuser/dune @@ -2,7 +2,7 @@ ; Edit file manifest/main.ml instead. (executable - (name main_agnostic_accuser) + (name main_accuser) (public_name octez-accuser) (package octez-accuser) (instrumentation (backend bisect_ppx)) @@ -13,11 +13,11 @@ octez-libs.base.unix octez-shell-libs.client-base-unix octez-baker-lib - octez-protocol-021-PsQuebec-libs.agnostic-baker - octez-protocol-022-PsRiotum-libs.agnostic-baker - (select void_for_linking-octez-protocol-alpha-libs-agnostic-baker from - (octez-protocol-alpha-libs.agnostic-baker -> void_for_linking-octez-protocol-alpha-libs-agnostic-baker.empty) - (-> void_for_linking-octez-protocol-alpha-libs-agnostic-baker.empty))) + octez-protocol-021-PsQuebec-libs.baker + octez-protocol-022-PsRiotum-libs.baker + (select void_for_linking-octez-protocol-alpha-libs-baker from + (octez-protocol-alpha-libs.baker -> void_for_linking-octez-protocol-alpha-libs-baker.empty) + (-> void_for_linking-octez-protocol-alpha-libs-baker.empty))) (preprocess (pps octez-libs.ppx_profiler)) (preprocessor_deps (env_var TEZOS_PPX_PROFILER)) (link_flags @@ -31,9 +31,9 @@ -open Tezos_base -open Tezos_base_unix -open Tezos_client_base_unix - -open Octez_agnostic_baker)) + -open Octez_baker)) (rule (action (progn - (write-file void_for_linking-octez-protocol-alpha-libs-agnostic-baker.empty "")))) + (write-file void_for_linking-octez-protocol-alpha-libs-baker.empty "")))) diff --git a/src/bin_agnostic_accuser/main_agnostic_accuser.ml b/src/bin_accuser/main_accuser.ml similarity index 93% rename from src/bin_agnostic_accuser/main_agnostic_accuser.ml rename to src/bin_accuser/main_accuser.ml index dce135f196c6b2057be80fbb5fb1c50ff8d143e6..209bb51bfe628ec0ba481ec960dff48a0b1720df 100644 --- a/src/bin_agnostic_accuser/main_agnostic_accuser.ml +++ b/src/bin_accuser/main_accuser.ml @@ -25,12 +25,10 @@ let lwt_run ~args () = let open Lwt_result_syntax in let base_dir = Option.value - ~default:Agnostic_baker_config.default_base_dir + ~default:Baker_config.default_base_dir (Run_args.get_base_dir args) in - let*! () = - Client_main_run.init_logging (module Agnostic_baker_config) ~base_dir () - in + let*! () = Client_main_run.init_logging (module Baker_config) ~base_dir () in () [@profiler.overwrite may_start_profiler base_dir] ; let daemon = Daemon.Accuser.create @@ -73,7 +71,7 @@ let () = (* No need to run the accuser commands, we just need to get their description, therefore we do not obtain the protocol plugin. *) Client_main_run.run - (module Agnostic_baker_config) + (module Baker_config) ~select_commands:(fun _ _ -> Lwt_result_syntax.return @@ Commands.accuser_commands ()) else run ~args () diff --git a/src/bin_agnostic_baker/README.md b/src/bin_baker/README.md similarity index 100% rename from src/bin_agnostic_baker/README.md rename to src/bin_baker/README.md diff --git a/src/bin_agnostic_baker/dune b/src/bin_baker/dune similarity index 61% rename from src/bin_agnostic_baker/dune rename to src/bin_baker/dune index a46efe378b7ca27941855470592932731dc02bed..7f4cf480a4e6413c4b990af6c11780941b6a3152 100644 --- a/src/bin_agnostic_baker/dune +++ b/src/bin_baker/dune @@ -2,7 +2,7 @@ ; Edit file manifest/main.ml instead. (executable - (name main_agnostic_baker) + (name main_baker) (public_name octez-baker) (package octez-baker) (instrumentation (backend bisect_ppx)) @@ -14,11 +14,11 @@ octez-shell-libs.client-base-unix octez-baker-lib octez-libs.octez-profiler - octez-protocol-021-PsQuebec-libs.agnostic-baker - octez-protocol-022-PsRiotum-libs.agnostic-baker - (select void_for_linking-octez-protocol-alpha-libs-agnostic-baker from - (octez-protocol-alpha-libs.agnostic-baker -> void_for_linking-octez-protocol-alpha-libs-agnostic-baker.empty) - (-> void_for_linking-octez-protocol-alpha-libs-agnostic-baker.empty))) + octez-protocol-021-PsQuebec-libs.baker + octez-protocol-022-PsRiotum-libs.baker + (select void_for_linking-octez-protocol-alpha-libs-baker from + (octez-protocol-alpha-libs.baker -> void_for_linking-octez-protocol-alpha-libs-baker.empty) + (-> void_for_linking-octez-protocol-alpha-libs-baker.empty))) (preprocess (pps octez-libs.ppx_profiler)) (preprocessor_deps (env_var TEZOS_PPX_PROFILER)) (link_flags @@ -32,10 +32,10 @@ -open Tezos_base -open Tezos_base_unix -open Tezos_client_base_unix - -open Octez_agnostic_baker + -open Octez_baker -open Tezos_profiler)) (rule (action (progn - (write-file void_for_linking-octez-protocol-alpha-libs-agnostic-baker.empty "")))) + (write-file void_for_linking-octez-protocol-alpha-libs-baker.empty "")))) diff --git a/src/bin_agnostic_baker/main_agnostic_baker.ml b/src/bin_baker/main_baker.ml similarity index 91% rename from src/bin_agnostic_baker/main_agnostic_baker.ml rename to src/bin_baker/main_baker.ml index f68b9a1de76e588fd66a075d45c98fe40570d45e..a1ab333677a6d392c6d0e33ca359c528efec1965 100644 --- a/src/bin_agnostic_baker/main_agnostic_baker.ml +++ b/src/bin_baker/main_baker.ml @@ -26,21 +26,21 @@ let lwt_run ~args () = let open Lwt_result_syntax in let base_dir = Option.value - ~default:Agnostic_baker_config.default_base_dir + ~default:Baker_config.default_base_dir (Run_args.get_base_dir args) in let full = new Tezos_client_base_unix.Client_context_unix.unix_full - ~chain:Agnostic_baker_config.default_chain - ~block:Agnostic_baker_config.default_block + ~chain:Baker_config.default_chain + ~block:Baker_config.default_block ~confirmations:None ~password_filename:None - ~base_dir:Agnostic_baker_config.default_base_dir + ~base_dir:Baker_config.default_base_dir ~rpc_config:Tezos_rpc_http_client_unix.RPC_client_unix.default_config ~verbose_rpc_error_diagnostics:false in let* parsed, _remaining = - Agnostic_baker_config.parse_config_args + Baker_config.parse_config_args full (List.tl args |> Option.value ~default:[]) in @@ -50,7 +50,7 @@ let lwt_run ~args () = Client_main_run.init_logging ?parsed_args ?parsed_config_file - (module Agnostic_baker_config) + (module Baker_config) ~base_dir () in @@ -96,7 +96,7 @@ let () = (* No need to run the baker commands, we just need to get their description, therefore we do not obtain the protocol plugin. *) Client_main_run.run - (module Agnostic_baker_config) + (module Baker_config) ~select_commands:(fun _ _ -> Lwt_result_syntax.return @@ Commands.baker_commands ()) else run ~args () diff --git a/src/bin_client/octez-init-sandboxed-client.sh b/src/bin_client/octez-init-sandboxed-client.sh index 43bd38f691f817d515324717b6d224d3d1343c18..a36a6f7aac651d0c0dfebfb04566b11679aa60cc 100755 --- a/src/bin_client/octez-init-sandboxed-client.sh +++ b/src/bin_client/octez-init-sandboxed-client.sh @@ -131,8 +131,8 @@ main() { protocol_underscore=$(echo "$protocol" | tr -- - _) protocol_without_number=$(echo "$protocol" | tr -d "\-[0-9]") local_baker="$bin_dir/../../_build/default/src/proto_$protocol_underscore/bin_baker/main_baker_$protocol_underscore.exe" - local_agnostic_baker="$bin_dir/../../_build/default/src/bin_agnostic_baker/main_agnostic_baker.exe" - local_agnostic_accuser="$bin_dir/../../_build/default/src/bin_agnostic_accuser/main_agnostic_accuser.exe" + local_agnostic_baker="$bin_dir/../../_build/default/src/bin_baker/main_baker.exe" + local_agnostic_accuser="$bin_dir/../../_build/default/src/bin_accuser/main_accuser.exe" local_accuser="$bin_dir/../../_build/default/src/proto_$protocol_underscore/bin_accuser/main_accuser_$protocol_underscore.exe" local_sc_rollup_node="$bin_dir/../../_build/default/src/proto_$protocol_underscore/bin_sc_rollup_node/main_sc_rollup_node_$protocol_underscore.exe" parameters_file="$bin_dir/../../_build/default/src/proto_$protocol_underscore/lib_parameters/sandbox-parameters.json" diff --git a/src/bin_tps_evaluation/benchmark_tps_command.ml b/src/bin_tps_evaluation/benchmark_tps_command.ml index c2266285385a9c4dc634fe053f8618e72bb95ac2..c470e24cc62274905ec87c2522e9e6bca3141f86 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 = Agnostic_baker.init ~delegates node client in + let _baker = 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_agnostic_baker] + ~uses:[Tezt_wrapper.Uses.octez_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 71694c58513485821d6e6cd19ff445a46f7b19a9..b96869f2d3b59080cf45d252c9b9a2bb27eb6457 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 = Agnostic_baker.init ~delegates node client in + let* baker = 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* _ = Agnostic_baker.terminate baker in + let* _ = 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_agnostic_baker] + ~uses:[Tezt_wrapper.Uses.octez_baker] (fun () -> let average_block_path = Cli.get ~default:None (fun s -> Some (Some s)) "average-block" diff --git a/src/lib_agnostic_baker/agnostic_baker_profiler.ml b/src/lib_baker/agnostic_baker_profiler.ml similarity index 89% rename from src/lib_agnostic_baker/agnostic_baker_profiler.ml rename to src/lib_baker/agnostic_baker_profiler.ml index 9b93ffd25beffacfd751a402166c6e20debeaaec..b120101ad3e8afde6083f89cc172208edd99aa36 100644 --- a/src/lib_agnostic_baker/agnostic_baker_profiler.ml +++ b/src/lib_baker/agnostic_baker_profiler.ml @@ -6,6 +6,8 @@ (*****************************************************************************) open Profiler +(* FIXME: https://gitlab.com/tezos/tezos/-/issues/7958 + Unify profiling for all bakers. *) let agnostic_baker_profiler = unplugged () let init profiler_maker = diff --git a/src/lib_agnostic_baker/agnostic_baker_profiler.mli b/src/lib_baker/agnostic_baker_profiler.mli similarity index 100% rename from src/lib_agnostic_baker/agnostic_baker_profiler.mli rename to src/lib_baker/agnostic_baker_profiler.mli diff --git a/src/lib_agnostic_baker/agnostic_baker_config.ml b/src/lib_baker/baker_config.ml similarity index 100% rename from src/lib_agnostic_baker/agnostic_baker_config.ml rename to src/lib_baker/baker_config.ml diff --git a/src/lib_agnostic_baker/commands.ml b/src/lib_baker/commands.ml similarity index 100% rename from src/lib_agnostic_baker/commands.ml rename to src/lib_baker/commands.ml diff --git a/src/lib_agnostic_baker/commands.mli b/src/lib_baker/commands.mli similarity index 100% rename from src/lib_agnostic_baker/commands.mli rename to src/lib_baker/commands.mli diff --git a/src/lib_agnostic_baker/configuration.ml b/src/lib_baker/configuration.ml similarity index 99% rename from src/lib_agnostic_baker/configuration.ml rename to src/lib_baker/configuration.ml index d0a9667f630d921342666718297c77d2a3cb6890..39a1f2a22d38d0c066e6e76fa05babeab221da64 100644 --- a/src/lib_agnostic_baker/configuration.ml +++ b/src/lib_baker/configuration.ml @@ -18,7 +18,7 @@ type error += Bad_preserved_levels of string let () = register_error_kind `Permanent - ~id:"agnostic_baker.configuration.block_vote_file_not_found" + ~id:"baker.configuration.block_vote_file_not_found" ~title: "The provided block vote file path does not point to an existing file." ~description: @@ -36,7 +36,7 @@ let () = (fun file_path -> Block_vote_file_not_found file_path) ; register_error_kind `Permanent - ~id:"agnostic_baker.configuration.badMinimalFeesArg" + ~id:"baker.configuration.badMinimalFeesArg" ~title:"Bad -minimal-fees arg" ~description:"invalid fee threshold in -fee-threshold" ~pp:(fun ppf literal -> @@ -46,7 +46,7 @@ let () = (fun parameter -> Bad_minimal_fees parameter) ; register_error_kind `Permanent - ~id:"badPreservedLevelsArg" + ~id:"baker.configuration.badPreservedLevelsArg" ~title:"Bad -preserved-levels arg" ~description:"invalid number of levels in -preserved-levels" ~pp:(fun ppf literal -> diff --git a/src/lib_agnostic_baker/configuration.mli b/src/lib_baker/configuration.mli similarity index 100% rename from src/lib_agnostic_baker/configuration.mli rename to src/lib_baker/configuration.mli diff --git a/src/lib_agnostic_baker/daemon.ml b/src/lib_baker/daemon.ml similarity index 99% rename from src/lib_agnostic_baker/daemon.ml rename to src/lib_baker/daemon.ml index f91f5bbc9f20e96263cf33ae77ae0232c966f5b4..cea209fcc5548cffc9f62a9dbdfe55c799214be7 100644 --- a/src/lib_agnostic_baker/daemon.ml +++ b/src/lib_baker/daemon.ml @@ -130,7 +130,7 @@ module Make_daemon (Agent : AGENT) : AGNOSTIC_DAEMON = struct Lwt.pick [ Client_main_run.lwt_run - (module Agnostic_baker_config) + (module Baker_config) ~select_commands:(fun _ _ -> Lwt_result_syntax.return @@ Agent.commands ~plugin ()) (* The underlying logging from the baker must not be initialised, otherwise we double log. *) diff --git a/src/lib_agnostic_baker/daemon.mli b/src/lib_baker/daemon.mli similarity index 100% rename from src/lib_agnostic_baker/daemon.mli rename to src/lib_baker/daemon.mli diff --git a/src/lib_agnostic_baker/dune b/src/lib_baker/dune similarity index 96% rename from src/lib_agnostic_baker/dune rename to src/lib_baker/dune index 8675d50e9fc5adc8a30753bfbfe5b15f17092367..18abc7e622c7d1d100fe3ae2891e172a5894f48f 100644 --- a/src/lib_agnostic_baker/dune +++ b/src/lib_baker/dune @@ -2,7 +2,7 @@ ; Edit file manifest/main.ml instead. (library - (name octez_agnostic_baker) + (name octez_baker) (public_name octez-baker-lib) (instrumentation (backend bisect_ppx)) (libraries diff --git a/src/lib_agnostic_baker/errors.ml b/src/lib_baker/errors.ml similarity index 100% rename from src/lib_agnostic_baker/errors.ml rename to src/lib_baker/errors.ml diff --git a/src/lib_agnostic_baker/events.ml b/src/lib_baker/events.ml similarity index 100% rename from src/lib_agnostic_baker/events.ml rename to src/lib_baker/events.ml diff --git a/src/lib_agnostic_baker/parameters.ml b/src/lib_baker/parameters.ml similarity index 100% rename from src/lib_agnostic_baker/parameters.ml rename to src/lib_baker/parameters.ml diff --git a/src/lib_agnostic_baker/parameters.mli b/src/lib_baker/parameters.mli similarity index 100% rename from src/lib_agnostic_baker/parameters.mli rename to src/lib_baker/parameters.mli diff --git a/src/lib_agnostic_baker/protocol_plugin_sig.ml b/src/lib_baker/protocol_plugin_sig.ml similarity index 100% rename from src/lib_agnostic_baker/protocol_plugin_sig.ml rename to src/lib_baker/protocol_plugin_sig.ml diff --git a/src/lib_agnostic_baker/protocol_plugins.ml b/src/lib_baker/protocol_plugins.ml similarity index 82% rename from src/lib_agnostic_baker/protocol_plugins.ml rename to src/lib_baker/protocol_plugins.ml index 2ed10e0e265d35dd5f835d50ddefa7cadf574366..b3566826a9213c00abcda78609e5f7ca34f823b5 100644 --- a/src/lib_agnostic_baker/protocol_plugins.ml +++ b/src/lib_baker/protocol_plugins.ml @@ -9,13 +9,13 @@ type error += Unsupported_protocol of Protocol_hash.t let () = register_error_kind - ~id:"agnostic_baker.unsupported_protocol" - ~title:"Protocol not supported by agnostic baker" - ~description:"Protocol not supported by agnostic baker." + ~id:"baker.unsupported_protocol" + ~title:"Protocol not supported by baker" + ~description:"Protocol not supported by baker." ~pp:(fun ppf proto -> Format.fprintf ppf - "Protocol %a is not supported by the agnostic baker." + "Protocol %a is not supported by the baker." Protocol_hash.pp proto) `Permanent @@ -35,8 +35,8 @@ let register (plugin : proto_plugin) = if Protocol_hash.Table.mem proto_plugins Plugin.protocol_hash then Format.kasprintf invalid_arg - "The agnostic baker protocol plugin for protocol %a is already \ - registered. Did you register it manually multiple times?" + "The baker protocol plugin for protocol %a is already registered. Did \ + you register it manually multiple times?" Protocol_hash.pp Plugin.protocol_hash ; last_registered := Some Plugin.protocol_hash ; diff --git a/src/lib_agnostic_baker/protocol_plugins.mli b/src/lib_baker/protocol_plugins.mli similarity index 100% rename from src/lib_agnostic_baker/protocol_plugins.mli rename to src/lib_baker/protocol_plugins.mli diff --git a/src/lib_agnostic_baker/rpc_services.ml b/src/lib_baker/rpc_services.ml similarity index 100% rename from src/lib_agnostic_baker/rpc_services.ml rename to src/lib_baker/rpc_services.ml diff --git a/src/lib_agnostic_baker/rpc_services.mli b/src/lib_baker/rpc_services.mli similarity index 100% rename from src/lib_agnostic_baker/rpc_services.mli rename to src/lib_baker/rpc_services.mli diff --git a/src/lib_agnostic_baker/run_args.ml b/src/lib_baker/run_args.ml similarity index 100% rename from src/lib_agnostic_baker/run_args.ml rename to src/lib_baker/run_args.ml diff --git a/src/lib_agnostic_baker/run_args.mli b/src/lib_baker/run_args.mli similarity index 100% rename from src/lib_agnostic_baker/run_args.mli rename to src/lib_baker/run_args.mli diff --git a/src/lib_octogram/tezos.ml b/src/lib_octogram/tezos.ml index ec2f73595d56c8be7133b92bdd177d474e4b9f21..833eb542995ef96fa145a5db034ebc8f1f81d97e 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 -> Agnostic_baker.t key +type _ key += Octez_baker_k : string -> Baker.t key module Octez_baker_key = struct type t = string - type r = Agnostic_baker.t + type r = Baker.t let proj : type a. a key -> (t * (a, r) eq) option = function | Octez_baker_k name -> Some (name, Eq) @@ -2627,7 +2627,7 @@ module Start_octez_baker = struct in (* Create a baker state. *) let octez_baker = - Agnostic_baker.create_from_uris + Baker.create_from_uris ?name ?path:baker_path ~base_dir @@ -2638,10 +2638,10 @@ module Start_octez_baker = struct () in (* Register the baker state. *) - let name = Agnostic_baker.name octez_baker in + let name = Baker.name octez_baker in Agent_state.add (Octez_baker_k name) octez_baker state ; (* Start the baker. *) - let* () = Agnostic_baker.run octez_baker in + let* () = Baker.run octez_baker in return {name} let on_completion ~on_new_service:_ ~on_new_metrics_source:_ (_ : r) = () diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/accuser_commands_helpers.ml b/src/proto_021_PsQuebec/lib_baker/accuser_commands_helpers.ml similarity index 100% rename from src/proto_021_PsQuebec/lib_agnostic_baker/accuser_commands_helpers.ml rename to src/proto_021_PsQuebec/lib_baker/accuser_commands_helpers.ml diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/baker_args_parser.ml b/src/proto_021_PsQuebec/lib_baker/baker_args_parser.ml similarity index 100% rename from src/proto_021_PsQuebec/lib_agnostic_baker/baker_args_parser.ml rename to src/proto_021_PsQuebec/lib_baker/baker_args_parser.ml diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/baker_args_parser.mli b/src/proto_021_PsQuebec/lib_baker/baker_args_parser.mli similarity index 100% rename from src/proto_021_PsQuebec/lib_agnostic_baker/baker_args_parser.mli rename to src/proto_021_PsQuebec/lib_baker/baker_args_parser.mli diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.ml b/src/proto_021_PsQuebec/lib_baker/baker_commands_helpers.ml similarity index 100% rename from src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.ml rename to src/proto_021_PsQuebec/lib_baker/baker_commands_helpers.ml diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.mli b/src/proto_021_PsQuebec/lib_baker/baker_commands_helpers.mli similarity index 100% rename from src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.mli rename to src/proto_021_PsQuebec/lib_baker/baker_commands_helpers.mli diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/agnostic_baker_plugin.ml b/src/proto_021_PsQuebec/lib_baker/baker_plugin.ml similarity index 100% rename from src/proto_021_PsQuebec/lib_agnostic_baker/agnostic_baker_plugin.ml rename to src/proto_021_PsQuebec/lib_baker/baker_plugin.ml diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/dune b/src/proto_021_PsQuebec/lib_baker/dune similarity index 81% rename from src/proto_021_PsQuebec/lib_agnostic_baker/dune rename to src/proto_021_PsQuebec/lib_baker/dune index ade998a4e4cf04b91397d98671bfa22c6b3f0fcc..fc4951f72bfac7fe988b15b7509f5d1d9823e583 100644 --- a/src/proto_021_PsQuebec/lib_agnostic_baker/dune +++ b/src/proto_021_PsQuebec/lib_baker/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_agnostic_baker_021_PsQuebec) - (public_name octez-protocol-021-PsQuebec-libs.agnostic-baker) + (name tezos_baker_021_PsQuebec) + (public_name octez-protocol-021-PsQuebec-libs.baker) (instrumentation (backend bisect_ppx)) (libraries octez-libs.base @@ -20,4 +20,4 @@ -open Tezos_protocol_021_PsQuebec -open Tezos_baking_021_PsQuebec -open Tezos_baking_021_PsQuebec_commands - -open Octez_agnostic_baker)) + -open Octez_baker)) diff --git a/src/proto_021_PsQuebec/lib_plugin/index.mld b/src/proto_021_PsQuebec/lib_plugin/index.mld index 85f6a5a73ef3994f37c8ef51ab3784e240595017..24d32b703760bba9b84031a4afc56a655b450025 100644 --- a/src/proto_021_PsQuebec/lib_plugin/index.mld +++ b/src/proto_021_PsQuebec/lib_plugin/index.mld @@ -5,7 +5,7 @@ This is a package containing some libraries related to the Tezos 021-PsQuebec pr It contains the following libraries: - {{!module-Tezos_021_PsQuebec_test_helpers}Tezos_021_PsQuebec_test_helpers}: Protocol testing framework -- {{!module-Tezos_agnostic_baker_021_PsQuebec}Tezos_agnostic_baker_021_PsQuebec}: Protocol specific library for the Agnostic Baker +- {{!module-Tezos_baker_021_PsQuebec}Tezos_baker_021_PsQuebec}: Protocol specific library for the Agnostic Baker - {{!module-Tezos_baking_021_PsQuebec}Tezos_baking_021_PsQuebec}: Base library for `tezos-baker/accuser` - {{!module-Tezos_baking_021_PsQuebec_commands}Tezos_baking_021_PsQuebec_commands}: Protocol-specific commands for baking - {{!module-Tezos_client_021_PsQuebec}Tezos_client_021_PsQuebec}: Protocol specific library for `octez-client` diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/accuser_commands_helpers.ml b/src/proto_022_PsRiotum/lib_baker/accuser_commands_helpers.ml similarity index 100% rename from src/proto_022_PsRiotum/lib_agnostic_baker/accuser_commands_helpers.ml rename to src/proto_022_PsRiotum/lib_baker/accuser_commands_helpers.ml diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/baker_args_parser.ml b/src/proto_022_PsRiotum/lib_baker/baker_args_parser.ml similarity index 100% rename from src/proto_022_PsRiotum/lib_agnostic_baker/baker_args_parser.ml rename to src/proto_022_PsRiotum/lib_baker/baker_args_parser.ml diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/baker_args_parser.mli b/src/proto_022_PsRiotum/lib_baker/baker_args_parser.mli similarity index 100% rename from src/proto_022_PsRiotum/lib_agnostic_baker/baker_args_parser.mli rename to src/proto_022_PsRiotum/lib_baker/baker_args_parser.mli diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.ml b/src/proto_022_PsRiotum/lib_baker/baker_commands_helpers.ml similarity index 100% rename from src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.ml rename to src/proto_022_PsRiotum/lib_baker/baker_commands_helpers.ml diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.mli b/src/proto_022_PsRiotum/lib_baker/baker_commands_helpers.mli similarity index 100% rename from src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.mli rename to src/proto_022_PsRiotum/lib_baker/baker_commands_helpers.mli diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/agnostic_baker_plugin.ml b/src/proto_022_PsRiotum/lib_baker/baker_plugin.ml similarity index 100% rename from src/proto_022_PsRiotum/lib_agnostic_baker/agnostic_baker_plugin.ml rename to src/proto_022_PsRiotum/lib_baker/baker_plugin.ml diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/dune b/src/proto_022_PsRiotum/lib_baker/dune similarity index 81% rename from src/proto_022_PsRiotum/lib_agnostic_baker/dune rename to src/proto_022_PsRiotum/lib_baker/dune index f1532f1d111c75a613cdcada3452813d6820ae65..b93d922581077765c913376591d852f427d7518d 100644 --- a/src/proto_022_PsRiotum/lib_agnostic_baker/dune +++ b/src/proto_022_PsRiotum/lib_baker/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_agnostic_baker_022_PsRiotum) - (public_name octez-protocol-022-PsRiotum-libs.agnostic-baker) + (name tezos_baker_022_PsRiotum) + (public_name octez-protocol-022-PsRiotum-libs.baker) (instrumentation (backend bisect_ppx)) (libraries octez-libs.base @@ -20,4 +20,4 @@ -open Tezos_protocol_022_PsRiotum -open Tezos_baking_022_PsRiotum -open Tezos_baking_022_PsRiotum_commands - -open Octez_agnostic_baker)) + -open Octez_baker)) diff --git a/src/proto_022_PsRiotum/lib_plugin/index.mld b/src/proto_022_PsRiotum/lib_plugin/index.mld index fb9418b42a379231dd1059940e0d74131afffe60..74c73df97139f614dc286cf2b23bbca5f63386dd 100644 --- a/src/proto_022_PsRiotum/lib_plugin/index.mld +++ b/src/proto_022_PsRiotum/lib_plugin/index.mld @@ -5,7 +5,7 @@ This is a package containing some libraries related to the Tezos 022-PsRiotum pr It contains the following libraries: - {{!module-Tezos_022_PsRiotum_test_helpers}Tezos_022_PsRiotum_test_helpers}: Protocol testing framework -- {{!module-Tezos_agnostic_baker_022_PsRiotum}Tezos_agnostic_baker_022_PsRiotum}: Protocol specific library for the Agnostic Baker +- {{!module-Tezos_baker_022_PsRiotum}Tezos_baker_022_PsRiotum}: Protocol specific library for the Agnostic Baker - {{!module-Tezos_baking_022_PsRiotum}Tezos_baking_022_PsRiotum}: Base library for `tezos-baker/accuser` - {{!module-Tezos_baking_022_PsRiotum_commands}Tezos_baking_022_PsRiotum_commands}: Protocol-specific commands for baking - {{!module-Tezos_client_022_PsRiotum}Tezos_client_022_PsRiotum}: Protocol specific library for `octez-client` diff --git a/src/proto_alpha/lib_agnostic_baker/accuser_commands_helpers.ml b/src/proto_alpha/lib_baker/accuser_commands_helpers.ml similarity index 100% rename from src/proto_alpha/lib_agnostic_baker/accuser_commands_helpers.ml rename to src/proto_alpha/lib_baker/accuser_commands_helpers.ml diff --git a/src/proto_alpha/lib_agnostic_baker/baker_args_parser.ml b/src/proto_alpha/lib_baker/baker_args_parser.ml similarity index 100% rename from src/proto_alpha/lib_agnostic_baker/baker_args_parser.ml rename to src/proto_alpha/lib_baker/baker_args_parser.ml diff --git a/src/proto_alpha/lib_agnostic_baker/baker_args_parser.mli b/src/proto_alpha/lib_baker/baker_args_parser.mli similarity index 100% rename from src/proto_alpha/lib_agnostic_baker/baker_args_parser.mli rename to src/proto_alpha/lib_baker/baker_args_parser.mli diff --git a/src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.ml b/src/proto_alpha/lib_baker/baker_commands_helpers.ml similarity index 100% rename from src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.ml rename to src/proto_alpha/lib_baker/baker_commands_helpers.ml diff --git a/src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.mli b/src/proto_alpha/lib_baker/baker_commands_helpers.mli similarity index 100% rename from src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.mli rename to src/proto_alpha/lib_baker/baker_commands_helpers.mli diff --git a/src/proto_alpha/lib_agnostic_baker/agnostic_baker_plugin.ml b/src/proto_alpha/lib_baker/baker_plugin.ml similarity index 100% rename from src/proto_alpha/lib_agnostic_baker/agnostic_baker_plugin.ml rename to src/proto_alpha/lib_baker/baker_plugin.ml diff --git a/src/proto_alpha/lib_agnostic_baker/dune b/src/proto_alpha/lib_baker/dune similarity index 81% rename from src/proto_alpha/lib_agnostic_baker/dune rename to src/proto_alpha/lib_baker/dune index 9f441e2c15ff291f2540e3ab44eec0e8f41e413e..b343c560a74da2817252e1f3c10c3611f4616434 100644 --- a/src/proto_alpha/lib_agnostic_baker/dune +++ b/src/proto_alpha/lib_baker/dune @@ -2,8 +2,8 @@ ; Edit file manifest/main.ml instead. (library - (name tezos_agnostic_baker_alpha) - (public_name octez-protocol-alpha-libs.agnostic-baker) + (name tezos_baker_alpha) + (public_name octez-protocol-alpha-libs.baker) (instrumentation (backend bisect_ppx)) (libraries octez-libs.base @@ -20,4 +20,4 @@ -open Tezos_protocol_alpha -open Tezos_baking_alpha -open Tezos_baking_alpha_commands - -open Octez_agnostic_baker)) + -open Octez_baker)) diff --git a/src/proto_alpha/lib_plugin/index.mld b/src/proto_alpha/lib_plugin/index.mld index 3d4d386ddbe3ffe9e1c352e54ad8296e53a388ce..eb4888cf5179a45fa5cec22e1b053a4eab500075 100644 --- a/src/proto_alpha/lib_plugin/index.mld +++ b/src/proto_alpha/lib_plugin/index.mld @@ -4,8 +4,8 @@ This is a package containing some libraries related to the Tezos alpha protocol. It contains the following libraries: -- {{!module-Tezos_agnostic_baker_alpha}Tezos_agnostic_baker_alpha}: Protocol specific library for the Agnostic Baker - {{!module-Tezos_alpha_test_helpers}Tezos_alpha_test_helpers}: Protocol testing framework +- {{!module-Tezos_baker_alpha}Tezos_baker_alpha}: Protocol specific library for the Agnostic Baker - {{!module-Tezos_baking_alpha}Tezos_baking_alpha}: Base library for `tezos-baker/accuser` - {{!module-Tezos_baking_alpha_commands}Tezos_baking_alpha_commands}: Protocol-specific commands for baking - {{!module-Tezos_client_alpha}Tezos_client_alpha}: Protocol specific library for `octez-client` diff --git a/tezt/lib_tezos/agnostic_baker.ml b/tezt/lib_tezos/baker.ml similarity index 66% rename from tezt/lib_tezos/agnostic_baker.ml rename to tezt/lib_tezos/baker.ml index fae476c2df55091ae7aed3d5e4773589839278a9..114478e516340815f8080bf02795a09cfa22f4a8 100644 --- a/tezt/lib_tezos/agnostic_baker.ml +++ b/tezt/lib_tezos/baker.ml @@ -22,8 +22,7 @@ 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]. *) +(* This is hard-coded after the same value from [Daemon] module from [src/lib_baker]. *) let extra_levels_for_old_baker = 3 module Parameters = struct @@ -49,7 +48,7 @@ module Parameters = struct type session_state = {mutable ready : bool} - let base_default_name = "agnostic-baker" + let base_default_name = "baker" let default_colors = Log.Color.[|FG.green|] end @@ -57,16 +56,16 @@ end open Parameters include Daemon.Make (Parameters) -let trigger_ready agnostic_baker value = - let pending = agnostic_baker.persistent_state.pending_ready in - agnostic_baker.persistent_state.pending_ready <- [] ; +let trigger_ready baker value = + let pending = baker.persistent_state.pending_ready in + baker.persistent_state.pending_ready <- [] ; List.iter (fun pending -> Lwt.wakeup_later pending value) pending -let set_ready agnostic_baker = - (match agnostic_baker.status with +let set_ready baker = + (match baker.status with | Not_running -> () | Running status -> status.session_state.ready <- true) ; - trigger_ready agnostic_baker (Some ()) + trigger_ready baker (Some ()) let liquidity_baking_votefile ?path vote = let votefile = @@ -89,8 +88,8 @@ let enable_remote_mode = | Some _ -> Some false | _ -> None -let create_from_uris ?runner ?(path = Uses.path Constant.octez_agnostic_baker) - ?name ?color ?event_pipe ?(delegates = []) ?votefile +let create_from_uris ?runner ?(path = Uses.path Constant.octez_baker) ?name + ?color ?event_pipe ?(delegates = []) ?votefile ?(liquidity_baking_toggle_vote = Some Pass) ?force_apply_from_round ?remote_mode ?operations_pool ?dal_node_rpc_endpoint ?dal_node_timeout_percentage ?(state_recorder = false) @@ -101,34 +100,31 @@ let create_from_uris ?runner ?(path = Uses.path Constant.octez_agnostic_baker) remote_mode ~default:(Option.value enable_remote_mode ~default:false) in - let agnostic_baker = - create - ~path - ?name - ?color - ?event_pipe - ?runner - { - delegates; - runner; - base_dir; - node_data_dir; - node_rpc_endpoint; - pending_ready = []; - votefile; - liquidity_baking_toggle_vote; - force_apply_from_round; - remote_mode; - operations_pool; - dal_node_rpc_endpoint; - dal_node_timeout_percentage; - state_recorder; - node_version_check_bypass; - node_version_allowed; - keep_alive; - } - in - agnostic_baker + create + ~path + ?name + ?color + ?event_pipe + ?runner + { + delegates; + runner; + base_dir; + node_data_dir; + node_rpc_endpoint; + pending_ready = []; + votefile; + liquidity_baking_toggle_vote; + force_apply_from_round; + remote_mode; + operations_pool; + dal_node_rpc_endpoint; + dal_node_timeout_percentage; + state_recorder; + node_version_check_bypass; + node_version_allowed; + keep_alive; + } let handle_event node ({name; _} : event) = match name with "starting_daemon.v0" -> set_ready node | _ -> () @@ -139,7 +135,7 @@ let create ?runner ?path ?name ?color ?event_pipe ?(delegates = []) ?votefile ?dal_node_timeout_percentage ?(state_recorder = false) ?(node_version_check_bypass = false) ?node_version_allowed ?keep_alive node client = - let agnostic_baker = + let baker = create_from_uris ?runner ?path @@ -163,27 +159,22 @@ let create ?runner ?path ?name ?color ?event_pipe ?(delegates = []) ?votefile ?keep_alive () in - on_event agnostic_baker (handle_event agnostic_baker) ; - agnostic_baker + on_event baker (handle_event baker) ; + baker -let run_args agnostic_baker = - let delegates = agnostic_baker.persistent_state.delegates in - let node_data_dir = agnostic_baker.persistent_state.node_data_dir in - let base_dir = agnostic_baker.persistent_state.base_dir in - let node_addr = - Endpoint.as_string agnostic_baker.persistent_state.node_rpc_endpoint - in +let run_args baker = + let delegates = baker.persistent_state.delegates in + let node_data_dir = baker.persistent_state.node_data_dir in + let base_dir = baker.persistent_state.base_dir in + let node_addr = Endpoint.as_string baker.persistent_state.node_rpc_endpoint in let votefile = - Cli_arg.optional_arg - "votefile" - Fun.id - agnostic_baker.persistent_state.votefile + Cli_arg.optional_arg "votefile" Fun.id baker.persistent_state.votefile in let liquidity_baking_toggle_vote = Cli_arg.optional_arg "liquidity-baking-toggle-vote" liquidity_baking_vote_to_string - agnostic_baker.persistent_state.liquidity_baking_toggle_vote + baker.persistent_state.liquidity_baking_toggle_vote in let force_apply_from_round = (* From Protocol Q, the flag --force-apply has been replaced by @@ -192,54 +183,50 @@ let run_args agnostic_baker = Cli_arg.optional_arg "force-apply-from-round" string_of_int - agnostic_baker.persistent_state.force_apply_from_round + baker.persistent_state.force_apply_from_round in let operations_pool = Cli_arg.optional_arg "operations-pool" Fun.id - agnostic_baker.persistent_state.operations_pool + baker.persistent_state.operations_pool in let dal_node_endpoint = Cli_arg.optional_arg "dal-node" Endpoint.as_string - agnostic_baker.persistent_state.dal_node_rpc_endpoint + baker.persistent_state.dal_node_rpc_endpoint in let without_dal = Cli_arg.optional_switch "without-dal" - (Option.is_none agnostic_baker.persistent_state.dal_node_rpc_endpoint) + (Option.is_none baker.persistent_state.dal_node_rpc_endpoint) in let dal_node_timeout_percentage = Cli_arg.optional_arg "dal-node-timeout-percentage" string_of_int - agnostic_baker.persistent_state.dal_node_timeout_percentage + baker.persistent_state.dal_node_timeout_percentage in let state_recorder = - Cli_arg.optional_switch - "record-state" - agnostic_baker.persistent_state.state_recorder + Cli_arg.optional_switch "record-state" baker.persistent_state.state_recorder in let node_version_check_bypass = Cli_arg.optional_switch "node-version-check-bypass" - agnostic_baker.persistent_state.node_version_check_bypass + baker.persistent_state.node_version_check_bypass in let node_version_allowed = Cli_arg.optional_arg "node-version-allowed" Fun.id - agnostic_baker.persistent_state.node_version_allowed + baker.persistent_state.node_version_allowed in let keep_alive = - Cli_arg.optional_switch - "keep-alive" - agnostic_baker.persistent_state.keep_alive + Cli_arg.optional_switch "keep-alive" baker.persistent_state.keep_alive in let run_args = - if agnostic_baker.persistent_state.remote_mode then ["remotely"] + if baker.persistent_state.remote_mode then ["remotely"] else ["with"; "local"; "node"; node_data_dir] in ["--endpoint"; node_addr; "--base-dir"; base_dir; "run"] @@ -249,63 +236,59 @@ let run_args agnostic_baker = @ node_version_allowed @ keep_alive let run ?env ?event_level ?event_sections_levels ?(extra_arguments = []) - (agnostic_baker : t) = - (match agnostic_baker.status with + (baker : t) = + (match baker.status with | Not_running -> () - | Running _ -> - Test.fail "agnostic_baker %s is already running" agnostic_baker.name) ; + | Running _ -> Test.fail "baker %s is already running" baker.name) ; let on_terminate _ = (* Cancel all [Ready] event listeners. *) - trigger_ready agnostic_baker None ; + trigger_ready baker None ; unit in run ?env ?event_level ?event_sections_levels - agnostic_baker + baker {ready = false} - (run_args agnostic_baker @ extra_arguments) + (run_args baker @ extra_arguments) ~on_terminate - ?runner:agnostic_baker.persistent_state.runner + ?runner:baker.persistent_state.runner -let spawn_run ?env (agnostic_baker : t) = - (match agnostic_baker.status with +let spawn_run ?env (baker : t) = + (match baker.status with | Not_running -> () - | Running _ -> - Test.fail "agnostic_baker %s is already running" agnostic_baker.name) ; + | Running _ -> Test.fail "baker %s is already running" baker.name) ; Process.spawn ?env - ?runner:agnostic_baker.persistent_state.runner - agnostic_baker.path - (run_args agnostic_baker) + ?runner:baker.persistent_state.runner + baker.path + (run_args baker) -let check_event ?where agnostic_baker name promise = +let check_event ?where baker name promise = let* result = promise in match result with | None -> - raise - (Terminated_before_event - {daemon = agnostic_baker.name; event = name; where}) + raise (Terminated_before_event {daemon = baker.name; event = name; where}) | Some x -> return x -let wait_for_ready agnostic_baker = - match agnostic_baker.status with +let wait_for_ready baker = + match baker.status with | Running {session_state = {ready = true; _}; _} -> unit | Not_running | Running {session_state = {ready = false; _}; _} -> let promise, resolver = Lwt.task () in - agnostic_baker.persistent_state.pending_ready <- - resolver :: agnostic_baker.persistent_state.pending_ready ; - check_event agnostic_baker "agnostic baker started" promise + baker.persistent_state.pending_ready <- + resolver :: baker.persistent_state.pending_ready ; + check_event baker "baker started" promise -let init ?env ?runner ?(path = Uses.path Constant.octez_agnostic_baker) ?name - ?color ?event_level ?event_pipe ?event_sections_levels ?(delegates = []) - ?votefile ?liquidity_baking_toggle_vote ?force_apply_from_round ?remote_mode +let init ?env ?runner ?(path = Uses.path Constant.octez_baker) ?name ?color + ?event_level ?event_pipe ?event_sections_levels ?(delegates = []) ?votefile + ?liquidity_baking_toggle_vote ?force_apply_from_round ?remote_mode ?operations_pool ?dal_node_rpc_endpoint ?dal_node_timeout_percentage ?state_recorder ?node_version_check_bypass ?node_version_allowed ?keep_alive node client = let* () = Node.wait_for_ready node in - let agnostic_baker = + let baker = create ?runner ~path @@ -327,9 +310,9 @@ let init ?env ?runner ?(path = Uses.path Constant.octez_agnostic_baker) ?name node client in - let* () = run ?env ?event_level ?event_sections_levels agnostic_baker in - let* () = wait_for_ready agnostic_baker in - return agnostic_baker + let* () = run ?env ?event_level ?event_sections_levels baker in + let* () = wait_for_ready baker in + return baker (** Logging helpers for baker events. *) diff --git a/tezt/lib_tezos/agnostic_baker.mli b/tezt/lib_tezos/baker.mli similarity index 100% rename from tezt/lib_tezos/agnostic_baker.mli rename to tezt/lib_tezos/baker.mli diff --git a/tezt/lib_tezos/constant.ml b/tezt/lib_tezos/constant.ml index a3eca961a7613919dc87a160652dda8a2fadc1ac..6d1e92bd1e73ac7397a224a549ee7a60b2d10a80 100644 --- a/tezt/lib_tezos/constant.ml +++ b/tezt/lib_tezos/constant.ml @@ -164,8 +164,7 @@ 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_baker = Uses.make ~tag:"baker" ~path:"./octez-baker" () (* TODO: tezos/tezos#4803 Can we do better than to depend on script-inputs? diff --git a/tezt/lib_tezos/vdf.ml b/tezt/lib_tezos/vdf.ml index 5557fef82d827d50d4226be460ef45d7b22f2c94..643712184d63da2dba0ce3221798ad649ce58d18 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 Constant.octez_agnostic_baker) + ~path:(Uses.path Constant.octez_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 ace14c19a5b7771471176c808c542bca586b3bd7..f16d10d6e24f206e0b08b62766bcc53f0c255335 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 @@ -12,7 +12,7 @@ accuser_psquebec: octez-accuser-PsQuebec accuser_psriotum: octez-accuser-PsRiotum accuser_alpha: octez-accuser-alpha admin_client: octez-admin-client -agnostic_baker: octez-baker +baker: octez-baker baker_psquebec: octez-baker-PsQuebec baker_psriotum: octez-baker-PsRiotum baker_alpha: octez-baker-alpha diff --git a/tezt/lib_wrapper/tezt_wrapper.ml b/tezt/lib_wrapper/tezt_wrapper.ml index abb483e68704b2a156388467ff592787a379c091..d63a3717f80524ec0dfbe9b107b73bcd2b144217 100644 --- a/tezt/lib_wrapper/tezt_wrapper.ml +++ b/tezt/lib_wrapper/tezt_wrapper.ml @@ -57,7 +57,7 @@ module Uses = struct let octez_admin_client = make ~tag:"admin_client" ~path:"./octez-admin-client" () - let octez_agnostic_baker = make ~tag:"agnostic_baker" ~path:"./octez-baker" () + let octez_baker = make ~tag:"baker" ~path:"./octez-baker" () let register_meta_test () = Regression.register diff --git a/tezt/lib_wrapper/tezt_wrapper.mli b/tezt/lib_wrapper/tezt_wrapper.mli index b479221c1d1fe68a186fc87b920eb60edbbf64f6..aca37f6fbd785fca799c606b0f9ecf08cf59da72 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"], with tag ["agnostic_baker"]. *) - val octez_agnostic_baker : t + (** ["./octez-baker"], with tag ["baker"]. *) + val octez_baker : t (** Register a test that generates: {[ diff --git a/tezt/long_tests/tenderbake.ml b/tezt/long_tests/tenderbake.ml index 1b01a066646a6cb0d0b35268a4d65e7ab5a66b3b..8fcea969d8317e70d5fba1b779ee688d7ea9244d 100644 --- a/tezt/long_tests/tenderbake.ml +++ b/tezt/long_tests/tenderbake.ml @@ -180,8 +180,7 @@ end module Sandbox = struct type state = { - mutable daemons : - (Node.t * Agnostic_baker.t option * Client.t option) array; + mutable daemons : (Node.t * Baker.t option * Client.t option) array; mutable delegates : Account.key Inf.t; } @@ -219,10 +218,8 @@ module Sandbox = struct | node, _, _ -> let* client = Client.init ~endpoint:(Client.Node node) () in let delegates = [get_delegate st] in - let baker = Agnostic_baker.create node client ~delegates in - let* () = - if run_baker then Agnostic_baker.run baker else Lwt.return_unit - in + let baker = Baker.create node client ~delegates in + let* () = if run_baker then Baker.run baker else Lwt.return_unit in st.daemons.(h) <- (node, Some baker, Some client) ; return (client, baker) @@ -236,7 +233,7 @@ module Sandbox = struct (Invalid_argument (sf "remove_baker_from_node: node %d has no baker" h)) | node, Some baker, client_opt -> - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in st.daemons.(h) <- (node, None, client_opt) ; return baker @@ -250,16 +247,14 @@ 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 (Agnostic_baker.name baker) ; + Log.info "Creating baker #%d (%s)" handle (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:Agnostic_baker.terminate baker_opt - in + and* () = Option.fold ~none:unit ~some:Baker.terminate baker_opt in unit) (Array.to_list st.daemons) end @@ -326,7 +321,7 @@ module Rounds = struct ~title:test ~tags:["tenderbake"; "basic"] ~team - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] ~executors ~timeout:(Long_test.Seconds (repeat * 8 * timeout)) @@ fun () -> @@ -360,7 +355,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 Agnostic_baker.run bakers in + let* () = Lwt_list.iter_p Baker.run bakers in let* parameter_file = write_parameter_file @@ -483,7 +478,7 @@ module Long_dynamic_bake = struct ~title:(test topology) ~tags:["tenderbake"; "dynamic"; string_of_topology topology] ~team - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] ~executors ~timeout:(Long_test.Seconds (repeat * 8 * timeout)) @@ fun () -> @@ -527,7 +522,7 @@ module Long_dynamic_bake = struct let* () = Cluster.start ~wait_connections:true nodes in Log.info "Starting bakers" ; - let* () = Lwt_list.iter_p Agnostic_baker.run bakers in + let* () = Lwt_list.iter_p Baker.run bakers in Log.info "Activating protocol" ; let* () = @@ -553,7 +548,7 @@ module Long_dynamic_bake = struct "Cycle %d (head level %d): killed baker %s from handle #%d" cycle head_level - (Agnostic_baker.name killed_baker) + (Baker.name killed_baker) dead_baker_handle' ; let revive_delay = 1.0 in @@ -568,7 +563,7 @@ module Long_dynamic_bake = struct "Cycle %d (head level %d): added baker %s to handle #%d" cycle head_level - (Agnostic_baker.name new_baker) + (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 e203a75ea5dfb54400b5dc1e3e4a794ae0826912..6f276be51b81e60e13decc30a6bc89d958b38b10 100644 --- a/tezt/manual_tests/baker_test.ml +++ b/tezt/manual_tests/baker_test.ml @@ -111,8 +111,8 @@ let baker_early_preattestation_test = Protocol.register_test ~__FILE__ ~title:"Test baker early pre-attestation" - ~tags:["node"; "agnostic_baker"; "early"; "preattestation"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~tags:["node"; "early"; "preattestation"] + ~uses:(fun _protocol -> [Constant.octez_baker]) ~supports:(Protocol.From_protocol 16) @@ fun protocol -> Log.info @@ -184,7 +184,7 @@ let baker_early_preattestation_test = pp_list baker1_delegates_alias ; let* baker1 = - Agnostic_baker.init + Baker.init ~delegates: (List.map (fun (bootstrap : Account.key) -> bootstrap.public_key_hash) @@ -199,7 +199,7 @@ let baker_early_preattestation_test = pp_list baker2_delegates_alias ; let* baker2 = - Agnostic_baker.init + Baker.init ~event_sections_levels: [ ( String.concat @@ -248,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. " - (Agnostic_baker.name baker1) + (Baker.name baker1) prev_lvl test_lvl - (Agnostic_baker.name baker2) + (Baker.name baker2) test_lvl ; let* baking_rights_prev_lvl = recover_baking_rights ~max_round:1 client1 prev_lvl @@ -279,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" - (Agnostic_baker.name baker2) + (Baker.name baker2) prev_lvl ; let is_proposed = ref false in - let baker_on_event resolver Agnostic_baker.{name; value; timestamp = _} = + let baker_on_event resolver Baker.{name; value; timestamp = _} = match name with | "new_valid_proposal.v0" -> let level = JSON.(value |-> "level" |> as_int) in @@ -295,7 +295,7 @@ let baker_early_preattestation_test = | _ -> () in let baker_t, baker_u = Lwt.task () in - Agnostic_baker.on_event baker2 (baker_on_event baker_u) ; + Baker.on_event baker2 (baker_on_event baker_u) ; let* () = baker_t in Log.info @@ -325,16 +325,16 @@ let baker_early_preattestation_test = Log.info "Stop the %s once these operations are included in the %s mempool." - (Agnostic_baker.name baker1) + (Baker.name baker1) (Node.name node1) ; - let* () = Agnostic_baker.stop baker1 in + let* () = Baker.stop baker1 in Log.info "Wait for %s to propose a block at level:%d round 1." - (Agnostic_baker.name baker2) + (Baker.name baker2) prev_lvl ; let is_proposed = ref false in - let baker_on_event resolver Agnostic_baker.{name; value; timestamp = _} = + let baker_on_event resolver Baker.{name; value; timestamp = _} = match name with | "new_valid_proposal.v0" -> let level = JSON.(value |-> "level" |> as_int) in @@ -347,12 +347,12 @@ let baker_early_preattestation_test = | _ -> () in let baker_t, baker_u = Lwt.task () in - Agnostic_baker.on_event baker2 (baker_on_event baker_u) ; + 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 - Agnostic_baker.{name; value; timestamp = _} = + Baker.{name; value; timestamp = _} = match name with | "new_valid_proposal.v0" -> let block = JSON.(value |-> "block" |> as_string) in @@ -440,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 - Agnostic_baker.on_event + Baker.on_event baker1 (baker_on_event ~log:true status1 preattestation_u1 pqc_u1 attestations_u1) ; @@ -450,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 - Agnostic_baker.on_event + 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." - (Agnostic_baker.name baker1) + (Baker.name baker1) test_lvl ; - let* _baker = Agnostic_baker.continue baker1 in + let* _baker = Baker.continue baker1 in let preattestation_should_be_validated = Protocol.(number protocol > 16) in @@ -479,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" - (Agnostic_baker.name baker1) + (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 b0c95e0d6c114da53bcf4118c255946f0cf7c758..d89e9bd1ea2c90a860aa062754762721108626a9 100644 --- a/tezt/manual_tests/dal.ml +++ b/tezt/manual_tests/dal.ml @@ -402,8 +402,8 @@ let baker_scenario ?baker_sk ~airdropper_alias client dal_node l1_node = after it is declared as delegate. *) let* () = stake_or_unstake_half_balance client ~baker_alias in let dal_node_rpc_endpoint = Dal_node.as_rpc_endpoint dal_node in - let baker = Agnostic_baker.create ~dal_node_rpc_endpoint l1_node client in - let* () = Agnostic_baker.run baker in + let baker = Baker.create ~dal_node_rpc_endpoint l1_node client in + let* () = Baker.run baker in Lwt_unix.sleep Float.max_float (** A slots injector test parameterized by a network. Typically, to run a slot @@ -458,7 +458,7 @@ let baker_test ~network = ~__FILE__ ~title:(sf "Join %s and bake" network) ~tags:[Tag.tezos2; "dal"; "baker"; network] - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] @@ fun () -> let baker_sk = Cli.get_string_opt "baker-sk" in let dal_bootstrap_peers = diff --git a/tezt/tests/agnostic_baker_test.ml b/tezt/tests/agnostic_baker_test.ml index 6d85078e84cf58c1c0fcdc1cef0ef15460aadf25..16230e657aae6705000b847a4b21bb97fc74361b 100644 --- a/tezt/tests/agnostic_baker_test.ml +++ b/tezt/tests/agnostic_baker_test.ml @@ -24,18 +24,14 @@ let team = Tag.layer1 let wait_for_active_protocol_waiting agnostic_baker = - Agnostic_baker.wait_for - agnostic_baker - "waiting_for_active_protocol.v0" - (fun _json -> Some ()) + Baker.wait_for agnostic_baker "waiting_for_active_protocol.v0" (fun _json -> + Some ()) let wait_for_become_old_baker agnostic_baker = - Agnostic_baker.wait_for agnostic_baker "become_old_agent.v0" (fun _json -> - Some ()) + Baker.wait_for agnostic_baker "become_old_agent.v0" (fun _json -> Some ()) let wait_for_stopping_baker agnostic_baker = - Agnostic_baker.wait_for agnostic_baker "stopping_agent.v0" (fun _json -> - Some ()) + Baker.wait_for agnostic_baker "stopping_agent.v0" (fun _json -> Some ()) let remote_sign client = let* () = Client.forget_all_keys client in @@ -65,14 +61,14 @@ let perform_protocol_migration ?node_name ?client_name ?parameter_file in let* () = if use_remote_signer then remote_sign client else unit in Log.info "Node %s initialized" (Node.name node) ; - let baker = Agnostic_baker.create node client in + let baker = Baker.create node client in let wait_for_active_protocol_waiting = wait_for_active_protocol_waiting baker in Log.info "Starting agnostic baker" ; - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* () = wait_for_active_protocol_waiting in - let* () = Agnostic_baker.wait_for_ready baker in + let* () = Baker.wait_for_ready baker in let* () = Client.activate_protocol ~protocol:migrate_from @@ -112,17 +108,15 @@ let perform_protocol_migration ?node_name ?client_name ?parameter_file Log.info "Check that baker for protocol %s is killed after %d levels" (Protocol.tag migrate_from) - Agnostic_baker.extra_levels_for_old_baker ; + Baker.extra_levels_for_old_baker ; let wait_for_stopping_baker = wait_for_stopping_baker baker in let* _level = - Node.wait_for_level - node - (migration_level + Agnostic_baker.extra_levels_for_old_baker) + Node.wait_for_level node (migration_level + Baker.extra_levels_for_old_baker) in let* () = wait_for_stopping_baker in (* Test that we can still bake after migration *) let* _level = Node.wait_for_level node baked_blocks_after_migration in - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in unit let migrate ~migrate_from ~migrate_to ~use_remote_signer = @@ -150,7 +144,7 @@ let migrate ~migrate_from ~migrate_to ~use_remote_signer = Protocol.tag migrate_from; Protocol.tag migrate_to; ] - ~uses:([Constant.octez_agnostic_baker] @ remote_signer) + ~uses:([Constant.octez_baker] @ remote_signer) @@ fun () -> let blocks_per_cycle = JSON.(get "blocks_per_cycle" parameters |> as_int) in let consensus_rights_delay = @@ -176,12 +170,12 @@ let test_start_and_stop () = ~__FILE__ ~title:"Agnostic baker starts and stops" ~tags:[team; "sandbox"; "agnostic"; "baker"; "init"] - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] @@ fun () -> let* node, client = Client.init_with_node `Client () in - let* baker = Agnostic_baker.init node client in - let* () = Agnostic_baker.wait_for_ready baker in - let* () = Agnostic_baker.terminate baker in + let* baker = Baker.init node client in + let* () = Baker.wait_for_ready baker in + let* () = Baker.terminate baker in unit let test_man () = @@ -189,19 +183,15 @@ let test_man () = ~__FILE__ ~title:"Agnostic baker man" ~tags:[team; "sandbox"; "agnostic"; "baker"; "man"] - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] ~uses_node:false ~uses_client:false ~uses_admin_client:false @@ fun () -> let hooks = Tezos_regression.hooks in - let* () = Process.run ~hooks (Uses.path Constant.octez_agnostic_baker) [] in - let* () = - Process.run ~hooks (Uses.path Constant.octez_agnostic_baker) ["--help"] - in - let* () = - Process.run ~hooks (Uses.path Constant.octez_agnostic_baker) ["man"] - in + let* () = Process.run ~hooks (Uses.path Constant.octez_baker) [] in + let* () = Process.run ~hooks (Uses.path Constant.octez_baker) ["--help"] in + let* () = Process.run ~hooks (Uses.path Constant.octez_baker) ["man"] in unit let test_keep_alive = @@ -209,13 +199,13 @@ let test_keep_alive = ~__FILE__ ~title:"Agnostic baker --keep-alive" ~tags:[team; "sandbox"; "agnostic"; "baker"; "keep_alive"] - ~uses:(fun _ -> [Constant.octez_agnostic_baker]) + ~uses:(fun _ -> [Constant.octez_baker]) @@ fun protocol -> let* node, client = Client.init_with_protocol ~protocol `Client () in (* Provide a delegate with no voting power to avoid baking blocks with the baker and the client simultaneously. *) let baker = - Agnostic_baker.create + Baker.create ~delegates:[Constant.activator.public_key_hash] ~node_version_check_bypass:true node @@ -223,18 +213,18 @@ let test_keep_alive = in let* () = Node.terminate node in (* Start the baker with no node running and no [--keep-alive], it crashes. *) - let process = Agnostic_baker.spawn_run baker in + let process = Baker.spawn_run baker in let* () = Process.check_error ~msg:(rex "Cannot connect to node") process in (* Start the baker with no node running and [--keep-alive], it'll wait. *) let wait_for_cannot_connect = - Agnostic_baker.wait_for baker "cannot_connect.v0" (fun _json -> Some ()) + Baker.wait_for baker "cannot_connect.v0" (fun _json -> Some ()) in - let* () = Agnostic_baker.run ~extra_arguments:["--keep-alive"] baker + let* () = Baker.run ~extra_arguments:["--keep-alive"] baker and* () = wait_for_cannot_connect in (* Start the node. *) let f_wait_for_chain_id () = (* This is an event emitted by the baker lib. *) - Agnostic_baker.wait_for baker "node_chain_id.v0" (fun _json -> Some ()) + Baker.wait_for baker "node_chain_id.v0" (fun _json -> Some ()) in let wait_for_chain_id = f_wait_for_chain_id () in let* () = Node.run node [] @@ -243,11 +233,11 @@ let test_keep_alive = (* Bake a block, the baker is connected so it'll see it. *) let f_wait_baker_proposal () = (* This is an event emitted by the baker lib. *) - Agnostic_baker.wait_for baker "new_valid_proposal.v0" (fun _json -> Some ()) + Baker.wait_for baker "new_valid_proposal.v0" (fun _json -> Some ()) in let f_wait_period_status () = (* This is an event emitted by the agnostic baker. *) - Agnostic_baker.wait_for baker "period_status.v0" (fun _json -> Some ()) + Baker.wait_for baker "period_status.v0" (fun _json -> Some ()) in let wait_baker_proposal = f_wait_baker_proposal () in let wait_period_status = f_wait_period_status () in @@ -273,7 +263,7 @@ 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 ( + if 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 () diff --git a/tezt/tests/baker_operations_cli_options.ml b/tezt/tests/baker_operations_cli_options.ml index f592aac7062c0abb87fcfa4a64d23bbc7ae57563..ad93366b8f1839d45d5020ef469132a03d56d6d3 100644 --- a/tezt/tests/baker_operations_cli_options.ml +++ b/tezt/tests/baker_operations_cli_options.ml @@ -338,7 +338,7 @@ let test_baker_external_operations = ~__FILE__ ~title:"Baker external operations" ~tags:[Tag.layer1; "baker"; "external"; "operations"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Init" ; let node_args = Node.[Synchronisation_threshold 0] in @@ -418,7 +418,7 @@ let test_baker_external_operations = Lwt_unix.sleep (float_of_int (minimal_block_delay + delay_increment_per_round)) in - let* _baker = Agnostic_baker.init ~operations_pool node client in + let* _baker = Baker.init ~operations_pool node client in (* Wait until we have seen enough blocks. This should not take much time. *) Log.info "Wait until high enough level" ; let* (_ : int) = Node.wait_for_level node (level + 1) in @@ -473,8 +473,8 @@ let test_baker_state_recorder protocol state_recorder = let* level = Node.get_level node in (* Initialise a baker *) let* _baker = - if state_recorder then Agnostic_baker.init ~state_recorder node client - else Agnostic_baker.init node client + if state_recorder then Baker.init ~state_recorder node client + else Baker.init node client in (* Wait for chain to process the empty block *) let* (_ : int) = Node.wait_for_level node (level + 1) in @@ -501,7 +501,7 @@ let test_baker_state_recorder_memory = ~__FILE__ ~title:"Baker state recorder - memory case" ~tags:[Tag.layer1; "baker"; "state"; "recorder"; "memory"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> test_baker_state_recorder protocol false let test_baker_state_recorder_filesystem = @@ -509,7 +509,7 @@ let test_baker_state_recorder_filesystem = ~__FILE__ ~title:"Baker state recorder - filesystem case" ~tags:[Tag.layer1; "baker"; "state"; "recorder"; "filesystem"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> test_baker_state_recorder protocol true let register ~protocols = diff --git a/tezt/tests/baker_test.ml b/tezt/tests/baker_test.ml index 698640f0cc5e2c261c915ab5f04b132fe73b0d0f..1bd232fa093feff0c4db57389004a88a04439e86 100644 --- a/tezt/tests/baker_test.ml +++ b/tezt/tests/baker_test.ml @@ -70,17 +70,14 @@ let check_node_version_check_bypass_test = ~title:"baker node version check bypass test" ~tags:[team; "node"; "baker"] ~supports:Protocol.(From_protocol 021) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let* node, client = Client.init_with_protocol `Client ~protocol () in - let baker = - Agnostic_baker.create ~node_version_check_bypass:true node client - in + let baker = Baker.create ~node_version_check_bypass:true node client in let check_bypassed_event_promise = - Agnostic_baker.wait_for baker "node_version_check_bypass.v0" (fun _ -> - Some ()) + Baker.wait_for baker "node_version_check_bypass.v0" (fun _ -> Some ()) in - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* () = check_bypassed_event_promise in unit @@ -90,14 +87,11 @@ let check_node_version_allowed_test = ~title:"baker node version allowed test" ~tags:[team; "node"; "baker"] ~supports:Protocol.(From_protocol 022) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let* node, client = Client.init_with_protocol `Client ~protocol () in let* _baker = - Agnostic_baker.init - ~node_version_allowed:"octez-v7894.789:1a991a03" - node - client + Baker.init ~node_version_allowed:"octez-v7894.789:1a991a03" node client in unit @@ -107,11 +101,11 @@ let check_node_version_no_commit_allowed_test = ~title:"baker node version no commit allowed test" ~tags:[team; "node"; "baker"] ~supports:Protocol.(From_protocol 022) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let* node, client = Client.init_with_protocol `Client ~protocol () in let* _baker = - Agnostic_baker.init ~node_version_allowed:"octez-v7894.789" node client + Baker.init ~node_version_allowed:"octez-v7894.789" node client in unit @@ -120,7 +114,7 @@ let baker_reward_test = ~__FILE__ ~title:"Baker rewards" ~tags:[team; "baker"; "rewards"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) (fun protocol -> let* parameter_file = Protocol.write_parameter_file @@ -136,9 +130,9 @@ let baker_reward_test = () in let level_2_promise = Node.wait_for_level node 2 in - let* baker = Agnostic_baker.init node client in + let* baker = Baker.init node client in Log.info "Wait for new head." ; - Agnostic_baker.log_events baker ; + Baker.log_events baker ; let* _ = level_2_promise in let* _ = Client.RPC.call ~hooks client @@ RPC.get_chain_block_metadata () @@ -163,9 +157,9 @@ let baker_test protocol ~keys = in let level_2_promise = Node.wait_for_level node 2 in let level_3_promise = Node.wait_for_level node 3 in - let* baker = Agnostic_baker.init node client in + let* baker = Baker.init node client in Log.info "Wait for new head." ; - Agnostic_baker.log_events baker ; + Baker.log_events baker ; let* _ = level_2_promise in Log.info "New head arrive level 2" ; let* _ = level_3_promise in @@ -177,7 +171,7 @@ let baker_simple_test = ~__FILE__ ~title:"baker test" ~tags:[team; "node"; "baker"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let* _ = baker_test protocol ~keys:(Account.Bootstrap.keys |> Array.to_list) @@ -189,12 +183,12 @@ let baker_stresstest = ~__FILE__ ~title:"baker stresstest" ~tags:[team; "node"; "baker"; "stresstest"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let* node, client = Client.init_with_protocol `Client ~protocol () ~timestamp:Now in - let* _ = Agnostic_baker.init node client in + let* _ = Baker.init node client in let* _ = Node.wait_for_level node 3 in (* Use a large tps, to have failing operations too *) let* () = Client.stresstest ~tps:25 ~transfers:100 client in @@ -206,12 +200,12 @@ let baker_stresstest_apply = ~__FILE__ ~title:"baker stresstest with forced application" ~tags:[team; "node"; "baker"; "stresstest"; "apply"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let* node, client = Client.init_with_protocol `Client ~protocol () ~timestamp:Now in - let* _ = Agnostic_baker.init ~force_apply_from_round:0 node client in + let* _ = Baker.init ~force_apply_from_round:0 node client in let* _ = Node.wait_for_level node 3 in (* Use a large tps, to have failing operations too *) let* () = Client.stresstest ~tps:25 ~transfers:100 client in @@ -297,12 +291,12 @@ let baker_remote_test = ~__FILE__ ~title:"Baker in RPC-only mode" ~tags:[team; "baker"; "remote"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let* node, client = Client.init_with_protocol `Client ~protocol () ~timestamp:Now in - let* _ = Agnostic_baker.init ~remote_mode:true node client in + let* _ = Baker.init ~remote_mode:true node client in let* _ = Node.wait_for_level node 3 in unit @@ -311,7 +305,7 @@ let baker_check_consensus_branch = ~__FILE__ ~title:"Baker check branch in consensus operations" ~tags:[team; "baker"; "grandparent"; "parent"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Init client and node with protocol %s" (Protocol.name protocol) ; let* node, client = @@ -320,9 +314,9 @@ let baker_check_consensus_branch = let target_level = 5 in Log.info "Start a baker and bake until level %d" target_level ; - let* baker = Agnostic_baker.init node client in + let* baker = Baker.init node client in let* _ = Node.wait_for_level node target_level in - let* () = Agnostic_baker.kill baker in + let* () = Baker.kill baker in Log.info "Retrieve mempool" ; let* mempool = @@ -359,7 +353,7 @@ let force_apply_from_round = ~title:"Baker check force apply from round" ~tags:[team; "baker"; "force_apply_from_round"] ~supports:Protocol.(From_protocol 021) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> log_step 1 "initialize a node and a client with protocol" ; let* node, client = @@ -398,15 +392,11 @@ let force_apply_from_round = delegate force_apply_from_round ; let* baker = - Agnostic_baker.init - ~force_apply_from_round - ~delegates:[delegate] - node - client + Baker.init ~force_apply_from_round ~delegates:[delegate] node client in (* fail if a block is applied at a round < [force_apply_from_round] *) - Agnostic_baker.on_event baker (fun Agnostic_baker.{name; value; _} -> + Baker.on_event baker (fun Baker.{name; value; _} -> if name = "forging_block.v0" then let round = JSON.(value |-> "round" |> as_int) in let level = JSON.(value |-> "level" |> as_int) in @@ -420,7 +410,7 @@ let force_apply_from_round = (* a promise that resolves on event forging_block when (force_apply = true && round = [round] && level = [level]) *) let forced_application_promise = - Agnostic_baker.wait_for baker "forging_block.v0" (fun json -> + Baker.wait_for baker "forging_block.v0" (fun json -> let round' = JSON.(json |-> "round" |> as_int) in let level' = JSON.(json |-> "level" |> as_int) in let force_apply = JSON.(json |-> "force_apply" |> as_bool) in @@ -628,7 +618,7 @@ let simple_attestations_aggregation = ~title:"Simple attestations aggregation" ~tags:[team; "baker"; "attestation"; "aggregation"] ~supports:Protocol.(From_protocol 023) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> log_step 1 "Initialize a node and a client with protocol" ; let consensus_rights_delay = 1 in @@ -698,7 +688,7 @@ let simple_attestations_aggregation = in (* Testing the baker automaton *) log_step 8 "Start a baker and wait until level 12" ; - let* _baker = Agnostic_baker.init ~delegates node client in + let* _baker = Baker.init ~delegates node client in let* _ = Node.wait_for_level node 12 in log_step 9 "Check consensus operations" ; let* () = @@ -714,7 +704,7 @@ let prequorum_check_levels = ~__FILE__ ~title:"prequorum monitoring check operations level" ~tags:[team; "prequorum"; "monitoring"; "check"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let parameter_file = Protocol.parameter_file ~constants:Constants_mainnet protocol @@ -739,13 +729,13 @@ let prequorum_check_levels = List.map (fun (account : Account.key) -> account.public_key_hash) in let* baker = - Agnostic_baker.init + Baker.init ~event_level:`Debug ~delegates:[Constant.activator.public_key_hash] node client in - Agnostic_baker.log_events ~max_length:1000 baker ; + Baker.log_events ~max_length:1000 baker ; let* () = Client.bake_for_and_wait ~node @@ -780,7 +770,7 @@ let prequorum_check_levels = unit in let wait_for_preattestations_received () = - Agnostic_baker.wait_for + Baker.wait_for baker "preattestations_received.v0" JSON.( @@ -833,7 +823,7 @@ let attestations_aggregation_on_reproposal = ~title:"Attestations aggregation on reproposal" ~tags:[team; "baker"; "attestation"; "aggregation"; "reproposal"] ~supports:Protocol.(From_protocol 023) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let consensus_rights_delay = 1 in let consensus_committee_size = 256 in @@ -879,10 +869,7 @@ let attestations_aggregation_on_reproposal = manually inject consensus operations to control the progression of consensus. *) let* _baker = - Agnostic_baker.init - ~delegates:[Constant.bootstrap5.public_key_hash] - node - client + Baker.init ~delegates:[Constant.bootstrap5.public_key_hash] node client in Log.info "Bake until BLS consensus keys are activated" ; let keys = diff --git a/tezt/tests/cloud/dal.ml b/tezt/tests/cloud/dal.ml index b216d705908e3795f694a00a57eebce921dde786..eaa2213906d9bdc1919e6f951571c4fdbcda3331 100644 --- a/tezt/tests/cloud/dal.ml +++ b/tezt/tests/cloud/dal.ml @@ -494,7 +494,7 @@ type bootstrap = { type baker = { node : Node.t; dal_node : Dal_node.t option; - baker : Agnostic_baker.t; + baker : Baker.t; account : Account.key; stake : int; } @@ -2578,7 +2578,7 @@ let init_baker ?stake cloud (configuration : configuration) ~bootstrap teztale in let* baker = let dal_node_rpc_endpoint = Option.map Dal_node.as_rpc_endpoint dal_node in - Agnostic_baker.Agent.init + Baker.Agent.init ~name:(Format.asprintf "baker-%d" i) ~delegates:[account.Account.alias] ~client @@ -3808,7 +3808,7 @@ let register (module Cli : Scenarios_cli.Dal) = [ "octez-dal-node"; "octez-client"; - Tezt_wrapper.Uses.path Constant.octez_agnostic_baker; + Tezt_wrapper.Uses.path Constant.octez_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 b99a3e7e39e8217590a854cf849887940ba8c076..5a44f928936501da48202271f9e176027f23b41b 100644 --- a/tezt/tests/cloud/layer1.ml +++ b/tezt/tests/cloud/layer1.ml @@ -416,7 +416,7 @@ type bootstrap = { type baker = { agent : Agent.t; node : Node.t; - baker : Agnostic_baker.t; + baker : Baker.t; accounts : string list; } @@ -451,10 +451,10 @@ let init_baker_i i (configuration : configuration) cloud ~peers (agent, node, name) in let* baker = - toplog "init_baker: Initialize agnostic baker" ; - let name = name ^ "-agnostic-baker" in - let* agnostic_baker = - Agnostic_baker.Agent.init + toplog "init_baker: Initialize baker" ; + let name = name ^ "-baker" in + let* baker = + Baker.Agent.init ~env:yes_crypto_env ~name ~delegates:(List.map (fun ({pkh; _} : baker_account) -> pkh) accounts) @@ -463,9 +463,9 @@ let init_baker_i i (configuration : configuration) cloud ~peers cloud agent in - let* () = Agnostic_baker.wait_for_ready agnostic_baker in + let* () = Baker.wait_for_ready baker in toplog "init_baker: %s is ready!" name ; - Lwt.return agnostic_baker + Lwt.return baker in Lwt.return { diff --git a/tezt/tests/cloud/tezos.ml b/tezt/tests/cloud/tezos.ml index 37398701c8df994b729abfe214f1bf17da87552b..02523fd02365552f953bd7d45d713d4cd06dfb20 100644 --- a/tezt/tests/cloud/tezos.ml +++ b/tezt/tests/cloud/tezos.ml @@ -444,13 +444,13 @@ module Client = struct end end -module Agnostic_baker = struct - include Agnostic_baker +module Baker = struct + include Baker module Agent = struct let init ?(group = "L1") ?env ?name ~delegates - ?(path = Uses.path Constant.octez_agnostic_baker) ~client - ?dal_node_rpc_endpoint ?dal_node_timeout_percentage node cloud agent = + ?(path = Uses.path Constant.octez_baker) ~client ?dal_node_rpc_endpoint + ?dal_node_timeout_percentage node cloud agent = let* path = Agent.copy agent ~source:path in let* () = Cloud.register_binary diff --git a/tezt/tests/dal.ml b/tezt/tests/dal.ml index a4eca97e9c976c6a91dc69bc81cffb59ea738c20..92818689acf6bfe74d829198ad8efb1012863285 100644 --- a/tezt/tests/dal.ml +++ b/tezt/tests/dal.ml @@ -2886,7 +2886,7 @@ let test_attester_with_daemon protocol parameters cryptobox node client dal_node let run_baker delegates target_level = let* baker = let dal_node_rpc_endpoint = Dal_node.as_rpc_endpoint dal_node in - Agnostic_baker.init + Baker.init ~event_sections_levels:[(Protocol.name protocol ^ ".baker", `Debug)] ~dal_node_rpc_endpoint ~delegates @@ -2895,7 +2895,7 @@ let test_attester_with_daemon protocol parameters cryptobox node client dal_node client in let* _ = Node.wait_for_level node target_level in - Agnostic_baker.terminate baker + Baker.terminate baker in (* Test goal: the published slot at levels in [first_level, intermediary_level - 1] @@ -3383,7 +3383,7 @@ let e2e_test_script ?expand_test:_ ?(beforehand_slot_injection = 1) "[e2e.start_baker] spawn a baker daemon with all bootstrap accounts@." ; let* _baker = let dal_node_rpc_endpoint = Dal_node.as_rpc_endpoint baker_dal_node in - Agnostic_baker.init ~dal_node_rpc_endpoint l1_node l1_client + Baker.init ~dal_node_rpc_endpoint l1_node l1_client in (* To be sure that we just moved to [start_dal_slots_level], we wait and extra @@ -3557,7 +3557,7 @@ let register_end_to_end_tests ~protocols = ~activation_timestamp:(Ago activation_timestamp) ~minimal_block_delay:(string_of_int block_delay) ~tags - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) title (e2e_test_script ~slot_index @@ -4154,13 +4154,12 @@ let test_baker_registers_profiles _protocol _parameters _cryptobox l1_node let* () = Dal_node.terminate dal_node in let baker = let dal_node_rpc_endpoint = Dal_node.as_rpc_endpoint dal_node in - Agnostic_baker.create ~dal_node_rpc_endpoint l1_node client ~delegates + Baker.create ~dal_node_rpc_endpoint l1_node client ~delegates in let wait_for_attestation_event = - Agnostic_baker.wait_for baker "failed_to_get_attestations.v0" (fun _json -> - Some ()) + Baker.wait_for baker "failed_to_get_attestations.v0" (fun _json -> Some ()) in - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* () = wait_for_attestation_event in let* _lvl = Node.wait_for_level l1_node 3 in @@ -4485,9 +4484,9 @@ let test_migration_accuser_issue ~migrate_from ~migrate_to = let baker = let dal_node_rpc_endpoint = Dal_node.as_rpc_endpoint dal_node in - Agnostic_baker.create ~dal_node_rpc_endpoint node client + Baker.create ~dal_node_rpc_endpoint node client in - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* _level = Node.wait_for_level node migration_level in Log.info "migrated to next protocol, starting a second DAL node accuser" ; @@ -4502,7 +4501,7 @@ let test_migration_accuser_issue ~migrate_from ~migrate_to = let* () = Dal_node.run accuser ~wait_ready:true in let* _level = Node.wait_for_level node last_level in - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in Lwt_list.iter_s (fun delegate -> @@ -4523,7 +4522,7 @@ let test_migration_accuser_issue ~migrate_from ~migrate_to = ~scenario ~tags ~description - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] ~activation_timestamp:Now ~operator_profiles:[slot_index] ~minimal_block_delay: @@ -4718,7 +4717,7 @@ let test_restart_dal_node _protocol dal_parameters _cryptobox node client in let* baker = let dal_node_rpc_endpoint = Dal_node.as_rpc_endpoint dal_node in - Agnostic_baker.init + Baker.init ~delegates:all_pkhs ~liquidity_baking_toggle_vote:(Some On) ~state_recorder:true @@ -4746,7 +4745,7 @@ let test_restart_dal_node _protocol dal_parameters _cryptobox node client wait_for_layer1_final_block dal_node last_finalized_level in let* _ = Node.wait_for_level node (last_finalized_level + 2) in - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in let* () = wait_for_dal_node in if profile <> Dal_RPC.Bootstrap then let expected_levels = @@ -7333,8 +7332,7 @@ let scenario_tutorial_dal_baker = ~regression:true ~__FILE__ ~tags:[team; Tag.memory_3k; "tutorial"; "dal"; "baker"] - ~uses:(fun _protocol -> - [Constant.octez_agnostic_baker; Constant.octez_dal_node]) + ~uses:(fun _protocol -> [Constant.octez_baker; Constant.octez_dal_node]) (Printf.sprintf "%s" description) (fun protocol -> (* Note: Step 1 consists in setting up docker which we don't use @@ -7457,7 +7455,7 @@ let scenario_tutorial_dal_baker = Log.info "Step 5: Run an Octez baking daemon" ; let* _baker = let dal_node_rpc_endpoint = Dal_node.as_rpc_endpoint dal_node in - Agnostic_baker.init + Baker.init ~event_sections_levels:[(Protocol.name protocol ^ ".baker", `Debug)] ~dal_node_rpc_endpoint ~delegates:all_delegates @@ -10043,7 +10041,7 @@ let use_mockup_node_for_getting_attestable_slots _protocol dal_parameters let dal_node_rpc_endpoint = Endpoint.make ~host:"localhost" ~scheme:"http" ~port () in - let baker = Agnostic_baker.create ~dal_node_rpc_endpoint l1_node client in + let baker = Baker.create ~dal_node_rpc_endpoint l1_node client in Log.info "Publish a slot" ; let* (`OpHash _op_hash) = @@ -10060,11 +10058,11 @@ let use_mockup_node_for_getting_attestable_slots _protocol dal_parameters in Log.info "Start the baker" ; - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in (* +2 blocks for the attested block to be final, +1 for some slack *) let* _ = Node.wait_for_level l1_node (publish_level + attestation_lag + 3) in - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in let () = Dal_node.Mockup_for_baker.stop dal_node_mockup in let attested_level = publish_level + attestation_lag in @@ -10208,7 +10206,7 @@ let register ~protocols = test_attester_with_bake_for protocols ; scenario_with_layer1_and_dal_nodes - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) ~attestation_threshold:100 ~attestation_lag:16 ~activation_timestamp:Now @@ -10264,7 +10262,7 @@ let register ~protocols = protocols ; scenario_with_layer1_and_dal_nodes "baker registers profiles with dal node" - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) ~activation_timestamp:Now ~prover:false test_baker_registers_profiles @@ -10383,7 +10381,7 @@ let register ~protocols = test_attesters_receive_dal_rewards (List.filter (fun p -> Protocol.number p >= 022) protocols) ; scenario_with_layer1_and_dal_nodes - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) ~tags:["restart"] ~activation_timestamp:Now ~operator_profiles:[0] @@ -10392,7 +10390,7 @@ let register ~protocols = test_restart_dal_node protocols ; scenario_with_layer1_and_dal_nodes - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) ~tags:["restart"] ~activation_timestamp:Now ~bootstrap_profile:true @@ -10489,7 +10487,7 @@ let register ~protocols = register_end_to_end_tests ~protocols ; dal_crypto_benchmark () ; scenario_with_layer1_node - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) ~activation_timestamp:Now "mockup get_attestable_slots" use_mockup_node_for_getting_attestable_slots diff --git a/tezt/tests/http_cache_headers.ml b/tezt/tests/http_cache_headers.ml index 1052669e31da0c3e7e2f543b8bdc5100e12b211f..56083b2a7248fb171e003394a6f4e6a700599fcc 100644 --- a/tezt/tests/http_cache_headers.ml +++ b/tezt/tests/http_cache_headers.ml @@ -117,7 +117,7 @@ let test_if_none_match ~rpc_external = ~title ~tags:["rpc"; "middleware"; "http_cache_headers"] ~supports:(From_protocol 19) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Initialize client, node and baker" ; let* node, client = @@ -143,7 +143,7 @@ let test_if_none_match ~rpc_external = Client.activate_protocol ~timestamp:Now ~parameter_file ~protocol client in Log.info "Bake and wait for block" ; - let* baker = Agnostic_baker.init ~delegates node client in + let* baker = Baker.init ~delegates node client in Log.info "Check etag found in query" ; let* _ = Node.wait_for_level node 2 in @@ -167,7 +167,7 @@ let test_if_none_match ~rpc_external = node (RPC.get_chain_block_hash ()) in - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in Check.( (String.length body > 0) int diff --git a/tezt/tests/liquidity_baking_per_block_votes.ml b/tezt/tests/liquidity_baking_per_block_votes.ml index 7ea2e79a16715ab82de9caabe958a9b08d5ac8a4..aa2922d57c59e0ed0ecab5901a146a84f57c0f41 100644 --- a/tezt/tests/liquidity_baking_per_block_votes.ml +++ b/tezt/tests/liquidity_baking_per_block_votes.ml @@ -41,13 +41,12 @@ let ensure_removal path p = unit let baker_wait_for_vote baker = - Agnostic_baker.wait_for baker "vote_for_liquidity_baking_toggle.v0" - @@ fun json -> - JSON.as_string json |> Agnostic_baker.liquidity_baking_vote_of_string_opt + Baker.wait_for baker "vote_for_liquidity_baking_toggle.v0" @@ fun json -> + JSON.as_string json |> Baker.liquidity_baking_vote_of_string_opt let baker_wait_for_per_block_vote_file_error ?expected_id ?expected_file_path baker = - Agnostic_baker.wait_for baker "per_block_vote_file_error.v0" @@ fun json -> + Baker.wait_for baker "per_block_vote_file_error.v0" @@ fun json -> let json = JSON.(json |=> 0) in let id = JSON.(json |-> "id" |> as_string) in let file_path = JSON.(json |-> "file_path" |> as_string) in @@ -57,8 +56,7 @@ let baker_wait_for_per_block_vote_file_error ?expected_id ?expected_file_path then Some (id, file_path) else None -let vote_typ = - Check.(convert Agnostic_baker.liquidity_baking_vote_to_string string) +let vote_typ = Check.(convert Baker.liquidity_baking_vote_to_string string) let check_vote ?__LOC__ expected_vote obtained_vote = Check.(obtained_vote = expected_vote) @@ -112,7 +110,7 @@ let test_all_per_block_votes = ~tags:[team; "liquidity"; "baking"; "votes"] ~supports: (Protocol.Between_protocols (Protocol.number Alpha, Protocol.number Alpha)) - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let ( >|= ) = Lwt.( >|= ) in let error_prefix = "baker." ^ Protocol.encoding_prefix protocol ^ "." in @@ -147,14 +145,14 @@ let test_all_per_block_votes = not set [--liquidity-baking-toggle-vote pass] as the normal baker does. *) let run_vote_file ?votefile ?liquidity_baking_toggle_vote baker = - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in let delegates = Array.map (fun Account.{alias; _} -> alias) Account.Bootstrap.keys |> Array.to_list in let baker = - Agnostic_baker.create + Baker.create ~liquidity_baking_toggle_vote ?votefile ~delegates @@ -169,30 +167,30 @@ let test_all_per_block_votes = let* error = baker_wait_for_per_block_vote_file_error baker in return (baker, Error error) in - let* () = Agnostic_baker.run baker in - let* () = Agnostic_baker.wait_for_ready baker in + let* () = Baker.run baker in + let* () = Baker.wait_for_ready baker in Lwt.pick [p_vote; p_error] in - let* baker = Agnostic_baker.init node client in + let* baker = Baker.init node client in Log.info "Test [off] vote file" ; let* baker = - let votefile = Agnostic_baker.liquidity_baking_votefile Off in + let votefile = Baker.liquidity_baking_votefile Off in run_vote_file ~votefile ~liquidity_baking_toggle_vote:On baker >|= check_vote_success ~__LOC__ Off in Log.info "Test [on] vote file" ; let* baker = - let votefile = Agnostic_baker.liquidity_baking_votefile On in + let votefile = Baker.liquidity_baking_votefile On in run_vote_file ~votefile ~liquidity_baking_toggle_vote:Off baker >|= check_vote_success ~__LOC__ On in Log.info "Test [pass] vote file" ; let* baker = - let votefile = Agnostic_baker.liquidity_baking_votefile Pass in + let votefile = Baker.liquidity_baking_votefile Pass in run_vote_file ~votefile ~liquidity_baking_toggle_vote:On baker >|= check_vote_success ~__LOC__ Pass in @@ -231,18 +229,14 @@ let test_all_per_block_votes = Log.info "Test vote file at default file location " ; let* baker = ensure_removal default_votefile @@ fun () -> - let _ = - Agnostic_baker.liquidity_baking_votefile ~path:default_votefile On - in + let _ = Baker.liquidity_baking_votefile ~path:default_votefile On in run_vote_file baker >|= check_vote_success ~__LOC__ On in Log.info "Test caching of the votefile setting" ; let* _baker = ensure_removal default_votefile @@ fun () -> - let _ = - Agnostic_baker.liquidity_baking_votefile ~path:default_votefile On - in + let _ = Baker.liquidity_baking_votefile ~path:default_votefile On in let* baker = run_vote_file baker >|= check_vote_success ~__LOC__ On in (* Explicitly remove the votefile to check that the baker has retained its value *) let p_error = @@ -264,10 +258,8 @@ let test_all_per_block_votes = Log.info "Test [--votefile] overrides default file location " ; let* baker = ensure_removal default_votefile @@ fun () -> - let _ = - Agnostic_baker.liquidity_baking_votefile ~path:default_votefile On - in - let votefile = Agnostic_baker.liquidity_baking_votefile Off in + let _ = Baker.liquidity_baking_votefile ~path:default_votefile On in + let votefile = Baker.liquidity_baking_votefile Off in run_vote_file ~votefile baker >|= check_vote_success ~__LOC__ Off in diff --git a/tezt/tests/nonce_seed_revelation.ml b/tezt/tests/nonce_seed_revelation.ml index 35b179257a58050ac04a4eb5287289c9c4e03669..6610edccb2c47eb49b346228b0338df5bb9bd83b 100644 --- a/tezt/tests/nonce_seed_revelation.ml +++ b/tezt/tests/nonce_seed_revelation.ml @@ -57,7 +57,7 @@ let test_nonce_seed_revelation = ~__FILE__ ~title:"Nonce seed revelation" ~tags:[team; "nonce"; "seed"; "revelation"; Tag.memory_3k] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> (* Run a node and a baker. The node runs in archive mode to obtain metadata with [RPC.get_chain_block]. *) @@ -98,7 +98,7 @@ let test_nonce_seed_revelation = (fun i node -> let* client = Client.init ~endpoint:(Node node) () in let delegates = [Account.Bootstrap.keys.(i).alias] in - Agnostic_baker.init ~delegates node client) + Baker.init ~delegates node client) nodes in let* () = @@ -114,7 +114,7 @@ let test_nonce_seed_revelation = (* Wait until target level is reached *) let* () = cycle_two_promise in (* No need to bake further *) - let* () = Lwt_list.iter_p Agnostic_baker.terminate bakers in + let* () = Lwt_list.iter_p Baker.terminate bakers in Log.info "Get all blocks" ; (* Retrieve all blocks for two full cycles. *) let* blocks = @@ -235,7 +235,7 @@ let test_baking_nonce_migration = ~__FILE__ ~title:"Baking nonce format migration" ~tags:[team; "nonce"; "migration"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Initialize node and client" ; let* node, client = @@ -248,7 +248,7 @@ let test_baking_nonce_migration = Array.to_list @@ Array.map (fun key -> Account.(key.alias)) Account.Bootstrap.keys in - let baker = Agnostic_baker.create ~delegates node client in + let baker = Baker.create ~delegates node client in (* Reduce the block per cycle to gain some time *) let blocks_per_cycle = 4 in @@ -276,9 +276,9 @@ let test_baking_nonce_migration = Log.info "Start the baker and wait for success migration nonces baker event" ; let successful_migration_event = - Agnostic_baker.wait_for baker "success_migrate_nonces.v0" Option.some + Baker.wait_for baker "success_migrate_nonces.v0" Option.some in - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* _ = successful_migration_event in @@ -286,7 +286,7 @@ let test_baking_nonce_migration = "Bake until the level: %d (end of the second cycle) then kill the baker" target_level ; let* _ = target_level_promise in - let* () = Agnostic_baker.kill baker in + let* () = Baker.kill baker in Log.info "Retrieve the nonce file contents" ; let* chain_id = Client.RPC.call client @@ RPC.get_chain_chain_id () in @@ -307,9 +307,9 @@ let test_baking_nonce_migration = "Restart the baker until level: %d (end of the fifth cycle) then kill the \ baker" target_level ; - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* _ = target_level_promise in - let* () = Agnostic_baker.kill baker in + let* () = Baker.kill baker in Log.info "Concat old nonces contents with the new one" ; let new_nonces_contents = Base.read_file nonces_file in @@ -323,20 +323,20 @@ let test_baking_nonce_migration = "Restart the baker and wait for ignore failed nonce migration event then \ kill the baker" ; let failed_migration_event = - Agnostic_baker.wait_for baker "ignore_failed_nonce_migration.v0" Option.some + Baker.wait_for baker "ignore_failed_nonce_migration.v0" Option.some in - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* _ = failed_migration_event in - let* () = Agnostic_baker.kill baker in + let* () = Baker.kill baker in Log.info "Remove old nonces contents from nonces file" ; let () = Base.write_file nonces_file ~contents:new_nonces_contents in Log.info "Restart the baker and wait for success migrate nonces event" ; let successful_migration_event = - Agnostic_baker.wait_for baker "success_migrate_nonces.v0" Option.some + Baker.wait_for baker "success_migrate_nonces.v0" Option.some in - let* () = Agnostic_baker.run baker in + let* () = Baker.run baker in let* _ = successful_migration_event in unit diff --git a/tezt/tests/protocol_migration.ml b/tezt/tests/protocol_migration.ml index c47a5a857c31a6ff020dc67d57018886f6307cc7..4c926ffdcdb151bb20af8bbff3de4150cdb17e8d 100644 --- a/tezt/tests/protocol_migration.ml +++ b/tezt/tests/protocol_migration.ml @@ -518,8 +518,7 @@ let start_protocol ?consensus_threshold ?round_duration ~parameter_file client -(** Test that migration occurring through agnostic baker daemons does not halt the - chain. +(** Test that migration occurring through baker daemons does not halt the chain. This has become an issue of sort after updating the consensus protocol to Tenderbake. For one, attestations have become mandatory, and not only a sign @@ -539,7 +538,7 @@ let test_migration_with_bakers ?(migration_level = 4) daemon(s)" (Protocol.tag migrate_from) (Protocol.tag migrate_to) - "agnostic_baker") + "baker") ~tags: [ team; @@ -550,7 +549,7 @@ let test_migration_with_bakers ?(migration_level = 4) "from_" ^ Protocol.tag migrate_from; "to_" ^ Protocol.tag migrate_to; ] - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] @@ fun () -> let* client, node = user_migratable_node_init ~migration_level ~migrate_to () @@ -569,10 +568,8 @@ let test_migration_with_bakers ?(migration_level = 4) (fun account -> account.Account.alias) (Array.to_list Account.Bootstrap.keys) in - Log.info "Launching an agnostic baker" ; - let* _agnostic_baker = - Agnostic_baker.init ~name:"agnostic_baker" node client ~delegates - in + Log.info "Launching a baker" ; + let* _baker = Baker.init ~name:"baker" node client ~delegates in let* _ret = Node.wait_for_level node migration_level in let* () = check_adaptive_issuance_launch_cycle ~loc:__LOC__ ~migrate_from client @@ -650,7 +647,7 @@ let test_forked_migration_manual ?(migration_level = 4) "from_" ^ Protocol.tag migrate_from; "to_" ^ Protocol.tag migrate_to; ] - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] ~title: (Printf.sprintf "manually forked migration blocks from %s to %s" @@ -778,9 +775,9 @@ let test_forked_migration_manual ?(migration_level = 4) (Protocol.name migrate_to) ; let* () = connect cn1 cn2 in - let* baker_1 = Agnostic_baker.init ~delegates:delegates_1 node_1 client_1 in + let* baker_1 = Baker.init ~delegates:delegates_1 node_1 client_1 in - let* baker_2 = Agnostic_baker.init ~delegates:delegates_2 node_2 client_2 in + let* baker_2 = Baker.init ~delegates:delegates_2 node_2 client_2 in let until_level = migration_level + num_blocks_post_migration in Log.info "Waiting to reach level %d" until_level ; @@ -789,8 +786,8 @@ let test_forked_migration_manual ?(migration_level = 4) check_adaptive_issuance_launch_cycle ~loc:__LOC__ ~migrate_from client_1 in - let* () = Agnostic_baker.terminate baker_1 in - let* () = Agnostic_baker.terminate baker_2 in + let* () = Baker.terminate baker_1 in + let* () = Baker.terminate baker_2 in unit (** Wait for a quorum event on a proposal at the given [level]. @@ -810,7 +807,7 @@ let wait_for_qc_at_level baker level = let where = sf "level = %d" level in let level_seen = ref false in let proposal_waiter = - Agnostic_baker.wait_for baker "new_valid_proposal.v0" ~where (fun json -> + Baker.wait_for baker "new_valid_proposal.v0" ~where (fun json -> let proposal_level = JSON.(json |-> "level" |> as_int) in if proposal_level = level then ( level_seen := true ; @@ -823,7 +820,7 @@ let wait_for_qc_at_level baker level = else None) in Background.register proposal_waiter ; - Agnostic_baker.wait_for baker "qc_reached.v0" ~where (fun (_ : JSON.t) -> + Baker.wait_for baker "qc_reached.v0" ~where (fun (_ : JSON.t) -> if !level_seen then Some () else None) let get_block_at_level level client = @@ -832,7 +829,7 @@ let get_block_at_level level client = (RPC.get_chain_block ~version:"1" ~block:(string_of_int level) ()) let wait_for_post_migration_proposal baker post_migration_level = - Agnostic_baker.wait_for baker "new_valid_proposal.v0" (fun json -> + Baker.wait_for baker "new_valid_proposal.v0" (fun json -> let level = JSON.(json |-> "level" |> as_int) in if level = post_migration_level then Some () else if level > post_migration_level then @@ -850,10 +847,10 @@ let test_forked_migration_bakers ~migrate_from ~migrate_to = "from_" ^ Protocol.tag migrate_from; "to_" ^ Protocol.tag migrate_to; ]) - ~uses:[Constant.octez_agnostic_baker] + ~uses:[Constant.octez_baker] ~title: (Printf.sprintf - "agnostic baker forked migration blocks from %s to %s" + "baker forked migration blocks from %s to %s" (Protocol.tag migrate_from) (Protocol.tag migrate_to)) @@ fun () -> @@ -886,8 +883,8 @@ let test_forked_migration_bakers ~migrate_from ~migrate_to = and* () = connect cn2 cn3 in Log.info - "Partition bootstrap delegates into 3 groups. Start agnostic bakers on a \ - separate node for each group of delegates." ; + "Partition bootstrap delegates into 3 groups. Start bakers on a separate \ + node for each group of delegates." ; (* The groups are chosen considering baker rights at levels 4 and 5, see comment further below. *) let group1 = @@ -902,11 +899,11 @@ let test_forked_migration_bakers ~migrate_from ~migrate_to = Format.pp_print_list ~pp_sep Format.pp_print_string in - let agnostic_baker (node, client, delegates) = - let name = sf "agnostic_baker_%s" (Node.name node) in + let baker (node, client, delegates) = + let name = sf "baker_%s" (Node.name node) in Log.info "Start %s for %a." name pp_delegates delegates ; - let* baker = Agnostic_baker.init ~name ~delegates node client in - Agnostic_baker.log_block_injection ~color:Log.Color.FG.yellow baker ; + let* baker = Baker.init ~name ~delegates node client in + Baker.log_block_injection ~color:Log.Color.FG.yellow baker ; return baker in @@ -966,21 +963,18 @@ let test_forked_migration_bakers ~migrate_from ~migrate_to = in let* () = - let* agnostic_baker1 = agnostic_baker group1 - and* _agnostic_baker2 = agnostic_baker group2 - and* agnostic_baker3 = agnostic_baker group3 in + let* baker1 = baker group1 + and* _baker2 = baker group2 + and* baker3 = baker group3 in let* () = start_protocol () in let* () = check_adaptive_issuance_launch_cycle ~loc:__LOC__ ~migrate_from client1 in - let* () = wait_for_qc_at_level agnostic_baker1 pre_migration_level in + let* () = wait_for_qc_at_level baker1 pre_migration_level in let* () = disconnect_clusters () in let wait_for () = - let* () = - wait_for_post_migration_proposal agnostic_baker1 post_migration_level - and* () = - wait_for_post_migration_proposal agnostic_baker3 post_migration_level - in + let* () = wait_for_post_migration_proposal baker1 post_migration_level + and* () = wait_for_post_migration_proposal baker3 post_migration_level in unit in check_post_migration_proposal ~wait_for diff --git a/tezt/tests/signer_test.ml b/tezt/tests/signer_test.ml index 7a36dff174edb8aa8e0e0ea2e383f44d29b6914c..154d1527789e25e3655736ae51014301890e60d4 100644 --- a/tezt/tests/signer_test.ml +++ b/tezt/tests/signer_test.ml @@ -62,7 +62,7 @@ let signer_test protocol ~keys = in let level_2_promise = Node.wait_for_level node 2 in let level_3_promise = Node.wait_for_level node 3 in - let* _baker = Agnostic_baker.init node client in + let* _baker = Baker.init node client in let* _ = level_2_promise in Log.info "New head arrive level 2" ; let* _ = level_3_promise in @@ -74,8 +74,7 @@ let signer_simple_test = ~__FILE__ ~title:"signer test" ~tags:[team; "node"; "baker"; "tz1"] - ~uses:(fun _protocol -> - [Constant.octez_signer; Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_signer; Constant.octez_baker]) @@ fun protocol -> let* _ = signer_test protocol ~keys:(Account.Bootstrap.keys |> Array.to_list) diff --git a/tezt/tests/synchronisation_heuristic.ml b/tezt/tests/synchronisation_heuristic.ml index cf95bc406a69d37f05fc83dd232ae281f6477b55..31c0426bea88fa56d1ed078ae0ff356e4983bd98 100644 --- a/tezt/tests/synchronisation_heuristic.ml +++ b/tezt/tests/synchronisation_heuristic.ml @@ -232,7 +232,7 @@ let test_threshold_zero = ~title:"bootstrap: test threshold zero" ~tags: [team; Tag.flaky; "synchronisation_threshold"; "bootstrap"; "threshold"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Setup network" ; let* node, client = @@ -244,7 +244,7 @@ let test_threshold_zero = ~timestamp:Now () in - let* _ = Agnostic_baker.init node client in + let* _ = Baker.init node client in Log.info "Check that the node is bootstrapped" ; let* () = check_sync_state client Synced in @@ -269,7 +269,7 @@ let test_threshold_one = ~__FILE__ ~title:"bootstrap: test threshold one" ~tags:[team; "bootstrap"; "threshold"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Add a first peer with threshold zero" ; let* node, client = @@ -281,7 +281,7 @@ let test_threshold_one = ~timestamp:Now () in - let* baker = Agnostic_baker.init node client in + let* baker = Baker.init node client in Log.info "Check synchronisation state of first peer" ; let* () = check_sync_state client Synced in @@ -295,7 +295,7 @@ let test_threshold_one = in let* () = Client.Admin.connect_address client ~peer:node1 in let* _ = Node.wait_for_level node 2 in - let* () = Agnostic_baker.kill baker in + let* () = Baker.kill baker in Log.info "Check bootstrapped state of second peer" ; let* () = Client.bootstrapped client1 in @@ -309,7 +309,7 @@ let test_threshold_two = ~title:"bootstrap: test threshold two" ~tags: [team; Tag.flaky; "synchronisation_threshold"; "bootstrap"; "threshold"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Add a first peer with threshold zero" ; let* node, client = @@ -321,7 +321,7 @@ let test_threshold_two = ~timestamp:Now () in - let* baker = Agnostic_baker.init node client in + let* baker = Baker.init node client in Log.info "Add nodes and connect in clique" ; @@ -363,7 +363,7 @@ let test_threshold_two = unit) [node; node1; node2; node3] in - let* () = Agnostic_baker.kill baker in + let* () = Baker.kill baker in let* () = Client.bootstrapped client in let* () = Client.bootstrapped client1 in @@ -378,7 +378,7 @@ let test_threshold_stuck = ~title:"bootstrap: test threshold stuck" ~tags: [team; Tag.flaky; "synchronisation_threshold"; "bootstrap"; "threshold"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let sync_latency = 3 in @@ -395,12 +395,12 @@ let test_threshold_stuck = ~timestamp:Now () in - let* baker = Agnostic_baker.init node client in + let* baker = Baker.init node client in Log.info "Bake a few blocks and kill baker" ; let* current_level = Node.get_level node in let* (level : int) = Node.wait_for_level node (current_level + 3) in - let* () = Agnostic_baker.terminate baker in + let* () = Baker.terminate baker in Log.info "Add two additional peers" ; let* node1, client1 = @@ -442,7 +442,7 @@ let test_threshold_split_view = ~title:"bootstrap: test threshold split view" ~tags: [team; Tag.flaky; "synchronisation_threshold"; "bootstrap"; "threshold"] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> Log.info "Add two peers with threshold zero, and one with threshold 2 and a high \ @@ -474,7 +474,7 @@ let test_threshold_split_view = ~timestamp:Now () in - let* _ = Agnostic_baker.init node client in + let* _ = Baker.init node client in let* () = connect_clique client [node; node1; node2] in Log.info "Test that all nodes bootstrap" ; @@ -517,7 +517,7 @@ let test_many_nodes_bootstrap = "threshold"; Tag.memory_4k; ] - ~uses:(fun _protocol -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_baker]) @@ fun protocol -> let num_nodes = 8 in let running_time = 10.0 in @@ -538,7 +538,7 @@ let test_many_nodes_bootstrap = ~timestamp:Now () in - let* _ = Agnostic_baker.init node client in + let* _ = Baker.init node client in let* node1, client1 = Client.init_with_protocol ~nodes_args: diff --git a/tezt/tests/vdf_test.ml b/tezt/tests/vdf_test.ml index ff785822f27bb7deb915e4df61a75539cae454b6..9b54feb301a8693deaaa574cf8f9e5609f566b74 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 -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_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 -> [Constant.octez_agnostic_baker]) + ~uses:(fun _protocol -> [Constant.octez_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 diff --git a/tezt/tests/voting.ml b/tezt/tests/voting.ml index bb683ae9e120e5f56c3a5b709e9249657313f755..75d8ed44ae2afb35628a3320d5605f0ec94802a4 100644 --- a/tezt/tests/voting.ml +++ b/tezt/tests/voting.ml @@ -890,7 +890,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:[Protocol.accuser to_protocol; Constant.octez_baker] @@ fun () -> let node_arguments = [Node.Synchronisation_threshold 0] in let to_protocol_hash = Protocol.hash to_protocol in @@ -1221,7 +1221,7 @@ let test_user_activated_protocol_override_baker_vote ~from_protocol ~to_protocol Node.wait_for_level node (expected_level_of_next_proposal + good_measure) in - let* _ = Agnostic_baker.init node client in + let* _ = Baker.init node client in (* We also start an accuser for the [to_protocol] protocol. After the protocol switch, we verify that it starts registering blocks. *) diff --git a/tobi/config b/tobi/config index d335fa553f955bbd3ef80cc1b510d7ad6e108369..0ae74e0d794ea5b42d14061801c771876fd86f17 100644 --- a/tobi/config +++ b/tobi/config @@ -47,16 +47,16 @@ internal-devtools: devtools/tztop internal-devtools_proto-context-du: devtools/proto_context_du kaitai: client-libs/kaitai-ocaml/src, client-libs/kaitai-ocaml/test kaitai-of-data-encoding: client-libs/lib_kaitai_of_data_encoding, client-libs/lib_kaitai_of_data_encoding/test -octez-accuser: src/bin_agnostic_accuser +octez-accuser: src/bin_accuser octez-accuser-PsQuebec: src/proto_021_PsQuebec/bin_accuser octez-accuser-PsRiotum: src/proto_022_PsRiotum/bin_accuser octez-accuser-alpha: src/proto_alpha/bin_accuser octez-alcotezt: tezt/lib_alcotezt -octez-baker: src/bin_agnostic_baker +octez-baker: src/bin_baker octez-baker-PsQuebec: src/proto_021_PsQuebec/bin_baker octez-baker-PsRiotum: src/proto_022_PsRiotum/bin_baker octez-baker-alpha: src/proto_alpha/bin_baker -octez-baker-lib: src/lib_agnostic_baker +octez-baker-lib: src/lib_baker octez-client: src/bin_client octez-codec: src/bin_codec octez-codec-kaitai: client-libs/bin_codec_kaitai @@ -98,9 +98,9 @@ octez-protocol-017-PtNairob-libs: src/proto_017_PtNairob/lib_client, src/proto_0 octez-protocol-018-Proxford-libs: src/proto_018_Proxford/lib_client, src/proto_018_Proxford/lib_client_commands, src/proto_018_Proxford/lib_client_sapling, src/proto_018_Proxford/lib_layer2_utils, src/proto_018_Proxford/lib_plugin, src/proto_018_Proxford/lib_sc_rollup, src/proto_018_Proxford/lib_sc_rollup_layer2 octez-protocol-019-PtParisB-libs: src/proto_019_PtParisB/lib_client, src/proto_019_PtParisB/lib_client_commands, src/proto_019_PtParisB/lib_client_sapling, src/proto_019_PtParisB/lib_layer2_utils, src/proto_019_PtParisB/lib_plugin, src/proto_019_PtParisB/lib_sc_rollup, src/proto_019_PtParisB/lib_sc_rollup_layer2 octez-protocol-020-PsParisC-libs: src/proto_020_PsParisC/lib_client, src/proto_020_PsParisC/lib_client_commands, src/proto_020_PsParisC/lib_client_sapling, src/proto_020_PsParisC/lib_layer2_utils, src/proto_020_PsParisC/lib_plugin, src/proto_020_PsParisC/lib_sc_rollup, src/proto_020_PsParisC/lib_sc_rollup_layer2 -octez-protocol-021-PsQuebec-libs: src/proto_021_PsQuebec/lib_agnostic_baker, src/proto_021_PsQuebec/lib_client, src/proto_021_PsQuebec/lib_client/test, src/proto_021_PsQuebec/lib_client_commands, src/proto_021_PsQuebec/lib_client_sapling, src/proto_021_PsQuebec/lib_dal, src/proto_021_PsQuebec/lib_dal/test, src/proto_021_PsQuebec/lib_delegate, src/proto_021_PsQuebec/lib_delegate/test, src/proto_021_PsQuebec/lib_delegate/test/mockup_simulator, src/proto_021_PsQuebec/lib_delegate/test/tenderbrute, src/proto_021_PsQuebec/lib_delegate/test/tenderbrute/lib, src/proto_021_PsQuebec/lib_layer2_utils, src/proto_021_PsQuebec/lib_plugin, src/proto_021_PsQuebec/lib_plugin/test, src/proto_021_PsQuebec/lib_protocol/test/helpers, src/proto_021_PsQuebec/lib_sc_rollup, src/proto_021_PsQuebec/lib_sc_rollup_layer2 -octez-protocol-022-PsRiotum-libs: src/proto_022_PsRiotum/lib_agnostic_baker, src/proto_022_PsRiotum/lib_client, src/proto_022_PsRiotum/lib_client/test, src/proto_022_PsRiotum/lib_client_commands, src/proto_022_PsRiotum/lib_client_sapling, src/proto_022_PsRiotum/lib_dal, src/proto_022_PsRiotum/lib_dal/test, src/proto_022_PsRiotum/lib_delegate, src/proto_022_PsRiotum/lib_delegate/test, src/proto_022_PsRiotum/lib_delegate/test/mockup_simulator, src/proto_022_PsRiotum/lib_delegate/test/tenderbrute, src/proto_022_PsRiotum/lib_delegate/test/tenderbrute/lib, src/proto_022_PsRiotum/lib_layer2_utils, src/proto_022_PsRiotum/lib_plugin, src/proto_022_PsRiotum/lib_plugin/test, src/proto_022_PsRiotum/lib_protocol/test/helpers, src/proto_022_PsRiotum/lib_sc_rollup, src/proto_022_PsRiotum/lib_sc_rollup_layer2 -octez-protocol-alpha-libs: src/proto_alpha/lib_agnostic_baker, src/proto_alpha/lib_client, src/proto_alpha/lib_client/test, src/proto_alpha/lib_client_commands, src/proto_alpha/lib_client_sapling, src/proto_alpha/lib_dal, src/proto_alpha/lib_dal/test, src/proto_alpha/lib_delegate, src/proto_alpha/lib_delegate/test, src/proto_alpha/lib_delegate/test/mockup_simulator, src/proto_alpha/lib_delegate/test/tenderbrute, src/proto_alpha/lib_delegate/test/tenderbrute/lib, src/proto_alpha/lib_layer2_utils, src/proto_alpha/lib_plugin, src/proto_alpha/lib_plugin/test, src/proto_alpha/lib_protocol/test/helpers, src/proto_alpha/lib_sc_rollup, src/proto_alpha/lib_sc_rollup_layer2 +octez-protocol-021-PsQuebec-libs: src/proto_021_PsQuebec/lib_baker, src/proto_021_PsQuebec/lib_client, src/proto_021_PsQuebec/lib_client/test, src/proto_021_PsQuebec/lib_client_commands, src/proto_021_PsQuebec/lib_client_sapling, src/proto_021_PsQuebec/lib_dal, src/proto_021_PsQuebec/lib_dal/test, src/proto_021_PsQuebec/lib_delegate, src/proto_021_PsQuebec/lib_delegate/test, src/proto_021_PsQuebec/lib_delegate/test/mockup_simulator, src/proto_021_PsQuebec/lib_delegate/test/tenderbrute, src/proto_021_PsQuebec/lib_delegate/test/tenderbrute/lib, src/proto_021_PsQuebec/lib_layer2_utils, src/proto_021_PsQuebec/lib_plugin, src/proto_021_PsQuebec/lib_plugin/test, src/proto_021_PsQuebec/lib_protocol/test/helpers, src/proto_021_PsQuebec/lib_sc_rollup, src/proto_021_PsQuebec/lib_sc_rollup_layer2 +octez-protocol-022-PsRiotum-libs: src/proto_022_PsRiotum/lib_baker, src/proto_022_PsRiotum/lib_client, src/proto_022_PsRiotum/lib_client/test, src/proto_022_PsRiotum/lib_client_commands, src/proto_022_PsRiotum/lib_client_sapling, src/proto_022_PsRiotum/lib_dal, src/proto_022_PsRiotum/lib_dal/test, src/proto_022_PsRiotum/lib_delegate, src/proto_022_PsRiotum/lib_delegate/test, src/proto_022_PsRiotum/lib_delegate/test/mockup_simulator, src/proto_022_PsRiotum/lib_delegate/test/tenderbrute, src/proto_022_PsRiotum/lib_delegate/test/tenderbrute/lib, src/proto_022_PsRiotum/lib_layer2_utils, src/proto_022_PsRiotum/lib_plugin, src/proto_022_PsRiotum/lib_plugin/test, src/proto_022_PsRiotum/lib_protocol/test/helpers, src/proto_022_PsRiotum/lib_sc_rollup, src/proto_022_PsRiotum/lib_sc_rollup_layer2 +octez-protocol-alpha-libs: src/proto_alpha/lib_baker, src/proto_alpha/lib_client, src/proto_alpha/lib_client/test, src/proto_alpha/lib_client_commands, src/proto_alpha/lib_client_sapling, src/proto_alpha/lib_dal, src/proto_alpha/lib_dal/test, src/proto_alpha/lib_delegate, src/proto_alpha/lib_delegate/test, src/proto_alpha/lib_delegate/test/mockup_simulator, src/proto_alpha/lib_delegate/test/tenderbrute, src/proto_alpha/lib_delegate/test/tenderbrute/lib, src/proto_alpha/lib_layer2_utils, src/proto_alpha/lib_plugin, src/proto_alpha/lib_plugin/test, src/proto_alpha/lib_protocol/test/helpers, src/proto_alpha/lib_sc_rollup, src/proto_alpha/lib_sc_rollup_layer2 octez-protocol-compiler: src/lib_protocol_compiler, src/lib_protocol_compiler/bin, src/lib_protocol_compiler/hashes, src/lib_protocol_compiler/registerer octez-protocol-compiler-compat: src/lib_protocol_compiler/compat octez-requester-tests: src/lib_requester/test