diff --git a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL index 19ec69c459c749e690324b06217903805a2f1e38..4505a81b5a49df9f92488f1ed33a048e177f4013 100644 --- a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL +++ b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL @@ -49,7 +49,7 @@ "Sc_rollup_tick_repr", "Sc_rollup_inbox_message_repr", "Sc_rollup_outbox_message_repr", - "Sc_rollup_PVM_sem", + "Sc_rollup_PVM_sig", "Sc_rollup_arith", "Sc_rollup_wasm", "Sc_rollups", diff --git a/src/proto_alpha/lib_protocol/alpha_context.ml b/src/proto_alpha/lib_protocol/alpha_context.ml index 28f16f6e67b79d9bebb73c43f36294d8d62b35bf..43d36fd849f9991200c281e2d0beec2574367658 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.ml +++ b/src/proto_alpha/lib_protocol/alpha_context.ml @@ -56,7 +56,7 @@ module Sc_rollup_repr = Sc_rollup_repr module Sc_rollup = struct module Tick = Sc_rollup_tick_repr include Sc_rollup_repr - include Sc_rollup_PVM_sem + include Sc_rollup_PVM_sig module ArithPVM = Sc_rollup_arith module Wasm_2_0_0PVM = Sc_rollup_wasm.V2_0_0 diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 6b6009cc14fc9848eca1bde6b3b9b7eaf90d0c1e..b4b791877439bc9cc7e5dcde8de00a62e30cbdc8 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -3023,14 +3023,14 @@ module Sc_rollup : sig Raw_level.t * Z.t -> history_proof -> proof -> - Sc_rollup_PVM_sem.input option tzresult Lwt.t + Sc_rollup_PVM_sig.input option tzresult Lwt.t val produce_proof : inbox_context -> History.t -> history_proof -> Raw_level.t * Z.t -> - (proof * Sc_rollup_PVM_sem.input option) tzresult Lwt.t + (proof * Sc_rollup_PVM_sig.input option) tzresult Lwt.t val empty : inbox_context -> Sc_rollup_repr.t -> Raw_level.t -> t Lwt.t @@ -3448,7 +3448,7 @@ module Sc_rollup : sig Raw_level.t -> pvm_name:string -> t -> - (bool * Sc_rollup_PVM_sem.input option) tzresult Lwt.t + (bool * Sc_rollup_PVM_sig.input option) tzresult Lwt.t val produce : (module PVM_with_context_and_state) -> Raw_level.t -> t tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/dune b/src/proto_alpha/lib_protocol/dune index 06601b32c5d3d79478d2c47b37d42b4df203ea75..af80c03b5f2e68d8cea394483df49076077ce968 100644 --- a/src/proto_alpha/lib_protocol/dune +++ b/src/proto_alpha/lib_protocol/dune @@ -78,7 +78,7 @@ Sc_rollup_tick_repr Sc_rollup_inbox_message_repr Sc_rollup_outbox_message_repr - Sc_rollup_PVM_sem + Sc_rollup_PVM_sig Sc_rollup_arith Sc_rollup_wasm Sc_rollups @@ -336,7 +336,7 @@ sc_rollup_tick_repr.ml sc_rollup_tick_repr.mli sc_rollup_inbox_message_repr.ml sc_rollup_inbox_message_repr.mli sc_rollup_outbox_message_repr.ml sc_rollup_outbox_message_repr.mli - sc_rollup_PVM_sem.ml sc_rollup_PVM_sem.mli + sc_rollup_PVM_sig.ml sc_rollup_arith.ml sc_rollup_arith.mli sc_rollup_wasm.ml sc_rollup_wasm.mli sc_rollups.ml sc_rollups.mli @@ -576,7 +576,7 @@ sc_rollup_tick_repr.ml sc_rollup_tick_repr.mli sc_rollup_inbox_message_repr.ml sc_rollup_inbox_message_repr.mli sc_rollup_outbox_message_repr.ml sc_rollup_outbox_message_repr.mli - sc_rollup_PVM_sem.ml sc_rollup_PVM_sem.mli + sc_rollup_PVM_sig.ml sc_rollup_arith.ml sc_rollup_arith.mli sc_rollup_wasm.ml sc_rollup_wasm.mli sc_rollups.ml sc_rollups.mli @@ -821,7 +821,7 @@ sc_rollup_tick_repr.ml sc_rollup_tick_repr.mli sc_rollup_inbox_message_repr.ml sc_rollup_inbox_message_repr.mli sc_rollup_outbox_message_repr.ml sc_rollup_outbox_message_repr.mli - sc_rollup_PVM_sem.ml sc_rollup_PVM_sem.mli + sc_rollup_PVM_sig.ml sc_rollup_arith.ml sc_rollup_arith.mli sc_rollup_wasm.ml sc_rollup_wasm.mli sc_rollups.ml sc_rollups.mli diff --git a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sem.mli b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml similarity index 80% rename from src/proto_alpha/lib_protocol/sc_rollup_PVM_sem.mli rename to src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml index 693c082c49c894a57e96167656876359f496433d..1b7d95b9815a14dfe7f7a32a76b16675fcdd1c9d 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sem.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml @@ -49,7 +49,14 @@ According the rollup management protocol, the payload must be obtained through {!Sc_rollup_inbox_message_repr.serialize} which follows a documented - format. *) + format. + + FIXME: https://gitlab.com/tezos/tezos/-/issues/3649 + + This type cannot be extended in a retro-compatible way. It should + be put into a variant. +*) + type input = { inbox_level : Raw_level_repr.t; message_counter : Z.t; @@ -57,10 +64,26 @@ type input = { } (** [input_encoding] encoding value for {!input}. *) -val input_encoding : input Data_encoding.t +let input_encoding = + let open Data_encoding in + conv + (fun {inbox_level; message_counter; payload} -> + (inbox_level, message_counter, (payload :> string))) + (fun (inbox_level, message_counter, payload) -> + let payload = Sc_rollup_inbox_message_repr.unsafe_of_string payload in + {inbox_level; message_counter; payload}) + (obj3 + (req "inbox_level" Raw_level_repr.encoding) + (req "message_counter" n) + (req "payload" string)) (** [input_equal i1 i2] return whether [i1] and [i2] are equal. *) -val input_equal : input -> input -> bool +let input_equal (a : input) (b : input) : bool = + let {inbox_level; message_counter; payload} = a in + (* To be robust to the addition of fields in [input] *) + Raw_level_repr.equal inbox_level b.inbox_level + && Z.equal message_counter b.message_counter + && String.equal (payload :> string) (b.payload :> string) (** The PVM's current input expectations: - [No_input_required] if the machine is busy and has no need for new input. @@ -75,15 +98,62 @@ type input_request = | Initial | First_after of Raw_level_repr.t * Z.t -(** [input_request_encoding] encoding value for {!input_requests}. *) -val input_request_encoding : input_request Data_encoding.t +(** [input_request_encoding] encoding value for {!input_request}. *) +let input_request_encoding = + let open Data_encoding in + union + ~tag_size:`Uint8 + [ + case + ~title:"No_input_required" + (Tag 0) + (obj1 (req "kind" (constant "no_input_required"))) + (function No_input_required -> Some () | _ -> None) + (fun () -> No_input_required); + case + ~title:"Initial" + (Tag 1) + (obj1 (req "kind" (constant "initial"))) + (function Initial -> Some () | _ -> None) + (fun () -> Initial); + case + ~title:"First_after" + (Tag 2) + (obj3 + (req "kind" (constant "first_after")) + (req "level" Raw_level_repr.encoding) + (req "counter" n)) + (function + | First_after (level, counter) -> Some ((), level, counter) + | _ -> None) + (fun ((), level, counter) -> First_after (level, counter)); + ] (** [pp_input_request fmt i] pretty prints the given input [i] to the formatter [fmt]. *) -val pp_input_request : Format.formatter -> input_request -> unit +let pp_input_request fmt request = + match request with + | No_input_required -> Format.fprintf fmt "No_input_required" + | Initial -> Format.fprintf fmt "Initial" + | First_after (l, n) -> + Format.fprintf + fmt + "First_after (level = %a, counter = %a)" + Raw_level_repr.pp + l + Z.pp_print + n (** [input_request_equal i1 i2] return whether [i1] and [i2] are equal. *) -val input_request_equal : input_request -> input_request -> bool +let input_request_equal a b = + match (a, b) with + | No_input_required, No_input_required -> true + | No_input_required, _ -> false + | Initial, Initial -> true + | Initial, _ -> false + | First_after (l, n), First_after (m, o) -> + Raw_level_repr.equal l m && Z.equal n o + | First_after _, _ -> false (** Type that describes output values. *) type output = { @@ -95,11 +165,30 @@ type output = { } (** [output_encoding] encoding value for {!output}. *) -val output_encoding : output Data_encoding.t +let output_encoding = + let open Data_encoding in + conv + (fun {outbox_level; message_index; message} -> + (outbox_level, message_index, message)) + (fun (outbox_level, message_index, message) -> + {outbox_level; message_index; message}) + (obj3 + (req "outbox_level" Raw_level_repr.encoding) + (req "message_index" n) + (req "message" Sc_rollup_outbox_message_repr.encoding)) (** [pp_output fmt o] pretty prints the given output [o] to the formatter [fmt]. *) -val pp_output : Format.formatter -> output -> unit +let pp_output fmt {outbox_level; message_index; message} = + Format.fprintf + fmt + "@[%a@;%a@;%a@;@]" + Raw_level_repr.pp + outbox_level + Z.pp_print + message_index + Sc_rollup_outbox_message_repr.pp + message module type S = sig (** The state of the PVM denotes a state of the rollup. diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index 60ae2a18e594dc466828c2046d902697dd3ce99e..f59f7ce7d8a844dd44300a2bcc0d693e86997985 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -24,7 +24,7 @@ (*****************************************************************************) open Sc_rollup_repr -module PS = Sc_rollup_PVM_sem +module PS = Sc_rollup_PVM_sig (* This is the state hash of reference that both the prover of the node @@ -114,7 +114,7 @@ module type S = sig val get_is_stuck : state -> string option Lwt.t end -type 'a proof = {tree_proof : 'a; requested : Sc_rollup_PVM_sem.input_request} +type 'a proof = {tree_proof : 'a; requested : Sc_rollup_PVM_sig.input_request} let proof_encoding : 'a Data_encoding.t -> 'a proof Data_encoding.t = fun encoding -> @@ -680,13 +680,13 @@ module Make (Context : P) : end) module Output = Make_dict (struct - type t = Sc_rollup_PVM_sem.output + type t = Sc_rollup_PVM_sig.output let name = "output" - let encoding = Sc_rollup_PVM_sem.output_encoding + let encoding = Sc_rollup_PVM_sig.output_encoding - let pp = Sc_rollup_PVM_sem.pp_output + let pp = Sc_rollup_PVM_sig.pp_output end) let pp = @@ -1019,7 +1019,7 @@ module Make (Context : P) : let message = Atomic_transaction_batch {transactions = [transaction]} in let* outbox_level = Current_level.get in let output = - Sc_rollup_PVM_sem.{outbox_level; message_index = counter; message} + Sc_rollup_PVM_sig.{outbox_level; message_index = counter; message} in Output.set (Z.to_string counter) output diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli index 123c288fa65ca4bf4037abe7d9a2b00b6cf82995..6479568c6fa7da40fb3e39d50fce4b269bee23d0 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli @@ -52,7 +52,7 @@ The machine has a boot sector which is a mere string used a prefix for each message. - The module implements the {!Sc_rollup_PVM_sem.S}Î interface to be + The module implements the {!Sc_rollup_PVM_sig.S}Î interface to be used in the smart contract rollup infrastructure. The machine exposes extra operations to be used in the rollup node. @@ -60,7 +60,7 @@ *) module type S = sig - include Sc_rollup_PVM_sem.S + include Sc_rollup_PVM_sig.S (** [name] is "arith". *) val name : string @@ -126,7 +126,7 @@ module type S = sig val get_is_stuck : state -> string option Lwt.t end -type 'a proof = {tree_proof : 'a; requested : Sc_rollup_PVM_sem.input_request} +type 'a proof = {tree_proof : 'a; requested : Sc_rollup_PVM_sig.input_request} module Protocol_implementation : S diff --git a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml index d26ecc6bc74ed4f8324e6f87aff1d055931f705d..9f1a914a5fc9909bc90170e90c03913ea69e2630 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml @@ -455,14 +455,14 @@ module type Merkelized_operations = sig Raw_level_repr.t * Z.t -> history_proof -> proof -> - Sc_rollup_PVM_sem.input option tzresult Lwt.t + Sc_rollup_PVM_sig.input option tzresult Lwt.t val produce_proof : inbox_context -> History.t -> history_proof -> Raw_level_repr.t * Z.t -> - (proof * Sc_rollup_PVM_sem.input option) tzresult Lwt.t + (proof * Sc_rollup_PVM_sig.input option) tzresult Lwt.t val empty : inbox_context -> Sc_rollup_repr.t -> Raw_level_repr.t -> t Lwt.t @@ -970,7 +970,7 @@ struct | Some payload -> return @@ Some - Sc_rollup_PVM_sem. + Sc_rollup_PVM_sig. {inbox_level = l; message_counter = n; payload}) | Level_crossing p -> ( let lower_level_hash = Skip_list.content p.lower in @@ -1001,7 +1001,7 @@ struct | Some payload -> return @@ Some - Sc_rollup_PVM_sem. + Sc_rollup_PVM_sig. { inbox_level = p.upper_level; message_counter = Z.zero; @@ -1060,10 +1060,11 @@ struct in match payload_opt with | Some payload -> - let input_given = - Some Sc_rollup_PVM_sem.{inbox_level = l; message_counter = n; payload} - in - return (Single_level {level; inc; message_proof}, input_given) + return + ( Single_level {level; inc; message_proof}, + Some + Sc_rollup_PVM_sig.{inbox_level = l; message_counter = n; payload} + ) | None -> ( if equal_history_proof inbox level then return (Single_level {level; inc; message_proof}, None) @@ -1103,7 +1104,7 @@ struct | Some payload -> let input_given = Some - Sc_rollup_PVM_sem. + Sc_rollup_PVM_sig. { inbox_level = upper_level; message_counter = Z.zero; diff --git a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.mli b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.mli index 82b5fa8646f5a3e75c979fafe8e3c50f1b3af7d8..a3b110aa3a6c972a8a0a496355868c0e21302e6c 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.mli @@ -35,7 +35,7 @@ rollup, there are only two possibilities: either these two claims correspond to two distinct interpretations of the same inbox ; or, these two claims differ on their views about the contents of the - inbox itself. {!Sc_rollup_PVM_sem} is meant to arbitrate the first + inbox itself. {!Sc_rollup_PVM_sig} is meant to arbitrate the first kind of conflicts while {!Sc_rollup_inbox} focuses on the second kind of conflicts. @@ -62,7 +62,7 @@ {1 Merkelization of the inbox} - As for the state of the {!Sc_rollup_PVM_sem}, the layer 1 does not + As for the state of the {!Sc_rollup_PVM_sig}, the layer 1 does not have to store the entire inbox but only a compressed form (typically a low number of hashes) that witnesses its contents, so that the protocol can check the validity of a proof about its contents. @@ -345,7 +345,7 @@ module type Merkelized_operations = sig - the [starting_point], of type [Raw_level_repr.t * Z.t], specifying a location in the inbox ; - - the [message], of type [Sc_rollup_PVM_sem.input option] ; + - the [message], of type [Sc_rollup_PVM_sig.input option] ; - and a reference [snapshot] inbox. @@ -375,7 +375,7 @@ module type Merkelized_operations = sig Raw_level_repr.t * Z.t -> history_proof -> proof -> - Sc_rollup_PVM_sem.input option tzresult Lwt.t + Sc_rollup_PVM_sig.input option tzresult Lwt.t (** [produce_proof ctxt history inbox (level, counter)] creates an inbox proof proving the first message after the index [counter] at @@ -387,7 +387,7 @@ module type Merkelized_operations = sig History.t -> history_proof -> Raw_level_repr.t * Z.t -> - (proof * Sc_rollup_PVM_sem.input option) tzresult Lwt.t + (proof * Sc_rollup_PVM_sig.input option) tzresult Lwt.t (** [empty ctxt level] is an inbox started at some given [level] with no message at all. *) diff --git a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml index c947f907c7d4b97b4c2a700e5e8da80e9ec16368..2c97055282367ec55d386e08be7f34f7611f6070 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml @@ -81,7 +81,7 @@ let stop input proof = above [commit_level] the [input_given] in the PVM proof should be [None]. *) let cut_at_level level input = - let input_level = Sc_rollup_PVM_sem.(input.inbox_level) in + let input_level = Sc_rollup_PVM_sig.(input.inbox_level) in if Raw_level_repr.(level <= input_level) then None else Some input let proof_error reason = @@ -107,7 +107,7 @@ let valid snapshot commit_level ~pvm_name proof = let open Lwt_tzresult_syntax in let (module P) = Sc_rollups.wrapped_proof_module proof.pvm_step in let* () = check (String.equal P.name pvm_name) "Incorrect PVM kind" in - let (input_requested : Sc_rollup_PVM_sem.input_request) = + let (input_requested : Sc_rollup_PVM_sig.input_request) = P.proof_input_requested P.proof in let* input = @@ -121,7 +121,7 @@ let valid snapshot commit_level ~pvm_name proof = proof_error (Format.asprintf "input_requested is %a, inbox proof is %a" - Sc_rollup_PVM_sem.pp_input_request + Sc_rollup_PVM_sig.pp_input_request input_requested (Format.pp_print_option pp_proof) proof.inbox) @@ -154,7 +154,7 @@ let produce pvm_and_state commit_level = let open Lwt_tzresult_syntax in let (module P : PVM_with_context_and_state) = pvm_and_state in let open P in - let*! (request : Sc_rollup_PVM_sem.input_request) = + let*! (request : Sc_rollup_PVM_sig.input_request) = P.is_input_state P.state in let* proof, input = diff --git a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.mli b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.mli index b8bf4c0bc24474da8321b152fef3eafc11df3977..6f67c50f7242ff29b6dec0bde59ef0e9157431c6 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.mli @@ -78,7 +78,7 @@ val start : t -> State_hash.t (** The state hash of the machine after the step. This must be checked against the value in the refutation game as well as checking the proof is valid. *) -val stop : Sc_rollup_PVM_sem.input option -> t -> State_hash.t option +val stop : Sc_rollup_PVM_sig.input option -> t -> State_hash.t option (** Check the validity of a proof. @@ -101,7 +101,7 @@ val valid : Raw_level_repr.t -> pvm_name:string -> t -> - (bool * Sc_rollup_PVM_sem.input option) tzresult Lwt.t + (bool * Sc_rollup_PVM_sig.input option) tzresult Lwt.t module type PVM_with_context_and_state = sig include Sc_rollups.PVM.S diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml index e9cc42e49583062d9858a637aaac08b3c6c46fd0..4386f5e070500a1dfafd0c833e53ccde13d94823 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml @@ -53,7 +53,7 @@ module V2_0_0 = struct "scs11pDQTn37TBnWgQAiCPdMAcQPiXARjg9ZZVmLx26sZwxeSxovE5" open Sc_rollup_repr - module PS = Sc_rollup_PVM_sem + module PS = Sc_rollup_PVM_sig module type P = sig module Tree : @@ -77,7 +77,7 @@ module V2_0_0 = struct end module type S = sig - include Sc_rollup_PVM_sem.S + include Sc_rollup_PVM_sig.S val name : string diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli index f702f6b744abc011fb1e7341b48e2f19abf8ef6e..b5dffdfc1530f2e72f70c94ed2c1c3d36b1561eb 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli @@ -29,7 +29,7 @@ module V2_0_0 : sig WebAssembly (version 2.0.0). *) module type S = sig - include Sc_rollup_PVM_sem.S + include Sc_rollup_PVM_sig.S (** [name] is "wasm_2_0_0". @@ -80,7 +80,7 @@ module V2_0_0 : sig Tree.t -> tree -> (tree -> (tree * 'a) Lwt.t) -> (proof * 'a) option Lwt.t end - type 'a proof = {tree_proof : 'a; requested : Sc_rollup_PVM_sem.input_request} + type 'a proof = {tree_proof : 'a; requested : Sc_rollup_PVM_sig.input_request} val proof_encoding : 'a Data_encoding.t -> 'a proof Data_encoding.t diff --git a/src/proto_alpha/lib_protocol/sc_rollups.ml b/src/proto_alpha/lib_protocol/sc_rollups.ml index 4b9c631b0a397e952088efc6ea8c6edc7e873785..3d1c7c79bee3efae6e40d16faf265635812024d3 100644 --- a/src/proto_alpha/lib_protocol/sc_rollups.ml +++ b/src/proto_alpha/lib_protocol/sc_rollups.ml @@ -34,7 +34,7 @@ module PVM = struct val pp_boot_sector : Format.formatter -> boot_sector -> unit - include Sc_rollup_PVM_sem.S + include Sc_rollup_PVM_sig.S end type t = (module S) diff --git a/src/proto_alpha/lib_protocol/sc_rollups.mli b/src/proto_alpha/lib_protocol/sc_rollups.mli index 0a6091428d42b3d4bdba41da091e58314844bed3..e76d7976fa4ff500a072fb831e9ec03cad654067 100644 --- a/src/proto_alpha/lib_protocol/sc_rollups.mli +++ b/src/proto_alpha/lib_protocol/sc_rollups.mli @@ -36,7 +36,7 @@ module PVM : sig val pp_boot_sector : Format.formatter -> boot_sector -> unit - include Sc_rollup_PVM_sem.S + include Sc_rollup_PVM_sig.S end type t = (module S) diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml index 195cfc9137072f869358f950a7b44a5807a2dc33..25e11c1a7da42bc5efa80649ce657180faf37c34 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml @@ -125,7 +125,7 @@ let boot boot_sector f = pre_boot boot_sector @@ fun ctxt state -> eval state >>= f ctxt let test_boot () = - let open Sc_rollup_PVM_sem in + let open Sc_rollup_PVM_sig in boot "" @@ fun _ctxt state -> is_input_state state >>= function | Initial -> return () @@ -141,7 +141,7 @@ let make_external_inbox_message str = Sc_rollup_inbox_message_repr.(External str |> serialize) let test_input_message () = - let open Sc_rollup_PVM_sem in + let open Sc_rollup_PVM_sig in boot "" @@ fun _ctxt state -> let input = { @@ -172,7 +172,7 @@ let go ~max_steps target_status state = aux 0 state let test_parsing_message ~valid (source, expected_code) = - let open Sc_rollup_PVM_sem in + let open Sc_rollup_PVM_sig in boot "" @@ fun _ctxt state -> let input = { @@ -240,7 +240,7 @@ let test_parsing_messages () = let test_evaluation_message ~valid (boot_sector, source, expected_stack, expected_vars) = - let open Sc_rollup_PVM_sem in + let open Sc_rollup_PVM_sig in boot boot_sector @@ fun _ctxt state -> let input = { @@ -315,7 +315,7 @@ let test_evaluation_messages () = let test_output_messages_proofs ~valid ~inbox_level (source, expected_outputs) = let open Lwt_result_syntax in - let open Sc_rollup_PVM_sem in + let open Sc_rollup_PVM_sig in boot "" @@ fun ctxt state -> let input = { @@ -346,7 +346,7 @@ let test_output_messages_proofs ~valid ~inbox_level (source, expected_outputs) = (Format.asprintf "A wrong output proof is valid: %s -> %a" source - Sc_rollup_PVM_sem.pp_output + Sc_rollup_PVM_sig.pp_output output))) | Error _ -> return () in @@ -364,7 +364,7 @@ let make_output ~outbox_level ~message_index n = let message_index = Z.of_int message_index in let outbox_level = Raw_level_repr.of_int32_exn (Int32.of_int outbox_level) in let message = Atomic_transaction_batch {transactions} in - Sc_rollup_PVM_sem.{outbox_level; message_index; message} + Sc_rollup_PVM_sig.{outbox_level; message_index; message} let test_valid_output_messages () = let test inbox_level = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml index e2b682170e8513372b7ef8419b13533d660bae17..2fafc0dfb1b8feac5717206b90ea7ce9fbb532fe 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml @@ -339,7 +339,7 @@ let next_input ps l n = match List.nth level (Z.to_int n) with | Some msg -> let payload = payload_string msg in - Some Sc_rollup_PVM_sem.{inbox_level = l; message_counter = n; payload} + Some Sc_rollup_PVM_sig.{inbox_level = l; message_counter = n; payload} | None -> let rec aux l = let* payloads = List.nth ps l in @@ -347,7 +347,7 @@ let next_input ps l n = | Some msg -> let payload = payload_string msg in Some - Sc_rollup_PVM_sem. + Sc_rollup_PVM_sig. { inbox_level = level_of_int l; message_counter = Z.zero;