diff --git a/docs/doc_gen/node_helpers.ml b/docs/doc_gen/node_helpers.ml index 363b6b3b93bfc041f18a9ef4559a6cba8658da85..da952f0ef1e662afc5cf66b05151158e6ffcc5cf 100644 --- a/docs/doc_gen/node_helpers.ml +++ b/docs/doc_gen/node_helpers.ml @@ -60,9 +60,22 @@ let with_node f = dal = Tezos_crypto_dal.Cryptobox.Config.default; } in + let version = + Tezos_version.Version.to_string + Tezos_version_value.Current_git_info.version + in + let commit_info = + ({ + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + : Tezos_version.Node_version.commit_info) + in let* node = Node.create ~singleprocess:true + ~version + ~commit_info node_config Tezos_shell_services.Shell_limits.default_peer_validator_limits Tezos_shell_services.Shell_limits.default_block_validator_limits diff --git a/docs/doc_gen/rpc_doc.ml b/docs/doc_gen/rpc_doc.ml index 3ca6327bf7efe5392690a0cf3bb06a185b418a8e..dfc724e88e6e4dc6f60bf0988d310f56727b34e2 100644 --- a/docs/doc_gen/rpc_doc.ml +++ b/docs/doc_gen/rpc_doc.ml @@ -372,7 +372,15 @@ let pp_document ppf _name intro prefix rpc_dir version = let make_index node required_version = let open Lwt_syntax in - let shell_dir = Node.build_rpc_directory node in + let version = Tezos_version_value.Current_git_info.version in + let commit_info = + ({ + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + : Tezos_version.Node_version.commit_info) + in + let shell_dir = Node.build_rpc_directory ~version ~commit_info node in let protocol_dirs = List.map (fun (version, name, intro, hash) -> diff --git a/manifest/main.ml b/manifest/main.ml index 0d26e08ec0ecfc691ec5746f5204ebcb5d9e6454..d1d75339a5349f033b3345444945e0f4193715ab 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -1,7 +1,7 @@ (*****************************************************************************) (* *) (* Open Source License *) -(* Copyright (c) 2021-2022 Nomadic Labs *) +(* Copyright (c) 2021-2023 Nomadic Labs *) (* Copyright (c) 2022-2023 Trili Tech *) (* *) (* Permission is hereby granted, free of charge, to any person obtaining a *) @@ -1991,6 +1991,18 @@ let octez_version = ~synopsis:"Tezos: version information generated from Git" ~deps:[octez_base |> open_ ~m:"TzPervasives"; octez_version_parser] ~js_compatible:true + +let octez_version_value = + public_lib + "tezos-version.value" + ~path:"src/lib_version/value/" + ~deps: + [ + octez_base |> open_ ~m:"TzPervasives"; + octez_version; + octez_version_parser; + ] + ~js_compatible:true (* We want generated_git_info.cmi to be compiled with -opaque so that a change in the implementation doesn't force rebuilding all the reverse dependencies. *) @@ -2002,7 +2014,7 @@ let octez_version = targets_rule ["generated_git_info.ml"] ~deps:[[S "universe"]] - ~action:[S "run"; S "./exe/get_git_info.exe"]; + ~action:[S "run"; S "../exe/get_git_info.exe"]; ] let _octez_version_get_git_info = @@ -2019,7 +2031,9 @@ let _octez_print_version_exe = "tezos-version" ~internal_name:"tezos_print_version" ~path:"src/lib_version/exe" - ~deps:[octez_version |> open_; octez_base_unix] + ~opam:"tezos-version" + ~deps: + [octez_version_value |> open_; octez_version |> open_; octez_base_unix] ~modules:["tezos_print_version"] ~bisect_ppx:No @@ -2809,7 +2823,6 @@ let octez_protocol_compiler_lib = [ octez_base |> open_ ~m:"TzPervasives"; octez_base_unix |> open_; - octez_version; tezos_protocol_environment_sigs; octez_stdlib_unix |> open_; compiler_libs_common; @@ -2949,6 +2962,7 @@ let octez_validation = octez_shell_services |> open_; octez_protocol_updater |> open_; octez_stdlib_unix |> open_; + octez_version_value; ] let octez_store_shared = @@ -3642,6 +3656,7 @@ let octez_client_base_unix = octez_proxy; octez_proxy_rpc; octez_signer_backends_unix; + octez_version_value; lwt_exit; uri; ] @@ -3794,7 +3809,7 @@ let _octez_protocol_compiler_bin = ~opam:"octez-protocol-compiler" ~internal_name:"main_native" ~modes:[Native] - ~deps:[octez_protocol_compiler_native] + ~deps:[octez_protocol_compiler_native; octez_version_value] ~linkall:true ~modules:["Main_native"] @@ -4061,6 +4076,7 @@ let octez_smart_rollup_node_lib = octez_node_config; prometheus_app; octez_injector |> open_; + octez_version_value |> open_; ] let octez_scoru_wasm_helpers = @@ -5638,7 +5654,7 @@ let hash = Protocol.hash octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; octez_clic; - octez_version; + octez_version_value; main |> open_; lifted |> if_ N.(number >= 018) |> open_; plugin |> if_some |> open_; @@ -6040,6 +6056,7 @@ let hash = Protocol.hash octez_scoru_wasm; octez_scoru_wasm_fast; octez_crypto_dal |> if_ N.(number >= 016) |> open_; + octez_version_value; ] ~conflicts:[Conflicts.checkseum] in @@ -6119,6 +6136,7 @@ let hash = Protocol.hash octez_clic; main |> open_; octez_sc_rollup_client |> if_some |> open_; + octez_version_value; ] in let _sc_rollup_node = @@ -6599,6 +6617,7 @@ let _octez_shell_tests = octez_event_logging_test_helpers |> open_; octez_test_helpers |> open_; alcotezt; + octez_version_value; ] (* INTERNAL EXES *) @@ -6849,6 +6868,7 @@ let _octez_node = octez_base |> open_ ~m:"TzPervasives" |> open_; octez_base_unix; octez_version; + octez_version_value; octez_node_config |> open_; octez_stdlib_unix |> open_; octez_shell_services |> open_; @@ -6977,6 +6997,7 @@ let _octez_codec = octez_stdlib_unix |> open_; octez_event_logging |> open_; octez_signer_services; + octez_version_value; ] @ Protocol.all_optionally @@ [ @@ -7014,7 +7035,7 @@ let _octez_proxy_server = octez_rpc_http_server; octez_shell_services; octez_shell_context; - octez_version; + octez_version_value; uri; ] @ Protocol.all_optionally [Protocol.client; Protocol.plugin]) @@ -7040,6 +7061,7 @@ let _octez_snoop = str; pyml; prbnmcn_stats; + octez_version_value; ] ~linkall:true ~dune: @@ -7337,6 +7359,7 @@ let _octez_scoru_wasm_debugger = octez_scoru_wasm_helpers |> open_; octez_webassembly_interpreter |> open_; octez_webassembly_interpreter_extra |> open_; + octez_version_value; ] let evm_proxy_lib = @@ -7352,7 +7375,7 @@ let evm_proxy_lib = octez_base |> open_ ~m:"TzPervasives"; octez_rpc_http |> open_; octez_rpc_http_client_unix; - octez_version; + octez_version_value; lwt_exit; rlp; rope; @@ -7392,6 +7415,7 @@ let _evm_proxy = octez_clic; octez_rpc_http |> open_; octez_rpc_http_server; + octez_version_value; evm_proxy_lib; ] ~bisect_ppx:Yes diff --git a/opam/octez-codec.opam b/opam/octez-codec.opam index 19e5bf325ac0ed7187122c18e07d0f66534d5092..cd3587090d1eab1632447e9584c328724b1c523c 100644 --- a/opam/octez-codec.opam +++ b/opam/octez-codec.opam @@ -18,6 +18,7 @@ depends: [ "tezos-stdlib-unix" "tezos-event-logging" "tezos-signer-services" + "tezos-version" ] depopts: [ "tezos-client-005-PsBabyM1" diff --git a/opam/octez-evm-proxy.opam b/opam/octez-evm-proxy.opam index a2c5932a07bfbe50c08b757ffdb5604bfc927ff6..16ad3697becd7e98837ab198aa037e5a636c9e42 100644 --- a/opam/octez-evm-proxy.opam +++ b/opam/octez-evm-proxy.opam @@ -14,6 +14,7 @@ depends: [ "tezos-clic" "tezos-rpc-http" "tezos-rpc-http-server" + "tezos-version" "octez-evm-proxy-lib" ] build: [ diff --git a/opam/octez-protocol-compiler.opam b/opam/octez-protocol-compiler.opam index 3a08872f58969bd924b40d2577fa6e0887545581..849843862c8c7bff0fae428fa9ec3ebad7dd7a03 100644 --- a/opam/octez-protocol-compiler.opam +++ b/opam/octez-protocol-compiler.opam @@ -12,11 +12,11 @@ depends: [ "ocaml" { >= "4.14" } "tezos-base" "tezos-protocol-environment" - "tezos-version" "tezos-stdlib-unix" "lwt" { >= "5.6.0" } "ocp-ocamlres" { >= "0.4" } "base-unix" + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/octez-smart-rollup-client-PtMumbai.opam b/opam/octez-smart-rollup-client-PtMumbai.opam index c6bb0e198216277c59eec537237772c569058add..7c16f3019469d976c2320edfff4f6506b1e9eb11 100644 --- a/opam/octez-smart-rollup-client-PtMumbai.opam +++ b/opam/octez-smart-rollup-client-PtMumbai.opam @@ -19,6 +19,7 @@ depends: [ "tezos-smart-rollup-016-PtMumbai" "tezos-smart-rollup-layer2-016-PtMumbai" "tezos-clic" + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/octez-smart-rollup-client-PtNairob.opam b/opam/octez-smart-rollup-client-PtNairob.opam index 1fb7fa4b5fff127e3543f98cc5379df5e727332a..7c068bbffc78e23e1a01bd9a6e2065743f41e1dc 100644 --- a/opam/octez-smart-rollup-client-PtNairob.opam +++ b/opam/octez-smart-rollup-client-PtNairob.opam @@ -19,6 +19,7 @@ depends: [ "tezos-smart-rollup-017-PtNairob" "tezos-smart-rollup-layer2-017-PtNairob" "tezos-clic" + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/octez-smart-rollup-client-alpha.opam b/opam/octez-smart-rollup-client-alpha.opam index 0e320ef7779a600e26fa8fcf5c92d43b64b9827c..da1d10981ba3567033cb0b49e7fe59c1c7d23cbf 100644 --- a/opam/octez-smart-rollup-client-alpha.opam +++ b/opam/octez-smart-rollup-client-alpha.opam @@ -19,6 +19,7 @@ depends: [ "tezos-smart-rollup-alpha" "tezos-smart-rollup-layer2-alpha" "tezos-clic" + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/octez-smart-rollup-node-PtMumbai.opam b/opam/octez-smart-rollup-node-PtMumbai.opam index a9816a74791f4388a425fcd68f5ce3d02e05f50f..2204a1abde4d68296eeccdc48ccb822971188767 100644 --- a/opam/octez-smart-rollup-node-PtMumbai.opam +++ b/opam/octez-smart-rollup-node-PtMumbai.opam @@ -41,6 +41,7 @@ depends: [ "tezos-scoru-wasm" "tezos-scoru-wasm-fast" "tezos-crypto-dal" + "tezos-version" "tezos-clic" "tezos-client-commands" ] diff --git a/opam/octez-smart-rollup-node-PtNairob.opam b/opam/octez-smart-rollup-node-PtNairob.opam index 9c57ed18acfa93d77445227b77098b8988e5fe2a..5a7387c1906b72299194da6e8bf269bcdd563434 100644 --- a/opam/octez-smart-rollup-node-PtNairob.opam +++ b/opam/octez-smart-rollup-node-PtNairob.opam @@ -41,6 +41,7 @@ depends: [ "tezos-scoru-wasm" "tezos-scoru-wasm-fast" "tezos-crypto-dal" + "tezos-version" "tezos-clic" "tezos-client-commands" ] diff --git a/opam/octez-smart-rollup-node-alpha.opam b/opam/octez-smart-rollup-node-alpha.opam index ed6babaea2bdd5b31aecb02b722ddc68bfac4450..c40334c9b0521c47b2dd12349b7a33c4278901fa 100644 --- a/opam/octez-smart-rollup-node-alpha.opam +++ b/opam/octez-smart-rollup-node-alpha.opam @@ -42,6 +42,7 @@ depends: [ "tezos-scoru-wasm" "tezos-scoru-wasm-fast" "tezos-crypto-dal" + "tezos-version" "tezos-clic" "tezos-client-commands" ] diff --git a/opam/octez-smart-rollup-node.opam b/opam/octez-smart-rollup-node.opam index 8f65c158b1f67856c8899dd326ba27592a1b4701..a16d7d72c2b3db2c9874994ab8a5dbc6b958caf6 100644 --- a/opam/octez-smart-rollup-node.opam +++ b/opam/octez-smart-rollup-node.opam @@ -17,6 +17,7 @@ depends: [ "octez-node-config" "prometheus-app" { >= "1.2" } "octez-injector" + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/octez-smart-rollup-wasm-debugger.opam b/opam/octez-smart-rollup-wasm-debugger.opam index 65565fd4a24a0f1b0178908ead7ca918bfd209e7..6ec8ddbea1626df95f51a6ac0e04ae8b7b95b558 100644 --- a/opam/octez-smart-rollup-wasm-debugger.opam +++ b/opam/octez-smart-rollup-wasm-debugger.opam @@ -19,6 +19,7 @@ depends: [ "tezos-scoru-wasm-helpers" "tezos-webassembly-interpreter" "tezos-webassembly-interpreter-extra" + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/octez-snoop.opam b/opam/octez-snoop.opam index 6586fa7312bae70f9121c77c1ca96f46ab496b4f..166a919f26ebf14e906bc20dc6ed63919044cd0c 100644 --- a/opam/octez-snoop.opam +++ b/opam/octez-snoop.opam @@ -19,6 +19,7 @@ depends: [ "tezos-benchmarks-proto-alpha" "pyml" "prbnmcn-stats" { = "0.0.6" } + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/opam/tezos-client-base-unix.opam b/opam/tezos-client-base-unix.opam index 866f4d2974ce9ef2d2ee49810b311446a10b0af3..082e7cade9e5e5a21900a2fa580de776498f65ae 100644 --- a/opam/tezos-client-base-unix.opam +++ b/opam/tezos-client-base-unix.opam @@ -24,6 +24,7 @@ depends: [ "tezos-mockup-commands" "tezos-proxy" "tezos-signer-backends" + "tezos-version" "lwt-exit" "uri" { >= "3.1.0" } "tezt" { with-test & >= "3.1.0" } diff --git a/opam/tezos-validation.opam b/opam/tezos-validation.opam index e17dc8fa521efaa6175fc97493c22d976518146f..49dc1e0e035605b7bd48268ce6fd0cb3095c2117 100644 --- a/opam/tezos-validation.opam +++ b/opam/tezos-validation.opam @@ -19,6 +19,7 @@ depends: [ "tezos-shell-services" "tezos-protocol-updater" "tezos-stdlib-unix" + "tezos-version" ] build: [ ["rm" "-r" "vendors" "contrib"] diff --git a/src/bin_codec/codec.ml b/src/bin_codec/codec.ml index ac6a0bbf347a7925d97b035bfbff01b3e319999e..387f1678f449c2b832e17105351a7edbf2b5fe2d 100644 --- a/src/bin_codec/codec.ml +++ b/src/bin_codec/codec.ml @@ -169,7 +169,7 @@ let main commands = match r with | Ok () -> Lwt.return 0 | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; Lwt.return 0 | Error [Tezos_clic.Help command] -> diff --git a/src/bin_codec/dune b/src/bin_codec/dune index 59d52a97070d11a2a8a9aac05c34a564f9dcc0bd..99ba321c729afa4238342581426469a5323bda3e 100644 --- a/src/bin_codec/dune +++ b/src/bin_codec/dune @@ -16,6 +16,7 @@ tezos-stdlib-unix tezos-event-logging tezos-signer-services + tezos-version.value (select void_for_linking-tezos-client-005-PsBabyM1 from (tezos-client-005-PsBabyM1 -> void_for_linking-tezos-client-005-PsBabyM1.empty) (-> void_for_linking-tezos-client-005-PsBabyM1.empty)) diff --git a/src/bin_evm_proxy/dune b/src/bin_evm_proxy/dune index 4bb9082cc57f53fecd21b9abbfceb179dab83f58..b30bb869c382ca4c07a38a821676d6717f10911e 100644 --- a/src/bin_evm_proxy/dune +++ b/src/bin_evm_proxy/dune @@ -12,6 +12,7 @@ tezos-clic tezos-rpc-http tezos-rpc-http-server + tezos-version.value evm_proxy_lib) (link_flags (:standard) diff --git a/src/bin_evm_proxy/evm_proxy.ml b/src/bin_evm_proxy/evm_proxy.ml index eb5e4a9f44b37edd73bf9b8226390c0c4aa5a175..95f81b8a43f0f9eae7a23a107ccec9c5f7a98e1a 100644 --- a/src/bin_evm_proxy/evm_proxy.ml +++ b/src/bin_evm_proxy/evm_proxy.ml @@ -215,7 +215,7 @@ let () = match result with | Ok _ -> () | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; exit 0 | Error e -> diff --git a/src/bin_evm_proxy/lib/dune b/src/bin_evm_proxy/lib/dune index a8bd83c95bf5c2cdde3041b0724bcb6c7ca1e290..6ed2cfd2ff5c0a44248e952f18242563674fd389 100644 --- a/src/bin_evm_proxy/lib/dune +++ b/src/bin_evm_proxy/lib/dune @@ -9,7 +9,7 @@ tezos-base tezos-rpc-http tezos-rpc-http-client-unix - tezos-version + tezos-version.value lwt-exit rlp rope) diff --git a/src/bin_evm_proxy/lib/services.ml b/src/bin_evm_proxy/lib/services.ml index daa78988c55049838dbe4ca813ba94123d256cd4..609e66f3648623ef90089554a095291a8d5b6772 100644 --- a/src/bin_evm_proxy/lib/services.ml +++ b/src/bin_evm_proxy/lib/services.ml @@ -37,8 +37,9 @@ let client_version = Format.sprintf "%s/%s-%s/%s/ocamlc.%s" "octez-evm-proxy-server" - Tezos_version.(Version.to_string Current_git_info.version) - Tezos_version.Current_git_info.abbreviated_commit_hash + (Tezos_version.Version.to_string + Tezos_version_value.Current_git_info.version) + Tezos_version_value.Current_git_info.abbreviated_commit_hash Stdlib.Sys.os_type Stdlib.Sys.ocaml_version diff --git a/src/bin_node/dune b/src/bin_node/dune index ba5d60c7a39328c8b6fa39c93b84269df9108526..56dea2491a883b53bf8a14dcadaa9e8125dad058 100644 --- a/src/bin_node/dune +++ b/src/bin_node/dune @@ -10,6 +10,7 @@ tezos-base tezos-base.unix tezos-version + tezos-version.value octez-node-config tezos-stdlib-unix tezos-shell-services diff --git a/src/bin_node/main.ml b/src/bin_node/main.ml index d667ffab77afbe142b657858890028650dfc2d39..1bbdae0a97ce14fa9a08794c39a104f0f783a06b 100644 --- a/src/bin_node/main.ml +++ b/src/bin_node/main.ml @@ -95,7 +95,8 @@ let () = if Filename.basename Sys.argv.(0) = Updater.compiler_name then ( try Octez_protocol_compiler.Compiler.main - Octez_protocol_compiler_native.Native.driver ; + Octez_protocol_compiler_native.Native.driver + Tezos_version_value.Bin_version.version_string ; Stdlib.exit 0 with exn -> Format.eprintf "%a\n%!" Opterrors.report_error exn ; @@ -126,7 +127,7 @@ let description = let man = description @ Node_run_command.Manpage.examples let info = - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Cmdliner.Cmd.info ~doc:"The Octez node" ~man ~version "octez-node" module Node_metrics_command = struct diff --git a/src/bin_node/node_run_command.ml b/src/bin_node/node_run_command.ml index 6e8e282d87dd2dfb8ff3c524016470d29a2e83d0..81a7a828df08be696dc7a1b7657392b287107330 100644 --- a/src/bin_node/node_run_command.ml +++ b/src/bin_node/node_run_command.ml @@ -328,10 +328,22 @@ let init_node ?sandbox ?target ~identity ~singleprocess ~internal_events ~new_history_mode:history_mode | _ -> return_unit in + let version = + Tezos_version.Version.to_string Tezos_version_value.Current_git_info.version + in + let commit_info = + ({ + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + : Tezos_version.Node_version.commit_info) + in Node.create ~sandboxed:(sandbox <> None) ?sandbox_parameters:(Option.map snd sandbox_param) ~singleprocess + ~version + ~commit_info node_config config.shell.peer_validator_limits config.shell.block_validator_limits @@ -361,7 +373,15 @@ let launch_rpc_server ~acl_policy ~media_types (config : Config_file.t) node let open Lwt_result_syntax in let rpc_config = config.rpc in let host = Ipaddr.V6.to_string addr in - let dir = Node.build_rpc_directory node in + let version = Tezos_version_value.Current_git_info.version in + let commit_info = + ({ + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + : Tezos_version.Node_version.commit_info) + in + let dir = Node.build_rpc_directory ~version ~commit_info node in let dir = Node_directory.build_node_directory config dir in let dir = Tezos_rpc.Directory.register_describe_directory_service @@ -512,8 +532,8 @@ let run ?verbosity ?sandbox ?target ?(cli_warnings = []) let*! () = Event.(emit starting_node) ( config.blockchain_network.chain_name, - Tezos_version.Current_git_info.version, - Tezos_version.Current_git_info.abbreviated_commit_hash ) + Tezos_version_value.Current_git_info.version, + Tezos_version_value.Current_git_info.abbreviated_commit_hash ) in let*! () = init_zcash () in let* () = diff --git a/src/bin_proxy_server/dune b/src/bin_proxy_server/dune index 3be00db71317f462eae09bdab5566881f5b67f0b..bea6fba0d40925f79310c8ee581ca1f5ba304bff 100644 --- a/src/bin_proxy_server/dune +++ b/src/bin_proxy_server/dune @@ -20,7 +20,7 @@ tezos-rpc-http-server tezos-shell-services tezos-shell-context - tezos-version + tezos-version.value uri (select void_for_linking-tezos-client-genesis from (tezos-client-genesis -> void_for_linking-tezos-client-genesis.empty) diff --git a/src/bin_proxy_server/main_proxy_server.ml b/src/bin_proxy_server/main_proxy_server.ml index 079f06cb8a3986072982fcf7ffc84ba798c6ef68..c348da09cc76e25559c4247f9dc42e81cf6967df 100644 --- a/src/bin_proxy_server/main_proxy_server.ml +++ b/src/bin_proxy_server/main_proxy_server.ml @@ -289,7 +289,7 @@ let info = `P "Report issues to https://gitlab.com/tezos/tezos/-/issues"; ] in - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Cmd.info name ~version ~doc ~exits:Cmd.Exit.defaults ~man let () = exit (Cmd.eval (Cmd.v info term)) diff --git a/src/bin_snoop/commands.ml b/src/bin_snoop/commands.ml index 28480694f68d63c4e51a651bf41fc381052db4c3..8717d3b76956747f6adf73d8c4ee93c5afed8eba 100644 --- a/src/bin_snoop/commands.ml +++ b/src/bin_snoop/commands.ml @@ -1719,7 +1719,7 @@ let list_solvers, list_models = match result with | Ok global_options -> global_options | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; exit 0 | Error [Tezos_clic.Help command] -> diff --git a/src/bin_snoop/dune b/src/bin_snoop/dune index ddf01b0f7387da23118e42ea245e5941941a07b5..b4d01774efd254509430d059c4294930737d426e 100644 --- a/src/bin_snoop/dune +++ b/src/bin_snoop/dune @@ -17,7 +17,8 @@ tezos-benchmarks-proto-alpha str pyml - prbnmcn-stats) + prbnmcn-stats + tezos-version.value) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp) diff --git a/src/bin_wasm_debugger/dune b/src/bin_wasm_debugger/dune index 3ee6b32c3d97f49f8d161d6caad1c04cc85df4de..134d8e130145431e809cc1ec8fbed9dc9dcba5a5 100644 --- a/src/bin_wasm_debugger/dune +++ b/src/bin_wasm_debugger/dune @@ -16,7 +16,8 @@ octez_smart_rollup_wasm_benchmark_lib tezos-scoru-wasm-helpers tezos-webassembly-interpreter - tezos-webassembly-interpreter-extra) + tezos-webassembly-interpreter-extra + tezos-version.value) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp) diff --git a/src/bin_wasm_debugger/main_wasm_debugger.ml b/src/bin_wasm_debugger/main_wasm_debugger.ml index b45631c315af88e28dbc205f5c44c8049604beb6..ac25887612017e99c64723316f1054ed95ab90d2 100644 --- a/src/bin_wasm_debugger/main_wasm_debugger.ml +++ b/src/bin_wasm_debugger/main_wasm_debugger.ml @@ -277,7 +277,7 @@ module Make (Wasm : Wasm_utils_intf.S) = struct match result with | Ok _ -> () | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; exit 0 | Error e -> diff --git a/src/lib_client_base_unix/client_main_run.ml b/src/lib_client_base_unix/client_main_run.ml index cbd134475248c839666ab3103cc7982bde401443..4c36b5ba628890f9d2035a905d9fa9ac38d7c5f2 100644 --- a/src/lib_client_base_unix/client_main_run.ml +++ b/src/lib_client_base_unix/client_main_run.ml @@ -542,7 +542,7 @@ let main (module C : M) ~select_commands = match r with | Ok () -> Lwt.return 0 | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; Lwt.return 0 | Error [Tezos_clic.Help command] -> diff --git a/src/lib_client_base_unix/dune b/src/lib_client_base_unix/dune index 47360ab799f1f147ec6c3063830fbabdfc6b9000..0076e40f6373f8a2ac9a101e7d9b4957974c5e16 100644 --- a/src/lib_client_base_unix/dune +++ b/src/lib_client_base_unix/dune @@ -22,6 +22,7 @@ tezos-proxy tezos-proxy.rpc tezos-signer-backends.unix + tezos-version.value lwt-exit uri) (library_flags (:standard -linkall)) diff --git a/src/lib_protocol_compiler/bin/dune b/src/lib_protocol_compiler/bin/dune index 82d225be91905a85cd1644ba0141d8c7bcd088f7..2ca1c5317e16a7362c26bbaedbde042f254f631a 100644 --- a/src/lib_protocol_compiler/bin/dune +++ b/src/lib_protocol_compiler/bin/dune @@ -15,7 +15,8 @@ (instrumentation (backend bisect_ppx)) (modes native) (libraries - octez-protocol-compiler.native) + octez-protocol-compiler.native + tezos-version.value) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp) diff --git a/src/lib_protocol_compiler/bin/main_native.ml b/src/lib_protocol_compiler/bin/main_native.ml index 36a479c9d8945772e33015ccd00816a67640deb5..febf3b75b75f4645a084bf299238ccdeb7b1151c 100644 --- a/src/lib_protocol_compiler/bin/main_native.ml +++ b/src/lib_protocol_compiler/bin/main_native.ml @@ -54,7 +54,8 @@ let () = let () = try Octez_protocol_compiler.Compiler.main - Octez_protocol_compiler_native.Native.driver ; + Octez_protocol_compiler_native.Native.driver + Tezos_version_value.Bin_version.version_string ; Stdlib.exit 0 with exn -> Format.eprintf "%a\n%!" Opterrors.report_error exn ; diff --git a/src/lib_protocol_compiler/compiler.ml b/src/lib_protocol_compiler/compiler.ml index d606156c0942f3e9db73c334ab74a084c4e816ee..bd2f7a29eabe942e5c7c11d8fb35c7463c7215e3 100644 --- a/src/lib_protocol_compiler/compiler.ml +++ b/src/lib_protocol_compiler/compiler.ml @@ -140,7 +140,7 @@ type driver = { let parse_options errflag s = Option.iter Location.(prerr_alert none) (Warnings.parse_options errflag s) -let main {compile_ml; pack_objects; link_shared} = +let main {compile_ml; pack_objects; link_shared} version = Random.self_init () ; parse_options false default_warnings ; parse_options true default_warn_error ; @@ -173,7 +173,7 @@ let main {compile_ml; pack_objects; link_shared} = ( "--version", Unit (fun () -> - Format.printf "%s\n" Tezos_version.Bin_version.version_string ; + Format.printf "%s\n" version ; Stdlib.exit 0), " Display version information" ); ( "-warning", diff --git a/src/lib_protocol_compiler/dune b/src/lib_protocol_compiler/dune index 5f4698a408b497a59060dada5fe39a5ea03f0d3b..e3dc605b694397a86012f9b49c7cf51e5b1bf9b3 100644 --- a/src/lib_protocol_compiler/dune +++ b/src/lib_protocol_compiler/dune @@ -8,7 +8,6 @@ (libraries tezos-base tezos-base.unix - tezos-version tezos-protocol-environment.sigs tezos-stdlib-unix compiler-libs.common diff --git a/src/lib_shell/monitor_directory.ml b/src/lib_shell/monitor_directory.ml index 8bda3712435661742267b7d5dcb8821b37be6fd3..a5de169b4e4c9a5d375c41b521bcf36315331ca7 100644 --- a/src/lib_shell/monitor_directory.ml +++ b/src/lib_shell/monitor_directory.ml @@ -24,7 +24,8 @@ (* *) (*****************************************************************************) -let build_rpc_directory validator mainchain_validator = +let build_rpc_directory ~(commit_info : Node_version.commit_info) validator + mainchain_validator = let open Lwt_syntax in let distributed_db = Validator.distributed_db validator in let store = Distributed_db.store distributed_db in @@ -320,7 +321,7 @@ let build_rpc_directory validator mainchain_validator = let next () = Lwt_stream.get stream in Tezos_rpc.Answer.return_stream {next; shutdown}) ; gen_register0 Monitor_services.S.commit_hash (fun () () -> - Tezos_rpc.Answer.return Tezos_version.Current_git_info.commit_hash) ; + Tezos_rpc.Answer.return commit_info.commit_hash) ; gen_register0 Monitor_services.S.active_chains (fun () () -> let stream, stopper = Validator.chains_watcher validator in let shutdown () = Lwt_watcher.shutdown stopper in diff --git a/src/lib_shell/monitor_directory.mli b/src/lib_shell/monitor_directory.mli index 178e26795f747dd242cdd1026c7d586870f6ea8e..1930847877625227e61d2688080c3df489e2ac27 100644 --- a/src/lib_shell/monitor_directory.mli +++ b/src/lib_shell/monitor_directory.mli @@ -24,4 +24,7 @@ (*****************************************************************************) val build_rpc_directory : - Validator.t -> Chain_validator.t -> unit Tezos_rpc.Directory.t + commit_info:Node_version.commit_info -> + Validator.t -> + Chain_validator.t -> + unit Tezos_rpc.Directory.t diff --git a/src/lib_shell/node.ml b/src/lib_shell/node.ml index 171fd603308071df72ed915b370959a12e339b38..58846d4b9b3c0f992c4aa8b5b143ae04cddf6d8e 100644 --- a/src/lib_shell/node.ml +++ b/src/lib_shell/node.ml @@ -197,7 +197,8 @@ let check_context_consistency store = let*! () = Node_event.(emit storage_corrupted_context_detected ()) in tzfail Non_recoverable_context -let create ?(sandboxed = false) ?sandbox_parameters ~singleprocess +let create ?(sandboxed = false) ?sandbox_parameters ~singleprocess ~version + ~commit_info { genesis; chain_name; @@ -230,7 +231,7 @@ let create ?(sandboxed = false) ?sandbox_parameters ~singleprocess p2p_params disable_mempool in - Shell_metrics.Version.init p2p ; + Shell_metrics.Version.init ~version ~commit_info p2p ; let* validator_process, store = let open Block_validator_process in let validator_environment = @@ -343,7 +344,7 @@ let create ?(sandboxed = false) ?sandbox_parameters ~singleprocess let shutdown node = node.shutdown () -let build_rpc_directory node = +let build_rpc_directory ~version ~commit_info node = let dir : unit Tezos_rpc.Directory.t ref = ref Tezos_rpc.Directory.empty in let merge d = dir := Tezos_rpc.Directory.merge !dir d in let register0 s f = @@ -355,6 +356,7 @@ let build_rpc_directory node = node.store) ; merge (Monitor_directory.build_rpc_directory + ~commit_info node.validator node.mainchain_validator) ; merge (Injection_directory.build_rpc_directory node.validator) ; @@ -368,7 +370,7 @@ let build_rpc_directory node = ~user_activated_protocol_overrides:node.user_activated_protocol_overrides ~mainchain_validator:node.mainchain_validator node.store) ; - merge (Version_directory.rpc_directory node.p2p) ; + merge (Version_directory.rpc_directory ~version ~commit_info node.p2p) ; register0 Tezos_rpc.Service.error_service (fun () () -> Lwt.return_ok (Data_encoding.Json.schema Error_monad.error_encoding)) ; !dir diff --git a/src/lib_shell/node.mli b/src/lib_shell/node.mli index e32022c22579fe6c667e5e709d56ee003c8cb12e..cb2489d880aef841c2afa658755ce7dd34e70985 100644 --- a/src/lib_shell/node.mli +++ b/src/lib_shell/node.mli @@ -55,14 +55,20 @@ val create : ?sandboxed:bool -> ?sandbox_parameters:Data_encoding.json -> singleprocess:bool -> + version:string -> + commit_info:Node_version.commit_info -> config -> Shell_limits.peer_validator_limits -> Shell_limits.block_validator_limits -> Shell_limits.prevalidator_limits -> Shell_limits.chain_validator_limits -> History_mode.t option -> - t tzresult Lwt.t + (t, tztrace) result Lwt.t val shutdown : t -> unit Lwt.t -val build_rpc_directory : t -> unit Tezos_rpc.Directory.t +val build_rpc_directory : + version:Tezos_version_parser.t -> + commit_info:Node_version.commit_info -> + t -> + unit Tezos_rpc.Directory.t diff --git a/src/lib_shell/shell_metrics.ml b/src/lib_shell/shell_metrics.ml index 12c97ec0a8dd243318f7e65f83d21d6c0f2a8427..dd6f8f66a09ecec54f8d4d677447c2a5b2d1a401 100644 --- a/src/lib_shell/shell_metrics.ml +++ b/src/lib_shell/shell_metrics.ml @@ -549,8 +549,6 @@ module Version = struct ] "version" - let version = Tezos_version.Version.to_string Current_git_info.version - let network_version net = let Network_version.{chain_name; distributed_db_version; p2p_version} = P2p.announced_version net @@ -561,11 +559,8 @@ module Version = struct Format.asprintf "%a" P2p_version.pp p2p_version; ] - let commit_hash = Current_git_info.commit_hash - - let commit_date = Current_git_info.committer_date - - let init net = + let init ~version + ~commit_info:({commit_hash; commit_date} : Node_version.commit_info) net = let _ = Prometheus.Gauge.labels metric @@ [version] @ network_version net @ [commit_hash; commit_date] diff --git a/src/lib_shell/shell_metrics.mli b/src/lib_shell/shell_metrics.mli index c1766349fefa203e986965169bbb884319869c68..95ef69382f28c6a461d1c7109037635f897bfabb 100644 --- a/src/lib_shell/shell_metrics.mli +++ b/src/lib_shell/shell_metrics.mli @@ -112,7 +112,11 @@ module Chain_validator : sig end module Version : sig - val init : ('a, 'b, 'c) P2p.t -> unit + val init : + version:string -> + commit_info:Node_version.commit_info -> + ('a, 'b, 'c) P2p.t -> + unit end module Peer_validator : sig diff --git a/src/lib_shell/test/dune b/src/lib_shell/test/dune index 6008b89187a16079fe7301cdc4460e0f34fe4fa3..4ef810e6db5b21715a2c4fdbb2f84b97fec9af89 100644 --- a/src/lib_shell/test/dune +++ b/src/lib_shell/test/dune @@ -24,7 +24,8 @@ tezos-validation tezos-event-logging-test-helpers tezos-test-helpers - octez-alcotezt) + octez-alcotezt + tezos-version.value) (library_flags (:standard -linkall)) (flags (:standard) diff --git a/src/lib_shell/test/test_node.ml b/src/lib_shell/test/test_node.ml index a03500f2df7822089bbf0704b3bd5204cbc3ff96..f1cfbbb817ee1a943f8ea781dec1fce776652d78 100644 --- a/src/lib_shell/test/test_node.ml +++ b/src/lib_shell/test/test_node.ml @@ -111,11 +111,23 @@ let ( let*?? ) m f = (** Node creation in sandbox. Expects one event with status [p2p_layer_disabled]. *) let node_sandbox_initialization_events sandbox_parameters config _switch () = + let version = + Tezos_version.Version.to_string Tezos_version_value.Current_git_info.version + in + let commit_info = + ({ + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + : Tezos_version.Node_version.commit_info) + in let*?? n = Node.create ~sandboxed:true ~sandbox_parameters ~singleprocess:true + ~version + ~commit_info (* Tezos_shell.Node.config *) config (* Tezos_shell.Node.peer_validator_limits *) @@ -146,10 +158,22 @@ let node_sandbox_initialization_events sandbox_parameters config _switch () = (** Node creation. Expects two events with statuses [bootstrapping] and [p2p_maintain_started]. *) let node_initialization_events _sandbox_parameters config _switch () = + let version = + Tezos_version.Version.to_string Tezos_version_value.Current_git_info.version + in + let commit_info = + ({ + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + : Tezos_version.Node_version.commit_info) + in let*?? n = Node.create ~sandboxed:false ~singleprocess:true + ~version + ~commit_info (* Tezos_shell.Node.config *) {config with p2p = default_p2p} (* Tezos_shell.Node.peer_validator_limits *) @@ -186,10 +210,22 @@ let node_initialization_events _sandbox_parameters config _switch () = Node.shutdown n let node_store_known_protocol_events _sandbox_parameters config _switch () = + let version = + Tezos_version.Version.to_string Tezos_version_value.Current_git_info.version + in + let commit_info = + ({ + commit_hash = Tezos_version_value.Current_git_info.commit_hash; + commit_date = Tezos_version_value.Current_git_info.committer_date; + } + : Tezos_version.Node_version.commit_info) + in let*?? n = Node.create ~sandboxed:false ~singleprocess:true + ~version + ~commit_info (* Tezos_shell.Node.config *) {config with p2p = default_p2p} (* Tezos_shell.Node.peer_validator_limits *) diff --git a/src/lib_shell/version_directory.ml b/src/lib_shell/version_directory.ml index 15444b690298e3c70620b9aef9de7a74367ad81c..e7ffe38d93f9d02a5cbe2122fcafec866f9145e8 100644 --- a/src/lib_shell/version_directory.ml +++ b/src/lib_shell/version_directory.ml @@ -22,18 +22,13 @@ (* *) (*****************************************************************************) -let rpc_directory net = +let rpc_directory ~version ~(commit_info : Node_version.commit_info) net = let dir = Tezos_rpc.Directory.empty in - let version = Current_git_info.version in let network_version = P2p.announced_version net in - let commit_hash = Current_git_info.commit_hash in - let commit_date = Current_git_info.committer_date in - let commit_info = - Some ({commit_hash; commit_date} : Node_version.commit_info) - in Tezos_rpc.Directory.gen_register dir Version_services.S.version (fun () () () -> Tezos_rpc.Answer.return - @@ ({version; network_version; commit_info} : Node_version.t)) + @@ ({version; network_version; commit_info = Some commit_info} + : Node_version.t)) diff --git a/src/lib_smart_rollup_node/dune b/src/lib_smart_rollup_node/dune index 76f35fe2d3f95bfd3f3e93e506574026574b074b..3bd4b2c47ec48df86dee4758762c9671857fd9dd 100644 --- a/src/lib_smart_rollup_node/dune +++ b/src/lib_smart_rollup_node/dune @@ -13,10 +13,12 @@ cohttp-lwt-unix octez-node-config prometheus-app - octez-injector) + octez-injector + tezos-version.value) (flags (:standard) -open Tezos_base.TzPervasives -open Tezos_stdlib_unix -open Tezos_crypto - -open Octez_injector)) + -open Octez_injector + -open Tezos_version_value)) diff --git a/src/lib_validation/command_line.ml b/src/lib_validation/command_line.ml index 61bad06517aaae51ec5a38c69da015eb7929c92a..35ff992a03bf8f0870b818283711937993ff94d6 100644 --- a/src/lib_validation/command_line.ml +++ b/src/lib_validation/command_line.ml @@ -52,7 +52,9 @@ let parse_args () = ( "--version", Unit (fun () -> - Format.printf "%s\n" Tezos_version.Bin_version.version_string ; + Format.printf + "%s\n" + Tezos_version_value.Bin_version.version_string ; Stdlib.exit 0), " Display version information" ); ] diff --git a/src/lib_validation/dune b/src/lib_validation/dune index e4c5cebcc2315ce443b29421c1fbd0459c60adb8..967dac641f1a1cb3e1442512306e2a63c55dadd9 100644 --- a/src/lib_validation/dune +++ b/src/lib_validation/dune @@ -15,7 +15,8 @@ tezos-shell-context tezos-shell-services tezos-protocol-updater - tezos-stdlib-unix) + tezos-stdlib-unix + tezos-version.value) (flags (:standard) -open Tezos_base.TzPervasives diff --git a/src/lib_version/dune b/src/lib_version/dune index 0da0dcf6e004b3abd2b6326beb82b27e85b03ae5..45ba048ca53032ff1880365c3a68cd5e34e80cd7 100644 --- a/src/lib_version/dune +++ b/src/lib_version/dune @@ -13,10 +13,4 @@ (js_of_ocaml) (flags (:standard) - -opaque -open Tezos_base.TzPervasives)) - -(rule - (targets generated_git_info.ml) - (deps (universe)) - (action (run ./exe/get_git_info.exe))) diff --git a/src/lib_version/exe/dune b/src/lib_version/exe/dune index 09ab40938448e97eb1b00f8da7f243dad54ef5c2..e335b81055e3e0eec706fa4d834135d050ee751e 100644 --- a/src/lib_version/exe/dune +++ b/src/lib_version/exe/dune @@ -13,6 +13,7 @@ (public_name tezos-version) (package tezos-version) (libraries + tezos-version.value tezos-version tezos-base.unix) (link_flags @@ -20,5 +21,6 @@ (:include %{workspace_root}/static-link-flags.sexp)) (flags (:standard) + -open Tezos_version_value -open Tezos_version) (modules tezos_print_version)) diff --git a/src/lib_version/exe/tezos_print_version.ml b/src/lib_version/exe/tezos_print_version.ml index 492715b952f69246b888e8e73a8f628aa113e756..00114704b9f3f04146ffa3b4460f7ec9e6b0b7d1 100644 --- a/src/lib_version/exe/tezos_print_version.ml +++ b/src/lib_version/exe/tezos_print_version.ml @@ -40,7 +40,7 @@ let () = | [|_; "--minor"|] -> print_endline (string_of_int version.minor) | [|_; "--additional-info"|] -> print_endline (string_of_additional_info version.additional_info) - | [|_; "--full"|] | [|_|] -> print_endline (Version.to_string version) + | [|_; "--full"|] | [|_|] -> print_endline (to_string version) | [|_; "--help"|] -> print_endline help_string | _ -> print_endline help_string ; diff --git a/src/lib_version/bin_version.ml b/src/lib_version/value/bin_version.ml similarity index 96% rename from src/lib_version/bin_version.ml rename to src/lib_version/value/bin_version.ml index a5917f8d5d4daf718aee0fcbbe1772496474a808..cd515b186ec364f0919e5f44fc1f8d603892fc82 100644 --- a/src/lib_version/bin_version.ml +++ b/src/lib_version/value/bin_version.ml @@ -27,4 +27,4 @@ let version_string = "%s (%s) (%s)" Current_git_info.abbreviated_commit_hash Current_git_info.committer_date - (Version.to_string Current_git_info.version) + (Tezos_version.Version.to_string Current_git_info.version) diff --git a/src/lib_version/bin_version.mli b/src/lib_version/value/bin_version.mli similarity index 100% rename from src/lib_version/bin_version.mli rename to src/lib_version/value/bin_version.mli diff --git a/src/lib_version/current_git_info.ml b/src/lib_version/value/current_git_info.ml similarity index 100% rename from src/lib_version/current_git_info.ml rename to src/lib_version/value/current_git_info.ml diff --git a/src/lib_version/current_git_info.mli b/src/lib_version/value/current_git_info.mli similarity index 98% rename from src/lib_version/current_git_info.mli rename to src/lib_version/value/current_git_info.mli index 2bcb7b46936a60621da6175531095079c8cd533d..61f1acbce459ca4259aafc0b7f2c09f8351df99e 100644 --- a/src/lib_version/current_git_info.mli +++ b/src/lib_version/value/current_git_info.mli @@ -31,4 +31,4 @@ val committer_date : string (** current_version : is the version of the node. it uses either the git tag or a default version *) -val version : Version.t +val version : Tezos_version.Version.t diff --git a/src/lib_version/value/dune b/src/lib_version/value/dune new file mode 100644 index 0000000000000000000000000000000000000000..79715a17295c74bab015915ecbed51d288f95642 --- /dev/null +++ b/src/lib_version/value/dune @@ -0,0 +1,23 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(env (_ (env-vars (NODE_PRELOAD hacl-wasm,ocaml-bls12-381,secp256k1-wasm)))) + +(library + (name tezos_version_value) + (public_name tezos-version.value) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-base + tezos-version + tezos-version.parser) + (js_of_ocaml) + (flags + (:standard) + -opaque + -open Tezos_base.TzPervasives)) + +(rule + (targets generated_git_info.ml) + (deps (universe)) + (action (run ../exe/get_git_info.exe))) diff --git a/src/lib_version/generated_git_info.mli b/src/lib_version/value/generated_git_info.mli similarity index 100% rename from src/lib_version/generated_git_info.mli rename to src/lib_version/value/generated_git_info.mli diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/dune b/src/proto_016_PtMumbai/bin_sc_rollup_client/dune index 8d4f522e7d4f4decf25ec744a3b27f032582b23c..489cb2b99a19d1dec60d7e9c73df57d2d45d9eb0 100644 --- a/src/proto_016_PtMumbai/bin_sc_rollup_client/dune +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/dune @@ -10,7 +10,8 @@ tezos-base tezos-clic tezos-protocol-016-PtMumbai - octez_smart_rollup_client_PtMumbai) + octez_smart_rollup_client_PtMumbai + tezos-version.value) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp) diff --git a/src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml b/src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml index c9f3e5989f38f31462efb867a2aab80176dec19c..1032f3d4e9ceb977c9036ecb5e3d394f2fd74736 100644 --- a/src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml +++ b/src/proto_016_PtMumbai/bin_sc_rollup_client/main_sc_rollup_client_016_PtMumbai.ml @@ -45,7 +45,7 @@ let main () = let handle_error = function | Ok () -> Stdlib.exit 0 | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; Stdlib.exit 0 | Error [Tezos_clic.Help command] -> diff --git a/src/proto_016_PtMumbai/lib_delegate/baking_pow.ml b/src/proto_016_PtMumbai/lib_delegate/baking_pow.ml index 5bd6f69d6234478bc1407b21e94553bf18b6001a..5a7306a3e31c6f464c2aa9715fa9e7086c9ee66c 100644 --- a/src/proto_016_PtMumbai/lib_delegate/baking_pow.ml +++ b/src/proto_016_PtMumbai/lib_delegate/baking_pow.ml @@ -29,8 +29,10 @@ let default_constant = "\x00\x00\x00\x05" let with_version_constant = let commit_hash = - match Hex.to_string (`Hex Tezos_version.Current_git_info.commit_hash) with - | None -> Tezos_version.Current_git_info.commit_hash + match + Hex.to_string (`Hex Tezos_version_value.Current_git_info.commit_hash) + with + | None -> Tezos_version_value.Current_git_info.commit_hash | Some s -> s in if String.length commit_hash >= 4 then String.sub commit_hash 0 4 diff --git a/src/proto_016_PtMumbai/lib_delegate/client_daemon.ml b/src/proto_016_PtMumbai/lib_delegate/client_daemon.ml index 09acb2115440dc566337a75e07e51e5193f2779b..f6dcd5f02daa9e977f0061ef19144e334cd462a9 100644 --- a/src/proto_016_PtMumbai/lib_delegate/client_daemon.ml +++ b/src/proto_016_PtMumbai/lib_delegate/client_daemon.ml @@ -93,8 +93,8 @@ module Baker = struct cctxt#message "Baker v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash >>= fun () -> @@ -121,8 +121,8 @@ module Accuser = struct cctxt#message "Accuser v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash >>= fun () -> @@ -160,8 +160,8 @@ module VDF = struct cctxt#message "VDF daemon v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash in diff --git a/src/proto_016_PtMumbai/lib_delegate/dune b/src/proto_016_PtMumbai/lib_delegate/dune index e81fde09cd3330431c8ba3b18853358dcc9f6b4d..73814284bd57d1758cde04f6ec225ddebc7a6bb6 100644 --- a/src/proto_016_PtMumbai/lib_delegate/dune +++ b/src/proto_016_PtMumbai/lib_delegate/dune @@ -8,7 +8,7 @@ (libraries tezos-base tezos-clic - tezos-version + tezos-version.value tezos-protocol-016-PtMumbai tezos-protocol-plugin-016-PtMumbai tezos-protocol-environment diff --git a/src/proto_016_PtMumbai/lib_sc_rollup_node/dune b/src/proto_016_PtMumbai/lib_sc_rollup_node/dune index fcbfc6a602119e559951a97c628ca29fcb3e303b..1a64e326ab74c53b49216a3792dc595be7b1cdb9 100644 --- a/src/proto_016_PtMumbai/lib_sc_rollup_node/dune +++ b/src/proto_016_PtMumbai/lib_sc_rollup_node/dune @@ -39,7 +39,8 @@ octez-smart-rollup-node tezos-scoru-wasm tezos-scoru-wasm-fast - tezos-crypto-dal) + tezos-crypto-dal + tezos-version.value) (flags (:standard) -open Tezos_base diff --git a/src/proto_016_PtMumbai/lib_sc_rollup_node/store_migration.ml b/src/proto_016_PtMumbai/lib_sc_rollup_node/store_migration.ml index 3805963a8cac526f8018a2e8066a367fb1e22169..a10d8043c46d84973ed7fea31701575d8fea9876 100644 --- a/src/proto_016_PtMumbai/lib_sc_rollup_node/store_migration.ml +++ b/src/proto_016_PtMumbai/lib_sc_rollup_node/store_migration.ml @@ -260,7 +260,7 @@ module V1_migrations = struct Format.asprintf "Rollup node %a" Tezos_version_parser.pp - Tezos_version.Current_git_info.version + Tezos_version_value.Current_git_info.version in let message = "Migration store from v0 to v1" in Irmin_store.Raw_irmin.Info.v ~author ~message date diff --git a/src/proto_017_PtNairob/bin_sc_rollup_client/dune b/src/proto_017_PtNairob/bin_sc_rollup_client/dune index 9497cba0e59188093033459a5168fa92ba9af040..16c2fc41dfbf97ddc8a80fce30b6b8659af406c8 100644 --- a/src/proto_017_PtNairob/bin_sc_rollup_client/dune +++ b/src/proto_017_PtNairob/bin_sc_rollup_client/dune @@ -10,7 +10,8 @@ tezos-base tezos-clic tezos-protocol-017-PtNairob - octez_smart_rollup_client_PtNairob) + octez_smart_rollup_client_PtNairob + tezos-version.value) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp) diff --git a/src/proto_017_PtNairob/bin_sc_rollup_client/main_sc_rollup_client_017_PtNairob.ml b/src/proto_017_PtNairob/bin_sc_rollup_client/main_sc_rollup_client_017_PtNairob.ml index c9f3e5989f38f31462efb867a2aab80176dec19c..1032f3d4e9ceb977c9036ecb5e3d394f2fd74736 100644 --- a/src/proto_017_PtNairob/bin_sc_rollup_client/main_sc_rollup_client_017_PtNairob.ml +++ b/src/proto_017_PtNairob/bin_sc_rollup_client/main_sc_rollup_client_017_PtNairob.ml @@ -45,7 +45,7 @@ let main () = let handle_error = function | Ok () -> Stdlib.exit 0 | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; Stdlib.exit 0 | Error [Tezos_clic.Help command] -> diff --git a/src/proto_017_PtNairob/lib_delegate/baking_pow.ml b/src/proto_017_PtNairob/lib_delegate/baking_pow.ml index 5bd6f69d6234478bc1407b21e94553bf18b6001a..5a7306a3e31c6f464c2aa9715fa9e7086c9ee66c 100644 --- a/src/proto_017_PtNairob/lib_delegate/baking_pow.ml +++ b/src/proto_017_PtNairob/lib_delegate/baking_pow.ml @@ -29,8 +29,10 @@ let default_constant = "\x00\x00\x00\x05" let with_version_constant = let commit_hash = - match Hex.to_string (`Hex Tezos_version.Current_git_info.commit_hash) with - | None -> Tezos_version.Current_git_info.commit_hash + match + Hex.to_string (`Hex Tezos_version_value.Current_git_info.commit_hash) + with + | None -> Tezos_version_value.Current_git_info.commit_hash | Some s -> s in if String.length commit_hash >= 4 then String.sub commit_hash 0 4 diff --git a/src/proto_017_PtNairob/lib_delegate/client_daemon.ml b/src/proto_017_PtNairob/lib_delegate/client_daemon.ml index 3748f0dd300574bac854ec4241a2ed694c7c2529..419ac9e7f9cd14511be61c5aa913254e0f588c80 100644 --- a/src/proto_017_PtNairob/lib_delegate/client_daemon.ml +++ b/src/proto_017_PtNairob/lib_delegate/client_daemon.ml @@ -94,8 +94,8 @@ module Baker = struct cctxt#message "Baker v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash >>= fun () -> @@ -122,8 +122,8 @@ module Accuser = struct cctxt#message "Accuser v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash >>= fun () -> @@ -161,8 +161,8 @@ module VDF = struct cctxt#message "VDF daemon v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash in diff --git a/src/proto_017_PtNairob/lib_delegate/dune b/src/proto_017_PtNairob/lib_delegate/dune index 9831e61f748d75f6013d7b498601d5553d4e0c44..a1b01f0aab2d27d33806494f787710f537737af1 100644 --- a/src/proto_017_PtNairob/lib_delegate/dune +++ b/src/proto_017_PtNairob/lib_delegate/dune @@ -8,7 +8,7 @@ (libraries tezos-base tezos-clic - tezos-version + tezos-version.value tezos-protocol-017-PtNairob tezos-protocol-plugin-017-PtNairob tezos-protocol-environment diff --git a/src/proto_017_PtNairob/lib_sc_rollup_node/dune b/src/proto_017_PtNairob/lib_sc_rollup_node/dune index 0ea16236df4264b9192535589b13363b02b56c37..62c12fad9c09d6bca85efa3278c9961a7cfedf8e 100644 --- a/src/proto_017_PtNairob/lib_sc_rollup_node/dune +++ b/src/proto_017_PtNairob/lib_sc_rollup_node/dune @@ -39,7 +39,8 @@ octez-smart-rollup-node tezos-scoru-wasm tezos-scoru-wasm-fast - tezos-crypto-dal) + tezos-crypto-dal + tezos-version.value) (flags (:standard) -open Tezos_base diff --git a/src/proto_017_PtNairob/lib_sc_rollup_node/store_migration.ml b/src/proto_017_PtNairob/lib_sc_rollup_node/store_migration.ml index 3805963a8cac526f8018a2e8066a367fb1e22169..a10d8043c46d84973ed7fea31701575d8fea9876 100644 --- a/src/proto_017_PtNairob/lib_sc_rollup_node/store_migration.ml +++ b/src/proto_017_PtNairob/lib_sc_rollup_node/store_migration.ml @@ -260,7 +260,7 @@ module V1_migrations = struct Format.asprintf "Rollup node %a" Tezos_version_parser.pp - Tezos_version.Current_git_info.version + Tezos_version_value.Current_git_info.version in let message = "Migration store from v0 to v1" in Irmin_store.Raw_irmin.Info.v ~author ~message date diff --git a/src/proto_alpha/bin_sc_rollup_client/dune b/src/proto_alpha/bin_sc_rollup_client/dune index eb84c18f51427c2f8f3e66f1b33180fa91c0ac09..963bdb7b668260b91681c669a1c1c021fb8d11d1 100644 --- a/src/proto_alpha/bin_sc_rollup_client/dune +++ b/src/proto_alpha/bin_sc_rollup_client/dune @@ -10,7 +10,8 @@ tezos-base tezos-clic tezos-protocol-alpha - octez_smart_rollup_client_alpha) + octez_smart_rollup_client_alpha + tezos-version.value) (link_flags (:standard) (:include %{workspace_root}/static-link-flags.sexp) diff --git a/src/proto_alpha/bin_sc_rollup_client/main_sc_rollup_client_alpha.ml b/src/proto_alpha/bin_sc_rollup_client/main_sc_rollup_client_alpha.ml index c9f3e5989f38f31462efb867a2aab80176dec19c..1032f3d4e9ceb977c9036ecb5e3d394f2fd74736 100644 --- a/src/proto_alpha/bin_sc_rollup_client/main_sc_rollup_client_alpha.ml +++ b/src/proto_alpha/bin_sc_rollup_client/main_sc_rollup_client_alpha.ml @@ -45,7 +45,7 @@ let main () = let handle_error = function | Ok () -> Stdlib.exit 0 | Error [Tezos_clic.Version] -> - let version = Tezos_version.Bin_version.version_string in + let version = Tezos_version_value.Bin_version.version_string in Format.printf "%s\n" version ; Stdlib.exit 0 | Error [Tezos_clic.Help command] -> diff --git a/src/proto_alpha/lib_delegate/baking_pow.ml b/src/proto_alpha/lib_delegate/baking_pow.ml index 5bd6f69d6234478bc1407b21e94553bf18b6001a..5a7306a3e31c6f464c2aa9715fa9e7086c9ee66c 100644 --- a/src/proto_alpha/lib_delegate/baking_pow.ml +++ b/src/proto_alpha/lib_delegate/baking_pow.ml @@ -29,8 +29,10 @@ let default_constant = "\x00\x00\x00\x05" let with_version_constant = let commit_hash = - match Hex.to_string (`Hex Tezos_version.Current_git_info.commit_hash) with - | None -> Tezos_version.Current_git_info.commit_hash + match + Hex.to_string (`Hex Tezos_version_value.Current_git_info.commit_hash) + with + | None -> Tezos_version_value.Current_git_info.commit_hash | Some s -> s in if String.length commit_hash >= 4 then String.sub commit_hash 0 4 diff --git a/src/proto_alpha/lib_delegate/client_daemon.ml b/src/proto_alpha/lib_delegate/client_daemon.ml index 1ec3357eabaa45fe3c84d351a3d9c757a98d4f67..f24a6b7783f581a22d975200d0196f612fb4b4c2 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.ml +++ b/src/proto_alpha/lib_delegate/client_daemon.ml @@ -94,8 +94,8 @@ module Baker = struct cctxt#message "Baker v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash >>= fun () -> @@ -122,8 +122,8 @@ module Accuser = struct cctxt#message "Accuser v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash >>= fun () -> @@ -161,8 +161,8 @@ module VDF = struct cctxt#message "VDF daemon v%a (%s) for %a started." Tezos_version.Version.pp - Tezos_version.Current_git_info.version - Tezos_version.Current_git_info.abbreviated_commit_hash + Tezos_version_value.Current_git_info.version + Tezos_version_value.Current_git_info.abbreviated_commit_hash Protocol_hash.pp_short Protocol.hash in diff --git a/src/proto_alpha/lib_delegate/dune b/src/proto_alpha/lib_delegate/dune index a0aaf319b93b992968e34f5fbb37b38ca9852395..8339c005329e00af1ed9b85dba1578c504e15837 100644 --- a/src/proto_alpha/lib_delegate/dune +++ b/src/proto_alpha/lib_delegate/dune @@ -8,7 +8,7 @@ (libraries tezos-base tezos-clic - tezos-version + tezos-version.value tezos-protocol-alpha tezos-protocol-alpha.lifted tezos-protocol-plugin-alpha diff --git a/src/proto_alpha/lib_sc_rollup_node/dune b/src/proto_alpha/lib_sc_rollup_node/dune index ef3f6a5dcfdf511aa663f1086fee82b25de0773c..98947334bafda806ef02e5fa91a3ae40006680d6 100644 --- a/src/proto_alpha/lib_sc_rollup_node/dune +++ b/src/proto_alpha/lib_sc_rollup_node/dune @@ -40,7 +40,8 @@ octez-smart-rollup-node tezos-scoru-wasm tezos-scoru-wasm-fast - tezos-crypto-dal) + tezos-crypto-dal + tezos-version.value) (flags (:standard) -open Tezos_base diff --git a/src/proto_alpha/lib_sc_rollup_node/store_migration.ml b/src/proto_alpha/lib_sc_rollup_node/store_migration.ml index 3805963a8cac526f8018a2e8066a367fb1e22169..a10d8043c46d84973ed7fea31701575d8fea9876 100644 --- a/src/proto_alpha/lib_sc_rollup_node/store_migration.ml +++ b/src/proto_alpha/lib_sc_rollup_node/store_migration.ml @@ -260,7 +260,7 @@ module V1_migrations = struct Format.asprintf "Rollup node %a" Tezos_version_parser.pp - Tezos_version.Current_git_info.version + Tezos_version_value.Current_git_info.version in let message = "Migration store from v0 to v1" in Irmin_store.Raw_irmin.Info.v ~author ~message date