From 09bdf07a951f9cb186fef2194044dcdb8e40b283 Mon Sep 17 00:00:00 2001 From: bsall Date: Wed, 7 Dec 2022 09:24:07 +0100 Subject: [PATCH 1/3] Scoru: add benchmark for output proof verification --- manifest/main.ml | 1 + opam/tezos-benchmarks-proto-014-PtKathma.opam | 1 + opam/tezos-benchmarks-proto-015-PtLimaPt.opam | 1 + opam/tezos-benchmarks-proto-alpha.opam | 1 + src/lib_webassembly/runtime/output_buffer.ml | 10 + .../lib_benchmarks_proto/dune | 2 + .../lib_benchmarks_proto/dune | 2 + src/proto_alpha/lib_benchmarks_proto/dune | 2 + .../sc_rollup_benchmarks.ml | 454 ++++++++++++++++++ 9 files changed, 474 insertions(+) diff --git a/manifest/main.ml b/manifest/main.ml index d51eb9aa49dd..8d8411201d66 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -5186,6 +5186,7 @@ module Protocol = Protocol |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; octez_error_monad |> open_; parameters |> if_some |> open_; + lazy_containers |> open_; octez_benchmark |> open_; benchmark |> if_some |> open_; benchmark_type_inference |> if_some |> open_; diff --git a/opam/tezos-benchmarks-proto-014-PtKathma.opam b/opam/tezos-benchmarks-proto-014-PtKathma.opam index 791010e06cc7..207eb68fdb4a 100644 --- a/opam/tezos-benchmarks-proto-014-PtKathma.opam +++ b/opam/tezos-benchmarks-proto-014-PtKathma.opam @@ -13,6 +13,7 @@ depends: [ "tezos-base" "tezos-error-monad" "tezos-protocol-014-PtKathma" + "tezos-lazy-containers" "tezos-benchmark" "tezos-benchmark-014-PtKathma" "tezos-benchmark-type-inference-014-PtKathma" diff --git a/opam/tezos-benchmarks-proto-015-PtLimaPt.opam b/opam/tezos-benchmarks-proto-015-PtLimaPt.opam index ab78f2b7082e..de8e5e495d8e 100644 --- a/opam/tezos-benchmarks-proto-015-PtLimaPt.opam +++ b/opam/tezos-benchmarks-proto-015-PtLimaPt.opam @@ -13,6 +13,7 @@ depends: [ "tezos-base" "tezos-error-monad" "tezos-protocol-015-PtLimaPt" + "tezos-lazy-containers" "tezos-benchmark" "tezos-benchmark-015-PtLimaPt" "tezos-benchmark-type-inference-015-PtLimaPt" diff --git a/opam/tezos-benchmarks-proto-alpha.opam b/opam/tezos-benchmarks-proto-alpha.opam index 594995c5f22a..c02e66d5bfe7 100644 --- a/opam/tezos-benchmarks-proto-alpha.opam +++ b/opam/tezos-benchmarks-proto-alpha.opam @@ -13,6 +13,7 @@ depends: [ "tezos-base" "tezos-error-monad" "tezos-protocol-alpha" + "tezos-lazy-containers" "tezos-benchmark" "tezos-benchmark-alpha" "tezos-benchmark-type-inference-alpha" diff --git a/src/lib_webassembly/runtime/output_buffer.ml b/src/lib_webassembly/runtime/output_buffer.ml index 3576d696f26d..40bcff27b485 100644 --- a/src/lib_webassembly/runtime/output_buffer.ml +++ b/src/lib_webassembly/runtime/output_buffer.ml @@ -161,3 +161,13 @@ let get_message buffer {outbox_level; message_index} = let* outbox = get_outbox buffer outbox_level in if not (is_message_available outbox message_index) then raise Invalid_id else Messages.get message_index outbox + +module Internal_for_tests = struct + let make level_map = + { + outboxes = level_map; + validity_period = Int32.min_int; + last_level = Some Int32.max_int; + message_limit = Z.of_int @@ Int.max_int; + } +end diff --git a/src/proto_014_PtKathma/lib_benchmarks_proto/dune b/src/proto_014_PtKathma/lib_benchmarks_proto/dune index cfdaf729a421..7804aa2d0456 100644 --- a/src/proto_014_PtKathma/lib_benchmarks_proto/dune +++ b/src/proto_014_PtKathma/lib_benchmarks_proto/dune @@ -11,6 +11,7 @@ tezos-base tezos-error-monad tezos-protocol-014-PtKathma.parameters + tezos-lazy-containers tezos-benchmark tezos-benchmark-014-PtKathma tezos-benchmark-type-inference-014-PtKathma @@ -32,6 +33,7 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_error_monad -open Tezos_protocol_014_PtKathma_parameters + -open Tezos_lazy_containers -open Tezos_benchmark -open Tezos_benchmark_014_PtKathma -open Tezos_benchmark_type_inference_014_PtKathma diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/dune b/src/proto_015_PtLimaPt/lib_benchmarks_proto/dune index 1c95e860d135..665b87f4d977 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/dune +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/dune @@ -11,6 +11,7 @@ tezos-base tezos-error-monad tezos-protocol-015-PtLimaPt.parameters + tezos-lazy-containers tezos-benchmark tezos-benchmark-015-PtLimaPt tezos-benchmark-type-inference-015-PtLimaPt @@ -32,6 +33,7 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_error_monad -open Tezos_protocol_015_PtLimaPt_parameters + -open Tezos_lazy_containers -open Tezos_benchmark -open Tezos_benchmark_015_PtLimaPt -open Tezos_benchmark_type_inference_015_PtLimaPt diff --git a/src/proto_alpha/lib_benchmarks_proto/dune b/src/proto_alpha/lib_benchmarks_proto/dune index ec271df25f9f..dfcf71e1bf12 100644 --- a/src/proto_alpha/lib_benchmarks_proto/dune +++ b/src/proto_alpha/lib_benchmarks_proto/dune @@ -11,6 +11,7 @@ tezos-base tezos-error-monad tezos-protocol-alpha.parameters + tezos-lazy-containers tezos-benchmark tezos-benchmark-alpha tezos-benchmark-type-inference-alpha @@ -32,6 +33,7 @@ -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_error_monad -open Tezos_protocol_alpha_parameters + -open Tezos_lazy_containers -open Tezos_benchmark -open Tezos_benchmark_alpha -open Tezos_benchmark_type_inference_alpha diff --git a/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml index cbe11b1551b8..7df3c5281247 100644 --- a/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/sc_rollup_benchmarks.ml @@ -26,3 +26,457 @@ let ns = Namespace.make Registration_helpers.ns "sc_rollup" let fv s = Free_variable.of_namespace (ns s) + +(** This benchmark estimates the cost of verifying an output proof for the + Wasm PVM. + The inferred cost model is [c1 + c2*proof_length]. *) +module Sc_rollup_verify_output_proof_benchmark = struct + (* This section contains preliminary definitions for building a pvm state + from scratch. *) + + module Context = Tezos_context_memory.Context_binary + + module Wasm_context = struct + type Tezos_lazy_containers.Lazy_map.tree += Tree of Context.tree + + module Tree = struct + include Context.Tree + + type tree = Context.tree + + type t = Context.t + + type key = string list + + type value = bytes + + let select = function + | Tree t -> t + | _ -> raise Tezos_tree_encoding.Incorrect_tree_type + + let wrap t = Tree t + end + + type tree = Context.tree + + type proof = Context.Proof.tree Context.Proof.t + + let verify_proof p f = + Lwt.map Result.to_option (Context.verify_tree_proof p f) + + let produce_proof context tree step = + let open Lwt_syntax in + let* context = Context.add_tree context [] tree in + let* _hash = Context.commit ~time:Time.Protocol.epoch context in + let index = Context.index context in + match Context.Tree.kinded_key tree with + | Some k -> + let* p = Context.produce_tree_proof index k step in + return (Some p) + | None -> return None + + let kinded_hash_to_state_hash = function + | `Value hash | `Node hash -> + Sc_rollup_repr.State_hash.context_hash_to_state_hash hash + + let proof_before proof = + kinded_hash_to_state_hash proof.Context.Proof.before + + let proof_after proof = kinded_hash_to_state_hash proof.Context.Proof.after + + let proof_encoding = + let module Proof_encoding = + Tezos_context_merkle_proof_encoding.Merkle_proof_encoding + in + Proof_encoding.V2.Tree2.tree_proof_encoding + end + + let make_transaction value text contract = + let entrypoint = Entrypoint_repr.default in + let destination : Contract_hash.t = + Contract_hash.of_bytes_exn @@ Bytes.of_string contract + in + let open Tezos_micheline.Micheline in + let open Michelson_v1_primitives in + let unparsed_parameters = + strip_locations + @@ Prim + ( 0, + I_TICKET, + [ + Prim + (0, I_PAIR, [Int (0, Z.of_int32 value); String (1, text)], []); + ], + [] ) + in + Sc_rollup_outbox_message_repr.{unparsed_parameters; entrypoint; destination} + + let ( -- ) min max : Base_samplers.range = {min; max} + + let make_transactions ~rng_state ~max = + let open Base_samplers in + let n = sample_in_interval ~range:(0 -- max) rng_state in + Stdlib.List.init n (fun _ -> + let contract = uniform_string ~nbytes:20 rng_state in + let value = + Int32.of_int @@ sample_in_interval ~range:(-1000 -- 1000) rng_state + in + let text = string ~size:(0 -- 40) rng_state in + make_transaction value text contract) + + let make_outbox_message ~nb_transactions ~rng_state = + let transactions = make_transactions ~rng_state ~max:nb_transactions in + Sc_rollup_outbox_message_repr.Atomic_transaction_batch {transactions} + + let dummy_context = + let dummy = Context.init "/tmp" in + Context.empty @@ Lwt_main.run dummy + + let empty_tree = Context.Tree.empty dummy_context + + (* Build a pvm state from scratch. *) + let build_pvm_state rng_state ~nb_inbox_messages ~input_payload_size + ~nb_output_buffer_levels ~output_buffer_size ~nb_transactions ~tree_depth + ~tree_branching_factor = + let open Lwt_result_syntax in + let random_key () = + Base_samplers.readable_ascii_string ~size:(5 -- 5) rng_state + in + (* [gen_tree] Generates a tree for the given depth and branching factor. + This function is witten in CPS to avoid [stack-overflow] errors when + branching factor is 1 and tree depth is big. *) + let gen_tree () = + let bottom_tree = + let tree = empty_tree in + let key = [random_key ()] in + let value = Bytes.empty in + Context.Tree.add tree key value + in + let rec gen_tree tree_depth kont = + if tree_depth = 0 then kont bottom_tree + else + gen_tree + (tree_depth - 1) + (let rec kont' nb_subtrees acc_subtrees subtree = + let*! subtree = subtree in + let acc_subtrees = subtree :: acc_subtrees in + let nb_subtrees = nb_subtrees + 1 in + if nb_subtrees = tree_branching_factor then + let tree = empty_tree in + kont + @@ List.fold_left_s + (fun tree subtree -> + let key = [random_key ()] in + Context.Tree.add_tree tree key subtree) + tree + acc_subtrees + else gen_tree (tree_depth - 1) (kont' nb_subtrees acc_subtrees) + in + kont' 0 []) + in + gen_tree tree_depth Fun.id + in + (* Add trees of junk data in the [durable] and [wasm] parts + of the storage. *) + let*! durable_junk_tree = gen_tree () in + let*! wasm_junk_tree = gen_tree () in + let tree = empty_tree in + let*! tree = Context.Tree.add_tree tree ["durable"] durable_junk_tree in + let*! tree = Context.Tree.add_tree tree ["wasm"] wasm_junk_tree in + (* Create an output buffers and fill it with random batches of + transactions. *) + let open Tezos_webassembly_interpreter in + let open Tezos_scoru_wasm in + let module Index_Vector = Lazy_vector.Mutable.ZVector in + let module Level_Map = Lazy_map.Mutable.LwtInt32Map in + let output = + Level_Map.create + ~produce_value:(fun _ -> + Lwt.return @@ Index_Vector.create (Z.of_int output_buffer_size)) + () + in + let*! () = + let open Sc_rollup_outbox_message_repr in + List.iter_s + (fun l -> + let*! outbox = Level_Map.get (Int32.of_int l) output in + Lwt.return + @@ List.iter + (fun i -> + let out = make_outbox_message ~nb_transactions ~rng_state in + let outbox_message = + Data_encoding.Binary.to_bytes_exn encoding out + in + Index_Vector.set (Z.of_int i) outbox_message outbox) + Misc.(0 --> (output_buffer_size - 1))) + Misc.(0 --> (nb_output_buffer_levels - 1)) + in + let output = Output_buffer.Internal_for_tests.make output in + (* Create the input buffer. *) + let input = Index_Vector.create (Z.of_int nb_inbox_messages) in + let make_input_message (message_counter : int) : Input_buffer.message = + let open Base_samplers in + let random_payload () = + uniform_bytes ~nbytes:input_payload_size rng_state + in + { + raw_level = Int32.of_int message_counter; + message_counter = Z.of_int message_counter; + payload = random_payload (); + } + in + let () = + List.iter + (fun counter -> + Index_Vector.set (Z.of_int counter) (make_input_message counter) input) + Misc.(0 --> (nb_inbox_messages - 1)) + in + (* Encode the buffers and update the state of the pvm. *) + let buffers = Eval.{input; output} in + let buffers_encoding = Wasm_pvm.durable_buffers_encoding in + let module Tree_encoding_runner = + Tezos_tree_encoding.Runner.Make (Wasm_context.Tree) in + let*! tree = + Tree_encoding_runner.encode + (Tezos_tree_encoding.option buffers_encoding) + (Some buffers) + tree + in + Lwt.return (dummy_context, output, tree) + + module Full_Wasm = + Sc_rollup_wasm.V2_0_0.Make (Environment.Wasm_2_0_0.Make) (Wasm_context) + + (* Benchmark starts here. *) + + let name = ns "Sc_rollup_verify_output_proof_benchmark" + + let info = "Estimating the cost of verifying an output proof" + + let tags = ["sc_rollup"] + + type config = { + nb_inbox_messages : int; + input_payload_size : int; + nb_output_buffer_levels : int; + output_buffer_size : int; + nb_transactions : int; + tree_depth : int; + tree_branching_factor : int; + } + + let config_encoding = + let open Data_encoding in + conv + (fun { + nb_inbox_messages; + input_payload_size; + nb_output_buffer_levels; + output_buffer_size; + nb_transactions; + tree_depth; + tree_branching_factor; + } -> + ( nb_inbox_messages, + input_payload_size, + nb_output_buffer_levels, + output_buffer_size, + nb_transactions, + tree_depth, + tree_branching_factor )) + (fun ( nb_inbox_messages, + input_payload_size, + nb_output_buffer_levels, + output_buffer_size, + nb_transactions, + tree_depth, + tree_branching_factor ) -> + { + nb_inbox_messages : int; + input_payload_size : int; + nb_output_buffer_levels; + output_buffer_size; + nb_transactions; + tree_depth; + tree_branching_factor; + }) + (obj7 + (req "nb_inbox_messages" int31) + (req "input_payload_size" int31) + (req "nb_output_buffer_levels" int31) + (req "output_buffer_size" int31) + (req "nb_transactions" int31) + (req "tree_depth" int31) + (req "tree_branching_factor" int31)) + + (** The actual config used to generate the more accurate model in + [sc_rollup_costs.ml] is : + [{ + nb_inbox_messages = 1000; + input_payload_size = 4096; + nb_output_buffer_levels = 10_000; + output_buffer_size = 100; + nb_transactions = 50; + tree_depth = 10; + tree_branching_factor = 4; + }] + With the config above, the benchmark takes more than an hour. The default + config is lighter and takes a few minutes. + + The table below shows benchmarking results for different tree depths and + number of outbox levels of the pvm state. The branching factor of the + generated "junk" trees in this benchmark is 4 (i.e for a depth of 10 the + generated tree contains more than 1_000_000 nodes). A tree depth of more + than 10 or a number of outbox levels of more than 10000 reaches the + memory limit of a laptop with 16Gb of memory. All proofs generated by + these benchmarks are below 10kb. + + +-----------+---------------+-------------------------+-----------------+ + | Junk tree | Number of | Inferred model | Gas cost for a | + | depth | outbox levels | | proof 10kb long | + +-----------+---------------+-------------------------+-----------------+ + | 5 | 1000 | 7.907*size + 99291.292 | 178361 | + +-----------+---------------+-------------------------+-----------------+ + | 6 | 2000 | 9.510*size + 99516.012 | 194616 | + +-----------+---------------+-------------------------+-----------------+ + | 7 | 4000 | 11.383*size + 95445.175 | 209275 | + +-----------+---------------+-------------------------+-----------------+ + | 8 | 6000 | 11.316*size + 100760.29 | 213920 | + +-----------+---------------+-------------------------+-----------------+ + | 9 | 8000 | 11.227*size + 98748.490 | 211018 | + +-----------+---------------+-------------------------+-----------------+ + | 10 | 10000 | 11.680*size + 98707.082 | 215507 | + +-----------+---------------+-------------------------+-----------------+ + + The [nb_transactions] parameter is the max number of transactions in an + outbox message, it is set at 50 because a message with 50 transactions + approches the max size of an outbox message. Hence, this allows to + benchmark for various proof lengths. The [nb_inbox_messages] parameter is + set to correspond to the max number of messages in an inbox. And the + [input_payload_size] parameter is set to the biggest possible size of an + input message. These two parameters impact the number of nodes in the pvm + state and are stored in the "input" part of the state. We add data in this + "input" part because of its proximity with the "output" part in the pvm + state. *) + let default_config = + { + nb_inbox_messages = 1000; + input_payload_size = 4096; + nb_output_buffer_levels = 10_000; + output_buffer_size = 100; + nb_transactions = 50; + tree_depth = 10; + tree_branching_factor = 4; + } + + type workload = {proof_length : int} + + let workload_encoding = + let open Data_encoding in + conv + (fun {proof_length} -> proof_length) + (fun proof_length -> {proof_length}) + (obj1 (req "proof_length" int31)) + + let workload_to_vector {proof_length} = + Sparse_vec.String.of_list [("proof_length", float_of_int proof_length)] + + let verify_output_proof_model = + Model.make + ~conv:(fun {proof_length} -> (proof_length, ())) + ~model: + (Model.affine + ~intercept:(Free_variable.of_string "const") + ~coeff:(Free_variable.of_string "proof_length")) + + let models = [("verify_output_proof", verify_output_proof_model)] + + let pvm_state = ref None + + let benchmark rng_state conf () = + let nb_output_buffer_levels = conf.nb_output_buffer_levels in + let output_buffer_size = conf.output_buffer_size in + let prepare_benchmark_scenario () = + let open Lwt_result_syntax in + (* Build [pvm_state] and save it to be used for all benchmarks. The state + is large enough for each benchmark to be relatively random. *) + let*! context, output, initial_tree = + match !pvm_state with + | None -> + let res = + build_pvm_state + rng_state + ~nb_inbox_messages:conf.nb_inbox_messages + ~input_payload_size:conf.input_payload_size + ~nb_output_buffer_levels:conf.nb_output_buffer_levels + ~output_buffer_size:conf.output_buffer_size + ~nb_transactions:conf.nb_transactions + ~tree_depth:conf.tree_depth + ~tree_branching_factor:conf.tree_branching_factor + in + pvm_state := Some res ; + res + | Some pvm_state -> pvm_state + in + let open Base_samplers in + (* Pick a level. *) + let outbox_level = + Int32.of_int + @@ sample_in_interval + ~range:(0 -- (nb_output_buffer_levels - 1)) + rng_state + in + (* Pick a message. *) + let message_index = + Z.of_int + @@ sample_in_interval ~range:(0 -- (output_buffer_size - 1)) rng_state + in + let*! bytes_output_message = + Tezos_webassembly_interpreter.Output_buffer.get_message + output + {outbox_level; message_index} + in + let message = + Data_encoding.Binary.of_bytes_exn + Sc_rollup_outbox_message_repr.encoding + bytes_output_message + in + let*? outbox_level = + Environment.wrap_tzresult @@ Raw_level_repr.of_int32 outbox_level + in + (* Produce an output proof for the picked message, and return the proof + and its length. *) + let output = Sc_rollup_PVM_sig.{outbox_level; message_index; message} in + let*! pf = Full_Wasm.produce_output_proof context initial_tree output in + match pf with + | Ok proof -> + let proof_length = + Data_encoding.Binary.length Full_Wasm.output_proof_encoding proof + in + return (proof, proof_length) + | Error _ -> assert false + in + + let output_proof, proof_length = + match Lwt_main.run @@ prepare_benchmark_scenario () with + | Ok (proof, len) -> (proof, len) + | Error _ -> assert false + in + let workload = {proof_length} in + + let closure () = + ignore (Lwt_main.run @@ Full_Wasm.verify_output_proof output_proof) + in + Generator.Plain {workload; closure} + + let create_benchmarks ~rng_state ~bench_num config = + List.repeat bench_num (benchmark rng_state config) + + let () = + Registration.register_for_codegen + (Namespace.basename name) + (Model.For_codegen verify_output_proof_model) +end + +let () = + Registration_helpers.register (module Sc_rollup_verify_output_proof_benchmark) -- GitLab From f5a2598f06943e595752a0c20c6fe9e89468f4af Mon Sep 17 00:00:00 2001 From: bsall Date: Wed, 7 Dec 2022 09:24:33 +0100 Subject: [PATCH 2/3] Proto: update costs of output proof verification --- .../lib_protocol/sc_rollup_costs.ml | 18 ++++++++++-------- ...trypoint- -aux- earliness- 0- external).out | 12 ++++++------ ...trypoint- -aux- earliness- 0- internal).out | 12 ++++++------ ...point- -default- earliness- 0- external.out | 12 ++++++------ ...point- -default- earliness- 0- internal.out | 12 ++++++------ ...entrypoint- -aux- earliness- 0- externa.out | 12 ++++++------ ...entrypoint- -aux- earliness- 0- interna.out | 12 ++++++------ ...entrypoint- -default- earliness- 0- ext.out | 12 ++++++------ ...entrypoint- -default- earliness- 0- int.out | 12 ++++++------ 9 files changed, 58 insertions(+), 56 deletions(-) diff --git a/src/proto_alpha/lib_protocol/sc_rollup_costs.ml b/src/proto_alpha/lib_protocol/sc_rollup_costs.ml index e847a14c0f3e..ec9d017cdd52 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_costs.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_costs.ml @@ -72,10 +72,6 @@ module Constants = struct (* Cost of serializing a nonce. The cost of serializing the index (an int32) is negligible. *) let cost_serialize_nonce = cost_serialize_operation_hash - - (* Set to [proof_size_coeff] in {!Tx_rollup_l2_verifier.verify_proof_model}. - This is an estimate to be updated when benchmarking is completed. *) - let cost_verify_output_proof_per_byte = S.safe_int 152 end (* Reusing model from {!Ticket_costs.has_tickets_of_ty_cost}. *) @@ -133,10 +129,6 @@ let cost_check_dissection ~number_of_states ~tick_size ~hash_size = cost_search_in_tick_list number_of_states tick_size + (S.safe_int 2 * cost_compare hash_size hash_size) -let cost_verify_output_proof ~bytes_len = - let open S.Syntax in - Constants.cost_verify_output_proof_per_byte * S.safe_int bytes_len - let cost_add_message ~current_index ~msg_len = let open S.Syntax in let hash_cell_cost = @@ -148,3 +140,13 @@ let cost_add_message ~current_index ~msg_len = Skip_list_costs.model_next ~length:(Z.succ current_index) in hash_cell_cost + hash_content_cost + next_cell_cost + +(* Derived from benchmark in + [Sc_rollup_benchmarks.Sc_rollup_verify_output_proof_benchmark] and model + [model_Sc_rollup_verify_output_proof_benchmark] with estimated parameters: + [fun size -> (98707.0824163 + (11.6809615751 * size))] *) +let cost_verify_output_proof ~bytes_len = + let open S.Syntax in + let size = S.safe_int bytes_len in + let v0 = size in + S.safe_int 98750 + ((v0 lsl 3) + (v0 lsl 1) + v0 + (v0 lsr 1)) diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out index b258047dfeb8..f43297d84d81 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out @@ -60,7 +60,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x03000232728bd7982ad47ab6f59971181ebb3f3f57762cba56ab8ba0a53b5df3c256f832728bd7982ad47ab6f59971181ebb3f3f57762cba56ab8ba0a53b5df3c256f800100007d0030170000382066f7574707574810130c805639510aee988ab3152135cb7851c3eb7d8e19f3b0b5d61a761107951ded1dd0c7061727365725f7374617465c8407f958990678e2e9fb06758bc6520dae46d838d39948a4c51a5b19bd079293dc0fa513fc9657217226bee9cf2242f01b8939ef07b7363a2c7ba435a57c2cbed83c0c94a7d88406cd132dab72d630166c726359f3367a007a915db26b0052147caebc0341f98e2e09c8e648e2ad9572b9a0a6c2fadeb87e5334650a4e0bb0abefd5f4932728bd7982ad47ab6f59971181ebb3f3f57762cba56ab8ba0a53b5df3c256f80000000500000000001f002501c00c5e4e94a48a49e267873112bbe3cf3373be5b0000000003617578 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5879.286 units (will add 100 for safety) +Estimated gas: 5930.406 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -71,19 +71,19 @@ 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.001217 + Fee to the baker: ꜩ0.001223 Expected counter: 2 - Gas limit: 5980 + Gas limit: 6031 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001217 - payload fees(the block proposer) ....... +ꜩ0.001217 + [PUBLIC_KEY_HASH] ... -ꜩ0.001223 + payload fees(the block proposer) ....... +ꜩ0.001223 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4676.147 + Consumed gas: 4727.267 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out index a58cc28203fc..1e812283695b 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out @@ -35,7 +35,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x03000269d5857d4eadb7a943345e791980b53c41ed50abb73cfe83575cef06a776592169d5857d4eadb7a943345e791980b53c41ed50abb73cfe83575cef06a776592100100007d0030170000382066f7574707574810130c805639510aee988ab3152135cb7851c3eb7d8e19f3b0b5d61a761107951ded1dd0c7061727365725f7374617465c8407f958990678e2e9fb06758bc6520dae46d838d39948a4c51a5b19bd079293dc0fa513fc9657217226bee9cf2242f01b8939ef07b7363a2c7ba435a57c2cbed83c0c94a7d88406cd132dab72d630166c726359f3367a007a915db26b0052147caebc06cebd770767d6e9e746e42e5b2c772092c7874983cd57a5a7d57128ad2a26eb769d5857d4eadb7a943345e791980b53c41ed50abb73cfe83575cef06a77659210000000500000000001f002501c00c5e4e94a48a49e267873112bbe3cf3373be5b0000000003617578 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5879.286 units (will add 100 for safety) +Estimated gas: 5930.406 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -46,19 +46,19 @@ 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.001217 + Fee to the baker: ꜩ0.001223 Expected counter: 1 - Gas limit: 5980 + Gas limit: 6031 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001217 - payload fees(the block proposer) ....... +ꜩ0.001217 + [PUBLIC_KEY_HASH] ... -ꜩ0.001223 + payload fees(the block proposer) ....... +ꜩ0.001223 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4676.147 + Consumed gas: 4727.267 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out index b865dfcd29a7..11309edb2d2e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out @@ -60,7 +60,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x030002ca9deff6c5c766d66c96a4339387d614811dea25656a82d7b629a676d0556df5ca9deff6c5c766d66c96a4339387d614811dea25656a82d7b629a676d0556df500100007d0030170000382066f7574707574810130c8b3be8e119db56ecbdb098e21636b1e0d6f7429a633db34b47445364df8c39c0c0c7061727365725f7374617465c8407f958990678e2e9fb06758bc6520dae46d838d39948a4c51a5b19bd079293dc0fa513fc9657217226bee9cf2242f01b8939ef07b7363a2c7ba435a57c2cbed83c00aeb3d498091257b568445fa9c2f756712d8bd07de2a02ffaf7eefe81c3556b7c097354cf34106c0e824fd1b44d759ce74dc917914c3ab5b23d62120d4ff1dabd3ca9deff6c5c766d66c96a4339387d614811dea25656a82d7b629a676d0556df500000005000000000023002501c00c5e4e94a48a49e267873112bbe3cf3373be5b000000000764656661756c74 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5879.904 units (will add 100 for safety) +Estimated gas: 5930.462 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -71,19 +71,19 @@ 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.001221 + Fee to the baker: ꜩ0.001227 Expected counter: 2 - Gas limit: 5980 + Gas limit: 6031 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001221 - payload fees(the block proposer) ....... +ꜩ0.001221 + [PUBLIC_KEY_HASH] ... -ꜩ0.001227 + payload fees(the block proposer) ....... +ꜩ0.001227 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4676.800 + Consumed gas: 4727.358 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out index 59ef6124da39..a2e0bfb8c017 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out @@ -35,7 +35,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x030002d256bd273853fde1fda3ed0ecdae276546f8d4b9ee522725e849da96332b0338d256bd273853fde1fda3ed0ecdae276546f8d4b9ee522725e849da96332b033800100007d0030170000382066f7574707574810130c8b3be8e119db56ecbdb098e21636b1e0d6f7429a633db34b47445364df8c39c0c0c7061727365725f7374617465c8407f958990678e2e9fb06758bc6520dae46d838d39948a4c51a5b19bd079293dc0fa513fc9657217226bee9cf2242f01b8939ef07b7363a2c7ba435a57c2cbed83c00aeb3d498091257b568445fa9c2f756712d8bd07de2a02ffaf7eefe81c3556b7c093cf7b0656a49a394fee9856478046aff511d04dd9d8cfcfa32a2182074c29c3d256bd273853fde1fda3ed0ecdae276546f8d4b9ee522725e849da96332b033800000005000000000023002501c00c5e4e94a48a49e267873112bbe3cf3373be5b000000000764656661756c74 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5879.904 units (will add 100 for safety) +Estimated gas: 5930.462 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -46,19 +46,19 @@ 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.001221 + Fee to the baker: ꜩ0.001227 Expected counter: 1 - Gas limit: 5980 + Gas limit: 6031 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001221 - payload fees(the block proposer) ....... +ꜩ0.001221 + [PUBLIC_KEY_HASH] ... -ꜩ0.001227 + payload fees(the block proposer) ....... +ꜩ0.001227 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4676.800 + Consumed gas: 4727.358 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out index bea7fa6fcbb6..e7e048a08d6d 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out @@ -60,7 +60,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x030002aed9197285014e13f545e6fb83b2cd3490202fc87744566becf1bd433546374caed9197285014e13f545e6fb83b2cd3490202fc87744566becf1bd433546374c0005820764757261626c65d07eb5216be3fcfd8317136e559c80d1a5eeb8f7b684c2101e92efb2b1b9c5324603746167c00800000004536f6d650003c09998e976abfc21a341c09b7a0d7f7bf2874b4185b5b68f82f861a0b8ffb3ff6a820576616c7565810370766d8107627566666572738205696e707574820468656164c00100066c656e677468c00100066f75747075740004820132810a6c6173745f6c6576656cc004000000080133810f76616c69646974795f706572696f64c00400009d8082013181086f7574626f78657300060004c0135db12c9dff68c37e3ca222ff3610666772481b317188e348aff2b0f96247740003c046249f852b8b3004ec9a6b9e479c88d4b0ead13b4dbc4f54f6483aa5b4a622708201350003810468656164c001008208636f6e74656e7473810130c02800000024000000001f002501c00c5e4e94a48a49e267873112bbe3cf3373be5b0000000003617578066c656e677468c001010136820468656164c00100066c656e677468c00100c0c9e4c229dd7bef220d2450007566e287ff2d159abe2d41f35a62cf6020bfce320134810d6d6573736167655f6c696d6974c002a401047761736dd0fe03ae018cf40eea79437f939ebfc1536e92d117f97c036943fe5a37a2a038b9aed9197285014e13f545e6fb83b2cd3490202fc87744566becf1bd433546374c0000000500000000001f002501c00c5e4e94a48a49e267873112bbe3cf3373be5b0000000003617578 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5926.242 units (will add 100 for safety) +Estimated gas: 5939.006 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -71,19 +71,19 @@ 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.001495 + Fee to the baker: ꜩ0.001496 Expected counter: 2 - Gas limit: 6027 + Gas limit: 6040 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001495 - payload fees(the block proposer) ....... +ꜩ0.001495 + [PUBLIC_KEY_HASH] ... -ꜩ0.001496 + payload fees(the block proposer) ....... +ꜩ0.001496 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4723.103 + Consumed gas: 4735.867 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out index e72a8aa9eeb4..a2306c561aaa 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out @@ -35,7 +35,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x03000218e2f064b01c59ff40b40450d8cc5dd53fc083cab1b77eea031361354d58dbd718e2f064b01c59ff40b40450d8cc5dd53fc083cab1b77eea031361354d58dbd70005820764757261626c65d07eb5216be3fcfd8317136e559c80d1a5eeb8f7b684c2101e92efb2b1b9c5324603746167c00800000004536f6d650003c08438b3f8243870868b2649ea870eca2ae2a9cbc0d27b934508c8dfe7e9f2b6f3820576616c7565810370766d8107627566666572738205696e707574820468656164c00100066c656e677468c00100066f75747075740004820132810a6c6173745f6c6576656cc004000000060133810f76616c69646974795f706572696f64c00400009d8082013181086f7574626f78657300040003e00003c046249f852b8b3004ec9a6b9e479c88d4b0ead13b4dbc4f54f6483aa5b4a622708201350003810468656164c001008208636f6e74656e7473810130c02800000024000000001f002501c00c5e4e94a48a49e267873112bbe3cf3373be5b0000000003617578066c656e677468c001010136820468656164c00100066c656e677468c00100c0ce13fd6c245acffc4c3c2ac8f373b58d30b0f11d1f1b11e8ef99563beb593eec0134810d6d6573736167655f6c696d6974c002a401047761736dd053d416b7282d6e92d846683e6b738a5dc1f374d3857e9d9cf8125b268f60bb0518e2f064b01c59ff40b40450d8cc5dd53fc083cab1b77eea031361354d58dbd70000000500000000001f002501c00c5e4e94a48a49e267873112bbe3cf3373be5b0000000003617578 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5920.738 units (will add 100 for safety) +Estimated gas: 5937.998 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -46,19 +46,19 @@ 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.001463 + Fee to the baker: ꜩ0.001464 Expected counter: 1 - Gas limit: 6021 + Gas limit: 6038 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001463 - payload fees(the block proposer) ....... +ꜩ0.001463 + [PUBLIC_KEY_HASH] ... -ꜩ0.001464 + payload fees(the block proposer) ....... +ꜩ0.001464 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4717.599 + Consumed gas: 4734.859 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out index 21cca7fe6fc8..c50fbabb7d5e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out @@ -60,7 +60,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x0300022e01ded8b469e787295b0058c2c776f81b12d997be05ebbdcb7c8f2a78b931a42e01ded8b469e787295b0058c2c776f81b12d997be05ebbdcb7c8f2a78b931a40005820764757261626c65d07eb5216be3fcfd8317136e559c80d1a5eeb8f7b684c2101e92efb2b1b9c5324603746167c00800000004536f6d650003c09998e976abfc21a341c09b7a0d7f7bf2874b4185b5b68f82f861a0b8ffb3ff6a820576616c7565810370766d8107627566666572738205696e707574820468656164c00100066c656e677468c00100066f75747075740004820132810a6c6173745f6c6576656cc004000000080133810f76616c69646974795f706572696f64c00400009d8082013181086f7574626f78657300060004c0135db12c9dff68c37e3ca222ff3610666772481b317188e348aff2b0f96247740003c046249f852b8b3004ec9a6b9e479c88d4b0ead13b4dbc4f54f6483aa5b4a622708201350003810468656164c001008208636f6e74656e7473810130c02c000000280000000023002501c00c5e4e94a48a49e267873112bbe3cf3373be5b000000000764656661756c74066c656e677468c001010136820468656164c00100066c656e677468c00100c0c9e4c229dd7bef220d2450007566e287ff2d159abe2d41f35a62cf6020bfce320134810d6d6573736167655f6c696d6974c002a401047761736dd0fe03ae018cf40eea79437f939ebfc1536e92d117f97c036943fe5a37a2a038b92e01ded8b469e787295b0058c2c776f81b12d997be05ebbdcb7c8f2a78b931a400000005000000000023002501c00c5e4e94a48a49e267873112bbe3cf3373be5b000000000764656661756c74 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5927.548 units (will add 100 for safety) +Estimated gas: 5939.188 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -71,19 +71,19 @@ 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.001503 + Fee to the baker: ꜩ0.001504 Expected counter: 2 - Gas limit: 6028 + Gas limit: 6040 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001503 - payload fees(the block proposer) ....... +ꜩ0.001503 + [PUBLIC_KEY_HASH] ... -ꜩ0.001504 + payload fees(the block proposer) ....... +ꜩ0.001504 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4724.444 + Consumed gas: 4736.084 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out index 82c885afa830..3a07034a5c56 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out @@ -35,7 +35,7 @@ This sequence of operations was run: ./octez-client --wait none execute outbox message of sc rollup '[SMART_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' for commitment hash '[SC_ROLLUP_COMMITMENT_HASH]' and output proof 0x03000220b53f5f46bab46423a44008055cca2d5481ae52792e9e05c2ebb6d2dbb7c1fe20b53f5f46bab46423a44008055cca2d5481ae52792e9e05c2ebb6d2dbb7c1fe0005820764757261626c65d07eb5216be3fcfd8317136e559c80d1a5eeb8f7b684c2101e92efb2b1b9c5324603746167c00800000004536f6d650003c08438b3f8243870868b2649ea870eca2ae2a9cbc0d27b934508c8dfe7e9f2b6f3820576616c7565810370766d8107627566666572738205696e707574820468656164c00100066c656e677468c00100066f75747075740004820132810a6c6173745f6c6576656cc004000000060133810f76616c69646974795f706572696f64c00400009d8082013181086f7574626f78657300040003e00003c046249f852b8b3004ec9a6b9e479c88d4b0ead13b4dbc4f54f6483aa5b4a622708201350003810468656164c001008208636f6e74656e7473810130c02c000000280000000023002501c00c5e4e94a48a49e267873112bbe3cf3373be5b000000000764656661756c74066c656e677468c001010136820468656164c00100066c656e677468c00100c0ce13fd6c245acffc4c3c2ac8f373b58d30b0f11d1f1b11e8ef99563beb593eec0134810d6d6573736167655f6c696d6974c002a401047761736dd053d416b7282d6e92d846683e6b738a5dc1f374d3857e9d9cf8125b268f60bb0520b53f5f46bab46423a44008055cca2d5481ae52792e9e05c2ebb6d2dbb7c1fe00000005000000000023002501c00c5e4e94a48a49e267873112bbe3cf3373be5b000000000764656661756c74 --burn-cap 10 Node is bootstrapped. -Estimated gas: 5922.044 units (will add 100 for safety) +Estimated gas: 5938.180 units (will add 100 for safety) Estimated storage: 5 bytes added (will add 20 for safety) Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -46,19 +46,19 @@ 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.001471 + Fee to the baker: ꜩ0.001472 Expected counter: 1 - Gas limit: 6023 + Gas limit: 6039 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001471 - payload fees(the block proposer) ....... +ꜩ0.001471 + [PUBLIC_KEY_HASH] ... -ꜩ0.001472 + payload fees(the block proposer) ....... +ꜩ0.001472 Smart contract output message execution: Address: [SMART_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract output message execution was successfully applied Paid storage size diff: 5 bytes - Consumed gas: 4718.940 + Consumed gas: 4735.076 Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.00125 storage fees ........................... +ꜩ0.00125 -- GitLab From 4c27146f92d59d68ee838b49ce84f869cbe8ab94 Mon Sep 17 00:00:00 2001 From: bsall Date: Tue, 6 Dec 2022 11:56:01 +0100 Subject: [PATCH 3/3] Proto: register in tezt benchmarks --- tezt/lib_tezos/snoop.ml | 2 ++ tezt/lib_tezos/snoop.mli | 1 + tezt/snoop/perform_benchmarks.ml | 9 ++++++++- tezt/snoop/perform_inference.ml | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tezt/lib_tezos/snoop.ml b/tezt/lib_tezos/snoop.ml index f2e66105ae26..f5a1026bf4ef 100644 --- a/tezt/lib_tezos/snoop.ml +++ b/tezt/lib_tezos/snoop.ml @@ -46,6 +46,7 @@ type tag = | Tickets | Big_map | Skip_list + | Sc_rollup type michelson_term_kind = Data | Code @@ -354,6 +355,7 @@ let string_of_tag (tag : tag) = | Tickets -> "tickets" | Big_map -> "big_map" | Skip_list -> "skip_list" + | Sc_rollup -> "sc_rollup" let list_benchmarks_command mode tags = let tags = List.map string_of_tag tags in diff --git a/tezt/lib_tezos/snoop.mli b/tezt/lib_tezos/snoop.mli index fd4d71fa0bff..4bc758e45d71 100644 --- a/tezt/lib_tezos/snoop.mli +++ b/tezt/lib_tezos/snoop.mli @@ -139,6 +139,7 @@ type tag = | Tickets | Big_map | Skip_list + | Sc_rollup type list_mode = All | Any | Exactly diff --git a/tezt/snoop/perform_benchmarks.ml b/tezt/snoop/perform_benchmarks.ml index dffefd1918ba..8e2a5245f4c6 100644 --- a/tezt/snoop/perform_benchmarks.ml +++ b/tezt/snoop/perform_benchmarks.ml @@ -297,6 +297,12 @@ let perform_skip_list_benchmarks snoop proto = in perform_benchmarks [] snoop benches +let perform_sc_rollup_benchmarks snoop proto = + let* benches = + Snoop.(list_benchmarks ~mode:All ~tags:[Sc_rollup; Proto proto] snoop) + in + perform_benchmarks [] snoop benches + let main protocol = Log.info "Entering Perform_inference.main" ; let snoop = Snoop.create () in @@ -310,4 +316,5 @@ let main protocol = let* () = perform_tx_rollup_benchmarks snoop protocol in let* () = perform_big_map_benchmarks snoop protocol in let* () = perform_skip_list_benchmarks snoop protocol in - perform_carbonated_map_benchmarks snoop protocol + let* () = perform_carbonated_map_benchmarks snoop protocol in + perform_sc_rollup_benchmarks snoop protocol diff --git a/tezt/snoop/perform_inference.ml b/tezt/snoop/perform_inference.ml index 79ef0cb0dd9e..79fa51afed30 100644 --- a/tezt/snoop/perform_inference.ml +++ b/tezt/snoop/perform_inference.ml @@ -70,6 +70,7 @@ let main () = "list_key_values"; "skip_list_next"; "skip_list_hash"; + "verify_output_proof"; ] in Lwt_list.iter_s -- GitLab