diff --git a/.gitlab/ci/templates.yml b/.gitlab/ci/templates.yml index 706ddb34661bfc2909c702112fb8deacce24ec39..0e9a187967d1234e12548c09f52c67a966420965 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/manifest/main.ml b/manifest/main.ml index 4c6c1c93b7af20ea3119596d7a58109af5b3a840..edb6d44c355425866e7e28d6402ab48928cbc29e 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 @@ -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.10" && less_than "1.0") let resto = external_lib ~js_compatible:true "resto" resto_version diff --git a/opam/lazy-containers-tests.opam b/opam/lazy-containers-tests.opam index 4c7ca591d87f9f3b71c82a4e7d44371b09bfce39..ea089d1eddcef7542146e26ff97a1269d185a6dd 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 86142182c9a79f1f82472171f0da8d6dfc433ff5..12345389ab42c18778a67d2f3bf6928ebf46b42d 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 a69e05f45bbf886acbdda72c63642d1cd72113ea..bf2cc6a59cb8211c52de894ad3c951ea6936be96 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 0a6c68bffee831cb483085aef079c8963f017392..b60a25691e6acdf287d906666f4562c06921a305 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 6cf18d6e0671169b9a57a2c8a65032c8f270a2dd..4be50b0e047e4cc0dc98c8ebf8d83983512d5b33 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 c0a6bda06812209f90b0b021e4a8c7aa4e99549b..577e0b88954fbf939a506d41e3912fee79e647a3 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 27ec531acb3b188e2d0c1024e702f3d89119d836..557228713e777960573bb773ba2c9d3aa60daaea 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-mockup-proxy.opam b/opam/tezos-mockup-proxy.opam index 49f2ae9f07931f60355c6377a48e96789685c116..8be49e5df5365368d40ed3ca03906931f8278ada 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.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 02b575f7bc96319ea87b0f50698734400fa89fbd..39bfaf29438d89d8c17a47496a362040eff7af23 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.10" & < "1.0" } "tezos-rpc" "tezos-p2p-services" "tezos-p2p" diff --git a/opam/tezos-protocol-compiler.opam b/opam/tezos-protocol-compiler.opam index 6b6962788301039f5dace7258d5febe18adcdb0c..3bd1040093523ffa860c5ba73d8711798f7cf1da 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 c90865fb0541996f482fcdcb3fc54a437976d12a..f3b99f85119cdfad276e58c2da1434e2d66c2bf6 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 b43ea86217cf3ec5a976f83e7858c9fec589e6c7..d02d3e56b87b5b4a53b6051f6671dc5dfcba9bcd 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-rpc-http-client-unix.opam b/opam/tezos-rpc-http-client-unix.opam index bc8d110cf72e583cb22fad158075ea43877701fe..e7791ac00d3082993d2cf932fec3abcc198219ca 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.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 b434b654c92359ea3c0b416dd2d644c4c55de3b2..85248e3c6f8720c836e89b7a8d1ae9821ccfa518 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.10" & < "1.0" } "tezos-rpc-http" ] build: [ diff --git a/opam/tezos-rpc-http-server.opam b/opam/tezos-rpc-http-server.opam index 5b9691535f448ab17620e3f079266925e10fa877..664be09e9928255554ce0299a1db0e6264b57ee7 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.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 a78d8c2d7ca3c05942d12222284844169d29b6bc..04b6cff8eab087bbfdea921325330da054519867 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.10" & < "1.0" } "uri" { >= "2.2.0" } ] build: [ diff --git a/opam/tezos-rpc.opam b/opam/tezos-rpc.opam index 089f78786c65d9463b20c77cfc07ac882def1cd4..5b2a9e42bb17d0be23eff1cb4f1350060d16012a 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.10" & < "1.0" } + "resto-directory" { >= "0.10" & < "1.0" } "uri" { >= "2.2.0" } ] build: [ diff --git a/opam/tezos-stdlib-unix.opam b/opam/tezos-stdlib-unix.opam index 82cda8a7f84ed01f13bf482c3fd92a58956b143b..d72ad88a1f764b30a4b61ea8ad6d9eecabccfa40 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 8bc54af8da8ad52af03a656fdeb74426f8fffd73..ffabb95f94e42694b902f5eed94c2bd15d811b9a 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 469788ce836561841610049083d2215bfd0d16b1..2543bce78df2493fee27722c3cd4e0111ba0851f 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 1e3e47360a3e8046c8794a2a149f5b456ff6b3c0..03caceb53819609d8874071101e124035183835e 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 4c3f7f6f1d83facb60bfc3f3e7b5ee6e0a909719..db6b729a586e5d8e1fd5eeb9522939ad4944599c 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: [ diff --git a/scripts/version.sh b/scripts/version.sh index c7f5c05363bd2eb20e0b30c9d2c28106c139606d..b0fdc11c28d866eda97a4d0da1734dd54d7656b9 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 diff --git a/src/lib_lwt_result_stdlib/bare/structs/monad.ml b/src/lib_lwt_result_stdlib/bare/structs/monad.ml index 8c2498d088cfeebf4554bdf6ffb04ca8abd2946e..f87b752d4a3e3bd96179857b256366e1fa6aae67 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 7e2e137ec232808a5315725cdf691b8cbdd02e0a..2cba052006666a534bab8f74d7f456652766f46f 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 255d5cfd4f1b752222ca282ccc3862042d6ce97f..b11fd85e1b20a24e259bd5b4797fc916841a5289 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 diff --git a/src/lib_protocol_environment/environment_V4.ml b/src/lib_protocol_environment/environment_V4.ml index 83e69daf352932d156e1eb78a0c0b479c4ee8743..14784e089d595e8d4296b4f89b561f48a3942a70 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 d4da242e9ddaf0caa7a8c5f6bee29f3197e2f076..46e97c4ebbf75568266e03c68aa70086e260c26e 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 902e538a6733da99b5290aa2a7d62cfb89fcfb5e..bdf17c67b6a47d9cf174c8d60fa9def8da83bd2c 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 770ab6ab253718e057863e395094ef52b41e2ea5..1532e3d519a7807e978c7f76fdbf0426671c3df8 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 = @@ -8603,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 b45970de9bfa0e91a929d4f17423f80723bd535e..94e70bf56fc55d6631627ad37fe76d5e0e4c64ea 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 = @@ -47,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/tezos_protocol_environment_structs.ml b/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml index e0a31f8e479efb2993ac506adb70e13beec4d0fb..e0461bc57091594921c62518323c7bd0a1aa8369 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 0000000000000000000000000000000000000000..12567a54c467eda1614e850a52f14129651c7f4c --- /dev/null +++ b/src/lib_protocol_environment/structs/v0_RPC_directory.ml @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* 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 + +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))) diff --git a/src/lib_shell/block_validator.ml b/src/lib_shell/block_validator.ml index 36638ba97a998c20c12f61b4a7cc3bb33a02939e..34b001584cf98b2106f339f4c354cc3a2fa4649d 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 diff --git a/src/proto_013_PtJakart/lib_injector/disk_persistence.ml b/src/proto_013_PtJakart/lib_injector/disk_persistence.ml index 3843ae027d1a02f92c009a4d2d8e34e7e94e05ed..20565456cb64436562187c6eb2150f2b7ed65176 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 3843ae027d1a02f92c009a4d2d8e34e7e94e05ed..20565456cb64436562187c6eb2150f2b7ed65176 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 3843ae027d1a02f92c009a4d2d8e34e7e94e05ed..20565456cb64436562187c6eb2150f2b7ed65176 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