From f402725db181916fd7dfdf6757f44c6058625d28 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Mon, 22 Aug 2022 16:43:12 +0200 Subject: [PATCH 1/9] Manifest: use resto 0.9 --- manifest/main.ml | 2 +- opam/tezos-mockup-proxy.opam | 2 +- opam/tezos-mockup.opam | 2 +- opam/tezos-rpc-http-client-unix.opam | 2 +- opam/tezos-rpc-http-client.opam | 2 +- opam/tezos-rpc-http-server.opam | 4 ++-- opam/tezos-rpc-http.opam | 2 +- opam/tezos-rpc.opam | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 4c6c1c93b7af..0707e761cc6d 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -275,7 +275,7 @@ let qcheck_core = external_lib "qcheck-core" V.True let re = external_lib ~js_compatible:true "re" V.(at_least "1.7.2") -let resto_version = V.(at_least "0.8" && less_than "0.9") +let resto_version = V.(at_least "0.9" && less_than "1.0") let resto = external_lib ~js_compatible:true "resto" resto_version diff --git a/opam/tezos-mockup-proxy.opam b/opam/tezos-mockup-proxy.opam index 49f2ae9f0793..fc244b455596 100644 --- a/opam/tezos-mockup-proxy.opam +++ b/opam/tezos-mockup-proxy.opam @@ -13,7 +13,7 @@ depends: [ "tezos-client-base" "tezos-protocol-environment" "tezos-rpc-http" - "resto-cohttp-self-serving-client" { >= "0.8" & < "0.9" } + "resto-cohttp-self-serving-client" { >= "0.9" & < "1.0" } "tezos-rpc-http-client" "tezos-shell-services" "uri" { >= "2.2.0" } diff --git a/opam/tezos-mockup.opam b/opam/tezos-mockup.opam index 02b575f7bc96..996a1ed8058f 100644 --- a/opam/tezos-mockup.opam +++ b/opam/tezos-mockup.opam @@ -12,7 +12,7 @@ depends: [ "tezos-base" "tezos-client-base" "tezos-mockup-proxy" - "resto-cohttp-self-serving-client" { >= "0.8" & < "0.9" } + "resto-cohttp-self-serving-client" { >= "0.9" & < "1.0" } "tezos-rpc" "tezos-p2p-services" "tezos-p2p" diff --git a/opam/tezos-rpc-http-client-unix.opam b/opam/tezos-rpc-http-client-unix.opam index bc8d110cf72e..34c515e09db3 100644 --- a/opam/tezos-rpc-http-client-unix.opam +++ b/opam/tezos-rpc-http-client-unix.opam @@ -12,7 +12,7 @@ depends: [ "tezos-stdlib-unix" "tezos-base" "cohttp-lwt-unix" { >= "2.2.0" } - "resto-cohttp-client" { >= "0.8" & < "0.9" } + "resto-cohttp-client" { >= "0.9" & < "1.0" } "tezos-rpc-http-client" ] build: [ diff --git a/opam/tezos-rpc-http-client.opam b/opam/tezos-rpc-http-client.opam index b434b654c923..c45db295c176 100644 --- a/opam/tezos-rpc-http-client.opam +++ b/opam/tezos-rpc-http-client.opam @@ -10,7 +10,7 @@ license: "MIT" depends: [ "dune" { >= "3.0" } "tezos-base" - "resto-cohttp-client" { >= "0.8" & < "0.9" } + "resto-cohttp-client" { >= "0.9" & < "1.0" } "tezos-rpc-http" ] build: [ diff --git a/opam/tezos-rpc-http-server.opam b/opam/tezos-rpc-http-server.opam index 5b9691535f44..4fd31e30f302 100644 --- a/opam/tezos-rpc-http-server.opam +++ b/opam/tezos-rpc-http-server.opam @@ -11,8 +11,8 @@ depends: [ "dune" { >= "3.0" } "tezos-base" "tezos-stdlib-unix" - "resto-cohttp-server" { >= "0.8" & < "0.9" } - "resto-acl" { >= "0.8" & < "0.9" } + "resto-cohttp-server" { >= "0.9" & < "1.0" } + "resto-acl" { >= "0.9" & < "1.0" } "tezos-rpc" "tezos-rpc-http" "tezos-stdlib" {with-test} diff --git a/opam/tezos-rpc-http.opam b/opam/tezos-rpc-http.opam index a78d8c2d7ca3..6aee01ec273e 100644 --- a/opam/tezos-rpc-http.opam +++ b/opam/tezos-rpc-http.opam @@ -10,7 +10,7 @@ license: "MIT" depends: [ "dune" { >= "3.0" } "tezos-base" - "resto-cohttp" { >= "0.8" & < "0.9" } + "resto-cohttp" { >= "0.9" & < "1.0" } "uri" { >= "2.2.0" } ] build: [ diff --git a/opam/tezos-rpc.opam b/opam/tezos-rpc.opam index 089f78786c65..dd2fcecca7b6 100644 --- a/opam/tezos-rpc.opam +++ b/opam/tezos-rpc.opam @@ -11,8 +11,8 @@ depends: [ "dune" { >= "3.0" } "data-encoding" { >= "0.6" & < "0.7" } "tezos-error-monad" - "resto" { >= "0.8" & < "0.9" } - "resto-directory" { >= "0.8" & < "0.9" } + "resto" { >= "0.9" & < "1.0" } + "resto-directory" { >= "0.9" & < "1.0" } "uri" { >= "2.2.0" } ] build: [ -- GitLab From 53c40e192bfc32c5509f6ea133cb9f5e28e812bc Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Tue, 30 Aug 2022 14:32:22 +0200 Subject: [PATCH 2/9] lib_protocol_environment: Adapt to resto v0.9 --- .../environment_V4.ml | 2 +- .../environment_V5.ml | 2 +- .../environment_V6.ml | 2 +- src/lib_protocol_environment/sigs/v7.ml | 6 +++- .../sigs/v7/RPC_directory.mli | 6 +++- .../tezos_protocol_environment_structs.ml | 7 +++++ .../structs/v0_RPC_directory.ml | 29 +++++++++++++++++++ 7 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 src/lib_protocol_environment/structs/v0_RPC_directory.ml diff --git a/src/lib_protocol_environment/environment_V4.ml b/src/lib_protocol_environment/environment_V4.ml index 83e69daf3529..14784e089d59 100644 --- a/src/lib_protocol_environment/environment_V4.ml +++ b/src/lib_protocol_environment/environment_V4.ml @@ -752,7 +752,7 @@ struct end module RPC_directory = struct - include RPC_directory + include Tezos_protocol_environment_structs.V4.RPC_directory let gen_register dir service handler = let open Lwt_syntax in diff --git a/src/lib_protocol_environment/environment_V5.ml b/src/lib_protocol_environment/environment_V5.ml index d4da242e9dda..46e97c4ebbf7 100644 --- a/src/lib_protocol_environment/environment_V5.ml +++ b/src/lib_protocol_environment/environment_V5.ml @@ -726,7 +726,7 @@ struct end module RPC_directory = struct - include RPC_directory + include Tezos_protocol_environment_structs.V5.RPC_directory let gen_register dir service handler = let open Lwt_syntax in diff --git a/src/lib_protocol_environment/environment_V6.ml b/src/lib_protocol_environment/environment_V6.ml index 902e538a6733..bdf17c67b6a4 100644 --- a/src/lib_protocol_environment/environment_V6.ml +++ b/src/lib_protocol_environment/environment_V6.ml @@ -732,7 +732,7 @@ struct end module RPC_directory = struct - include RPC_directory + include Tezos_protocol_environment_structs.V6.RPC_directory let gen_register dir service handler = let open Lwt_syntax in diff --git a/src/lib_protocol_environment/sigs/v7.ml b/src/lib_protocol_environment/sigs/v7.ml index 770ab6ab2537..3a875ea39189 100644 --- a/src/lib_protocol_environment/sigs/v7.ml +++ b/src/lib_protocol_environment/sigs/v7.ml @@ -8591,7 +8591,11 @@ val map : ('a -> 'b Lwt.t) -> 'b directory -> 'a directory val prefix : ('pr, 'p) RPC_path.path -> 'p directory -> 'pr directory -val merge : 'a directory -> 'a directory -> 'a directory +val merge : + ?strategy:[`Raise | `Pick_left | `Pick_right] -> + 'a directory -> + 'a directory -> + 'a directory (** Possible error while registering services. *) type step = diff --git a/src/lib_protocol_environment/sigs/v7/RPC_directory.mli b/src/lib_protocol_environment/sigs/v7/RPC_directory.mli index b45970de9bfa..064b3be7b485 100644 --- a/src/lib_protocol_environment/sigs/v7/RPC_directory.mli +++ b/src/lib_protocol_environment/sigs/v7/RPC_directory.mli @@ -35,7 +35,11 @@ val map : ('a -> 'b Lwt.t) -> 'b directory -> 'a directory val prefix : ('pr, 'p) RPC_path.path -> 'p directory -> 'pr directory -val merge : 'a directory -> 'a directory -> 'a directory +val merge : + ?strategy:[`Raise | `Pick_left | `Pick_right] -> + 'a directory -> + 'a directory -> + 'a directory (** Possible error while registering services. *) type step = diff --git a/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml b/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml index e0a31f8e479e..e0461bc57091 100644 --- a/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml +++ b/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml @@ -18,6 +18,7 @@ module V0 = struct module Data_encoding = V0_data_encoding module Error_monad_infix_globals = V0_error_monad_infix_globals module Error_monad_trace_eval = V0_error_monad_trace_eval + module RPC_directory = V0_RPC_directory end module V1 = struct @@ -42,6 +43,7 @@ module V1 = struct module Hex = V1_hex module Error_monad_infix_globals = V0_error_monad_infix_globals module Error_monad_trace_eval = V0_error_monad_trace_eval + module RPC_directory = V0_RPC_directory end module V2 = struct @@ -65,6 +67,7 @@ module V2 = struct module Hex = V1_hex module Error_monad_infix_globals = V0_error_monad_infix_globals module Error_monad_trace_eval = V0_error_monad_trace_eval + module RPC_directory = V0_RPC_directory end module V3 = struct @@ -76,6 +79,7 @@ module V3 = struct module Hex = V1_hex module Error_monad_infix_globals = V0_error_monad_infix_globals module Error_monad_trace_eval = V0_error_monad_trace_eval + module RPC_directory = V0_RPC_directory end module V4 = struct @@ -83,17 +87,20 @@ module V4 = struct module Replicated_signatures = V3_replicated_signatures module Lwtreslib_list_combine = V3_lwtreslib_list_combine module Error_monad_infix_globals = V0_error_monad_infix_globals + module RPC_directory = V0_RPC_directory end module V5 = struct module Error_monad_infix_globals = V0_error_monad_infix_globals module Bounded = V5_bounded + module RPC_directory = V0_RPC_directory end module V6 = struct module Error_monad_infix_globals = V0_error_monad_infix_globals module Plonk = V6_plonk module Bounded = V5_bounded + module RPC_directory = V0_RPC_directory end module V7 = struct diff --git a/src/lib_protocol_environment/structs/v0_RPC_directory.ml b/src/lib_protocol_environment/structs/v0_RPC_directory.ml new file mode 100644 index 000000000000..238b35580148 --- /dev/null +++ b/src/lib_protocol_environment/structs/v0_RPC_directory.ml @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) +(* Copyright (c) 2019 Nomadic Labs, *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +include Tezos_rpc.RPC_directory + +let merge d1 d2 = merge ~strategy:`Pick_left d1 d2 -- GitLab From 548a8ebced7792f84c2d13c87197fc6d86bcac43 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Mon, 22 Aug 2022 16:41:34 +0200 Subject: [PATCH 3/9] Manifest: use Resto 0.10 --- manifest/main.ml | 2 +- opam/tezos-mockup-proxy.opam | 2 +- opam/tezos-mockup.opam | 2 +- opam/tezos-rpc-http-client-unix.opam | 2 +- opam/tezos-rpc-http-client.opam | 2 +- opam/tezos-rpc-http-server.opam | 4 ++-- opam/tezos-rpc-http.opam | 2 +- opam/tezos-rpc.opam | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 0707e761cc6d..9d3eefac5094 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -275,7 +275,7 @@ let qcheck_core = external_lib "qcheck-core" V.True let re = external_lib ~js_compatible:true "re" V.(at_least "1.7.2") -let resto_version = V.(at_least "0.9" && less_than "1.0") +let resto_version = V.(at_least "0.10" && less_than "1.0") let resto = external_lib ~js_compatible:true "resto" resto_version diff --git a/opam/tezos-mockup-proxy.opam b/opam/tezos-mockup-proxy.opam index fc244b455596..8be49e5df536 100644 --- a/opam/tezos-mockup-proxy.opam +++ b/opam/tezos-mockup-proxy.opam @@ -13,7 +13,7 @@ depends: [ "tezos-client-base" "tezos-protocol-environment" "tezos-rpc-http" - "resto-cohttp-self-serving-client" { >= "0.9" & < "1.0" } + "resto-cohttp-self-serving-client" { >= "0.10" & < "1.0" } "tezos-rpc-http-client" "tezos-shell-services" "uri" { >= "2.2.0" } diff --git a/opam/tezos-mockup.opam b/opam/tezos-mockup.opam index 996a1ed8058f..39bfaf29438d 100644 --- a/opam/tezos-mockup.opam +++ b/opam/tezos-mockup.opam @@ -12,7 +12,7 @@ depends: [ "tezos-base" "tezos-client-base" "tezos-mockup-proxy" - "resto-cohttp-self-serving-client" { >= "0.9" & < "1.0" } + "resto-cohttp-self-serving-client" { >= "0.10" & < "1.0" } "tezos-rpc" "tezos-p2p-services" "tezos-p2p" diff --git a/opam/tezos-rpc-http-client-unix.opam b/opam/tezos-rpc-http-client-unix.opam index 34c515e09db3..e7791ac00d30 100644 --- a/opam/tezos-rpc-http-client-unix.opam +++ b/opam/tezos-rpc-http-client-unix.opam @@ -12,7 +12,7 @@ depends: [ "tezos-stdlib-unix" "tezos-base" "cohttp-lwt-unix" { >= "2.2.0" } - "resto-cohttp-client" { >= "0.9" & < "1.0" } + "resto-cohttp-client" { >= "0.10" & < "1.0" } "tezos-rpc-http-client" ] build: [ diff --git a/opam/tezos-rpc-http-client.opam b/opam/tezos-rpc-http-client.opam index c45db295c176..85248e3c6f87 100644 --- a/opam/tezos-rpc-http-client.opam +++ b/opam/tezos-rpc-http-client.opam @@ -10,7 +10,7 @@ license: "MIT" depends: [ "dune" { >= "3.0" } "tezos-base" - "resto-cohttp-client" { >= "0.9" & < "1.0" } + "resto-cohttp-client" { >= "0.10" & < "1.0" } "tezos-rpc-http" ] build: [ diff --git a/opam/tezos-rpc-http-server.opam b/opam/tezos-rpc-http-server.opam index 4fd31e30f302..664be09e9928 100644 --- a/opam/tezos-rpc-http-server.opam +++ b/opam/tezos-rpc-http-server.opam @@ -11,8 +11,8 @@ depends: [ "dune" { >= "3.0" } "tezos-base" "tezos-stdlib-unix" - "resto-cohttp-server" { >= "0.9" & < "1.0" } - "resto-acl" { >= "0.9" & < "1.0" } + "resto-cohttp-server" { >= "0.10" & < "1.0" } + "resto-acl" { >= "0.10" & < "1.0" } "tezos-rpc" "tezos-rpc-http" "tezos-stdlib" {with-test} diff --git a/opam/tezos-rpc-http.opam b/opam/tezos-rpc-http.opam index 6aee01ec273e..04b6cff8eab0 100644 --- a/opam/tezos-rpc-http.opam +++ b/opam/tezos-rpc-http.opam @@ -10,7 +10,7 @@ license: "MIT" depends: [ "dune" { >= "3.0" } "tezos-base" - "resto-cohttp" { >= "0.9" & < "1.0" } + "resto-cohttp" { >= "0.10" & < "1.0" } "uri" { >= "2.2.0" } ] build: [ diff --git a/opam/tezos-rpc.opam b/opam/tezos-rpc.opam index dd2fcecca7b6..5b2a9e42bb17 100644 --- a/opam/tezos-rpc.opam +++ b/opam/tezos-rpc.opam @@ -11,8 +11,8 @@ depends: [ "dune" { >= "3.0" } "data-encoding" { >= "0.6" & < "0.7" } "tezos-error-monad" - "resto" { >= "0.9" & < "1.0" } - "resto-directory" { >= "0.9" & < "1.0" } + "resto" { >= "0.10" & < "1.0" } + "resto-directory" { >= "0.10" & < "1.0" } "uri" { >= "2.2.0" } ] build: [ -- GitLab From 77f9788131425d27cdb75ca3e65dcbaceab8e9c9 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Mon, 22 Aug 2022 16:41:48 +0200 Subject: [PATCH 4/9] lib_protocol_environment: Adapt to resto v0.10 --- src/lib_protocol_environment/sigs/v7.ml | 1 + .../sigs/v7/RPC_directory.mli | 1 + .../structs/v0_RPC_directory.ml | 34 ++++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/lib_protocol_environment/sigs/v7.ml b/src/lib_protocol_environment/sigs/v7.ml index 3a875ea39189..1532e3d519a7 100644 --- a/src/lib_protocol_environment/sigs/v7.ml +++ b/src/lib_protocol_environment/sigs/v7.ml @@ -8607,6 +8607,7 @@ type conflict = | CService of RPC_service.meth | CDir | CBuilder + | CDynDescr of string * string | CTail | CTypes of RPC_arg.descr * RPC_arg.descr | CType of RPC_arg.descr * string list diff --git a/src/lib_protocol_environment/sigs/v7/RPC_directory.mli b/src/lib_protocol_environment/sigs/v7/RPC_directory.mli index 064b3be7b485..94e70bf56fc5 100644 --- a/src/lib_protocol_environment/sigs/v7/RPC_directory.mli +++ b/src/lib_protocol_environment/sigs/v7/RPC_directory.mli @@ -51,6 +51,7 @@ type conflict = | CService of RPC_service.meth | CDir | CBuilder + | CDynDescr of string * string | CTail | CTypes of RPC_arg.descr * RPC_arg.descr | CType of RPC_arg.descr * string list diff --git a/src/lib_protocol_environment/structs/v0_RPC_directory.ml b/src/lib_protocol_environment/structs/v0_RPC_directory.ml index 238b35580148..12567a54c467 100644 --- a/src/lib_protocol_environment/structs/v0_RPC_directory.ml +++ b/src/lib_protocol_environment/structs/v0_RPC_directory.ml @@ -26,4 +26,36 @@ include Tezos_rpc.RPC_directory -let merge d1 d2 = merge ~strategy:`Pick_left d1 d2 +type conflict = + | CService of Tezos_rpc.RPC_service.meth + | CDir + | CBuilder + | CTail + | CTypes of Tezos_rpc.RPC_arg.descr * Tezos_rpc.RPC_arg.descr + | CType of Tezos_rpc.RPC_arg.descr * string list + +exception Conflict of step list * conflict + +let merge d1 d2 = + try merge ~strategy:`Raise d1 d2 with + | Tezos_rpc.RPC_directory.Conflict (sl, Tezos_rpc.RPC_directory.CService m) -> + raise (Conflict (sl, CService m)) + | Tezos_rpc.RPC_directory.Conflict (sl, Tezos_rpc.RPC_directory.CDir) -> + raise (Conflict (sl, CDir)) + | Tezos_rpc.RPC_directory.Conflict (sl, Tezos_rpc.RPC_directory.CBuilder) -> + raise (Conflict (sl, CBuilder)) + (* Here we reproduce the old behavior before + https://gitlab.com/tezos/tezos/-/merge_requests/6085#note_1075865206. + This conflit is raised when merging dynamic directories. + As dynamic directories were not mergeable, [CBuilder] was raised.*) + | Tezos_rpc.RPC_directory.Conflict + (sl, Tezos_rpc.RPC_directory.CDynDescr (_, _)) -> + raise (Conflict (sl, CBuilder)) + | Tezos_rpc.RPC_directory.Conflict (sl, Tezos_rpc.RPC_directory.CTail) -> + raise (Conflict (sl, CTail)) + | Tezos_rpc.RPC_directory.Conflict + (sl, Tezos_rpc.RPC_directory.CTypes (arg1, arg2)) -> + raise (Conflict (sl, CTypes (arg1, arg2))) + | Tezos_rpc.RPC_directory.Conflict (sl, Tezos_rpc.RPC_directory.CType (d, l)) + -> + raise (Conflict (sl, CType (d, l))) -- GitLab From bb578fe2458ec99a2889a71468cbafc08209944c Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Mon, 29 Aug 2022 18:34:49 +0200 Subject: [PATCH 5/9] lib_lwt_result_stdlib: fix deprecated lwt_result.err --- src/lib_lwt_result_stdlib/bare/structs/monad.ml | 2 +- src/lib_lwt_result_stdlib/bare/structs/seq_e.ml | 8 ++++---- src/lib_lwt_result_stdlib/bare/structs/seq_es.ml | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib_lwt_result_stdlib/bare/structs/monad.ml b/src/lib_lwt_result_stdlib/bare/structs/monad.ml index 8c2498d088cf..f87b752d4a3e 100644 --- a/src/lib_lwt_result_stdlib/bare/structs/monad.ml +++ b/src/lib_lwt_result_stdlib/bare/structs/monad.ml @@ -160,7 +160,7 @@ module Lwt_result_syntax = struct let ( let+ ) v f = Lwt_result.map f v - let lwt_map_error = Lwt_result.map_err + let lwt_map_error = Lwt_result.map_error let ( let*! ) = Lwt.bind diff --git a/src/lib_lwt_result_stdlib/bare/structs/seq_e.ml b/src/lib_lwt_result_stdlib/bare/structs/seq_e.ml index 7e2e137ec232..2cba05200666 100644 --- a/src/lib_lwt_result_stdlib/bare/structs/seq_e.ml +++ b/src/lib_lwt_result_stdlib/bare/structs/seq_e.ml @@ -130,7 +130,7 @@ let rec fold_left_es_discriminated f acc seq = | Error e -> Lwt.return_error (Either.left e) | Ok Nil -> return acc | Ok (Cons (item, seq)) -> - let* acc = Lwt_result.map_err Either.right @@ f acc item in + let* acc = Lwt_result.map_error Either.right @@ f acc item in fold_left_es_discriminated f acc seq let fold_left_es_discriminated f acc seq = @@ -139,7 +139,7 @@ let fold_left_es_discriminated f acc seq = | Error e -> Lwt.return_error (Either.Left e) | Ok Nil -> return acc | Ok (Cons (item, seq)) -> - let* acc = Lwt_result.map_err Either.right @@ lwt_apply2 f acc item in + let* acc = Lwt_result.map_error Either.right @@ lwt_apply2 f acc item in fold_left_es_discriminated f acc seq let rec iter f seq = @@ -208,7 +208,7 @@ let rec iter_es_discriminated f seq = | Error e -> Lwt.return_error (Either.Left e) | Ok Nil -> return_unit | Ok (Cons (item, seq)) -> - let* () = Lwt_result.map_err Either.right @@ f item in + let* () = Lwt_result.map_error Either.right @@ f item in iter_es_discriminated f seq let iter_es_discriminated f seq = @@ -217,7 +217,7 @@ let iter_es_discriminated f seq = | Error e -> Lwt.return_error (Either.Left e) | Ok Nil -> return_unit | Ok (Cons (item, seq)) -> - let* () = Lwt_result.map_err Either.right @@ Lwt.apply f item in + let* () = Lwt_result.map_error Either.right @@ Lwt.apply f item in iter_es_discriminated f seq let iter_p f seq = diff --git a/src/lib_lwt_result_stdlib/bare/structs/seq_es.ml b/src/lib_lwt_result_stdlib/bare/structs/seq_es.ml index 255d5cfd4f1b..b11fd85e1b20 100644 --- a/src/lib_lwt_result_stdlib/bare/structs/seq_es.ml +++ b/src/lib_lwt_result_stdlib/bare/structs/seq_es.ml @@ -113,7 +113,7 @@ let rec fold_left_e f acc seq = let fold_left_e f acc seq = fold_left_e f acc @@ protect seq let rec fold_left_e_discriminated f acc seq = - let* n = Lwt_result.map_err Either.left @@ seq () in + let* n = Lwt_result.map_error Either.left @@ seq () in match n with | Nil -> return acc | Cons (item, seq) -> @@ -144,11 +144,11 @@ let rec fold_left_es f acc seq = let fold_left_es f acc seq = fold_left_es f acc @@ protect seq let rec fold_left_es_discriminated f acc seq = - let* n = Lwt_result.map_err Either.left @@ seq () in + let* n = Lwt_result.map_error Either.left @@ seq () in match n with | Nil -> return acc | Cons (item, seq) -> - let* acc = Lwt_result.map_err Either.right @@ f acc item in + let* acc = Lwt_result.map_error Either.right @@ f acc item in fold_left_es_discriminated f acc seq let fold_left_es_discriminated f acc seq = @@ -175,7 +175,7 @@ let rec iter_e f seq = let iter_e f seq = iter_e f @@ protect seq let rec iter_e_discriminated f seq = - let* n = Lwt_result.map_err Either.left @@ seq () in + let* n = Lwt_result.map_error Either.left @@ seq () in match n with | Nil -> return_unit | Cons (item, seq) -> @@ -205,11 +205,11 @@ let rec iter_es f seq = let iter_es f seq = iter_es f @@ protect seq let rec iter_es_discriminated f seq = - let* n = Lwt_result.map_err Either.left @@ seq () in + let* n = Lwt_result.map_error Either.left @@ seq () in match n with | Nil -> Lwt_result_syntax.return_unit | Cons (item, seq) -> - let* () = Lwt_result.map_err Either.right @@ f item in + let* () = Lwt_result.map_error Either.right @@ f item in iter_es_discriminated f seq let iter_es_discriminated f seq = iter_es_discriminated f @@ protect seq -- GitLab From 6ea8bbedb1ad1808ed19675bfdc6d269fc3b7338 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Mon, 29 Aug 2022 18:35:13 +0200 Subject: [PATCH 6/9] lib_shell: fix deprecated lwt_result.err --- src/lib_shell/block_validator.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_shell/block_validator.ml b/src/lib_shell/block_validator.ml index 36638ba97a99..34b001584cf9 100644 --- a/src/lib_shell/block_validator.ml +++ b/src/lib_shell/block_validator.ml @@ -492,11 +492,11 @@ let validate w ?canceler ?peer ?(notify_new_block = fun _ -> ()) expected = header.shell.operations_hash; found = computed_hash; }) - |> Lwt_result.map_err (fun e -> Worker.Request_error e) + |> Lwt_result.map_error (fun e -> Worker.Request_error e) in let* () = check_chain_liveness chain_db hash header - |> Lwt_result.map_err (fun e -> Worker.Request_error e) + |> Lwt_result.map_error (fun e -> Worker.Request_error e) in Worker.Queue.push_request_and_wait w -- GitLab From f51582547ea5b132e8c2eedaa7f8364be55d70f5 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Thu, 1 Sep 2022 15:43:38 +0200 Subject: [PATCH 7/9] Manifest: Use Lwt 5.6.0 --- manifest/main.ml | 2 +- opam/lazy-containers-tests.opam | 2 +- opam/tezos-base.opam | 2 +- opam/tezos-clic.opam | 2 +- opam/tezos-crypto-dal.opam | 2 +- opam/tezos-crypto.opam | 2 +- opam/tezos-error-monad.opam | 2 +- opam/tezos-lwt-result-stdlib.opam | 2 +- opam/tezos-protocol-compiler.opam | 2 +- opam/tezos-protocol-environment.opam | 2 +- opam/tezos-proxy-server.opam | 2 +- opam/tezos-stdlib-unix.opam | 2 +- opam/tezos-stdlib.opam | 2 +- opam/tezos-test-helpers.opam | 2 +- opam/tezos-tps-evaluation.opam | 2 +- opam/tezt.opam | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 9d3eefac5094..edb6d44c3554 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -194,7 +194,7 @@ let logs = external_lib "logs" V.True let logs_fmt = external_sublib logs "logs.fmt" -let lwt = external_lib ~js_compatible:true "lwt" V.(at_least "5.4.0") +let lwt = external_lib ~js_compatible:true "lwt" V.(at_least "5.6.0") let lwt_canceler = external_lib diff --git a/opam/lazy-containers-tests.opam b/opam/lazy-containers-tests.opam index 4c7ca591d87f..ea089d1eddce 100644 --- a/opam/lazy-containers-tests.opam +++ b/opam/lazy-containers-tests.opam @@ -13,7 +13,7 @@ depends: [ "qcheck-core" {with-test} "qcheck-alcotest" { with-test & >= "0.18" } "alcotest" { with-test & >= "1.5.0" } - "lwt" { with-test & >= "5.4.0" } + "lwt" { with-test & >= "5.6.0" } ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-base.opam b/opam/tezos-base.opam index 86142182c9a7..12345389ab42 100644 --- a/opam/tezos-base.opam +++ b/opam/tezos-base.opam @@ -19,7 +19,7 @@ depends: [ "tezos-event-logging" "ptime" { >= "1.0.0" } "ezjsonm" { >= "1.1.0" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "ipaddr" { >= "5.0.0" & < "6.0.0" } "uri" { >= "2.2.0" } "tezos-hacl" diff --git a/opam/tezos-clic.opam b/opam/tezos-clic.opam index a69e05f45bbf..bf2cc6a59cb8 100644 --- a/opam/tezos-clic.opam +++ b/opam/tezos-clic.opam @@ -10,7 +10,7 @@ license: "MIT" depends: [ "dune" { >= "3.0" } "tezos-stdlib" - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "re" { >= "1.7.2" } "tezos-error-monad" "tezos-lwt-result-stdlib" diff --git a/opam/tezos-crypto-dal.opam b/opam/tezos-crypto-dal.opam index 0a6c68bffee8..b60a25691e6a 100644 --- a/opam/tezos-crypto-dal.opam +++ b/opam/tezos-crypto-dal.opam @@ -14,7 +14,7 @@ depends: [ "data-encoding" { >= "0.6" & < "0.7" } "tezos-crypto" "tezos-bls12-381-polynomial" { >= "0.1.0" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "alcotest" { with-test & >= "1.5.0" } "qcheck-alcotest" { with-test & >= "0.18" } ] diff --git a/opam/tezos-crypto.opam b/opam/tezos-crypto.opam index 6cf18d6e0671..4be50b0e047e 100644 --- a/opam/tezos-crypto.opam +++ b/opam/tezos-crypto.opam @@ -12,7 +12,7 @@ depends: [ "tezos-stdlib" "data-encoding" { >= "0.6" & < "0.7" } "tezos-lwt-result-stdlib" - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "tezos-hacl" "secp256k1-internal" { >= "0.3.0" } "tezos-error-monad" diff --git a/opam/tezos-error-monad.opam b/opam/tezos-error-monad.opam index c0a6bda06812..577e0b88954f 100644 --- a/opam/tezos-error-monad.opam +++ b/opam/tezos-error-monad.opam @@ -13,7 +13,7 @@ depends: [ "tezos-stdlib" "data-encoding" { >= "0.6" & < "0.7" } "lwt-canceler" { >= "0.3" & < "0.4" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "tezos-lwt-result-stdlib" "alcotest" { with-test & >= "1.5.0" } ] diff --git a/opam/tezos-lwt-result-stdlib.opam b/opam/tezos-lwt-result-stdlib.opam index 27ec531acb3b..557228713e77 100644 --- a/opam/tezos-lwt-result-stdlib.opam +++ b/opam/tezos-lwt-result-stdlib.opam @@ -10,7 +10,7 @@ license: "MIT" depends: [ "dune" { >= "3.0" } "ocaml" { >= "4.12" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "alcotest-lwt" { with-test & >= "1.5.0" } "qcheck-alcotest" { with-test & >= "0.18" } "tezos-test-helpers" {with-test} diff --git a/opam/tezos-protocol-compiler.opam b/opam/tezos-protocol-compiler.opam index 6b6962788301..3bd104009352 100644 --- a/opam/tezos-protocol-compiler.opam +++ b/opam/tezos-protocol-compiler.opam @@ -14,7 +14,7 @@ depends: [ "tezos-protocol-environment" "tezos-version" "tezos-stdlib-unix" - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "ocp-ocamlres" { >= "0.4" } "base-unix" ] diff --git a/opam/tezos-protocol-environment.opam b/opam/tezos-protocol-environment.opam index c90865fb0541..f3b99f85119c 100644 --- a/opam/tezos-protocol-environment.opam +++ b/opam/tezos-protocol-environment.opam @@ -31,7 +31,7 @@ depends: [ "alcotest-lwt" { with-test & >= "1.5.0" } "tezos-test-helpers" {with-test} "qcheck-alcotest" { with-test & >= "0.18" } - "lwt" { with-test & >= "5.4.0" } + "lwt" { with-test & >= "5.6.0" } ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-proxy-server.opam b/opam/tezos-proxy-server.opam index b43ea86217cf..d02d3e56b87b 100644 --- a/opam/tezos-proxy-server.opam +++ b/opam/tezos-proxy-server.opam @@ -13,7 +13,7 @@ depends: [ "tezos-stdlib-unix" "cmdliner" { >= "1.1.0" } "lwt-exit" - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "tezos-proxy" "tezos-proxy-server-config" "tezos-rpc-http-client-unix" diff --git a/opam/tezos-stdlib-unix.opam b/opam/tezos-stdlib-unix.opam index 82cda8a7f84e..d72ad88a1f76 100644 --- a/opam/tezos-stdlib-unix.opam +++ b/opam/tezos-stdlib-unix.opam @@ -15,7 +15,7 @@ depends: [ "tezos-event-logging" "tezos-stdlib" "data-encoding" { >= "0.6" & < "0.7" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "ipaddr" { >= "5.0.0" & < "6.0.0" } "re" { >= "1.7.2" } "ezjsonm" { >= "1.1.0" } diff --git a/opam/tezos-stdlib.opam b/opam/tezos-stdlib.opam index 8bc54af8da8a..ffabb95f94e4 100644 --- a/opam/tezos-stdlib.opam +++ b/opam/tezos-stdlib.opam @@ -14,7 +14,7 @@ depends: [ "hex" { >= "1.3.0" } "zarith" { >= "1.12" & < "1.13" } "zarith_stubs_js" - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "ringo" { >= "0.9" } "alcotest" { with-test & >= "1.5.0" } "bigstring" {with-test} diff --git a/opam/tezos-test-helpers.opam b/opam/tezos-test-helpers.opam index 469788ce8365..2543bce78df2 100644 --- a/opam/tezos-test-helpers.opam +++ b/opam/tezos-test-helpers.opam @@ -14,7 +14,7 @@ depends: [ "fmt" { >= "0.8.7" } "qcheck-alcotest" { >= "0.18" } "alcotest" { >= "1.5.0" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "pure-splitmix" { = "0.3" } "data-encoding" { >= "0.6" & < "0.7" } ] diff --git a/opam/tezos-tps-evaluation.opam b/opam/tezos-tps-evaluation.opam index 1e3e47360a3e..03caceb53819 100644 --- a/opam/tezos-tps-evaluation.opam +++ b/opam/tezos-tps-evaluation.opam @@ -14,7 +14,7 @@ depends: [ "caqti-dynload" "caqti-lwt" "data-encoding" { >= "0.6" & < "0.7" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "tezos-baking-alpha" "tezos-client-alpha" "tezos-client-base-unix" diff --git a/opam/tezt.opam b/opam/tezt.opam index 4c3f7f6f1d83..db6b729a586e 100644 --- a/opam/tezt.opam +++ b/opam/tezt.opam @@ -12,7 +12,7 @@ depends: [ "dune" { >= "3.0" } "ocaml" { >= "4.12" } "re" { >= "1.7.2" } - "lwt" { >= "5.4.0" } + "lwt" { >= "5.6.0" } "ezjsonm" { >= "1.1.0" } ] build: [ -- GitLab From d65b11e542d894e47ab0a5a474a695914d6858c8 Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Mon, 29 Aug 2022 18:35:21 +0200 Subject: [PATCH 8/9] proto: fix deprecated lwt_result.err --- src/proto_013_PtJakart/lib_injector/disk_persistence.ml | 2 +- src/proto_014_PtKathma/lib_injector/disk_persistence.ml | 2 +- src/proto_alpha/lib_injector/disk_persistence.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/proto_013_PtJakart/lib_injector/disk_persistence.ml b/src/proto_013_PtJakart/lib_injector/disk_persistence.ml index 3843ae027d1a..20565456cb64 100644 --- a/src/proto_013_PtJakart/lib_injector/disk_persistence.ml +++ b/src/proto_013_PtJakart/lib_injector/disk_persistence.ml @@ -178,7 +178,7 @@ let write_value file encoding value = trace (Cannot_write_file file) @@ protect @@ fun () -> - Lwt_result.map_err (fun e -> [Io_error e]) + Lwt_result.map_error (fun e -> [Io_error e]) @@ Lwt_utils_unix.with_open_out ~overwrite:true file @@ fun fd -> let block_bytes = Data_encoding.Binary.to_bytes_exn encoding value in diff --git a/src/proto_014_PtKathma/lib_injector/disk_persistence.ml b/src/proto_014_PtKathma/lib_injector/disk_persistence.ml index 3843ae027d1a..20565456cb64 100644 --- a/src/proto_014_PtKathma/lib_injector/disk_persistence.ml +++ b/src/proto_014_PtKathma/lib_injector/disk_persistence.ml @@ -178,7 +178,7 @@ let write_value file encoding value = trace (Cannot_write_file file) @@ protect @@ fun () -> - Lwt_result.map_err (fun e -> [Io_error e]) + Lwt_result.map_error (fun e -> [Io_error e]) @@ Lwt_utils_unix.with_open_out ~overwrite:true file @@ fun fd -> let block_bytes = Data_encoding.Binary.to_bytes_exn encoding value in diff --git a/src/proto_alpha/lib_injector/disk_persistence.ml b/src/proto_alpha/lib_injector/disk_persistence.ml index 3843ae027d1a..20565456cb64 100644 --- a/src/proto_alpha/lib_injector/disk_persistence.ml +++ b/src/proto_alpha/lib_injector/disk_persistence.ml @@ -178,7 +178,7 @@ let write_value file encoding value = trace (Cannot_write_file file) @@ protect @@ fun () -> - Lwt_result.map_err (fun e -> [Io_error e]) + Lwt_result.map_error (fun e -> [Io_error e]) @@ Lwt_utils_unix.with_open_out ~overwrite:true file @@ fun fd -> let block_bytes = Data_encoding.Binary.to_bytes_exn encoding value in -- GitLab From 9337d963d804b6f50250ad46a0f833c46703a247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Thu, 1 Sep 2022 10:25:09 +0200 Subject: [PATCH 9/9] Build: update opam hash --- .gitlab/ci/templates.yml | 2 +- scripts/version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/templates.yml b/.gitlab/ci/templates.yml index 706ddb34661b..0e9a187967d1 100644 --- a/.gitlab/ci/templates.yml +++ b/.gitlab/ci/templates.yml @@ -2,7 +2,7 @@ variables: # /!\ CI_REGISTRY is overriden to use a private Docker registry mirror in AWS ECR # in GitLab namespaces `nomadic-labs` and `tezos` ## This value MUST be the same as `opam_repository_tag` in `scripts/version.sh` - build_deps_image_version: 7ba7b3796ef709071a013d0ba7c8844ef70810e6 + build_deps_image_version: fe613ae6e399204434c4be3e8d8d82662832d352 build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository" GIT_STRATEGY: fetch GIT_DEPTH: "1" diff --git a/scripts/version.sh b/scripts/version.sh index c7f5c05363bd..b0fdc11c28d8 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -25,7 +25,7 @@ export full_opam_repository_tag=2b604f9ca3a48aea0f017fa42aebc83f8cfe4ec8 ## opam_repository is an additional, tezos-specific opam repository. ## This value MUST be the same as `build_deps_image_version` in `.gitlab/ci/templates.ym export opam_repository_url=https://gitlab.com/tezos/opam-repository -export opam_repository_tag=7ba7b3796ef709071a013d0ba7c8844ef70810e6 +export opam_repository_tag=fe613ae6e399204434c4be3e8d8d82662832d352 export opam_repository_git=$opam_repository_url.git export opam_repository=$opam_repository_git\#$opam_repository_tag -- GitLab