From 33adaac4f33b8b08bec6629b95f5a83ceb0be9b5 Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Mon, 1 Aug 2022 14:16:44 +0200 Subject: [PATCH 1/2] proto/scoru: use snake case for constructors --- .../bin_sc_rollup_node/arith_pvm.ml | 2 +- .../bin_sc_rollup_node/wasm_2_0_0_pvm.ml | 2 +- .../lib_protocol/alpha_context.mli | 4 ++-- .../lib_protocol/sc_rollup_arith.ml | 22 +++++++++---------- .../lib_protocol/sc_rollup_arith.mli | 2 +- .../lib_protocol/sc_rollup_wasm.ml | 8 +++---- .../lib_protocol/sc_rollup_wasm.mli | 2 +- .../test/unit/test_sc_rollup_arith.ml | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/proto_alpha/bin_sc_rollup_node/arith_pvm.ml b/src/proto_alpha/bin_sc_rollup_node/arith_pvm.ml index 1f594cf28986..7ae169bcb040 100644 --- a/src/proto_alpha/bin_sc_rollup_node/arith_pvm.ml +++ b/src/proto_alpha/bin_sc_rollup_node/arith_pvm.ml @@ -98,7 +98,7 @@ module Impl : Pvm.S = struct let string_of_status status = match status with | Halted -> "Halted" - | WaitingForInputMessage -> "WaitingForInputMessage" + | Waiting_for_input_message -> "Waiting for input message" | Parsing -> "Parsing" | Evaluating -> "Evaluating" end diff --git a/src/proto_alpha/bin_sc_rollup_node/wasm_2_0_0_pvm.ml b/src/proto_alpha/bin_sc_rollup_node/wasm_2_0_0_pvm.ml index 1cd3d69dbfb9..90a725531683 100644 --- a/src/proto_alpha/bin_sc_rollup_node/wasm_2_0_0_pvm.ml +++ b/src/proto_alpha/bin_sc_rollup_node/wasm_2_0_0_pvm.ml @@ -82,7 +82,7 @@ module Impl : Pvm.S = struct end) let string_of_status : status -> string = function - | WaitingForInputMessage -> "WaitingForInputMessage" + | Waiting_for_input_message -> "Waiting for input message" | Computing -> "Computing" end diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 07824d669da6..148cf2a68e00 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -3143,7 +3143,7 @@ module Sc_rollup : sig val get_tick : state -> Tick.t Lwt.t - type status = Halted | WaitingForInputMessage | Parsing | Evaluating + type status = Halted | Waiting_for_input_message | Parsing | Evaluating val get_status : state -> status Lwt.t end @@ -3197,7 +3197,7 @@ module Sc_rollup : sig val get_tick : state -> Tick.t Lwt.t - type status = Computing | WaitingForInputMessage + type status = Computing | Waiting_for_input_message val get_status : state -> status Lwt.t diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index 1933e8932513..4285b08ac8dc 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -88,7 +88,7 @@ module type S = sig val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t - type status = Halted | WaitingForInputMessage | Parsing | Evaluating + type status = Halted | Waiting_for_input_message | Parsing | Evaluating val get_status : state -> status Lwt.t @@ -166,7 +166,7 @@ module Make (Context : P) : type tree = Tree.tree - type status = Halted | WaitingForInputMessage | Parsing | Evaluating + type status = Halted | Waiting_for_input_message | Parsing | Evaluating type instruction = | IPush : int -> instruction @@ -552,7 +552,7 @@ module Make (Context : P) : Data_encoding.string_enum [ ("Halted", Halted); - ("WaitingForInput", WaitingForInputMessage); + ("Waiting_for_input_message", Waiting_for_input_message); ("Parsing", Parsing); ("Evaluating", Evaluating); ] @@ -561,7 +561,7 @@ module Make (Context : P) : let string_of_status = function | Halted -> "Halted" - | WaitingForInputMessage -> "WaitingForInputMessage" + | Waiting_for_input_message -> "Waiting for input message" | Parsing -> "Parsing" | Evaluating -> "Evaluating" @@ -794,7 +794,7 @@ module Make (Context : P) : let open Monad.Syntax in let* () = Status.create in let* () = NextMessage.create in - let* () = Status.set WaitingForInputMessage in + let* () = Status.set Waiting_for_input_message in return () let result_of ~default m state = @@ -813,7 +813,7 @@ module Make (Context : P) : let open Monad.Syntax in let* status = Status.get in match status with - | WaitingForInputMessage -> ( + | Waiting_for_input_message -> ( let* level = CurrentLevel.get in let* counter = MessageCounter.get in match counter with @@ -824,7 +824,7 @@ module Make (Context : P) : let is_input_state = result_of ~default:PS.No_input_required @@ is_input_state_monadic - let get_status = result_of ~default:WaitingForInputMessage @@ Status.get + let get_status = result_of ~default:Waiting_for_input_message @@ Status.get let get_code = result_of ~default:[] @@ Code.to_list @@ -870,7 +870,7 @@ module Make (Context : P) : | None -> let* () = CurrentLevel.set inbox_level in let* () = MessageCounter.set (Some message_counter) in - let* () = Status.set WaitingForInputMessage in + let* () = Status.set Waiting_for_input_message in return () let set_input input = state_of @@ set_input_monadic input @@ -932,7 +932,7 @@ module Make (Context : P) : let stop_evaluating outcome = let open Monad.Syntax in let* () = EvaluationResult.set (Some outcome) in - Status.set WaitingForInputMessage + Status.set Waiting_for_input_message let parse : unit t = let open Monad.Syntax in @@ -1048,7 +1048,7 @@ module Make (Context : P) : let reboot = let open Monad.Syntax in - let* () = Status.set WaitingForInputMessage in + let* () = Status.set Waiting_for_input_message in let* () = Stack.clear in let* () = Code.clear in return () @@ -1062,7 +1062,7 @@ module Make (Context : P) : let* status = Status.get in match status with | Halted -> boot - | WaitingForInputMessage -> ( + | Waiting_for_input_message -> ( let* msg = NextMessage.get in match msg with | None -> diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli index 74aede909576..a84882473f0a 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli @@ -80,7 +80,7 @@ module type S = sig val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t (** The machine has three possible statuses: *) - type status = Halted | WaitingForInputMessage | Parsing | Evaluating + type status = Halted | Waiting_for_input_message | Parsing | Evaluating (** [get_status state] returns the machine status in [state]. *) val get_status : state -> status Lwt.t diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml index 09c0b877bf93..1c9f2227d598 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml @@ -89,7 +89,7 @@ module V2_0_0 = struct val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t (** PVM status *) - type status = Computing | WaitingForInputMessage + type status = Computing | Waiting_for_input_message (** [get_status state] gives you the current execution status for the PVM. *) val get_status : state -> status Lwt.t @@ -152,7 +152,7 @@ module V2_0_0 = struct type tree = Tree.tree - type status = Computing | WaitingForInputMessage + type status = Computing | Waiting_for_input_message module State = struct type state = tree @@ -249,7 +249,7 @@ module V2_0_0 = struct @@ match info.input_request with | No_input_required -> Computing - | Input_required -> WaitingForInputMessage + | Input_required -> Waiting_for_input_message let get_last_message_read : _ Monad.t = let open Monad.Syntax in @@ -267,7 +267,7 @@ module V2_0_0 = struct let open Monad.Syntax in let* status = get_status in match status with - | WaitingForInputMessage -> ( + | Waiting_for_input_message -> ( let* last_read = get_last_message_read in match last_read with | Some (level, n) -> return (PS.First_after (level, n)) diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli index 01a3da0feba1..a94b15a63ae0 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli @@ -53,7 +53,7 @@ module V2_0_0 : sig val get_tick : state -> Sc_rollup_tick_repr.t Lwt.t (** PVM status *) - type status = Computing | WaitingForInputMessage + type status = Computing | Waiting_for_input_message (** [get_status state] gives you the current execution status for the PVM. *) val get_status : state -> status Lwt.t 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 ee0e39cc9e57..24e6778dcd3c 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 @@ -250,7 +250,7 @@ let test_evaluation_message ~valid in set_input input state >>= fun state -> eval state >>= fun state -> - go ~max_steps:10000 WaitingForInputMessage state >>=? fun state -> + go ~max_steps:10000 Waiting_for_input_message state >>=? fun state -> if valid then get_stack state >>= fun stack -> Assert.equal @@ -325,7 +325,7 @@ let test_output_messages_proofs ~valid ~inbox_level (source, expected_outputs) = in let*! state = set_input input state in let*! state = eval state in - let* state = go ~max_steps:10000 WaitingForInputMessage state in + let* state = go ~max_steps:10000 Waiting_for_input_message state in let check_output output = let*! result = produce_output_proof ctxt state output in if valid then -- GitLab From ad872ddaa3aeec9fcfc3d29799547a9c4d727727 Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Mon, 1 Aug 2022 14:19:57 +0200 Subject: [PATCH 2/2] proto/scoru: use snake case for module name --- src/proto_alpha/bin_sc_rollup_node/store.ml | 2 +- .../lib_protocol/alpha_context.mli | 10 +- .../lib_protocol/sc_rollup_arith.ml | 118 +++++++++--------- .../lib_protocol/sc_rollup_inbox_repr.ml | 12 +- .../lib_protocol/sc_rollup_inbox_repr.mli | 10 +- .../lib_protocol/sc_rollup_proof_repr.ml | 2 +- .../lib_protocol/sc_rollup_proof_repr.mli | 2 +- .../test/unit/test_sc_rollup_inbox.ml | 2 +- 8 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/proto_alpha/bin_sc_rollup_node/store.ml b/src/proto_alpha/bin_sc_rollup_node/store.ml index 02553212507c..3a921ba8342f 100644 --- a/src/proto_alpha/bin_sc_rollup_node/store.ml +++ b/src/proto_alpha/bin_sc_rollup_node/store.ml @@ -208,7 +208,7 @@ module IStoreProof = module Inbox = struct include Sc_rollup.Inbox - include Sc_rollup.Inbox.MakeHashingScheme (struct + include Sc_rollup.Inbox.Make_hashing_scheme (struct module Tree = IStoreTree type t = IStore.t diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 148cf2a68e00..47aa310300b1 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2821,7 +2821,7 @@ module Sc_rollup : sig val serialized_proof_encoding : serialized_proof Data_encoding.t - module type MerkelizedOperations = sig + module type Merkelized_operations = sig type tree type inbox_context @@ -2904,7 +2904,7 @@ module Sc_rollup : sig end include - MerkelizedOperations + Merkelized_operations with type tree = Context.tree and type inbox_context = Context.t @@ -2936,8 +2936,8 @@ module Sc_rollup : sig (proof * 'a) option Lwt.t end - module MakeHashingScheme (P : P) : - MerkelizedOperations with type tree = P.tree and type inbox_context = P.t + module Make_hashing_scheme (P : P) : + Merkelized_operations with type tree = P.tree and type inbox_context = P.t val add_external_messages : context -> rollup -> string list -> (t * Z.t * context) tzresult Lwt.t @@ -3301,7 +3301,7 @@ module Sc_rollup : sig val proof_encoding : proof Data_encoding.t module Inbox_with_history : sig - include Inbox.MerkelizedOperations with type inbox_context = context + include Inbox.Merkelized_operations with type inbox_context = context val inbox : Inbox.history_proof diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index 4285b08ac8dc..331e7e23503d 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -323,7 +323,7 @@ module Make (Context : P) : open Monad - module MakeVar (P : sig + module Make_var (P : sig type t val name : string @@ -356,7 +356,7 @@ module Make (Context : P) : return @@ fun fmt () -> Format.fprintf fmt "@[%s : %a@]" P.name P.pp v end - module MakeDict (P : sig + module Make_dict (P : sig type t val name : string @@ -388,7 +388,7 @@ module Make (Context : P) : return @@ fun fmt () -> Format.pp_print_list pp_elem fmt l end - module MakeDeque (P : sig + module Make_deque (P : sig type t val name : string @@ -477,13 +477,13 @@ module Make (Context : P) : let clear = remove [P.name] end - module CurrentTick = MakeVar (struct + module Current_tick = Make_var (struct include Sc_rollup_tick_repr let name = "tick" end) - module Vars = MakeDict (struct + module Vars = Make_dict (struct type t = int let name = "vars" @@ -493,7 +493,7 @@ module Make (Context : P) : let pp fmt x = Format.fprintf fmt "%d" x end) - module Stack = MakeDeque (struct + module Stack = Make_deque (struct type t = int let name = "stack" @@ -501,7 +501,7 @@ module Make (Context : P) : let encoding = Data_encoding.int31 end) - module Code = MakeDeque (struct + module Code = Make_deque (struct type t = instruction let name = "code" @@ -531,7 +531,7 @@ module Make (Context : P) : ]) end) - module Boot_sector = MakeVar (struct + module Boot_sector = Make_var (struct type t = string let name = "boot_sector" @@ -543,7 +543,7 @@ module Make (Context : P) : let pp fmt s = Format.fprintf fmt "%s" s end) - module Status = MakeVar (struct + module Status = Make_var (struct type t = status let initial = Halted @@ -568,7 +568,7 @@ module Make (Context : P) : let pp fmt status = Format.fprintf fmt "%s" (string_of_status status) end) - module CurrentLevel = MakeVar (struct + module Current_level = Make_var (struct type t = Raw_level_repr.t let initial = Raw_level_repr.root @@ -580,7 +580,7 @@ module Make (Context : P) : let pp = Raw_level_repr.pp end) - module MessageCounter = MakeVar (struct + module Message_counter = Make_var (struct type t = Z.t option let initial = None @@ -594,7 +594,7 @@ module Make (Context : P) : | Some c -> Format.fprintf fmt "Some %a" Z.pp_print c end) - module NextMessage = MakeVar (struct + module Next_message = Make_var (struct type t = string option let initial = None @@ -610,7 +610,7 @@ module Make (Context : P) : type parser_state = ParseInt | ParseVar | SkipLayout - module LexerState = MakeVar (struct + module Lexer_state = Make_var (struct type t = int * int let name = "lexer_buffer" @@ -623,7 +623,7 @@ module Make (Context : P) : Format.fprintf fmt "lexer.(start = %d, len = %d)" start len end) - module ParserState = MakeVar (struct + module Parser_state = Make_var (struct type t = parser_state let name = "parser_state" @@ -644,7 +644,7 @@ module Make (Context : P) : | SkipLayout -> Format.fprintf fmt "Skipping layout" end) - module ParsingResult = MakeVar (struct + module Parsing_result = Make_var (struct type t = bool option let name = "parsing_result" @@ -659,7 +659,7 @@ module Make (Context : P) : | Some false -> Format.fprintf fmt "parsing fails" end) - module EvaluationResult = MakeVar (struct + module Evaluation_result = Make_var (struct type t = bool option let name = "evaluation_result" @@ -674,7 +674,7 @@ module Make (Context : P) : | Some false -> Format.fprintf fmt "evaluation fails" end) - module OutputCounter = MakeVar (struct + module Output_counter = Make_var (struct type t = Z.t let initial = Z.zero @@ -686,7 +686,7 @@ module Make (Context : P) : let pp = Z.pp_print end) - module Output = MakeDict (struct + module Output = Make_dict (struct type t = Sc_rollup_PVM_sem.output let name = "output" @@ -699,16 +699,16 @@ module Make (Context : P) : let pp = let open Monad.Syntax in let* status_pp = Status.pp in - let* message_counter_pp = MessageCounter.pp in - let* next_message_pp = NextMessage.pp in - let* parsing_result_pp = ParsingResult.pp in - let* parser_state_pp = ParserState.pp in - let* lexer_state_pp = LexerState.pp in - let* evaluation_result_pp = EvaluationResult.pp in + let* message_counter_pp = Message_counter.pp in + let* next_message_pp = Next_message.pp in + let* parsing_result_pp = Parsing_result.pp in + let* parser_state_pp = Parser_state.pp in + let* lexer_state_pp = Lexer_state.pp in + let* evaluation_result_pp = Evaluation_result.pp in let* vars_pp = Vars.pp in let* output_pp = Output.pp in let* stack = Stack.to_list in - let* current_tick_pp = CurrentTick.pp in + let* current_tick_pp = Current_tick.pp in return @@ fun fmt () -> Format.fprintf fmt @@ -793,7 +793,7 @@ module Make (Context : P) : let boot = let open Monad.Syntax in let* () = Status.create in - let* () = NextMessage.create in + let* () = Next_message.create in let* () = Status.set Waiting_for_input_message in return () @@ -807,15 +807,15 @@ module Make (Context : P) : let* s, _ = run m state in return s - let get_tick = result_of ~default:Sc_rollup_tick_repr.initial CurrentTick.get + let get_tick = result_of ~default:Sc_rollup_tick_repr.initial Current_tick.get let is_input_state_monadic = let open Monad.Syntax in let* status = Status.get in match status with | Waiting_for_input_message -> ( - let* level = CurrentLevel.get in - let* counter = MessageCounter.get in + let* level = Current_level.get in + let* counter = Message_counter.get in match counter with | Some n -> return (PS.First_after (level, n)) | None -> return PS.Initial) @@ -828,22 +828,22 @@ module Make (Context : P) : let get_code = result_of ~default:[] @@ Code.to_list - let get_parsing_result = result_of ~default:None @@ ParsingResult.get + let get_parsing_result = result_of ~default:None @@ Parsing_result.get let get_stack = result_of ~default:[] @@ Stack.to_list let get_var state k = (result_of ~default:None @@ Vars.get k) state - let get_evaluation_result = result_of ~default:None @@ EvaluationResult.get + let get_evaluation_result = result_of ~default:None @@ Evaluation_result.get let get_is_stuck = result_of ~default:None @@ is_stuck let start_parsing : unit t = let open Monad.Syntax in let* () = Status.set Parsing in - let* () = ParsingResult.set None in - let* () = ParserState.set SkipLayout in - let* () = LexerState.set (0, 0) in + let* () = Parsing_result.set None in + let* () = Parser_state.set SkipLayout in + let* () = Lexer_state.set (0, 0) in let* () = Code.clear in return () @@ -862,14 +862,14 @@ module Make (Context : P) : | Some payload -> let* boot_sector = Boot_sector.get in let msg = boot_sector ^ payload in - let* () = CurrentLevel.set inbox_level in - let* () = MessageCounter.set (Some message_counter) in - let* () = NextMessage.set (Some msg) in + let* () = Current_level.set inbox_level in + let* () = Message_counter.set (Some message_counter) in + let* () = Next_message.set (Some msg) in let* () = start_parsing in return () | None -> - let* () = CurrentLevel.set inbox_level in - let* () = MessageCounter.set (Some message_counter) in + let* () = Current_level.set inbox_level in + let* () = Message_counter.set (Some message_counter) in let* () = Status.set Waiting_for_input_message in return () @@ -877,7 +877,7 @@ module Make (Context : P) : let next_char = let open Monad.Syntax in - LexerState.( + Lexer_state.( let* start, len = get in set (start, len + 1)) @@ -886,8 +886,8 @@ module Make (Context : P) : let current_char = let open Monad.Syntax in - let* start, len = LexerState.get in - let* msg = NextMessage.get in + let* start, len = Lexer_state.get in + let* msg = Next_message.get in match msg with | None -> no_message_to_lex () | Some s -> @@ -897,12 +897,12 @@ module Make (Context : P) : let lexeme = let open Monad.Syntax in - let* start, len = LexerState.get in - let* msg = NextMessage.get in + let* start, len = Lexer_state.get in + let* msg = Next_message.get in match msg with | None -> no_message_to_lex () | Some s -> - let* () = LexerState.set (start + len, 0) in + let* () = Lexer_state.set (start + len, 0) in return (String.sub s start len) let push_int_literal = @@ -920,18 +920,18 @@ module Make (Context : P) : let start_evaluating : unit t = let open Monad.Syntax in let* () = Status.set Evaluating in - let* () = EvaluationResult.set None in + let* () = Evaluation_result.set None in let* () = Stack.clear in return () let stop_parsing outcome = let open Monad.Syntax in - let* () = ParsingResult.set (Some outcome) in + let* () = Parsing_result.set (Some outcome) in start_evaluating let stop_evaluating outcome = let open Monad.Syntax in - let* () = EvaluationResult.set (Some outcome) in + let* () = Evaluation_result.set (Some outcome) in Status.set Waiting_for_input_message let parse : unit t = @@ -944,17 +944,17 @@ module Make (Context : P) : in let produce_int = let* () = push_int_literal in - let* () = ParserState.set SkipLayout in + let* () = Parser_state.set SkipLayout in return () in let produce_var = let* () = push_var in - let* () = ParserState.set SkipLayout in + let* () = Parser_state.set SkipLayout in return () in let is_digit d = Compare.Char.(d >= '0' && d <= '9') in let is_letter d = Compare.Char.(d >= 'a' && d <= 'z') in - let* parser_state = ParserState.get in + let* parser_state = Parser_state.get in match parser_state with | ParseInt -> ( let* char = current_char in @@ -996,12 +996,12 @@ module Make (Context : P) : | Some d when is_digit d -> let* _ = lexeme in let* () = next_char in - let* () = ParserState.set ParseInt in + let* () = Parser_state.set ParseInt in return () | Some d when is_letter d -> let* _ = lexeme in let* () = next_char in - let* () = ParserState.set ParseVar in + let* () = Parser_state.set ParseVar in return () | None -> stop_parsing true | _ -> stop_parsing false) @@ -1009,8 +1009,8 @@ module Make (Context : P) : let output v = let open Monad.Syntax in let open Sc_rollup_outbox_message_repr in - let* counter = OutputCounter.get in - let* () = OutputCounter.set (Z.succ counter) in + let* counter = Output_counter.get in + let* () = Output_counter.set (Z.succ counter) in let unparsed_parameters = Micheline.(Int ((), Z.of_int v) |> strip_locations) in @@ -1018,7 +1018,7 @@ module Make (Context : P) : let entrypoint = Entrypoint_repr.default in let transaction = {unparsed_parameters; destination; entrypoint} in let message = Atomic_transaction_batch {transactions = [transaction]} in - let* outbox_level = CurrentLevel.get in + let* outbox_level = Current_level.get in let output = Sc_rollup_PVM_sem.{outbox_level; message_index = counter; message} in @@ -1063,7 +1063,7 @@ module Make (Context : P) : match status with | Halted -> boot | Waiting_for_input_message -> ( - let* msg = NextMessage.get in + let* msg = Next_message.get in match msg with | None -> internal_error @@ -1074,8 +1074,8 @@ module Make (Context : P) : let ticked m = let open Monad.Syntax in - let* tick = CurrentTick.get in - let* () = CurrentTick.set (Sc_rollup_tick_repr.next tick) in + let* tick = Current_tick.get in + let* () = Current_tick.set (Sc_rollup_tick_repr.next tick) in m let eval state = state_of (ticked eval_step) state 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 ea922ce92a4c..36ce1e827efc 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml @@ -206,7 +206,7 @@ module V1 = struct [old_levels_messages] and empties [current_level]. It then initialises a new level tree for the new messages---note that any intermediate levels are simply skipped. See - {!MakeHashingScheme.archive_if_needed} for details. + {!Make_hashing_scheme.archive_if_needed} for details. *) type t = { @@ -379,7 +379,7 @@ type serialized_proof = bytes let serialized_proof_encoding = Data_encoding.bytes -module type MerkelizedOperations = sig +module type Merkelized_operations = sig type inbox_context type tree @@ -485,8 +485,8 @@ module type P = sig Tree.t -> tree -> (tree -> (tree * 'a) Lwt.t) -> (proof * 'a) option Lwt.t end -module MakeHashingScheme (P : P) : - MerkelizedOperations with type tree = P.tree and type inbox_context = P.t = +module Make_hashing_scheme (P : P) : + Merkelized_operations with type tree = P.tree and type inbox_context = P.t = struct module Tree = P.Tree @@ -1253,7 +1253,7 @@ struct end include ( - MakeHashingScheme (struct + Make_hashing_scheme (struct module Tree = struct include Context.Tree @@ -1293,7 +1293,7 @@ include ( (* We cannot produce a proof without full inbox_context *) Lwt.return None end) : - MerkelizedOperations + Merkelized_operations with type tree = Context.tree and type inbox_context = Context.t) 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 856444ac0e9e..79399710e1a9 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.mli @@ -230,7 +230,7 @@ val serialized_proof_encoding : serialized_proof Data_encoding.t (** The following operations are subject to cross-validation between rollup nodes and the layer 1. *) -module type MerkelizedOperations = sig +module type Merkelized_operations = sig (** The type for the Merkle trees used in this module. *) type tree @@ -442,14 +442,14 @@ end We provide a functor that takes a {!Context.TREE} module from any context, checks that the assumptions made about tree's arity and hashing scheme are valid, and returns a standard compliant - implementation of the {!MerkelizedOperations}. + implementation of the {!Merkelized_operations}. *) -module MakeHashingScheme (P : P) : - MerkelizedOperations with type tree = P.tree and type inbox_context = P.t +module Make_hashing_scheme (P : P) : + Merkelized_operations with type tree = P.tree and type inbox_context = P.t include - MerkelizedOperations + Merkelized_operations with type tree = Context.tree and type inbox_context = Context.t 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 179105813c47..c9f69cb75341 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml @@ -134,7 +134,7 @@ module type PVM_with_context_and_state = sig module Inbox_with_history : sig include - Sc_rollup_inbox_repr.MerkelizedOperations + Sc_rollup_inbox_repr.Merkelized_operations with type inbox_context = context val inbox : Sc_rollup_inbox_repr.history_proof 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 80c1e997409a..ba312894786f 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.mli @@ -109,7 +109,7 @@ module type PVM_with_context_and_state = sig module Inbox_with_history : sig include - Sc_rollup_inbox_repr.MerkelizedOperations + Sc_rollup_inbox_repr.Merkelized_operations with type inbox_context = context val inbox : Sc_rollup_inbox_repr.history_proof 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 83e9f30b99b9..9db811a6eee9 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 @@ -244,7 +244,7 @@ end It is intended to resemble (at least well enough for these tests) the rollup node's inbox instance. *) -module Node = MakeHashingScheme (Tree) +module Node = Make_hashing_scheme (Tree) (** In the tests below we use the {!Node} inbox above to generate proofs, but we need to test that they can be interpreted and validated by -- GitLab