From 1bf2dd7a98314d7fda6858006a692edc140df6eb Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Fri, 9 Sep 2022 18:03:25 +0200 Subject: [PATCH 1/6] Manifest: open Crypto for benchmarks --- manifest/main.ml | 2 +- .../lib_benchmark/lib_benchmark_type_inference/dune | 1 + .../lib_benchmark/lib_benchmark_type_inference/dune | 1 + .../lib_benchmark/lib_benchmark_type_inference/dune | 1 + src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/dune | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest/main.ml b/manifest/main.ml index a62af92f3a6c..c13800cd703d 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4753,7 +4753,7 @@ module Protocol = Protocol [ octez_stdlib |> open_; octez_error_monad |> open_; - octez_crypto; + octez_crypto |> open_; octez_micheline |> open_; octez_micheline_rewriting |> open_; main |> open_; diff --git a/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/dune b/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/dune index 6b76db68f888..462224db9f00 100644 --- a/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/dune +++ b/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/dune @@ -17,6 +17,7 @@ (:standard) -open Tezos_stdlib -open Tezos_error_monad + -open Tezos_crypto -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_protocol_012_Psithaca)) diff --git a/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/dune b/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/dune index 9e80bfe152ee..54a4c7df521b 100644 --- a/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/dune +++ b/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/dune @@ -17,6 +17,7 @@ (:standard) -open Tezos_stdlib -open Tezos_error_monad + -open Tezos_crypto -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_protocol_013_PtJakart)) diff --git a/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/dune b/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/dune index bf031dccb9e1..375d3dd64dd0 100644 --- a/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/dune +++ b/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/dune @@ -17,6 +17,7 @@ (:standard) -open Tezos_stdlib -open Tezos_error_monad + -open Tezos_crypto -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_protocol_014_PtKathma)) diff --git a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/dune b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/dune index 59ed88cf18f4..d77fee8c6414 100644 --- a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/dune +++ b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/dune @@ -17,6 +17,7 @@ (:standard) -open Tezos_stdlib -open Tezos_error_monad + -open Tezos_crypto -open Tezos_micheline -open Tezos_micheline_rewriting -open Tezos_protocol_alpha)) -- GitLab From ea74a2f9c6433160abe13a75f66ca8f45527d6e3 Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Fri, 9 Sep 2022 17:36:18 +0200 Subject: [PATCH 2/6] Benchmarks: rename Signature to Algebraic_signature To avoid conflicts with Signature from Tezos_crypto. --- .../{signature.ml => algebraic_signature.ml} | 0 .../lib_micheline_rewriting/micheline_with_hash_consing.ml | 2 +- .../lib_micheline_rewriting/micheline_without_hash_consing.ml | 2 +- src/lib_benchmark/lib_micheline_rewriting/pattern.ml | 4 ++-- src/lib_benchmark/lib_micheline_rewriting/pattern.mli | 4 ++-- src/lib_benchmark/lib_micheline_rewriting/rewrite.ml | 2 +- src/lib_benchmark/lib_micheline_rewriting/rewrite.mli | 2 +- .../lib_micheline_rewriting/test/test_rewriting.ml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) rename src/lib_benchmark/lib_micheline_rewriting/{signature.ml => algebraic_signature.ml} (100%) diff --git a/src/lib_benchmark/lib_micheline_rewriting/signature.ml b/src/lib_benchmark/lib_micheline_rewriting/algebraic_signature.ml similarity index 100% rename from src/lib_benchmark/lib_micheline_rewriting/signature.ml rename to src/lib_benchmark/lib_micheline_rewriting/algebraic_signature.ml diff --git a/src/lib_benchmark/lib_micheline_rewriting/micheline_with_hash_consing.ml b/src/lib_benchmark/lib_micheline_rewriting/micheline_with_hash_consing.ml index be04ebed7d82..918f5360dbf4 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/micheline_with_hash_consing.ml +++ b/src/lib_benchmark/lib_micheline_rewriting/micheline_with_hash_consing.ml @@ -32,7 +32,7 @@ open Custom_weak type hcons_info = {tag : int; hash : int} module Make - (X : Signature.S) (P : sig + (X : Algebraic_signature.S) (P : sig val initial_size : int option end) : Micheline_sig.S with type label = hcons_info and type head = X.t = struct diff --git a/src/lib_benchmark/lib_micheline_rewriting/micheline_without_hash_consing.ml b/src/lib_benchmark/lib_micheline_rewriting/micheline_without_hash_consing.ml index f194a16f0fbd..e1d4cb868926 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/micheline_without_hash_consing.ml +++ b/src/lib_benchmark/lib_micheline_rewriting/micheline_without_hash_consing.ml @@ -24,7 +24,7 @@ (*****************************************************************************) module Make - (X : Signature.S) (Label : sig + (X : Algebraic_signature.S) (Label : sig type t val default : t diff --git a/src/lib_benchmark/lib_micheline_rewriting/pattern.ml b/src/lib_benchmark/lib_micheline_rewriting/pattern.ml index bd251ca44218..63de4dada4a6 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/pattern.ml +++ b/src/lib_benchmark/lib_micheline_rewriting/pattern.ml @@ -139,7 +139,7 @@ module type S = sig end module Make - (X : Signature.S) + (X : Algebraic_signature.S) (Micheline : Micheline_sig.S with type head = X.t) (Path : Path.S) = struct @@ -335,7 +335,7 @@ struct end module Make_with_hash_consing - (X : Signature.S) + (X : Algebraic_signature.S) (Micheline : Micheline_sig.S with type head = X.t and type label = Micheline_with_hash_consing.hcons_info) diff --git a/src/lib_benchmark/lib_micheline_rewriting/pattern.mli b/src/lib_benchmark/lib_micheline_rewriting/pattern.mli index 073e03b34a98..35d1f9c34eee 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/pattern.mli +++ b/src/lib_benchmark/lib_micheline_rewriting/pattern.mli @@ -99,13 +99,13 @@ module type S = sig end module Make - (X : Signature.S) + (X : Algebraic_signature.S) (Micheline : Micheline_sig.S with type head = X.t) (Path : Path.S) : S with type head = X.t and type path = Path.t and type node = Micheline.node module Make_with_hash_consing - (X : Signature.S) + (X : Algebraic_signature.S) (Micheline : Micheline_sig.S with type head = X.t and type label = Micheline_with_hash_consing.hcons_info) diff --git a/src/lib_benchmark/lib_micheline_rewriting/rewrite.ml b/src/lib_benchmark/lib_micheline_rewriting/rewrite.ml index ffd1943d23d3..a9af11eb02a3 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/rewrite.ml +++ b/src/lib_benchmark/lib_micheline_rewriting/rewrite.ml @@ -48,7 +48,7 @@ module type S = sig end module Make - (X : Signature.S) + (X : Algebraic_signature.S) (M : Micheline_sig.S with type head = X.t) (Path : Path.S) (Patt : Pattern.S diff --git a/src/lib_benchmark/lib_micheline_rewriting/rewrite.mli b/src/lib_benchmark/lib_micheline_rewriting/rewrite.mli index 6b71f03dabab..e23281a400f9 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/rewrite.mli +++ b/src/lib_benchmark/lib_micheline_rewriting/rewrite.mli @@ -49,7 +49,7 @@ module type S = sig end module Make - (X : Signature.S) + (X : Algebraic_signature.S) (M : Micheline_sig.S with type head = X.t) (Path : Path.S) (Patt : Pattern.S diff --git a/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml b/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml index b4b38bab6a04..1782ffdc6b1c 100644 --- a/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml +++ b/src/lib_benchmark/lib_micheline_rewriting/test/test_rewriting.ml @@ -34,7 +34,7 @@ open Tezos_micheline_rewriting open Tezos_protocol_alpha.Protocol module Michelson_signature : - Signature.S with type t = Michelson_v1_primitives.prim = struct + Algebraic_signature.S with type t = Michelson_v1_primitives.prim = struct type t = Michelson_v1_primitives.prim let compare (x : t) (y : t) = Stdlib.compare x y -- GitLab From ab34cf3fe92b82bd04a20505881d7718e52de2fc Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Fri, 9 Sep 2022 17:38:13 +0200 Subject: [PATCH 3/6] Benchmark/012: scope fixes --- .../lib_benchmark_type_inference/mikhailsky.ml | 14 ++++---------- .../lib_benchmark_type_inference/mikhailsky.mli | 7 ++++--- .../lib_benchmark/michelson_samplers_base.ml | 2 +- .../lib_benchmark/michelson_samplers_base.mli | 2 +- .../lib_benchmark/test/test_distribution.ml | 3 +-- .../lib_benchmark/test/test_sampling_code.ml | 2 -- .../lib_benchmark/test/test_sampling_data.ml | 2 -- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml b/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml index a015381180a0..fd2f752c2ccf 100644 --- a/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml +++ b/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml @@ -27,8 +27,8 @@ open Protocol exception Term_contains_holes -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim = -struct +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim = struct type t = Mikhailsky_prim.prim let compare (x : t) (y : t) = Stdlib.compare x y @@ -386,18 +386,12 @@ module Data = struct let key_hash kh = let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key_hash.encoding - kh + Data_encoding.Binary.to_bytes_exn Signature.Public_key_hash.encoding kh in prim A_Key_hash [bytes b] [] let key k = - let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key.encoding - k - in + let b = Data_encoding.Binary.to_bytes_exn Signature.Public_key.encoding k in prim A_Key [bytes b] [] let integer (i : int) = prim A_Int [int (Z.of_int i)] [] diff --git a/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli b/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli index 6285f6a39555..e11262943838 100644 --- a/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli +++ b/src/proto_012_Psithaca/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli @@ -65,7 +65,8 @@ open Protocol *) (** The signature of Mikhailsky terms. *) -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim (** Elements of type [Path.t] allow to index subterms of Mikhailsky terms. *) module Path : Path.S @@ -308,9 +309,9 @@ module Data : sig val mutez : Alpha_context.Tez.t -> node - val key_hash : Tezos_crypto.Signature.Public_key_hash.t -> node + val key_hash : Signature.Public_key_hash.t -> node - val key : Tezos_crypto.Signature.Public_key.t -> node + val key : Signature.Public_key.t -> node val integer : int -> node diff --git a/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.ml b/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.ml index c772d60f1008..e6780d5ec622 100644 --- a/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.ml +++ b/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.ml @@ -53,7 +53,7 @@ module type S = sig val nat : Alpha_context.Script_int.n Alpha_context.Script_int.num sampler - val signature : Tezos_crypto.Signature.t sampler + val signature : Signature.t sampler val string : Alpha_context.Script_string.t sampler diff --git a/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.mli b/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.mli index 975dd002bc1f..a4e113804cb6 100644 --- a/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.mli +++ b/src/proto_012_Psithaca/lib_benchmark/michelson_samplers_base.mli @@ -47,7 +47,7 @@ module type S = sig val nat : Alpha_context.Script_int.n Alpha_context.Script_int.num sampler - val signature : Tezos_crypto.Signature.t sampler + val signature : Signature.t sampler val string : Alpha_context.Script_string.t sampler diff --git a/src/proto_012_Psithaca/lib_benchmark/test/test_distribution.ml b/src/proto_012_Psithaca/lib_benchmark/test/test_distribution.ml index c78a0174083f..6c7762fea6d0 100644 --- a/src/proto_012_Psithaca/lib_benchmark/test/test_distribution.ml +++ b/src/proto_012_Psithaca/lib_benchmark/test/test_distribution.ml @@ -1,4 +1,3 @@ -open Tezos_benchmark open Michelson_samplers open Protocol open Internal_for_tests @@ -47,7 +46,7 @@ module Type_name = struct let hash = Stdlib.Hashtbl.hash end -module Type_name_hashtbl = Hashtbl.Make (Type_name) +module Type_name_hashtbl = Stdlib.Hashtbl.Make (Type_name) let rec tnames_of_type : type a. a Script_typed_ir.ty -> type_name list -> type_name list = diff --git a/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_code.ml b/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_code.ml index c637d3944e1f..e5e8edf378d5 100644 --- a/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_code.ml +++ b/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_code.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = diff --git a/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_data.ml b/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_data.ml index a93671d4e102..fb67a046d1ef 100644 --- a/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_data.ml +++ b/src/proto_012_Psithaca/lib_benchmark/test/test_sampling_data.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = -- GitLab From cad7205188b613323ebfe307c8737fd2199f80a4 Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Fri, 9 Sep 2022 17:38:13 +0200 Subject: [PATCH 4/6] Benchmark/013: scope fixes --- .../lib_benchmark_type_inference/mikhailsky.ml | 14 ++++---------- .../lib_benchmark_type_inference/mikhailsky.mli | 7 ++++--- .../lib_benchmark/michelson_samplers_base.ml | 2 +- .../lib_benchmark/michelson_samplers_base.mli | 2 +- .../lib_benchmark/test/test_distribution.ml | 3 +-- .../lib_benchmark/test/test_sampling_code.ml | 2 -- .../lib_benchmark/test/test_sampling_data.ml | 2 -- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml b/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml index a015381180a0..fd2f752c2ccf 100644 --- a/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml +++ b/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml @@ -27,8 +27,8 @@ open Protocol exception Term_contains_holes -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim = -struct +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim = struct type t = Mikhailsky_prim.prim let compare (x : t) (y : t) = Stdlib.compare x y @@ -386,18 +386,12 @@ module Data = struct let key_hash kh = let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key_hash.encoding - kh + Data_encoding.Binary.to_bytes_exn Signature.Public_key_hash.encoding kh in prim A_Key_hash [bytes b] [] let key k = - let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key.encoding - k - in + let b = Data_encoding.Binary.to_bytes_exn Signature.Public_key.encoding k in prim A_Key [bytes b] [] let integer (i : int) = prim A_Int [int (Z.of_int i)] [] diff --git a/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli b/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli index 6285f6a39555..e11262943838 100644 --- a/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli +++ b/src/proto_013_PtJakart/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli @@ -65,7 +65,8 @@ open Protocol *) (** The signature of Mikhailsky terms. *) -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim (** Elements of type [Path.t] allow to index subterms of Mikhailsky terms. *) module Path : Path.S @@ -308,9 +309,9 @@ module Data : sig val mutez : Alpha_context.Tez.t -> node - val key_hash : Tezos_crypto.Signature.Public_key_hash.t -> node + val key_hash : Signature.Public_key_hash.t -> node - val key : Tezos_crypto.Signature.Public_key.t -> node + val key : Signature.Public_key.t -> node val integer : int -> node diff --git a/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.ml b/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.ml index c772d60f1008..e6780d5ec622 100644 --- a/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.ml +++ b/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.ml @@ -53,7 +53,7 @@ module type S = sig val nat : Alpha_context.Script_int.n Alpha_context.Script_int.num sampler - val signature : Tezos_crypto.Signature.t sampler + val signature : Signature.t sampler val string : Alpha_context.Script_string.t sampler diff --git a/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.mli b/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.mli index 975dd002bc1f..a4e113804cb6 100644 --- a/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.mli +++ b/src/proto_013_PtJakart/lib_benchmark/michelson_samplers_base.mli @@ -47,7 +47,7 @@ module type S = sig val nat : Alpha_context.Script_int.n Alpha_context.Script_int.num sampler - val signature : Tezos_crypto.Signature.t sampler + val signature : Signature.t sampler val string : Alpha_context.Script_string.t sampler diff --git a/src/proto_013_PtJakart/lib_benchmark/test/test_distribution.ml b/src/proto_013_PtJakart/lib_benchmark/test/test_distribution.ml index 5f1a28b31616..a9eadcab62f1 100644 --- a/src/proto_013_PtJakart/lib_benchmark/test/test_distribution.ml +++ b/src/proto_013_PtJakart/lib_benchmark/test/test_distribution.ml @@ -1,4 +1,3 @@ -open Tezos_benchmark open Michelson_samplers open Protocol open Internal_for_tests @@ -49,7 +48,7 @@ module Type_name = struct let hash = Stdlib.Hashtbl.hash end -module Type_name_hashtbl = Hashtbl.Make (Type_name) +module Type_name_hashtbl = Stdlib.Hashtbl.Make (Type_name) let rec tnames_of_type : type a ac. (a, ac) Script_typed_ir.ty -> type_name list -> type_name list = diff --git a/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_code.ml b/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_code.ml index c637d3944e1f..e5e8edf378d5 100644 --- a/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_code.ml +++ b/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_code.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = diff --git a/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_data.ml b/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_data.ml index a93671d4e102..fb67a046d1ef 100644 --- a/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_data.ml +++ b/src/proto_013_PtJakart/lib_benchmark/test/test_sampling_data.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = -- GitLab From a57e9b25e5cfc34defd49273fb81266366fe3d98 Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Fri, 9 Sep 2022 17:38:13 +0200 Subject: [PATCH 5/6] Benchmark/014: scope fixes --- .../lib_benchmark_type_inference/mikhailsky.ml | 14 ++++---------- .../lib_benchmark_type_inference/mikhailsky.mli | 7 ++++--- .../lib_benchmark/michelson_samplers_base.ml | 2 +- .../lib_benchmark/michelson_samplers_base.mli | 2 +- .../lib_benchmark/test/test_distribution.ml | 3 +-- .../lib_benchmark/test/test_sampling_code.ml | 2 -- .../lib_benchmark/test/test_sampling_data.ml | 2 -- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml b/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml index e32e4fabcde2..5672070a26e7 100644 --- a/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml +++ b/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml @@ -27,8 +27,8 @@ open Protocol exception Term_contains_holes -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim = -struct +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim = struct type t = Mikhailsky_prim.prim let compare (x : t) (y : t) = Stdlib.compare x y @@ -386,18 +386,12 @@ module Data = struct let key_hash kh = let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key_hash.encoding - kh + Data_encoding.Binary.to_bytes_exn Signature.Public_key_hash.encoding kh in prim A_Key_hash [bytes b] [] let key k = - let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key.encoding - k - in + let b = Data_encoding.Binary.to_bytes_exn Signature.Public_key.encoding k in prim A_Key [bytes b] [] let integer (i : int) = prim A_Int [int (Z.of_int i)] [] diff --git a/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli b/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli index e8c5b3ac5e19..4cebbffb4467 100644 --- a/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli +++ b/src/proto_014_PtKathma/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli @@ -65,7 +65,8 @@ open Protocol *) (** The signature of Mikhailsky terms. *) -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim (** Elements of type [Path.t] allow to index subterms of Mikhailsky terms. *) module Path : Path.S @@ -308,9 +309,9 @@ module Data : sig val mutez : Alpha_context.Tez.t -> node - val key_hash : Tezos_crypto.Signature.Public_key_hash.t -> node + val key_hash : Signature.Public_key_hash.t -> node - val key : Tezos_crypto.Signature.Public_key.t -> node + val key : Signature.Public_key.t -> node val integer : int -> node diff --git a/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.ml b/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.ml index 586c2176e626..92ffe284fcee 100644 --- a/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.ml +++ b/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.ml @@ -53,7 +53,7 @@ module type S = sig val nat : Script_int.n Script_int.num sampler - val signature : Tezos_crypto.Signature.t sampler + val signature : Signature.t sampler val string : Script_string.t sampler diff --git a/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.mli b/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.mli index 18a150245cfc..339ad824e4cc 100644 --- a/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.mli +++ b/src/proto_014_PtKathma/lib_benchmark/michelson_samplers_base.mli @@ -47,7 +47,7 @@ module type S = sig val nat : Script_int.n Script_int.num sampler - val signature : Tezos_crypto.Signature.t sampler + val signature : Signature.t sampler val string : Script_string.t sampler diff --git a/src/proto_014_PtKathma/lib_benchmark/test/test_distribution.ml b/src/proto_014_PtKathma/lib_benchmark/test/test_distribution.ml index ce8866dd7afe..7822b5b6e08c 100644 --- a/src/proto_014_PtKathma/lib_benchmark/test/test_distribution.ml +++ b/src/proto_014_PtKathma/lib_benchmark/test/test_distribution.ml @@ -1,4 +1,3 @@ -open Tezos_benchmark open Michelson_samplers open Protocol open Internal_for_tests @@ -49,7 +48,7 @@ module Type_name = struct let hash = Stdlib.Hashtbl.hash end -module Type_name_hashtbl = Hashtbl.Make (Type_name) +module Type_name_hashtbl = Stdlib.Hashtbl.Make (Type_name) let rec tnames_of_type : type a ac. (a, ac) Script_typed_ir.ty -> type_name list -> type_name list = diff --git a/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_code.ml b/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_code.ml index c637d3944e1f..e5e8edf378d5 100644 --- a/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_code.ml +++ b/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_code.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = diff --git a/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_data.ml b/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_data.ml index a93671d4e102..fb67a046d1ef 100644 --- a/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_data.ml +++ b/src/proto_014_PtKathma/lib_benchmark/test/test_sampling_data.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = -- GitLab From 7f6c5832a43d3f75ba5b24abcd0f2a8a4d0994e7 Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Fri, 9 Sep 2022 17:38:13 +0200 Subject: [PATCH 6/6] Benchmark/alpha: scope fixes --- .../lib_benchmark_type_inference/mikhailsky.ml | 14 ++++---------- .../lib_benchmark_type_inference/mikhailsky.mli | 7 ++++--- .../lib_benchmark/test/test_distribution.ml | 3 +-- .../lib_benchmark/test/test_sampling_code.ml | 2 -- .../lib_benchmark/test/test_sampling_data.ml | 2 -- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml index e32e4fabcde2..5672070a26e7 100644 --- a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml +++ b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.ml @@ -27,8 +27,8 @@ open Protocol exception Term_contains_holes -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim = -struct +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim = struct type t = Mikhailsky_prim.prim let compare (x : t) (y : t) = Stdlib.compare x y @@ -386,18 +386,12 @@ module Data = struct let key_hash kh = let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key_hash.encoding - kh + Data_encoding.Binary.to_bytes_exn Signature.Public_key_hash.encoding kh in prim A_Key_hash [bytes b] [] let key k = - let b = - Data_encoding.Binary.to_bytes_exn - Tezos_crypto.Signature.Public_key.encoding - k - in + let b = Data_encoding.Binary.to_bytes_exn Signature.Public_key.encoding k in prim A_Key [bytes b] [] let integer (i : int) = prim A_Int [int (Z.of_int i)] [] diff --git a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli index e8c5b3ac5e19..4cebbffb4467 100644 --- a/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli +++ b/src/proto_alpha/lib_benchmark/lib_benchmark_type_inference/mikhailsky.mli @@ -65,7 +65,8 @@ open Protocol *) (** The signature of Mikhailsky terms. *) -module Mikhailsky_signature : Signature.S with type t = Mikhailsky_prim.prim +module Mikhailsky_signature : + Algebraic_signature.S with type t = Mikhailsky_prim.prim (** Elements of type [Path.t] allow to index subterms of Mikhailsky terms. *) module Path : Path.S @@ -308,9 +309,9 @@ module Data : sig val mutez : Alpha_context.Tez.t -> node - val key_hash : Tezos_crypto.Signature.Public_key_hash.t -> node + val key_hash : Signature.Public_key_hash.t -> node - val key : Tezos_crypto.Signature.Public_key.t -> node + val key : Signature.Public_key.t -> node val integer : int -> node diff --git a/src/proto_alpha/lib_benchmark/test/test_distribution.ml b/src/proto_alpha/lib_benchmark/test/test_distribution.ml index ce8866dd7afe..7822b5b6e08c 100644 --- a/src/proto_alpha/lib_benchmark/test/test_distribution.ml +++ b/src/proto_alpha/lib_benchmark/test/test_distribution.ml @@ -1,4 +1,3 @@ -open Tezos_benchmark open Michelson_samplers open Protocol open Internal_for_tests @@ -49,7 +48,7 @@ module Type_name = struct let hash = Stdlib.Hashtbl.hash end -module Type_name_hashtbl = Hashtbl.Make (Type_name) +module Type_name_hashtbl = Stdlib.Hashtbl.Make (Type_name) let rec tnames_of_type : type a ac. (a, ac) Script_typed_ir.ty -> type_name list -> type_name list = diff --git a/src/proto_alpha/lib_benchmark/test/test_sampling_code.ml b/src/proto_alpha/lib_benchmark/test/test_sampling_code.ml index c637d3944e1f..e5e8edf378d5 100644 --- a/src/proto_alpha/lib_benchmark/test/test_sampling_code.ml +++ b/src/proto_alpha/lib_benchmark/test/test_sampling_code.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = diff --git a/src/proto_alpha/lib_benchmark/test/test_sampling_data.ml b/src/proto_alpha/lib_benchmark/test/test_sampling_data.ml index a93671d4e102..fb67a046d1ef 100644 --- a/src/proto_alpha/lib_benchmark/test/test_sampling_data.ml +++ b/src/proto_alpha/lib_benchmark/test/test_sampling_data.ml @@ -23,8 +23,6 @@ (* *) (*****************************************************************************) -open Tezos_benchmark - (* Input parameter parsing *) let verbose = -- GitLab