From caa2d055d8a8ae7ed68e47826b31a30938d0cbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=BCger?= Date: Wed, 17 May 2023 21:05:00 +0100 Subject: [PATCH 1/2] Wasmer: Delete value types after use -- GitLab From 183841f9ecd5a5770d0d2eff4ccd892d63efc85e Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Mon, 22 May 2023 10:53:22 +0200 Subject: [PATCH 2/2] V10: Add a new [Context_binary] module for rollups --- CHANGES.rst | 5 ++ .../environment_V10.ml | 18 +++++++ .../environment_V10.mli | 2 + src/lib_protocol_environment/sigs/v10.in.ml | 2 + src/lib_protocol_environment/sigs/v10.ml | 51 +++++++++++++++++-- .../sigs/v10/context_binary.mli | 37 ++++++++++++++ 6 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 src/lib_protocol_environment/sigs/v10/context_binary.mli diff --git a/CHANGES.rst b/CHANGES.rst index a84198ee2769..c0e387aeb2a7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -95,6 +95,11 @@ Proxy Server Protocol Compiler And Environment --------------------------------- +- Added a new version of the protocol environment (V10) + + - Exposed a limited API to manipulate an Irmin binary tree within the + protocol. + Codec ----- diff --git a/src/lib_protocol_environment/environment_V10.ml b/src/lib_protocol_environment/environment_V10.ml index e0fa3c8e83f2..6dafff36695f 100644 --- a/src/lib_protocol_environment/environment_V10.ml +++ b/src/lib_protocol_environment/environment_V10.ml @@ -55,6 +55,8 @@ module type T = sig and type Context_hash.Version.t = Context_hash.Version.t and type Context.config = Tezos_context_sigs.Config.t and module Context.Proof = Environment_context.Context.Proof + and type Context_binary.t = Tezos_context_memory.Context_binary.t + and type Context_binary.tree = Tezos_context_memory.Context_binary.tree and type Protocol_hash.t = Protocol_hash.t and type Time.t = Time.Protocol.t and type Operation.shell_header = Operation.shell_header @@ -1109,6 +1111,22 @@ struct let complete ctxt s = Base58.complete ctxt s end + module Context_binary = struct + include Tezos_context_memory.Context_binary + + module Tree = struct + type nonrec tree = tree + + type nonrec t = t + + type key = string list + + type value = bytes + + include Tezos_context_memory.Context_binary.Tree + end + end + module Wasm_2_0_0 = struct type input = Tezos_scoru_wasm.Wasm_pvm_state.input_info = { inbox_level : Bounded.Non_negative_int32.t; diff --git a/src/lib_protocol_environment/environment_V10.mli b/src/lib_protocol_environment/environment_V10.mli index e47f16cbdea6..8691c37fb2ca 100644 --- a/src/lib_protocol_environment/environment_V10.mli +++ b/src/lib_protocol_environment/environment_V10.mli @@ -55,6 +55,8 @@ module type T = sig and type Context_hash.Version.t = Context_hash.Version.t and type Context.config = Tezos_context_sigs.Config.t and module Context.Proof = Environment_context.Context.Proof + and type Context_binary.t = Tezos_context_memory.Context_binary.t + and type Context_binary.tree = Tezos_context_memory.Context_binary.tree and type Protocol_hash.t = Protocol_hash.t and type Time.t = Time.Protocol.t and type Operation.shell_header = Operation.shell_header diff --git a/src/lib_protocol_environment/sigs/v10.in.ml b/src/lib_protocol_environment/sigs/v10.in.ml index 32aef9e0e931..ab5509e866c7 100644 --- a/src/lib_protocol_environment/sigs/v10.in.ml +++ b/src/lib_protocol_environment/sigs/v10.in.ml @@ -129,6 +129,8 @@ module type T = sig module RPC_context : [%sig "v10/RPC_context.mli"] + module Context_binary : [%sig "v10/context_binary.mli"] + module Wasm_2_0_0 : [%sig "v10/wasm_2_0_0.mli"] module Plonk : [%sig "v10/plonk.mli"] diff --git a/src/lib_protocol_environment/sigs/v10.ml b/src/lib_protocol_environment/sigs/v10.ml index c5d5ce9af7ff..8b105a1dbd16 100644 --- a/src/lib_protocol_environment/sigs/v10.ml +++ b/src/lib_protocol_environment/sigs/v10.ml @@ -12005,6 +12005,49 @@ end # 130 "v10.in.ml" + module Context_binary : sig +# 1 "v10/context_binary.mli" +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +type t + +type tree + +module Tree : + Context.TREE + with type t = t + with type tree = tree + with type key = string list + with type value = bytes + +val make_empty_context : ?root:string -> unit -> t +end +# 132 "v10.in.ml" + + module Wasm_2_0_0 : sig # 1 "v10/wasm_2_0_0.mli" (*****************************************************************************) @@ -12078,7 +12121,7 @@ module Make val get_info : Tree.tree -> info Lwt.t end end -# 132 "v10.in.ml" +# 134 "v10.in.ml" module Plonk : sig @@ -12197,7 +12240,7 @@ val scalar_array_encoding : scalar array Data_encoding.t on the given [inputs] according to the [public_parameters]. *) val verify : public_parameters -> verifier_inputs -> proof -> bool end -# 134 "v10.in.ml" +# 136 "v10.in.ml" module Dal : sig @@ -12320,7 +12363,7 @@ val verify_page : page_proof -> (bool, [> `Segment_index_out_of_range | `Page_length_mismatch]) Result.t end -# 136 "v10.in.ml" +# 138 "v10.in.ml" module Smart_rollup : sig @@ -12377,6 +12420,6 @@ module Inbox_hash : S.HASH (** Smart rollup merkelized payload hashes' hash *) module Merkelized_payload_hashes_hash : S.HASH end -# 138 "v10.in.ml" +# 140 "v10.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v10/context_binary.mli b/src/lib_protocol_environment/sigs/v10/context_binary.mli new file mode 100644 index 000000000000..ed7b51b1987c --- /dev/null +++ b/src/lib_protocol_environment/sigs/v10/context_binary.mli @@ -0,0 +1,37 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +type t + +type tree + +module Tree : + Context.TREE + with type t = t + with type tree = tree + with type key = string list + with type value = bytes + +val make_empty_context : ?root:string -> unit -> t -- GitLab