diff --git a/src/proto_alpha/bin_sc_rollup_client/RPC.ml b/src/proto_alpha/bin_sc_rollup_client/RPC.ml index dffca04b90a535786fadd246de2d3d603363470a..d1d9721017ebb30641f82f6d1bfa4727c60b3cd4 100644 --- a/src/proto_alpha/bin_sc_rollup_client/RPC.ml +++ b/src/proto_alpha/bin_sc_rollup_client/RPC.ml @@ -32,3 +32,6 @@ let get_sc_rollup_addresses_command cctxt = let get_state_value_command cctxt key = call cctxt (Sc_rollup_services.Local.current_state_value ()) () {key} () + +let get_outbox_proof cctxt serialized_output = + call cctxt (Sc_rollup_services.Global.outbox_proof ()) () serialized_output () diff --git a/src/proto_alpha/bin_sc_rollup_client/commands.ml b/src/proto_alpha/bin_sc_rollup_client/commands.ml index aef42ec0160aa758f759ab770a967e951c4653c6..7372a84a6e70c21c8e56da27d905636359707ff4 100644 --- a/src/proto_alpha/bin_sc_rollup_client/commands.ml +++ b/src/proto_alpha/bin_sc_rollup_client/commands.ml @@ -84,6 +84,78 @@ let display_answer (cctxt : #Configuration.sc_client_context) : cctxt#error "@[[HTTP 403] Access denied to: %a@]@." Uri.pp cctxt#base | _ -> cctxt#error "Unexpected server answer\n%!" +let get_output_proof () = + let parse_transactions transactions = + let json = Ezjsonm.from_string transactions in + let open Ezjsonm in + let open Sc_rollup.Outbox.Message in + let open Lwt_result_syntax in + let transaction json = + let destination = + find json ["destination"] |> get_string + |> Protocol.Contract_hash.of_b58check_exn + in + let entrypoint = + try + find json ["entrypoint"] |> get_string + |> Entrypoint.of_string_strict_exn + with Not_found -> Entrypoint.default + in + let*? parameters = + Tezos_micheline.Micheline_parser.no_parsing_error + @@ (find json ["parameters"] |> get_string + |> Michelson_v1_parser.parse_expression) + in + let unparsed_parameters = parameters.expanded in + return @@ {destination; entrypoint; unparsed_parameters} + in + match json with + | `A messages -> + let* transactions = List.map_es transaction messages in + return @@ Atomic_transaction_batch {transactions} + | `O _ -> + let* transaction = transaction json in + return @@ Atomic_transaction_batch {transactions = [transaction]} + | _ -> + failwith + "An outbox message must be either a single transaction or a list of \ + transactions." + in + + command + ~desc:"Ask the rollup node for an output proof." + no_options + (prefixes ["get"; "proof"; "for"; "message"] + @@ string ~name:"index" ~desc:"The index of the message in the outbox" + @@ prefixes ["of"; "outbox"; "at"; "level"] + @@ string + ~name:"level" + ~desc:"The level of the rollup outbox where the message is available" + @@ prefixes ["transferring"] + @@ string + ~name:"transactions" + ~desc:"A JSON description of the transactions" + @@ stop) + (fun () index level transactions (cctxt : #Configuration.sc_client_context) -> + let open Lwt_result_syntax in + let* message = parse_transactions transactions in + let output = + Protocol.Alpha_context.Sc_rollup. + { + message_index = Z.of_string index; + outbox_level = Raw_level.of_int32_exn (Int32.of_string level); + message; + } + in + RPC.get_outbox_proof cctxt output >>=? fun (commitment_hash, proof) -> + cctxt#message + {|@[{ "proof" : "0x%a", "commitment_hash" : "%a"@]}|} + Hex.pp + (Hex.of_string proof) + Protocol.Alpha_context.Sc_rollup.Commitment.Hash.pp + commitment_hash + >>= fun () -> return_unit) + (** [call_get cctxt raw_url] executes a GET RPC call against the [raw_url]. *) let call_get (cctxt : #Configuration.sc_client_context) raw_url = let open Lwt_result_syntax in @@ -155,6 +227,7 @@ let all () = [ get_sc_rollup_addresses_command (); get_state_value_command (); + get_output_proof (); rpc_get_command; Keys.generate_keys (); Keys.list_keys (); diff --git a/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml b/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml index 56c9e153945c3cee3072d547b2551758791c4670..50f8f64762ec223c95fdcb63cfeee2415d9a93b4 100644 --- a/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml +++ b/src/proto_alpha/bin_sc_rollup_node/RPC_server.ml @@ -26,6 +26,7 @@ open Tezos_rpc open Tezos_rpc_http open Tezos_rpc_http_server +open Protocol let get_head store = let open Lwt_result_syntax in @@ -145,11 +146,21 @@ end module Make (PVM : Pvm.S) : S with module PVM = PVM = struct include Common module PVM = PVM + module Outbox = Outbox.Make (PVM) - let get_state (node_ctxt : Node_context.t) = + let get_context ?block_hash (node_ctxt : Node_context.t) = let open Lwt_result_syntax in - let* head = get_head node_ctxt.store in - let* ctxt = Node_context.checkout_context node_ctxt head in + let* block_hash = + match block_hash with + | None -> get_head node_ctxt.store + | Some block_hash -> return block_hash + in + let* ctxt = Node_context.checkout_context node_ctxt block_hash in + return ctxt + + let get_state ?block_hash (node_ctxt : Node_context.t) = + let open Lwt_result_syntax in + let* ctxt = get_context ?block_hash node_ctxt in let*! state = PVM.State.find ctxt in match state with None -> failwith "No state" | Some state -> return state @@ -254,6 +265,29 @@ module Make (PVM : Pvm.S) : S with module PVM = PVM = struct (Sc_rollup_services.Global.dal_confirmed_slots ()) (fun () () -> get_dal_confirmed_slots store) + let register_current_outbox node_ctxt dir = + RPC_directory.register0 + dir + (Sc_rollup_services.Global.current_outbox ()) + (fun () () -> + let open Lwt_result_syntax in + let store = node_ctxt.Node_context.store in + let*! lcc_level = Store.Last_cemented_commitment_level.get store in + let*! block_hash = + Layer1.hash_of_level + store + (Alpha_context.Raw_level.to_int32 lcc_level) + in + let* state = get_state ~block_hash node_ctxt in + let*! outbox = PVM.get_outbox state in + return outbox) + + let register_outbox_proof node_ctxt dir = + RPC_directory.register0 + dir + (Sc_rollup_services.Global.outbox_proof ()) + (fun output () -> Outbox.proof_of_output node_ctxt output) + let register (node_ctxt : Node_context.t) configuration = RPC_directory.empty |> register_sc_rollup_address configuration @@ -270,6 +304,8 @@ module Make (PVM : Pvm.S) : S with module PVM = PVM = struct |> register_dal_slot_subscriptions node_ctxt.store |> register_dal_slots node_ctxt.store |> register_dal_confirmed_slots node_ctxt.store + |> register_current_outbox node_ctxt + |> register_outbox_proof node_ctxt let start node_ctxt configuration = Common.start configuration (register node_ctxt configuration) diff --git a/src/proto_alpha/bin_sc_rollup_node/context.ml b/src/proto_alpha/bin_sc_rollup_node/context.ml index d4ff0301ba5143104bbea8d979122a5c0324e83f..74aa8c0c991031b689a856ebf5ccc1747d0eed14 100644 --- a/src/proto_alpha/bin_sc_rollup_node/context.ml +++ b/src/proto_alpha/bin_sc_rollup_node/context.ml @@ -209,7 +209,7 @@ module Inbox = struct end) end -(** State of the PVM that this rollup node deals with *) +(** State of the PVM that this rollup node deals with. *) module PVMState = struct type value = tree diff --git a/src/proto_alpha/bin_sc_rollup_node/outbox.ml b/src/proto_alpha/bin_sc_rollup_node/outbox.ml new file mode 100644 index 0000000000000000000000000000000000000000..29ae63ecceed535383ec24290ea40754c6a182d6 --- /dev/null +++ b/src/proto_alpha/bin_sc_rollup_node/outbox.ml @@ -0,0 +1,81 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 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. *) +(* *) +(*****************************************************************************) + +(** This module provides helper to interact with PVM outboxes. *) + +open Node_context +open Protocol.Alpha_context + +module Make (PVM : Pvm.S) = struct + let get_head store = + let open Lwt_result_syntax in + let*! head = Layer1.current_head_hash store in + match head with None -> failwith "No head" | Some head -> return head + + let get_context (node_ctxt : Node_context.t) = + let open Lwt_result_syntax in + let* head = get_head node_ctxt.store in + let* ctxt = Node_context.checkout_context node_ctxt head in + return ctxt + + let get_state_of_lcc node_ctxt = + let open Lwt_result_syntax in + let*! lcc_level = + Store.Last_cemented_commitment_level.get node_ctxt.store + in + let*! block_hash = + Layer1.hash_of_level node_ctxt.store (Raw_level.to_int32 lcc_level) + in + let* ctxt = Node_context.checkout_context node_ctxt block_hash in + let*! state = PVM.State.find ctxt in + return state + + let proof_of_output node_ctxt output = + let open Lwt_result_syntax in + let*! commitment_hash = + Store.Last_cemented_commitment_hash.get node_ctxt.store + in + let* state = get_state_of_lcc node_ctxt in + match state with + | None -> + (* + This case should never happen as origination creates an LCC which + must have been considered by the rollup node at startup time. + *) + failwith "Error producing outbox proof (no cemented state in the node)" + | Some state -> ( + let*! proof = PVM.produce_output_proof node_ctxt.context state output in + match proof with + | Ok proof -> + let serialized_proof = + Data_encoding.Binary.to_string_exn PVM.output_proof_encoding proof + in + return @@ (commitment_hash, serialized_proof) + | Error err -> + failwith + "Error producing outbox proof (%a)" + Environment.Error_monad.pp + err) +end diff --git a/src/proto_alpha/bin_sc_rollup_node/pvm.ml b/src/proto_alpha/bin_sc_rollup_node/pvm.ml index 53d078950dbe9f4df1cd3166e0a3de80f433b499..0fa214ff08f5e743440804d56f81aeda1a8f675d 100644 --- a/src/proto_alpha/bin_sc_rollup_node/pvm.ml +++ b/src/proto_alpha/bin_sc_rollup_node/pvm.ml @@ -2,6 +2,7 @@ (* *) (* Open Source License *) (* Copyright (c) 2022 TriliTech *) +(* Copyright (c) 2022 Nomadic Labs, *) (* *) (* Permission is hereby granted, free of charge, to any person obtaining a *) (* copy of this software and associated documentation files (the "Software"),*) @@ -45,6 +46,10 @@ module type S = sig (** [string_of_status status] returns a string representation of [status]. *) val string_of_status : status -> string + (** [get_outbox state] returns a list of outputs available in the + outbox of [state]. *) + val get_outbox : state -> Sc_rollup.output list Lwt.t + (** State storage for this PVM. *) module State : sig (** [find context] returns the PVM state stored in the [context], if any. *) diff --git a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml index 7393c2ecee14b5337f22e103501c3968c6619e19..5a0ef98b7f91277eea363e9b64f64a57dd699840 100644 --- a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml +++ b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml @@ -3325,7 +3325,7 @@ let commands_rw () = ~name:"output proof" ~desc: "The output proof containing the outbox level, index and message." - Sc_rollup_params.unchecked_payload_parameter + bytes_parameter @@ stop) (fun ( fee, dry_run, @@ -3356,7 +3356,7 @@ let commands_rw () = ~source ~rollup ~cemented_commitment - ~output_proof + ~output_proof:(Bytes.to_string output_proof) ~src_pk ~src_sk ~fee_parameter diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 0b6aefe149068988e66b712e63a77f4b49913f3c..457fac89365f07befdaf33d7ee301245f1f276fe 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2928,12 +2928,14 @@ module Sc_rollup : sig type t = Internal of internal_inbox_message | External of string - type serialized = private string + type serialized val encoding : t Data_encoding.t val unsafe_of_string : string -> serialized + val unsafe_to_string : serialized -> string + val serialize : t -> serialized tzresult val deserialize : serialized -> t tzresult @@ -3135,15 +3137,15 @@ module Sc_rollup : sig type t = Atomic_transaction_batch of {transactions : transaction list} - type serialized = private string + type serialized + + val unsafe_of_string : string -> serialized + + val unsafe_to_string : serialized -> string val deserialize : serialized -> t tzresult - (** This module discloses definitions that are only useful for tests and - must not be used otherwise. *) - module Internal_for_tests : sig - val serialize : t -> serialized tzresult - end + val serialize : t -> serialized tzresult end val record_applied_message : @@ -3160,6 +3162,8 @@ module Sc_rollup : sig message : Outbox.Message.t; } + val output_encoding : output Data_encoding.t + module PVM : sig type boot_sector = string @@ -3291,6 +3295,8 @@ module Sc_rollup : sig type status = Halted | Waiting_for_input_message | Parsing | Evaluating val get_status : state -> status Lwt.t + + val get_outbox : state -> output list Lwt.t end val reference_initial_state_hash : State_hash.t @@ -3342,6 +3348,8 @@ module Sc_rollup : sig val get_status : state -> status Lwt.t + val get_outbox : state -> output list Lwt.t + val produce_proof : context -> input option -> state -> proof tzresult Lwt.t end diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index f59f7ce7d8a844dd44300a2bcc0d693e86997985..ad892e902ad32e14da7beda3b52632556e76cc7f 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -53,6 +53,44 @@ let reference_initial_state_hash = State_hash.of_b58check_exn "scs11cXwQJJ5dkpEQGq3x2MJm3cM73cbEkHJqo5eDSoRpHUPyEQLB4" +type error += + | Arith_proof_production_failed + | Arith_output_proof_production_failed + | Arith_invalid_claim_about_outbox + +let () = + let open Data_encoding in + let msg = "Invalid claim about outbox" in + register_error_kind + `Permanent + ~id:"sc_rollup_arith_invalid_claim_about_outbox" + ~title:msg + ~pp:(fun fmt () -> Format.pp_print_string fmt msg) + ~description:msg + unit + (function Arith_invalid_claim_about_outbox -> Some () | _ -> None) + (fun () -> Arith_invalid_claim_about_outbox) ; + let msg = "Output proof production failed" in + register_error_kind + `Permanent + ~id:"sc_rollup_arith_output_proof_production_failed" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Arith_output_proof_production_failed -> Some () | _ -> None) + (fun () -> Arith_output_proof_production_failed) ; + let msg = "Proof production failed" in + register_error_kind + `Permanent + ~id:"sc_rollup_arith_proof_production_failed" + ~title:msg + ~pp:(fun fmt () -> Format.fprintf fmt "%s" msg) + ~description:msg + unit + (function Arith_proof_production_failed -> Some () | _ -> None) + (fun () -> Arith_proof_production_failed) + module type P = sig module Tree : Context.TREE with type key = string list and type value = bytes @@ -92,6 +130,8 @@ module type S = sig val get_status : state -> status Lwt.t + val get_outbox : state -> Sc_rollup_PVM_sig.output list Lwt.t + type instruction = | IPush : int -> instruction | IAdd : instruction @@ -365,6 +405,8 @@ module Make (Context : P) : let set k v = set_value (key k) P.encoding v + let entries = children [P.name] P.encoding + let mapped_to k v state = let open Lwt_syntax in let* state', _ = Monad.(run (set k v) state) in @@ -374,7 +416,7 @@ module Make (Context : P) : let pp = let open Monad.Syntax in - let* l = children [P.name] P.encoding in + let* l = entries in let pp_elem fmt (key, value) = Format.fprintf fmt "@[%s : %a@]" key P.pp value in @@ -819,6 +861,11 @@ module Make (Context : P) : let get_status = result_of ~default:Waiting_for_input_message @@ Status.get + let get_outbox state = + let open Lwt_syntax in + let+ entries = result_of ~default:[] Output.entries state in + List.map snd entries + let get_code = result_of ~default:[] @@ Code.to_list let get_parsing_result = result_of ~default:None @@ Parsing_result.get @@ -952,7 +999,13 @@ module Make (Context : P) : 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 is_letter d = + Compare.Char.((d >= 'a' && d <= 'z') || (d >= 'A' && d <= 'Z')) + in + let is_identifier_char = function + | '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' | '%' -> true + | _ -> false + in let* parser_state = Parser_state.get in match parser_state with | ParseInt -> ( @@ -974,7 +1027,7 @@ module Make (Context : P) : | ParseVar -> ( let* char = current_char in match char with - | Some d when is_letter d -> next_char + | Some d when is_identifier_char d -> next_char | Some '+' -> let* () = produce_var in let* () = produce_add in @@ -1005,7 +1058,7 @@ module Make (Context : P) : | None -> stop_parsing true | _ -> stop_parsing false) - let output v = + let output (destination, entrypoint) v = let open Monad.Syntax in let open Sc_rollup_outbox_message_repr in let* counter = Output_counter.get in @@ -1013,8 +1066,6 @@ module Make (Context : P) : let unparsed_parameters = Micheline.(Int ((), Z.of_int v) |> strip_locations) in - let destination = Contract_hash.zero in - let entrypoint = Entrypoint_repr.default in let transaction = {unparsed_parameters; destination; entrypoint} in let message = Atomic_transaction_batch {transactions = [transaction]} in let* outbox_level = Current_level.get in @@ -1023,6 +1074,32 @@ module Make (Context : P) : in Output.set (Z.to_string counter) output + let identifies_target_contract x = + let open Option_syntax in + match Contract_hash.of_b58check_opt x with + | None -> + if Compare.String.(x = "out") then + return (Contract_hash.zero, Entrypoint_repr.default) + else fail + | Some _ -> ( + match String.split_on_char '%' x with + | destination :: entrypoint -> + let* destination = Contract_hash.of_b58check_opt destination in + let* entrypoint = + match entrypoint with + | [] -> return Entrypoint_repr.default + | _ -> + let* entrypoint = + Non_empty_string.of_string (String.concat "" entrypoint) + in + let* entrypoint = + Entrypoint_repr.of_annot_lax_opt entrypoint + in + return entrypoint + in + return (destination, entrypoint) + | [] -> fail) + let evaluate = let open Monad.Syntax in let* i = Code.pop in @@ -1033,8 +1110,10 @@ module Make (Context : P) : let* v = Stack.top in match v with | None -> stop_evaluating false - | Some v -> - if Compare.String.(x = "out") then output v else Vars.set x v) + | Some v -> ( + match identifies_target_contract x with + | Some contract_entrypoint -> output contract_entrypoint v + | None -> Vars.set x v)) | Some IAdd -> ( let* v = Stack.pop in match v with @@ -1096,8 +1175,6 @@ module Make (Context : P) : | Some (_, request) -> return (PS.input_request_equal request proof.requested) - type error += Arith_proof_production_failed - let produce_proof context input_given state = let open Lwt_tzresult_syntax in let*! result = @@ -1170,10 +1247,6 @@ module Make (Context : P) : let* result = Context.verify_proof p.output_proof transition in match result with None -> return false | Some _ -> return true - type error += Arith_output_proof_production_failed - - type error += Arith_invalid_claim_about_outbox - let produce_output_proof context state output_proof_output = let open Lwt_result_syntax in let*! output_proof_state = state_hash state in diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli index 6479568c6fa7da40fb3e39d50fce4b269bee23d0..97856bed7d026efcab3e9c7a36f10269d12509c3 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.mli @@ -85,6 +85,9 @@ module type S = sig (** [get_status state] returns the machine status in [state]. *) val get_status : state -> status Lwt.t + (** [get_outbox state] returns the outbox in [state]. *) + val get_outbox : state -> Sc_rollup_PVM_sig.output list Lwt.t + (** The machine has only three instructions. *) type instruction = | IPush : int -> instruction diff --git a/src/proto_alpha/lib_protocol/sc_rollup_management_protocol.ml b/src/proto_alpha/lib_protocol/sc_rollup_management_protocol.ml index 575a60114f3e226d5d82d54d0ff53b1b6c34e5d0..4b5845b24e0a8e731af9800fc088dd222acdbc95 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_management_protocol.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_management_protocol.ml @@ -164,8 +164,7 @@ module Internal_for_tests = struct let output_message_internal = Sc_rollup.Outbox.Message.Atomic_transaction_batch {transactions} in - Sc_rollup.Outbox.Message.Internal_for_tests.serialize - output_message_internal + Sc_rollup.Outbox.Message.serialize output_message_internal let deserialize_inbox_message = Sc_rollup.Inbox_message.deserialize end diff --git a/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.ml index 4fb174a241a1e0f736e229f9dbaf247faa106dd2..839f313cf8fa322dab311d9bf505b55726f272cd 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.ml @@ -72,7 +72,7 @@ let transaction_encoding = @@ obj3 (req "parameters" Script_repr.expr_encoding) (req "destination" Contract_repr.originated_encoding) - (req "entrypoint" Entrypoint_repr.simple_encoding) + Entrypoint_repr.(dft "entrypoint" simple_encoding default) let encoding = let open Data_encoding in @@ -122,10 +122,12 @@ let deserialize data = | Some x -> return x | None -> fail Error_decode_outbox_message -module Internal_for_tests = struct - let serialize outbox_message = - let open Tzresult_syntax in - match Data_encoding.Binary.to_string_opt encoding outbox_message with - | Some str -> return str - | None -> fail Error_encode_outbox_message -end +let serialize outbox_message = + let open Tzresult_syntax in + match Data_encoding.Binary.to_string_opt encoding outbox_message with + | Some str -> return str + | None -> fail Error_encode_outbox_message + +let unsafe_of_string s = s + +let unsafe_to_string s = s diff --git a/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.mli b/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.mli index b896335fe9bcf70a20922fd846d6146f6a45f842..4edae272da7ec0d560fe7091fe6108455541ddd8 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_outbox_message_repr.mli @@ -56,8 +56,14 @@ type serialized = private string typed values. *) val deserialize : serialized -> t tzresult -(** Module containing functions exposed so they can be used in tests. *) -module Internal_for_tests : sig - (** [serialize msg] serializes the given outbox message [msg]. *) - val serialize : t -> serialized tzresult -end +(** [serialize msg] serializes the given outbox message [msg]. *) +val serialize : t -> serialized tzresult + +(** [unsafe_of_string s] builds a serialized value out of a string. + You must understand the invariants of [serialized] to do so. *) +val unsafe_of_string : string -> serialized + +(** [unsafe_to_string s] builds a string out of a serialized value. + You must understand the invariants of [serialized] to manipulate + the resulting string. *) +val unsafe_to_string : serialized -> string diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml index 4386f5e070500a1dfafd0c833e53ccde13d94823..2111ad1468526495d338c8508b270f458a211881 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.ml @@ -93,6 +93,8 @@ module V2_0_0 = struct (** [get_status state] gives you the current execution status for the PVM. *) val get_status : state -> status Lwt.t + + val get_outbox : state -> Sc_rollup_PVM_sig.output list Lwt.t end (* TODO: https://gitlab.com/tezos/tezos/-/issues/3091 @@ -269,6 +271,11 @@ module V2_0_0 = struct let get_status : state -> status Lwt.t = result_of get_status + let get_outbox _state = + (* FIXME: https://gitlab.com/tezos/tezos/-/issues/3790 *) + let open Lwt_syntax in + return [] + let set_input_state input = let open PS in let open Monad.Syntax in diff --git a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli index b5dffdfc1530f2e72f70c94ed2c1c3d36b1561eb..16c817018dc225eae0f3c18d8f49de99830028f9 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_wasm.mli @@ -57,6 +57,9 @@ module V2_0_0 : sig (** [get_status state] gives you the current execution status for the PVM. *) val get_status : state -> status Lwt.t + + (** [get_outbox state] returns the outbox in [state]. *) + val get_outbox : state -> Sc_rollup_PVM_sig.output list Lwt.t end module type P = sig 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 25e11c1a7da42bc5efa80649ce657180faf37c34..be8af5b04e20d8dc869e5dba5aba1ca339c76d55 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 @@ -188,7 +188,7 @@ let test_parsing_message ~valid (source, expected_code) = Assert.equal ~loc:__LOC__ (Option.equal Bool.equal) - "Unexpected parsing resutlt" + "Unexpected parsing result" (fun fmt r -> Format.fprintf fmt @@ -229,7 +229,7 @@ let syntactically_valid_messages = let syntactically_invalid_messages = List.map (fun s -> (s, [])) - ["@"; " @"; " @ "; "---"; "12 +++ --"; "1a"; "a1"] + ["@"; " @"; " @ "; "---"; "12 +++ --"; "1a"; "a_"] let test_parsing_messages () = List.iter_es (test_parsing_message ~valid:true) syntactically_valid_messages diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml index 86ae64837a9040407a52917ec0f1596f92c6e5ab..e5f1cf1e62e0d77ab8dd970599c8d204782d0db8 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml @@ -49,7 +49,10 @@ let check_encode_decode_inbox_message message = let*? bytes' = Environment.wrap_tzresult @@ Sc_rollup.Inbox_message.serialize message' in - Assert.equal_string ~loc:__LOC__ (bytes :> string) (bytes' :> string) + Assert.equal_string + ~loc:__LOC__ + (Sc_rollup.Inbox_message.unsafe_to_string bytes) + (Sc_rollup.Inbox_message.unsafe_to_string bytes') let check_encode_decode_outbox_message ctxt message = let open Lwt_result_syntax in @@ -68,7 +71,10 @@ let check_encode_decode_outbox_message ctxt message = Environment.wrap_tzresult @@ Internal_for_tests.serialize_outbox_message message' in - Assert.equal_string ~loc:__LOC__ (bytes :> string) (bytes' :> string) + Assert.equal_string + ~loc:__LOC__ + (Sc_rollup.Outbox.Message.unsafe_to_string bytes) + (Sc_rollup.Outbox.Message.unsafe_to_string bytes') let string_ticket ticketer contents amount = let open WithExceptions in @@ -152,7 +158,9 @@ let test_encode_decode_external_inbox_message () = Environment.wrap_tzresult @@ Sc_rollup.Inbox_message.serialize inbox_message in - let real_encoding = (real_encoding :> string) in + let real_encoding = + Sc_rollup.Inbox_message.unsafe_to_string real_encoding + in (* The prefix consists of a tag (0 for internal, 1 for external). *) let real_prefix = String.get real_encoding 0 in let expected_prefix = '\001' in diff --git a/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml b/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml index 6f0a82d99f4be8471cbd38bb3cef18f1399d44ee..39f1f0626a55b26cb5b5512f03026ce895eb88c7 100644 --- a/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml +++ b/src/proto_alpha/lib_sc_rollup/sc_rollup_services.ml @@ -131,6 +131,13 @@ module Global = struct ~output:Data_encoding.string (prefix / "status") + let current_outbox () = + RPC_service.get_service + ~description:"Current outbox" + ~query:RPC_query.empty + ~output:Data_encoding.(list Sc_rollup.output_encoding) + (prefix / "outbox") + let dal_slot_subscriptions () = RPC_service.get_service ~description:"Current data availability layer slot subscriptions" @@ -151,6 +158,62 @@ module Global = struct ~query:RPC_query.empty ~output:(Data_encoding.list Dal.Slot.encoding) (prefix / "dal" / "confirmed_slots") + + let outbox_proof_query = + let open RPC_query in + let open Sc_rollup in + let invalid_message e = + raise + (Invalid + (Format.asprintf + "Invalid message (%a)" + Environment.Error_monad.pp_trace + e)) + in + query (fun outbox_level message_index serialized_outbox_message -> + let req name f = function + | None -> + raise + (Invalid (Format.sprintf "Query parameter %s is required" name)) + | Some arg -> f arg + in + let outbox_level = + req "outbox_level" Raw_level.of_int32_exn outbox_level + in + let message_index = req "message_index" Z.of_int64 message_index in + let message = + req + "serialized_outbox_message" + (fun s -> Outbox.Message.(unsafe_of_string s |> deserialize)) + serialized_outbox_message + in + match message with + | Error e -> invalid_message e + | Ok message -> {outbox_level; message_index; message}) + |+ opt_field "outbox_level" RPC_arg.int32 (fun o -> + Some (Raw_level.to_int32 o.outbox_level)) + |+ opt_field "message_index" RPC_arg.int64 (fun o -> + Some (Z.to_int64 o.message_index)) + |+ opt_field "serialized_outbox_message" RPC_arg.string (fun o -> + match Outbox.Message.serialize o.message with + | Ok message -> Some (Outbox.Message.unsafe_to_string message) + | Error e -> invalid_message e) + |> seal + + let hex_string = + let open Data_encoding in + conv Bytes.of_string Bytes.to_string bytes + + let outbox_proof () = + RPC_service.get_service + ~description:"Generate serialized output proof for some outbox message" + ~query:outbox_proof_query + ~output: + Data_encoding.( + obj2 + (req "commitment" Sc_rollup.Commitment.Hash.encoding) + (req "proof" hex_string)) + (prefix / "proofs" / "outbox") end module Local = struct diff --git a/tezt/lib_tezos/client.ml b/tezt/lib_tezos/client.ml index 76094c1c311c9d0f1fe11b94085942d348973cb4..454c0292f736036e9add5ca628957d1029a542ae 100644 --- a/tezt/lib_tezos/client.ml +++ b/tezt/lib_tezos/client.ml @@ -1856,6 +1856,35 @@ module Sc_rollup = struct in let parse process = Process.check process in {value = process; run = parse} + + (** Run [tezos-client execute outbox message of sc rollup from + for commitment hash and output proof ]. *) + let execute_outbox_message ?(wait = "none") ?burn_cap ?storage_limit ?fee + ?hooks ~rollup ~src ~commitment_hash ~proof client = + let process = + spawn_command + ?hooks + client + (["--wait"; wait] + @ ["execute"; "outbox"; "message"; "of"; "sc"; "rollup"; rollup] + @ ["from"; src] + @ ["for"; "commitment"; "hash"; commitment_hash] + @ ["and"; "output"; "proof"; proof] + @ Option.fold + ~none:[] + ~some:(fun burn_cap -> ["--burn-cap"; Tez.to_string burn_cap]) + burn_cap + @ Option.fold + ~none:[] + ~some:(fun fee -> ["--fee"; Tez.to_string fee]) + fee + @ Option.fold + ~none:[] + ~some:(fun s -> ["--storage-limit"; string_of_int s]) + storage_limit) + in + let parse process = Process.check process in + {value = process; run = parse} end let init ?path ?admin_path ?name ?color ?base_dir ?endpoint ?media_type () = diff --git a/tezt/lib_tezos/client.mli b/tezt/lib_tezos/client.mli index a2751b616bc7c9ede46f1c88b4dfb9b2de670aa8..aa49b4cfe78e2cb47571b83174bc472793509ab4 100644 --- a/tezt/lib_tezos/client.mli +++ b/tezt/lib_tezos/client.mli @@ -1383,6 +1383,21 @@ module Sc_rollup : sig src:string -> t -> unit Runnable.process + + (** Run [tezos-client execute outbox message of sc rollup from + for commitment hash and output proof ]. *) + val execute_outbox_message : + ?wait:string -> + ?burn_cap:Tez.t -> + ?storage_limit:int -> + ?fee:Tez.t -> + ?hooks:Process.hooks -> + rollup:string -> + src:string -> + commitment_hash:string -> + proof:string -> + t -> + unit Runnable.process end (** {2 High-Level Functions} *) diff --git a/tezt/lib_tezos/sc_rollup_client.ml b/tezt/lib_tezos/sc_rollup_client.ml index ac6078c225f2c6377a85afbd9711fe9f9d6ba918..04d5876c988ed7c7c3e02628c54fb5f60c78a8f3 100644 --- a/tezt/lib_tezos/sc_rollup_client.ml +++ b/tezt/lib_tezos/sc_rollup_client.ml @@ -108,6 +108,69 @@ let state_value ?hooks sc_client ~key = in return (Scanf.sscanf (String.trim out) "%S" (fun s -> s) |> String.to_bytes) +type transaction = { + destination : string; + entrypoint : string option; + parameters : string; +} + +let string_of_transaction {destination; entrypoint; parameters} = + Format.asprintf + {| { "destination" : "%s", %s"parameters" : "%s" } |} + destination + (match entrypoint with + | None -> "" + | Some entrypoint -> Format.asprintf {| "entrypoint" : "%s", |} entrypoint) + parameters + +let string_of_batch ts = + "[ " ^ String.concat "," (List.map string_of_transaction ts) ^ " ]" + +type outbox_proof = {commitment_hash : string; proof : string} + +let outbox_proof_batch ?hooks ?expected_error sc_client ~message_index + ~outbox_level batch = + let process = + spawn_command + ?hooks + sc_client + [ + "get"; + "proof"; + "for"; + "message"; + string_of_int message_index; + "of"; + "outbox"; + "at"; + "level"; + string_of_int outbox_level; + "transferring"; + string_of_batch batch; + ] + in + match expected_error with + | None -> + let* answer = Process.check_and_read_stdout process in + let open JSON in + let json = parse ~origin:"outbox_proof" answer in + let commitment_hash = json |-> "commitment_hash" |> as_string in + let proof = json |-> "proof" |> as_string in + return (Some {commitment_hash; proof}) + | Some msg -> + let* () = Process.check_error ~msg process in + return None + +let outbox_proof_single ?hooks ?expected_error ?entrypoint sc_client + ~message_index ~outbox_level ~destination ~parameters = + outbox_proof_batch + ?hooks + ?expected_error + sc_client + ~message_index + ~outbox_level + [{destination; entrypoint; parameters}] + let rpc_get ?hooks sc_client path = let process = spawn_command ?hooks sc_client ["rpc"; "get"; Client.string_of_path path] @@ -135,6 +198,11 @@ let status ?hooks sc_client = let+ res = rpc_get ?hooks sc_client ["global"; "status"] in JSON.as_string res +let outbox ?hooks sc_client = + let open Lwt.Syntax in + let+ res = rpc_get ?hooks sc_client ["global"; "outbox"] in + JSON.encode res + let last_stored_commitment ?hooks sc_client = let open Lwt.Syntax in let+ json = rpc_get ?hooks sc_client ["global"; "last_stored_commitment"] in diff --git a/tezt/lib_tezos/sc_rollup_client.mli b/tezt/lib_tezos/sc_rollup_client.mli index 535d5292fc4325d1db277ef6b83dcb87e3209154..47007915b00c8151c086f3a62563410c0093c9ee 100644 --- a/tezt/lib_tezos/sc_rollup_client.mli +++ b/tezt/lib_tezos/sc_rollup_client.mli @@ -70,6 +70,43 @@ val state_value : ?hooks:Process.hooks -> t -> key:string -> bytes Lwt.t (** [status client] gets the corresponding PVM status for the current head block. *) val status : ?hooks:Process.hooks -> t -> string Lwt.t +(** [outbox client] gets the rollup outbox for the current head block. *) +val outbox : ?hooks:Process.hooks -> t -> string Lwt.t + +type outbox_proof = {commitment_hash : string; proof : string} + +(** [outbox_proof_single] asks the rollup node for a proof that an + output of a given [message_index] is available in the outbox at a + given [outbox_level] as a latent call to [destination]'s + [entrypoint] with the given [parameters]. *) +val outbox_proof_single : + ?hooks:Process.hooks -> + ?expected_error:Base.rex -> + ?entrypoint:string -> + t -> + message_index:int -> + outbox_level:int -> + destination:string -> + parameters:string -> + outbox_proof option Lwt.t + +type transaction = { + destination : string; + entrypoint : string option; + parameters : string; +} + +(** Same as [outbox_proof_single] except that the claim is about a batch + of output transactions. *) +val outbox_proof_batch : + ?hooks:Process.hooks -> + ?expected_error:Base.rex -> + t -> + message_index:int -> + outbox_level:int -> + transaction list -> + outbox_proof option Lwt.t + (** [commitment_from_json] parses a commitment from its JSON representation. *) val commitment_from_json : JSON.t -> commitment option diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_0).out new file mode 100644 index 0000000000000000000000000000000000000000..276b7ecf55ed642a926f25f6656f970069915f95 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_0).out @@ -0,0 +1,73 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind arith of type string booting with --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3110.449 units (will add 100 for safety) +Estimated storage: 6655 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000671 + Expected counter: 1 + Gas limit: 3211 + Storage limit: 6675 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000671 + payload fees(the block proposer) ....... +ꜩ0.000671 + Smart contract rollup origination: + Kind: arith + Parameter type: string + Boot sector Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' + This smart contract rollup origination was successfully applied + Consumed gas: 3110.449 + Storage size: 6655 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1.66375 + storage fees ........................... +ꜩ1.66375 + + +./tezos-client --wait none send sc rollup message 'text:["37 [CONTRACT_HASH]"]' from bootstrap2 to '[SC_ROLLUP_HASH]' +Node is bootstrapped. +Estimated gas: 1877.377 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00051 + Expected counter: 1 + Gas limit: 1978 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00051 + payload fees(the block proposer) ....... +ꜩ0.00051 + Smart contract rollup messages submission: + Address: [SC_ROLLUP_HASH] + This smart contract rollup messages submission was successfully applied + Consumed gas: 1877.377 + Resulting inbox state: { rollup = [SC_ROLLUP_HASH] + level = 4 + current messages hash = [SC_ROLLUP_INBOX_HASH] + nb_messages_in_commitment_period = 1 + starting_level_of_current_commitment_period = 4 + message_counter = 1 + old_levels_messages = hash : [SC_ROLLUP_INBOX_HASH] + + content = [SC_ROLLUP_INBOX_HASH] + index = 1 + back_pointers = [SC_ROLLUP_INBOX_HASH] + + } + diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_5).out new file mode 100644 index 0000000000000000000000000000000000000000..276b7ecf55ed642a926f25f6656f970069915f95 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_5).out @@ -0,0 +1,73 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind arith of type string booting with --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3110.449 units (will add 100 for safety) +Estimated storage: 6655 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000671 + Expected counter: 1 + Gas limit: 3211 + Storage limit: 6675 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000671 + payload fees(the block proposer) ....... +ꜩ0.000671 + Smart contract rollup origination: + Kind: arith + Parameter type: string + Boot sector Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' + This smart contract rollup origination was successfully applied + Consumed gas: 3110.449 + Storage size: 6655 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1.66375 + storage fees ........................... +ꜩ1.66375 + + +./tezos-client --wait none send sc rollup message 'text:["37 [CONTRACT_HASH]"]' from bootstrap2 to '[SC_ROLLUP_HASH]' +Node is bootstrapped. +Estimated gas: 1877.377 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.00051 + Expected counter: 1 + Gas limit: 1978 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.00051 + payload fees(the block proposer) ....... +ꜩ0.00051 + Smart contract rollup messages submission: + Address: [SC_ROLLUP_HASH] + This smart contract rollup messages submission was successfully applied + Consumed gas: 1877.377 + Resulting inbox state: { rollup = [SC_ROLLUP_HASH] + level = 4 + current messages hash = [SC_ROLLUP_INBOX_HASH] + nb_messages_in_commitment_period = 1 + starting_level_of_current_commitment_period = 4 + message_counter = 1 + old_levels_messages = hash : [SC_ROLLUP_INBOX_HASH] + + content = [SC_ROLLUP_INBOX_HASH] + index = 1 + back_pointers = [SC_ROLLUP_INBOX_HASH] + + } + diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_0).out new file mode 100644 index 0000000000000000000000000000000000000000..aa61e69130ca1728deb6d93f6b04895fa1110556 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_0).out @@ -0,0 +1,73 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind arith of type string booting with --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3110.449 units (will add 100 for safety) +Estimated storage: 6655 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000671 + Expected counter: 1 + Gas limit: 3211 + Storage limit: 6675 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000671 + payload fees(the block proposer) ....... +ꜩ0.000671 + Smart contract rollup origination: + Kind: arith + Parameter type: string + Boot sector Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' + This smart contract rollup origination was successfully applied + Consumed gas: 3110.449 + Storage size: 6655 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1.66375 + storage fees ........................... +ꜩ1.66375 + + +./tezos-client --wait none send sc rollup message 'text:["37 [CONTRACT_HASH]%aux"]' from bootstrap2 to '[SC_ROLLUP_HASH]' +Node is bootstrapped. +Estimated gas: 1877.445 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000514 + Expected counter: 1 + Gas limit: 1978 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000514 + payload fees(the block proposer) ....... +ꜩ0.000514 + Smart contract rollup messages submission: + Address: [SC_ROLLUP_HASH] + This smart contract rollup messages submission was successfully applied + Consumed gas: 1877.445 + Resulting inbox state: { rollup = [SC_ROLLUP_HASH] + level = 4 + current messages hash = [SC_ROLLUP_INBOX_HASH] + nb_messages_in_commitment_period = 1 + starting_level_of_current_commitment_period = 4 + message_counter = 1 + old_levels_messages = hash : [SC_ROLLUP_INBOX_HASH] + + content = [SC_ROLLUP_INBOX_HASH] + index = 1 + back_pointers = [SC_ROLLUP_INBOX_HASH] + + } + diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_5).out new file mode 100644 index 0000000000000000000000000000000000000000..aa61e69130ca1728deb6d93f6b04895fa1110556 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_5).out @@ -0,0 +1,73 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind arith of type string booting with --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3110.449 units (will add 100 for safety) +Estimated storage: 6655 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000671 + Expected counter: 1 + Gas limit: 3211 + Storage limit: 6675 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000671 + payload fees(the block proposer) ....... +ꜩ0.000671 + Smart contract rollup origination: + Kind: arith + Parameter type: string + Boot sector Blake2B hash: '0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8' + This smart contract rollup origination was successfully applied + Consumed gas: 3110.449 + Storage size: 6655 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1.66375 + storage fees ........................... +ꜩ1.66375 + + +./tezos-client --wait none send sc rollup message 'text:["37 [CONTRACT_HASH]%aux"]' from bootstrap2 to '[SC_ROLLUP_HASH]' +Node is bootstrapped. +Estimated gas: 1877.445 units (will add 100 for safety) +Estimated storage: no bytes added +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000514 + Expected counter: 1 + Gas limit: 1978 + Storage limit: 0 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000514 + payload fees(the block proposer) ....... +ꜩ0.000514 + Smart contract rollup messages submission: + Address: [SC_ROLLUP_HASH] + This smart contract rollup messages submission was successfully applied + Consumed gas: 1877.445 + Resulting inbox state: { rollup = [SC_ROLLUP_HASH] + level = 4 + current messages hash = [SC_ROLLUP_INBOX_HASH] + nb_messages_in_commitment_period = 1 + starting_level_of_current_commitment_period = 4 + message_counter = 1 + old_levels_messages = hash : [SC_ROLLUP_INBOX_HASH] + + content = [SC_ROLLUP_INBOX_HASH] + index = 1 + back_pointers = [SC_ROLLUP_INBOX_HASH] + + } + diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (batcher_does_not_p.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (batcher_does_not_p.out index bab0708aeb9341e9d4550515c442ab512cadaca9..8399310fa01344126ccff5cff7445b555717fab7 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (batcher_does_not_p.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (batcher_does_not_p.out @@ -2622,7 +2622,7 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 35 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (commitment_is_stor.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (commitment_is_stor.out index 37e9350e0e5a500dfd34163e7d88dea33c5c71f2..2b75de97a9bdb91f2885a0de440cd19215022bf6 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (commitment_is_stor.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (commitment_is_stor.out @@ -1307,7 +1307,7 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]" } ./tezos-sc-rollup-client-alpha rpc get /local/last_published_commitment @@ -1316,6 +1316,6 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 35 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (maintenance_publis.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (maintenance_publis.out index c8f60a0627aad40c3f90700a062b1ec3605d8d72..46aed3af8888f428f7c047e0ff79285454e7619e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (maintenance_publis.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (maintenance_publis.out @@ -2622,7 +2622,7 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 35 } @@ -2632,6 +2632,6 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 35 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (node_use_proto_par.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (node_use_proto_par.out index 831a202ba3f15d341804e2deeb0024f0302e5b13..52dacd0135f1c1ae63ce80230e7d11b52d3e9d0c 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (node_use_proto_par.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (node_use_proto_par.out @@ -662,7 +662,7 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 17, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "361" }, + "number_of_ticks": "1321" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]" } ./tezos-sc-rollup-client-alpha rpc get /local/last_published_commitment @@ -671,6 +671,6 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 17, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "361" }, + "number_of_ticks": "1321" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 20 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (observer_does_not_.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (observer_does_not_.out index bab0708aeb9341e9d4550515c442ab512cadaca9..8399310fa01344126ccff5cff7445b555717fab7 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (observer_does_not_.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (observer_does_not_.out @@ -2622,7 +2622,7 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 35 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (operator_publishes.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (operator_publishes.out index c8f60a0627aad40c3f90700a062b1ec3605d8d72..46aed3af8888f428f7c047e0ff79285454e7619e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (operator_publishes.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (operator_publishes.out @@ -2622,7 +2622,7 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 35 } @@ -2632,6 +2632,6 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]", "published_at_level": 35 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (robust_to_failures.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (robust_to_failures.out index 2f7b05a2dd78820818cd02577a80681be7371f1d..4693419900c73b8ea5e1e17d4781511d5c6a3b7e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (robust_to_failures.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (robust_to_failures.out @@ -1307,7 +1307,7 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]" } ./tezos-sc-rollup-client-alpha rpc get /global/last_stored_commitment @@ -1316,5 +1316,5 @@ This sequence of operations was run: "[SC_ROLLUP_PVM_STATE_HASH]", "inbox_level": 32, "predecessor": "[SC_ROLLUP_COMMITMENT_HASH]", - "number_of_ticks": "1396" }, + "number_of_ticks": "5116" }, "hash": "[SC_ROLLUP_COMMITMENT_HASH]" } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_0).out new file mode 100644 index 0000000000000000000000000000000000000000..b3b89b56276631a7057eb2685b5d715a6197ae17 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_0).out @@ -0,0 +1,34 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind wasm_2_0_0 of type string booting with 010fa03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303000d5024ff4c33df62141bd485af4154641aa9220c5dede9aed006eb5d3c88bff3b --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3126.593 units (will add 100 for safety) +Estimated storage: 10691 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.004714 + Expected counter: 1 + Gas limit: 3227 + Storage limit: 10711 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.004714 + payload fees(the block proposer) ....... +ꜩ0.004714 + Smart contract rollup origination: + Kind: wasm_2_0_0 + Parameter type: string + Boot sector Blake2B hash: '789431137a40057a39867cbc5cd7f984139360559c655c0508821b9be8047a02' + This smart contract rollup origination was successfully applied + Consumed gas: 3126.593 + Storage size: 10691 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ2.67275 + storage fees ........................... +ꜩ2.67275 + diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_5).out new file mode 100644 index 0000000000000000000000000000000000000000..b3b89b56276631a7057eb2685b5d715a6197ae17 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_5).out @@ -0,0 +1,34 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind wasm_2_0_0 of type string booting with 010fa03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303000d5024ff4c33df62141bd485af4154641aa9220c5dede9aed006eb5d3c88bff3b --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3126.593 units (will add 100 for safety) +Estimated storage: 10691 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.004714 + Expected counter: 1 + Gas limit: 3227 + Storage limit: 10711 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.004714 + payload fees(the block proposer) ....... +ꜩ0.004714 + Smart contract rollup origination: + Kind: wasm_2_0_0 + Parameter type: string + Boot sector Blake2B hash: '789431137a40057a39867cbc5cd7f984139360559c655c0508821b9be8047a02' + This smart contract rollup origination was successfully applied + Consumed gas: 3126.593 + Storage size: 10691 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ2.67275 + storage fees ........................... +ꜩ2.67275 + diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_0).out new file mode 100644 index 0000000000000000000000000000000000000000..b3b89b56276631a7057eb2685b5d715a6197ae17 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_0).out @@ -0,0 +1,34 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind wasm_2_0_0 of type string booting with 010fa03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303000d5024ff4c33df62141bd485af4154641aa9220c5dede9aed006eb5d3c88bff3b --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3126.593 units (will add 100 for safety) +Estimated storage: 10691 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.004714 + Expected counter: 1 + Gas limit: 3227 + Storage limit: 10711 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.004714 + payload fees(the block proposer) ....... +ꜩ0.004714 + Smart contract rollup origination: + Kind: wasm_2_0_0 + Parameter type: string + Boot sector Blake2B hash: '789431137a40057a39867cbc5cd7f984139360559c655c0508821b9be8047a02' + This smart contract rollup origination was successfully applied + Consumed gas: 3126.593 + Storage size: 10691 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ2.67275 + storage fees ........................... +ꜩ2.67275 + diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_5).out new file mode 100644 index 0000000000000000000000000000000000000000..b3b89b56276631a7057eb2685b5d715a6197ae17 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_5).out @@ -0,0 +1,34 @@ + +./tezos-client --wait none originate sc rollup from bootstrap1 of kind wasm_2_0_0 of type string booting with 010fa03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303000d5024ff4c33df62141bd485af4154641aa9220c5dede9aed006eb5d3c88bff3b --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 3126.593 units (will add 100 for safety) +Estimated storage: 10691 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.004714 + Expected counter: 1 + Gas limit: 3227 + Storage limit: 10711 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.004714 + payload fees(the block proposer) ....... +ꜩ0.004714 + Smart contract rollup origination: + Kind: wasm_2_0_0 + Parameter type: string + Boot sector Blake2B hash: '789431137a40057a39867cbc5cd7f984139360559c655c0508821b9be8047a02' + This smart contract rollup origination was successfully applied + Consumed gas: 3126.593 + Storage size: 10691 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ2.67275 + storage fees ........................... +ꜩ2.67275 + diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index a74ab376d7104e451842ea0db9955d3d83c79347..1650dd46f8cdee1afeaaba68ef1142dbfd5166a3 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -2975,6 +2975,160 @@ let test_refutation_reward_and_punishment protocols = unit) protocols +(* Testing the execution of outbox messages + ---------------------------------------- + + When the PVM interprets an input message that produces an output + message, the outbox in the PVM state is populated with this output + message. When the state is cemented (after the refutation period + has passed without refutation), one can trigger the execution of + the outbox message, that is a call to a given L1 contract. + + This test first populates an L1 contract that waits for an integer + and stores this integer in its state. Then, the test executes a + rollup operation that produces a call to this contract. Finally, + the test triggers this call and we check that the L1 contract has + been correctly executed by observing its local storage. + + The input depends on the PVM. +*) +let test_outbox_message_generic ?expected_error skip earliness entrypoint + input_message expected_storage kind = + let commitment_period = 2 and challenge_window = 5 in + let variant = + (if entrypoint = "" then "" else entrypoint) ^ "_" ^ string_of_int earliness + in + test_scenario + ~kind + ~commitment_period + ~challenge_window + { + tags = ["outbox"]; + variant; + description = "an outbox message should be executable"; + } + @@ fun _protocol sc_rollup_node sc_rollup _node client -> + let* () = Sc_rollup_node.run sc_rollup_node in + let sc_client = Sc_rollup_client.create sc_rollup_node in + let src = Constant.bootstrap1.public_key_hash in + let originate_target_contract () = + let prg = + {| + { + parameter (or (int %default) (int %aux)); + storage (int :s); + + code + { + UNPAIR; + IF_LEFT + { SWAP ; DROP; NIL operation } + { SWAP ; DROP; NIL operation }; + PAIR; + } + } |} + in + let* address = + Client.originate_contract + ~alias:"target" + ~amount:(Tez.of_int 100) + ~burn_cap:(Tez.of_int 100) + ~src + ~prg + ~init:"0" + client + in + let* () = Client.bake_for_and_wait client in + return address + in + let check_contract_execution address expected_storage = + let* storage = Client.contract_storage address client in + return + @@ Check.( + (storage = expected_storage) + string + ~error_msg:"Invalid contract storage: expecting '%R', got '%L'.") + in + let perform_rollup_execution_and_cement address = + let* () = send_text_messages client sc_rollup [input_message address] in + let blocks_to_wait = + 2 + (2 * commitment_period) + challenge_window - earliness + in + repeat blocks_to_wait @@ fun () -> Client.bake_for client + in + let trigger_outbox_message_execution address = + let* outbox = Sc_rollup_client.outbox sc_client in + Log.info "Outbox is %s" outbox ; + let* answer = + let message_index = 0 in + let outbox_level = 4 in + let destination = address in + let parameters = "37" in + let entrypoint = if entrypoint = "" then None else Some entrypoint in + Sc_rollup_client.outbox_proof_single + sc_client + ?expected_error + ~message_index + ~outbox_level + ~destination + ?entrypoint + ~parameters + in + match (answer, expected_error) with + | Some _, Some _ -> assert false + | None, None -> failwith "Unexpected error during proof generation" + | None, Some _ -> return () + | Some {commitment_hash; proof}, None -> + let*! () = + Client.Sc_rollup.execute_outbox_message + ~burn_cap:(Tez.of_int 10) + ~rollup:sc_rollup + ~src + ~commitment_hash + ~proof + client + in + Client.bake_for client + in + if skip then return () + else + let* target_contract_address = originate_target_contract () in + let* () = perform_rollup_execution_and_cement target_contract_address in + let* () = trigger_outbox_message_execution target_contract_address in + match expected_error with + | None -> + let* () = + check_contract_execution target_contract_address expected_storage + in + return () + | Some _ -> return () + +let test_outbox_message ?expected_error ~earliness entrypoint ~kind = + let skip, input_message, expected_storage = + let entrypoint = if entrypoint = "" then entrypoint else "%" ^ entrypoint in + match kind with + | "arith" -> + ( false, + (fun contract_address -> "37 " ^ contract_address ^ entrypoint), + "37\n" ) + | "wasm_2_0_0" -> + (* FIXME: https://gitlab.com/tezos/tezos/-/issues/3790 + For the moment, the WASM PVM has no support for + output. Hence, the storage is unchanged.*) + (true, Fun.const "", "0\n") + | _ -> + (* There is no other PVM in the protocol. *) + assert false + in + test_outbox_message_generic + ?expected_error + skip + earliness + entrypoint + input_message + expected_storage + kind + let register ~kind ~protocols = test_origination ~kind protocols ; test_rollup_node_running ~kind protocols ; @@ -3085,7 +3239,21 @@ let register ~kind ~protocols = ~kind ; test_consecutive_commitments protocols ~kind ; test_refutation protocols ~kind ; - test_late_rollup_node protocols ~kind + test_late_rollup_node protocols ~kind ; + test_outbox_message ~earliness:0 "" protocols ~kind ; + test_outbox_message ~earliness:0 "aux" protocols ~kind ; + test_outbox_message + ~expected_error:(Base.rex ".*Invalid claim about outbox") + ~earliness:5 + "" + protocols + ~kind ; + test_outbox_message + ~expected_error:(Base.rex ".*Invalid claim about outbox") + ~earliness:5 + "aux" + protocols + ~kind let register ~protocols = (* PVM-independent tests. We still need to specify a PVM kind