diff --git a/src/proto_alpha/lib_client/client_proto_context.ml b/src/proto_alpha/lib_client/client_proto_context.ml index 755f1eeac2756746185c98d3bcd94c8b5ea2ecbc..f169d54e4895396565189eb4267b4500bc0d4ad0 100644 --- a/src/proto_alpha/lib_client/client_proto_context.ml +++ b/src/proto_alpha/lib_client/client_proto_context.ml @@ -870,7 +870,11 @@ let submit_tx_rollup_commitment (cctxt : #full) ~chain ~block ?confirmations List.map_es (fun root -> match Hex.to_bytes (`Hex root) with - | Some content -> return Tx_rollup_commitment.{root = content} + | Some content -> + return + @@ Tx_rollup_commitment.batch_commitment + content + (Tx_rollup_withdraw.merkelize_list []) | None -> failwith "%s is not a valid binary text encoded using the hexadecimal \ diff --git a/src/proto_alpha/lib_client/injection.ml b/src/proto_alpha/lib_client/injection.ml index 69ab31da28eb85dc05502766bcd62c50e5d19efa..c1b9d007d84d44ba94498db7cdd7c948304c4b9b 100644 --- a/src/proto_alpha/lib_client/injection.ml +++ b/src/proto_alpha/lib_client/injection.ml @@ -337,6 +337,7 @@ let estimated_gas_single (type kind) | Applied (Tx_rollup_remove_commitment_result {consumed_gas; _}) -> Ok consumed_gas | Applied (Tx_rollup_rejection_result {consumed_gas; _}) -> Ok consumed_gas + | Applied (Tx_rollup_withdraw_result {consumed_gas; _}) -> Ok consumed_gas | Applied (Sc_rollup_originate_result {consumed_gas; _}) -> Ok consumed_gas | Applied (Sc_rollup_add_messages_result {consumed_gas; _}) -> Ok consumed_gas @@ -391,6 +392,7 @@ let estimated_storage_single (type kind) ~tx_rollup_origination_size | Applied (Tx_rollup_finalize_commitment_result _) -> Ok Z.zero | Applied (Tx_rollup_remove_commitment_result _) -> Ok Z.zero | Applied (Tx_rollup_rejection_result _) -> Ok Z.zero + | Applied (Tx_rollup_withdraw_result _) -> Ok Z.zero | Applied (Sc_rollup_originate_result {size; _}) -> Ok size | Applied (Sc_rollup_add_messages_result _) -> Ok Z.zero | Applied (Sc_rollup_cement_result _) -> Ok Z.zero @@ -450,6 +452,7 @@ let originated_contracts_single (type kind) | Applied (Tx_rollup_finalize_commitment_result _) -> Ok [] | Applied (Tx_rollup_remove_commitment_result _) -> Ok [] | Applied (Tx_rollup_rejection_result _) -> Ok [] + | Applied (Tx_rollup_withdraw_result _) -> Ok [] | Applied (Sc_rollup_originate_result _) -> Ok [] | Applied (Sc_rollup_add_messages_result _) -> Ok [] | Applied (Sc_rollup_cement_result _) -> Ok [] diff --git a/src/proto_alpha/lib_client/operation_result.ml b/src/proto_alpha/lib_client/operation_result.ml index b0e7580f858fec2460c5430e79ba0ada937e5370..b4c1633b404b504317035fa013f80738f17dd444 100644 --- a/src/proto_alpha/lib_client/operation_result.ml +++ b/src/proto_alpha/lib_client/operation_result.ml @@ -250,6 +250,18 @@ let pp_manager_operation_content (type kind) source internal pp_result ppf source pp_result result + | Tx_rollup_withdraw {tx_rollup; _} -> + Format.fprintf + ppf + "@[%s:%a@,From: %a%a@]" + (if internal then "Internal tx rollup withdraw" + else "Tx rollup withdraw") + Tx_rollup.pp + tx_rollup + Contract.pp + source + pp_result + result | Sc_rollup_originate {kind; boot_sector} -> let (module R : Sc_rollups.PVM.S) = Sc_rollups.of_kind kind in Format.fprintf @@ -563,6 +575,9 @@ let pp_manager_operation_contents_and_result ppf balance_updates ; Format.fprintf ppf "@,Consumed gas: %a" Gas.Arith.pp consumed_gas in + let pp_tx_rollup_withdraw_result (Tx_rollup_withdraw_result {consumed_gas}) = + Format.fprintf ppf "@,Consumed gas: %a" Gas.Arith.pp consumed_gas + in let pp_sc_rollup_originate_result (Sc_rollup_originate_result {address; consumed_gas; size; balance_updates}) = @@ -719,6 +734,17 @@ let pp_manager_operation_contents_and_result ppf "@[This tx rollup rejection operation was BACKTRACKED, its \ expected effects (as follow) were NOT applied.@]" ; pp_tx_rollup_rejection_result op + | Applied (Tx_rollup_withdraw_result _ as op) -> + Format.fprintf + ppf + "This tx rollup withdraw operation was successfully applied" ; + pp_tx_rollup_withdraw_result op + | Backtracked ((Tx_rollup_withdraw_result _ as op), _err) -> + Format.fprintf + ppf + "@[This tx rollup withdraw rollup operation was BACKTRACKED, \ + its expected effects (as follow) were NOT applied.@]" ; + pp_tx_rollup_withdraw_result op | Applied (Sc_rollup_originate_result _ as op) -> Format.fprintf ppf diff --git a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL index 3c1bc61756b00b291f79e9217c5c300937009d58..8a41b901b306b0fcbfe4062002264a458c3a15d0 100644 --- a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL +++ b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL @@ -50,6 +50,7 @@ "Tx_rollup_l2_qty", "Tx_rollup_l2_context_hash", "Tx_rollup_repr", + "Tx_rollup_withdraw_repr", "Tx_rollup_message_repr", "Tx_rollup_inbox_repr", "Tx_rollup_commitment_repr", @@ -112,6 +113,7 @@ "Global_constants_costs", "Global_constants_storage", "Tx_rollup_state_storage", + "Tx_rollup_withdraw_storage", "Tx_rollup_inbox_storage", "Tx_rollup_commitment_storage", "Tx_rollup_storage", diff --git a/src/proto_alpha/lib_protocol/alpha_context.ml b/src/proto_alpha/lib_protocol/alpha_context.ml index 44bf0a2464d487efa1b10fb6c23b0910f3c832d4..256ab8e56f3d90f375c9c3f809bfcf2be83d71b2 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.ml +++ b/src/proto_alpha/lib_protocol/alpha_context.ml @@ -248,7 +248,18 @@ module Tx_rollup = struct let owner = String (dummy_location, to_b58check tx_rollup) in Ticket_hash_builder.make ctxt ~ticketer ~ty ~contents ~owner - module Internal_for_tests = Tx_rollup_repr + module Internal_for_tests = struct + include Tx_rollup_repr + + let hash_ticket_uncarbonated tx_rollup ~contents ~ticketer ~ty = + let open Micheline in + let owner = String (dummy_location, to_b58check tx_rollup) in + Ticket_hash_builder.Internal_for_tests.make_uncarbonated + ~ticketer + ~ty + ~contents + ~owner + end end module Tx_rollup_state = struct @@ -261,6 +272,11 @@ module Tx_rollup_state = struct end end +module Tx_rollup_withdraw = struct + include Tx_rollup_withdraw_repr + include Tx_rollup_withdraw_storage +end + module Tx_rollup_message = struct include Tx_rollup_message_repr include Tx_rollup_message_builder diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 1d94e5d2f911ecd3ef29ad139bb8b6004a09e6e6..bc253dd24a0e5163ebb062831384a1493fffb0ec 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2021,6 +2021,8 @@ module Ticket_hash : sig val pp : Format.formatter -> t -> unit + val zero : t + val of_script_expr_hash : Script_expr_hash.t -> t val to_b58check : t -> string @@ -2129,6 +2131,14 @@ module Tx_rollup : sig (** see [tx_rollup_repr.originated_tx_rollup] for documentation *) val originated_tx_rollup : Origination_nonce.Internal_for_tests.t -> tx_rollup + + (** same as [hash_ticket] but uncarbonated *) + val hash_ticket_uncarbonated : + t -> + contents:Script.node -> + ticketer:Script.node -> + ty:Script.node -> + Ticket_hash.t tzresult end end @@ -2179,6 +2189,48 @@ module Tx_rollup_state : sig end end +module Tx_rollup_withdraw : sig + type withdrawal = { + claimer : Signature.Public_key_hash.t; + ticket_hash : Ticket_hash.t; + amount : Tx_rollup_l2_qty.t; + } + + type t = withdrawal + + val encoding : t Data_encoding.t + + type withdrawals_merkle_root + + val withdrawals_merkle_root_encoding : withdrawals_merkle_root Data_encoding.t + + type merkle_tree_path + + val merkle_tree_path_encoding : merkle_tree_path Data_encoding.t + + val merkelize_list : t list -> withdrawals_merkle_root + + val compute_path : t list -> int -> merkle_tree_path + + val check_path : merkle_tree_path -> t -> withdrawals_merkle_root * int + + val add : + context -> + Tx_rollup.t -> + Tx_rollup_level.t -> + message_index:int -> + withdraw_index:int -> + context tzresult Lwt.t + + val mem : + context -> + Tx_rollup.t -> + Tx_rollup_level.t -> + message_index:int -> + withdraw_index:int -> + (bool * context) tzresult Lwt.t +end + (** This module re-exports definitions from {!Tx_rollup_message_repr}. *) module Tx_rollup_message : sig type deposit = { @@ -2307,15 +2359,16 @@ module Tx_rollup_inbox : sig end end -(** This simply re-exports [Tx_rollup_commitments_repr] *) +(** This simply re-exports [Tx_rollup_commitment_repr] *) module Tx_rollup_commitment : sig - type batch_commitment = {root : bytes} + module Message_result_hash : S.HASH - val batch_commitment_equal : batch_commitment -> batch_commitment -> bool + val batch_commitment : + bytes -> Tx_rollup_withdraw.withdrawals_merkle_root -> Message_result_hash.t type t = { level : Tx_rollup_level.t; - batches : batch_commitment list; + batches : Message_result_hash.t list; predecessor : Tx_rollup_commitment_hash.t option; inbox_hash : Tx_rollup_inbox.hash; } @@ -2340,6 +2393,13 @@ module Tx_rollup_commitment : sig val hash : t -> Tx_rollup_commitment_hash.t + val check_batch_commitment : + t -> + context_hash:bytes -> + Tx_rollup_withdraw.withdrawals_merkle_root -> + message_index:int -> + bool + val add_commitment : context -> Tx_rollup.t -> @@ -2348,7 +2408,7 @@ module Tx_rollup_commitment : sig t -> (context * Tx_rollup_state.t) tzresult Lwt.t - val check_commitment_level : Tx_rollup_state.t -> t -> unit tzresult Lwt.t + val check_commitment_level : Tx_rollup_state.t -> t -> unit tzresult val find : context -> @@ -2362,6 +2422,12 @@ module Tx_rollup_commitment : sig Tx_rollup_level.t -> (context * Submitted_commitment.t) tzresult Lwt.t + val get_finalized : + context -> + Tx_rollup.t -> + Tx_rollup_level.t -> + (context * Submitted_commitment.t) tzresult Lwt.t + val pending_bonded_commitments : context -> Tx_rollup.t -> @@ -2436,6 +2502,12 @@ module Tx_rollup_errors : sig length : int; } | Wrong_message_hash + | No_finalized_commitment_for_level of { + level : Tx_rollup_level.t; + window : (Tx_rollup_level.t * Tx_rollup_level.t) option; + } + | Withdraw_invalid_path + | Withdraw_already_consumed end (** This simply re-exports {!Destination_repr}. *) @@ -2519,6 +2591,8 @@ module Kind : sig type tx_rollup_rejection = Tx_rollup_rejection_kind + type tx_rollup_withdraw = Tx_rollup_withdraw_kind + type sc_rollup_originate = Sc_rollup_originate_kind type sc_rollup_add_messages = Sc_rollup_add_messages_kind @@ -2541,6 +2615,7 @@ module Kind : sig | Tx_rollup_remove_commitment_manager_kind : tx_rollup_remove_commitment manager | Tx_rollup_rejection_manager_kind : tx_rollup_rejection manager + | Tx_rollup_withdraw_manager_kind : tx_rollup_withdraw manager | Sc_rollup_originate_manager_kind : sc_rollup_originate manager | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager | Sc_rollup_cement_manager_kind : sc_rollup_cement manager @@ -2695,6 +2770,20 @@ and _ manager_operation = proof : (* FIXME/TORU *) bool; } -> Kind.tx_rollup_rejection manager_operation + | Tx_rollup_withdraw : { + tx_rollup : Tx_rollup.t; + level : Tx_rollup_level.t; + context_hash : bytes; + message_index : int; + withdraw_path : Tx_rollup_withdraw.merkle_tree_path; + contents : Script.lazy_expr; + ty : Script.lazy_expr; + ticketer : Contract.t; + amount : Tx_rollup_l2_qty.t; + destination : Contract.t; + entrypoint : Entrypoint.t; + } + -> Kind.tx_rollup_withdraw manager_operation | Sc_rollup_originate : { kind : Sc_rollup.Kind.t; boot_sector : Sc_rollup.PVM.boot_sector; @@ -2863,6 +2952,8 @@ module Operation : sig val tx_rollup_rejection_case : Kind.tx_rollup_rejection Kind.manager case + val tx_rollup_withdraw_case : Kind.tx_rollup_withdraw Kind.manager case + val register_global_constant_case : Kind.register_global_constant Kind.manager case @@ -2921,6 +3012,8 @@ module Operation : sig val tx_rollup_rejection_case : Kind.tx_rollup_rejection case + val tx_rollup_withdraw_case : Kind.tx_rollup_withdraw case + val sc_rollup_originate_case : Kind.sc_rollup_originate case val sc_rollup_add_messages_case : Kind.sc_rollup_add_messages case diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index d297f133e2014933cbaeb2131a4e0981c64f2b7e..5fd9b292b6e24ec45f7ede888927116a966c1f8e 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -1248,6 +1248,116 @@ let apply_manager_operation_content : ~payer ~dst_rollup:dst ~since:before_operation + | Tx_rollup_withdraw + (* FIXME/TORU: #2488 The ticket accounting for the withdraw is not done here *) + { + tx_rollup; + level; + context_hash; + message_index; + withdraw_path; + contents; + ty; + ticketer; + amount; + destination; + entrypoint; + } -> + (* Ticket parsing and hashing *) + Script.force_decode_in_context ~consume_deserialization_gas ctxt ty + >>?= fun (ty, ctxt) -> + Script.force_decode_in_context ~consume_deserialization_gas ctxt contents + >>?= fun (contents, ctxt) -> + Script_ir_translator.unparse_data + ctxt + Optimized + Script_typed_ir.address_t + {destination = Contract ticketer; entrypoint = Entrypoint.default} + >>=? fun (ticketer_node, ctxt) -> + Tx_rollup.hash_ticket + ctxt + tx_rollup + ~contents:(Micheline.root contents) + ~ticketer:(Micheline.root @@ Micheline.strip_locations ticketer_node) + ~ty:(Micheline.root ty) + >>?= fun (ticket_hash, ctxt) -> + (* Checking the operation is non-internal *) + Option.value_e + ~error: + (Error_monad.trace_of_error + Tx_rollup_operation_with_non_implicit_contract) + (Contract.is_implicit source) + >>?= fun source_pkh -> + (* Computing the withdrawal hash *) + let withdrawal = + Tx_rollup_withdraw.{claimer = source_pkh; ticket_hash; amount} + in + let (computed_list_hash, withdraw_index) = + Tx_rollup_withdraw.check_path withdraw_path withdrawal + in + Tx_rollup_commitment.get_finalized ctxt tx_rollup level + >>=? fun (ctxt, commitment) -> + fail_unless + (Tx_rollup_commitment.check_batch_commitment + commitment.commitment + ~context_hash + computed_list_hash + ~message_index) + Tx_rollup_errors.Withdraw_invalid_path + >>=? fun () -> + Tx_rollup_withdraw.mem ctxt tx_rollup level ~message_index ~withdraw_index + >>=? fun (already_consumed, ctxt) -> + fail_when already_consumed Tx_rollup_errors.Withdraw_already_consumed + >>=? fun () -> + Tx_rollup_withdraw.add ctxt tx_rollup level ~message_index ~withdraw_index + >>=? fun ctxt -> + (* FIXME/TORU: #2488 The ticket accounting for the withdraw should be done here. + Before calling the next function we needs to make sure that + this ticket is owns by the tx_rollup *) + (* Now reconstruct the ticket sent as the parameter + destination. *) + ( Script_ir_translator.parse_comparable_ty ctxt (Micheline.root ty) + >>?= fun (Ex_comparable_ty ty, ctxt) -> + Script_ir_translator.parse_comparable_data + ctxt + ty + (Micheline.root contents) + >>=? fun (contents, ctxt) -> + let amount = + Option.value + ~default:Script_int.zero_n + Script_int.(is_nat @@ of_int64 @@ Tx_rollup_l2_qty.to_int64 amount) + in + let ticket = Script_typed_ir.{ticketer; contents; amount} in + Script_typed_ir.ticket_t Micheline.dummy_location ty >>?= fun ty -> + return (ticket, ty, ctxt) >>=? fun (ticket, ticket_ty, ctxt) -> + Script_ir_translator.unparse_data ctxt Optimized ticket_ty ticket + >|=? fun (parameters, ctxt) -> + (Script.lazy_expr (Micheline.strip_locations parameters), ctxt) ) + >>=? fun (parameters, ctxt) -> + (* FIXME/TORU: #2488 the returned op will fail when ticket hardening is + merged, it must be commented or fixed *) + let op = + Internal_operation + { + source; + (* TODO is 0 correct ? *) + nonce = 0; + operation = + Transaction + { + amount = Tez.zero; + parameters; + destination = Contract destination; + entrypoint; + }; + } + in + let result = + Tx_rollup_withdraw_result + {consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt} + in + return (ctxt, result, [op]) | Origination {delegate; script; preorigination; credit} -> Script.force_decode_in_context ~consume_deserialization_gas @@ -1342,7 +1452,6 @@ let apply_manager_operation_content : in return (ctxt, result, []) | Tx_rollup_submit_batch {tx_rollup; content; burn_limit} -> - assert_tx_rollup_feature_enabled ctxt >>=? fun () -> let (message, message_size) = Tx_rollup_message.make_batch content in Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> Tx_rollup_state.burn_cost ~limit:burn_limit state message_size @@ -1631,9 +1740,10 @@ let precheck_manager_contents (type kind) ctxt (op : kind Kind.manager contents) assert_tx_rollup_feature_enabled ctxt >>=? fun () -> Tx_rollup_state.get ctxt tx_rollup >>=? fun (ctxt, state) -> Tx_rollup_commitment.check_commitment_level state commitment - >|=? fun () -> ctxt + >>?= fun () -> return ctxt | Tx_rollup_return_bond _ | Tx_rollup_finalize_commitment _ - | Tx_rollup_remove_commitment _ | Tx_rollup_rejection _ -> + | Tx_rollup_remove_commitment _ | Tx_rollup_rejection _ | Tx_rollup_withdraw _ + -> assert_tx_rollup_feature_enabled ctxt >|=? fun () -> ctxt | Sc_rollup_originate _ | Sc_rollup_add_messages _ | Sc_rollup_cement _ -> assert_sc_rollup_feature_enabled ctxt >|=? fun () -> ctxt) @@ -1742,7 +1852,8 @@ let burn_storage_fees : Michelson’s big map). *) | Tx_rollup_submit_batch_result _ | Tx_rollup_commit_result _ | Tx_rollup_return_bond_result _ | Tx_rollup_finalize_commitment_result _ - | Tx_rollup_remove_commitment_result _ | Tx_rollup_rejection_result _ -> + | Tx_rollup_remove_commitment_result _ | Tx_rollup_rejection_result _ + | Tx_rollup_withdraw_result _ -> return (ctxt, storage_limit, smopr) | Sc_rollup_originate_result payload -> Fees.burn_sc_rollup_origination_fees diff --git a/src/proto_alpha/lib_protocol/apply_results.ml b/src/proto_alpha/lib_protocol/apply_results.ml index 519dbd932d981195a4f4f8eefc14e53f84dd5bca..a1f97bf313c261a5f4408846b695f593d22b1bf6 100644 --- a/src/proto_alpha/lib_protocol/apply_results.ml +++ b/src/proto_alpha/lib_protocol/apply_results.ml @@ -182,6 +182,10 @@ type _ successful_manager_operation_result = consumed_gas : Gas.Arith.fp; } -> Kind.tx_rollup_rejection successful_manager_operation_result + | Tx_rollup_withdraw_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_withdraw successful_manager_operation_result | Sc_rollup_originate_result : { balance_updates : Receipt.balance_updates; address : Sc_rollup.Address.t; @@ -733,6 +737,26 @@ module Manager_result = struct Tx_rollup_rejection_result {balance_updates; consumed_gas = consumed_milligas}) + let[@coq_axiom_with_reason "gadt"] tx_rollup_withdraw_case = + make + ~op_case:Operation.Encoding.Manager_operations.tx_rollup_withdraw_case + ~encoding: + Data_encoding.( + obj2 + (dft "consumed_gas" Gas.Arith.n_integral_encoding Gas.Arith.zero) + (dft "consumed_milligas" Gas.Arith.n_fp_encoding Gas.Arith.zero)) + ~kind:Kind.Tx_rollup_withdraw_manager_kind + ~select:(function + | Successful_manager_result (Tx_rollup_withdraw_result _ as op) -> + Some op + | _ -> None) + ~proj:(function + | Tx_rollup_withdraw_result {consumed_gas} -> + (Gas.Arith.ceil consumed_gas, consumed_gas)) + ~inj:(fun (consumed_gas, consumed_milligas) -> + assert (Gas.Arith.(equal (ceil consumed_milligas) consumed_gas)) ; + Tx_rollup_withdraw_result {consumed_gas = consumed_milligas}) + let[@coq_axiom_with_reason "gadt"] sc_rollup_originate_case = make ~op_case:Operation.Encoding.Manager_operations.sc_rollup_originate_case @@ -1112,6 +1136,10 @@ let equal_manager_kind : Kind.Tx_rollup_rejection_manager_kind ) -> Some Eq | (Kind.Tx_rollup_rejection_manager_kind, _) -> None + | (Kind.Tx_rollup_withdraw_manager_kind, Kind.Tx_rollup_withdraw_manager_kind) + -> + Some Eq + | (Kind.Tx_rollup_withdraw_manager_kind, _) -> None | ( Kind.Sc_rollup_originate_manager_kind, Kind.Sc_rollup_originate_manager_kind ) -> Some Eq @@ -1553,6 +1581,17 @@ module Encoding = struct Some (op, res) | _ -> None) + let[@coq_axiom_with_reason "gadt"] tx_rollup_withdraw_case = + make_manager_case + Operation.Encoding.tx_rollup_withdraw_case + Manager_result.tx_rollup_withdraw_case + (function + | Contents_and_result + ( (Manager_operation {operation = Tx_rollup_withdraw _; _} as op), + res ) -> + Some (op, res) + | _ -> None) + let[@coq_axiom_with_reason "gadt"] sc_rollup_originate_case = make_manager_case Operation.Encoding.sc_rollup_originate_case @@ -1628,6 +1667,7 @@ let contents_result_encoding = make tx_rollup_finalize_commitment_case; make tx_rollup_remove_commitment_case; make tx_rollup_rejection_case; + make tx_rollup_withdraw_case; make sc_rollup_originate_case; make sc_rollup_add_messages_case; make sc_rollup_cement_case; @@ -2153,6 +2193,32 @@ let kind_equal : } ) -> Some Eq | (Manager_operation {operation = Tx_rollup_rejection _; _}, _) -> None + | ( Manager_operation {operation = Tx_rollup_withdraw _; _}, + Manager_operation_result + {operation_result = Applied (Tx_rollup_withdraw_result _); _} ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_withdraw _; _}, + Manager_operation_result + {operation_result = Backtracked (Tx_rollup_withdraw_result _, _); _} ) + -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_withdraw _; _}, + Manager_operation_result + { + operation_result = + Failed (Alpha_context.Kind.Tx_rollup_withdraw_manager_kind, _); + _; + } ) -> + Some Eq + | ( Manager_operation {operation = Tx_rollup_withdraw _; _}, + Manager_operation_result + { + operation_result = + Skipped Alpha_context.Kind.Tx_rollup_withdraw_manager_kind; + _; + } ) -> + Some Eq + | (Manager_operation {operation = Tx_rollup_withdraw _; _}, _) -> None | ( Manager_operation {operation = Sc_rollup_originate _; _}, Manager_operation_result {operation_result = Applied (Sc_rollup_originate_result _); _} ) -> diff --git a/src/proto_alpha/lib_protocol/apply_results.mli b/src/proto_alpha/lib_protocol/apply_results.mli index 762096bb5fc2ef7d9e97189a93c65f50e6bc59e7..cb1837fcbad87c191bf0f3ac2a5da2b08d4d5b9a 100644 --- a/src/proto_alpha/lib_protocol/apply_results.mli +++ b/src/proto_alpha/lib_protocol/apply_results.mli @@ -239,6 +239,10 @@ and _ successful_manager_operation_result = consumed_gas : Gas.Arith.fp; } -> Kind.tx_rollup_rejection successful_manager_operation_result + | Tx_rollup_withdraw_result : { + consumed_gas : Gas.Arith.fp; + } + -> Kind.tx_rollup_withdraw successful_manager_operation_result | Sc_rollup_originate_result : { balance_updates : Receipt.balance_updates; address : Sc_rollup.Address.t; diff --git a/src/proto_alpha/lib_protocol/dune.inc b/src/proto_alpha/lib_protocol/dune.inc index 70f3873234061fe87fdcb267b84a11aa5f1df292..884138c39a0c2e25deac1866ed5ef3ba689fba64 100644 --- a/src/proto_alpha/lib_protocol/dune.inc +++ b/src/proto_alpha/lib_protocol/dune.inc @@ -75,6 +75,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end tx_rollup_l2_qty.mli tx_rollup_l2_qty.ml tx_rollup_l2_context_hash.mli tx_rollup_l2_context_hash.ml tx_rollup_repr.mli tx_rollup_repr.ml + tx_rollup_withdraw_repr.mli tx_rollup_withdraw_repr.ml tx_rollup_message_repr.mli tx_rollup_message_repr.ml tx_rollup_inbox_repr.mli tx_rollup_inbox_repr.ml tx_rollup_commitment_repr.mli tx_rollup_commitment_repr.ml @@ -131,6 +132,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end global_constants_costs.mli global_constants_costs.ml global_constants_storage.mli global_constants_storage.ml tx_rollup_state_storage.mli tx_rollup_state_storage.ml + tx_rollup_withdraw_storage.mli tx_rollup_withdraw_storage.ml tx_rollup_inbox_storage.mli tx_rollup_inbox_storage.ml tx_rollup_commitment_storage.mli tx_rollup_commitment_storage.ml tx_rollup_storage.mli tx_rollup_storage.ml @@ -243,6 +245,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end tx_rollup_l2_qty.mli tx_rollup_l2_qty.ml tx_rollup_l2_context_hash.mli tx_rollup_l2_context_hash.ml tx_rollup_repr.mli tx_rollup_repr.ml + tx_rollup_withdraw_repr.mli tx_rollup_withdraw_repr.ml tx_rollup_message_repr.mli tx_rollup_message_repr.ml tx_rollup_inbox_repr.mli tx_rollup_inbox_repr.ml tx_rollup_commitment_repr.mli tx_rollup_commitment_repr.ml @@ -299,6 +302,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end global_constants_costs.mli global_constants_costs.ml global_constants_storage.mli global_constants_storage.ml tx_rollup_state_storage.mli tx_rollup_state_storage.ml + tx_rollup_withdraw_storage.mli tx_rollup_withdraw_storage.ml tx_rollup_inbox_storage.mli tx_rollup_inbox_storage.ml tx_rollup_commitment_storage.mli tx_rollup_commitment_storage.ml tx_rollup_storage.mli tx_rollup_storage.ml @@ -411,6 +415,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end tx_rollup_l2_qty.mli tx_rollup_l2_qty.ml tx_rollup_l2_context_hash.mli tx_rollup_l2_context_hash.ml tx_rollup_repr.mli tx_rollup_repr.ml + tx_rollup_withdraw_repr.mli tx_rollup_withdraw_repr.ml tx_rollup_message_repr.mli tx_rollup_message_repr.ml tx_rollup_inbox_repr.mli tx_rollup_inbox_repr.ml tx_rollup_commitment_repr.mli tx_rollup_commitment_repr.ml @@ -467,6 +472,7 @@ module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end global_constants_costs.mli global_constants_costs.ml global_constants_storage.mli global_constants_storage.ml tx_rollup_state_storage.mli tx_rollup_state_storage.ml + tx_rollup_withdraw_storage.mli tx_rollup_withdraw_storage.ml tx_rollup_inbox_storage.mli tx_rollup_inbox_storage.ml tx_rollup_commitment_storage.mli tx_rollup_commitment_storage.ml tx_rollup_storage.mli tx_rollup_storage.ml @@ -601,6 +607,7 @@ include Tezos_raw_protocol_alpha.Main Tx_rollup_l2_qty Tx_rollup_l2_context_hash Tx_rollup_repr + Tx_rollup_withdraw_repr Tx_rollup_message_repr Tx_rollup_inbox_repr Tx_rollup_commitment_repr @@ -657,6 +664,7 @@ include Tezos_raw_protocol_alpha.Main Global_constants_costs Global_constants_storage Tx_rollup_state_storage + Tx_rollup_withdraw_storage Tx_rollup_inbox_storage Tx_rollup_commitment_storage Tx_rollup_storage @@ -810,6 +818,7 @@ include Tezos_raw_protocol_alpha.Main tx_rollup_l2_qty.mli tx_rollup_l2_qty.ml tx_rollup_l2_context_hash.mli tx_rollup_l2_context_hash.ml tx_rollup_repr.mli tx_rollup_repr.ml + tx_rollup_withdraw_repr.mli tx_rollup_withdraw_repr.ml tx_rollup_message_repr.mli tx_rollup_message_repr.ml tx_rollup_inbox_repr.mli tx_rollup_inbox_repr.ml tx_rollup_commitment_repr.mli tx_rollup_commitment_repr.ml @@ -866,6 +875,7 @@ include Tezos_raw_protocol_alpha.Main global_constants_costs.mli global_constants_costs.ml global_constants_storage.mli global_constants_storage.ml tx_rollup_state_storage.mli tx_rollup_state_storage.ml + tx_rollup_withdraw_storage.mli tx_rollup_withdraw_storage.ml tx_rollup_inbox_storage.mli tx_rollup_inbox_storage.ml tx_rollup_commitment_storage.mli tx_rollup_commitment_storage.ml tx_rollup_storage.mli tx_rollup_storage.ml diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 52b3b0b8059cdfb48c75378b4c1c987532bf8cd6..9120e4902698390333b9ffb83a10dea4e3890d02 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -85,6 +85,8 @@ module Kind = struct type tx_rollup_rejection = Tx_rollup_rejection_kind + type tx_rollup_withdraw = Tx_rollup_withdraw_kind + type sc_rollup_originate = Sc_rollup_originate_kind type sc_rollup_add_messages = Sc_rollup_add_messages_kind @@ -107,6 +109,7 @@ module Kind = struct | Tx_rollup_remove_commitment_manager_kind : tx_rollup_remove_commitment manager | Tx_rollup_rejection_manager_kind : tx_rollup_rejection manager + | Tx_rollup_withdraw_manager_kind : tx_rollup_withdraw manager | Sc_rollup_originate_manager_kind : sc_rollup_originate manager | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager | Sc_rollup_cement_manager_kind : sc_rollup_cement manager @@ -321,6 +324,20 @@ and _ manager_operation = proof : (* FIXME/TORU *) bool; } -> Kind.tx_rollup_rejection manager_operation + | Tx_rollup_withdraw : { + tx_rollup : Tx_rollup_repr.t; + level : Tx_rollup_level_repr.t; + context_hash : bytes; + message_index : int; + withdraw_path : Tx_rollup_withdraw_repr.merkle_tree_path; + contents : Script_repr.lazy_expr; + ty : Script_repr.lazy_expr; + ticketer : Contract_repr.t; + amount : Tx_rollup_l2_qty.t; + destination : Contract_repr.t; + entrypoint : Entrypoint_repr.t; + } + -> Kind.tx_rollup_withdraw manager_operation | Sc_rollup_originate : { kind : Sc_rollup_repr.Kind.t; boot_sector : Sc_rollup_repr.PVM.boot_sector; @@ -356,6 +373,7 @@ let manager_kind : type kind. kind manager_operation -> kind Kind.manager = | Tx_rollup_remove_commitment _ -> Kind.Tx_rollup_remove_commitment_manager_kind | Tx_rollup_rejection _ -> Kind.Tx_rollup_rejection_manager_kind + | Tx_rollup_withdraw _ -> Kind.Tx_rollup_withdraw_manager_kind | Sc_rollup_originate _ -> Kind.Sc_rollup_originate_manager_kind | Sc_rollup_add_messages _ -> Kind.Sc_rollup_add_messages_manager_kind | Sc_rollup_cement _ -> Kind.Sc_rollup_cement_manager_kind @@ -436,6 +454,8 @@ let tx_rollup_operation_remove_commitment_tag = let tx_rollup_operation_rejection_tag = tx_rollup_operation_tag_offset + 6 +let tx_rollup_operation_withdraw_tag = tx_rollup_operation_tag_offset + 7 + let sc_rollup_operation_tag_offset = 200 let sc_rollup_operation_origination_tag = sc_rollup_operation_tag_offset + 0 @@ -727,6 +747,85 @@ module Encoding = struct }); } + let[@coq_axiom_with_reason "gadt"] tx_rollup_withdraw_case = + MCase + { + tag = tx_rollup_operation_withdraw_tag; + name = "tx_rollup_withdraw"; + encoding = + merge_objs + (obj10 + (req "tx_rollup" Tx_rollup_repr.encoding) + (req "level" Tx_rollup_level_repr.encoding) + (req "context_hash" bytes) + (req "message_index" int31) + (req + "withdraw_path" + Tx_rollup_withdraw_repr.merkle_tree_path_encoding) + (req "ticket_contents" Script_repr.lazy_expr_encoding) + (req "ticket_ty" Script_repr.lazy_expr_encoding) + (req "ticket_ticketer" Contract_repr.encoding) + (req "ticket_amount" Tx_rollup_l2_qty.encoding) + (req "destination" Contract_repr.encoding)) + (obj1 (req "entrypoint" Entrypoint_repr.simple_encoding)); + select = + (function + | Manager (Tx_rollup_withdraw _ as op) -> Some op | _ -> None); + proj = + (function + | Tx_rollup_withdraw + { + tx_rollup; + level; + context_hash; + message_index; + withdraw_path; + contents; + ty; + ticketer; + amount; + destination; + entrypoint; + } -> + ( ( tx_rollup, + level, + context_hash, + message_index, + withdraw_path, + contents, + ty, + ticketer, + amount, + destination ), + entrypoint )); + inj = + (fun ( ( tx_rollup, + level, + context_hash, + message_index, + withdraw_path, + contents, + ty, + ticketer, + amount, + destination ), + entrypoint ) -> + Tx_rollup_withdraw + { + tx_rollup; + level; + context_hash; + message_index; + withdraw_path; + contents; + ty; + ticketer; + amount; + destination; + entrypoint; + }); + } + let[@coq_axiom_with_reason "gadt"] sc_rollup_originate_case = MCase { @@ -811,6 +910,7 @@ module Encoding = struct make tx_rollup_finalize_commitment_case; make tx_rollup_remove_commitment_case; make tx_rollup_rejection_case; + make tx_rollup_withdraw_case; make sc_rollup_originate_case; make sc_rollup_add_messages_case; make sc_rollup_cement_case; @@ -1145,6 +1245,11 @@ module Encoding = struct tx_rollup_operation_rejection_tag Manager_operations.tx_rollup_rejection_case + let tx_rollup_withdraw_case = + make_manager_case + tx_rollup_operation_withdraw_tag + Manager_operations.tx_rollup_withdraw_case + let sc_rollup_originate_case = make_manager_case sc_rollup_operation_origination_tag @@ -1195,6 +1300,7 @@ module Encoding = struct make tx_rollup_finalize_commitment_case; make tx_rollup_remove_commitment_case; make tx_rollup_rejection_case; + make tx_rollup_withdraw_case; make sc_rollup_originate_case; make sc_rollup_add_messages_case; make sc_rollup_cement_case; @@ -1412,6 +1518,8 @@ let equal_manager_operation_kind : | (Tx_rollup_remove_commitment _, _) -> None | (Tx_rollup_rejection _, Tx_rollup_rejection _) -> Some Eq | (Tx_rollup_rejection _, _) -> None + | (Tx_rollup_withdraw _, Tx_rollup_withdraw _) -> Some Eq + | (Tx_rollup_withdraw _, _) -> None | (Sc_rollup_originate _, Sc_rollup_originate _) -> Some Eq | (Sc_rollup_originate _, _) -> None | (Sc_rollup_add_messages _, Sc_rollup_add_messages _) -> Some Eq diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index 2b8c0a531effcd87fc657e97a86b4788aac08c64..b6bb9243d77b3831d5c909e29df103e9d291ca72 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -44,6 +44,8 @@ - set deposits limitation - tx rollup origination - tx rollup batch submission + - tx rollup commit + - tx rollup withdraw - smart contract rollup origination Each of them can be encoded as raw bytes. Operations are distinguished at @@ -111,6 +113,8 @@ module Kind : sig type tx_rollup_rejection = Tx_rollup_rejection_kind + type tx_rollup_withdraw = Tx_rollup_withdraw_kind + type sc_rollup_originate = Sc_rollup_originate_kind type sc_rollup_add_messages = Sc_rollup_add_messages_kind @@ -133,6 +137,7 @@ module Kind : sig | Tx_rollup_remove_commitment_manager_kind : tx_rollup_remove_commitment manager | Tx_rollup_rejection_manager_kind : tx_rollup_rejection manager + | Tx_rollup_withdraw_manager_kind : tx_rollup_withdraw manager | Sc_rollup_originate_manager_kind : sc_rollup_originate manager | Sc_rollup_add_messages_manager_kind : sc_rollup_add_messages manager | Sc_rollup_cement_manager_kind : sc_rollup_cement manager @@ -364,6 +369,40 @@ and _ manager_operation = proof : (* FIXME/TORU *) bool; } -> Kind.tx_rollup_rejection manager_operation + (** [Tx_rollup_withdraw] allows an implicit account (the "claimer") to + receive [amount] tickets, pulled out of [tx_rollup], to the + [entrypoint] of the smart contract [destination]. + + The ticket must have been addressed to the + claimer, who must be the source of this operation. It must have been + pulled out at [level] and from the message at [message_index]. The ticket + is composed of [ticketer; ty; contents]. *) + | Tx_rollup_withdraw : { + tx_rollup : Tx_rollup_repr.t; + (** The rollup from where the tickets are retrieved *) + level : Tx_rollup_level_repr.t; + (** The level at which the withdrawal was enabled *) + context_hash : bytes; + (** The hash of the l2 context resulting from the execution of the + inbox from where this withdrawal was enabled. *) + message_index : int; + (** Index of the message in the inbox at [level] where this withdrawal was enabled. *) + withdraw_path : Tx_rollup_withdraw_repr.merkle_tree_path; + (** The proof that this withdraw is indeed included in + commitment for [tx_rollup] at [level] with [context_hash]. *) + contents : Script_repr.lazy_expr; (** Contents of the withdrawn ticket *) + ty : Script_repr.lazy_expr; + (** Type of the withdrawn ticket's contents *) + ticketer : Contract_repr.t; (** Ticketer of the withdrawn ticket *) + amount : Tx_rollup_l2_qty.t; + (** Quantity of the withdrawn ticket. Must match the + amount that was enabled. *) + destination : Contract_repr.t; + (** The smart contract address that should receive the tickets. *) + entrypoint : Entrypoint_repr.t; + (** The entrypoint of the smart contract address that should receive the tickets. *) + } + -> Kind.tx_rollup_withdraw manager_operation (* [Sc_rollup_originate] allows an implicit account to originate a new smart contract rollup (initialized with a given boot sector). *) @@ -522,6 +561,8 @@ module Encoding : sig val tx_rollup_rejection_case : Kind.tx_rollup_rejection Kind.manager case + val tx_rollup_withdraw_case : Kind.tx_rollup_withdraw Kind.manager case + val sc_rollup_originate_case : Kind.sc_rollup_originate Kind.manager case val sc_rollup_add_messages_case : @@ -574,6 +615,8 @@ module Encoding : sig val tx_rollup_rejection_case : Kind.tx_rollup_rejection case + val tx_rollup_withdraw_case : Kind.tx_rollup_withdraw case + val sc_rollup_originate_case : Kind.sc_rollup_originate case val sc_rollup_add_messages_case : Kind.sc_rollup_add_messages case diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 520f966a7c6d5d5ff7c702a0995f5f9e02af2393..4a04ef3ecc5fe4c8fc81fb312f7f39cda63e9fc1 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -1412,7 +1412,7 @@ module Tx_rollup = struct let encoding = Tx_rollup_inbox_repr.metadata_encoding end) - module Message_index = struct + module Int32_index = struct type t = int32 let compare = Compare.Int32.compare @@ -1430,6 +1430,15 @@ module Tx_rollup = struct | [i] -> Int32.of_string_opt i end + module Consumed_withdraw = + Make_indexed_carbonated_data_storage + (Make_subcontext (Registered) (Level_tx_rollup_context.Raw_context) + (struct + let name = ["withdraw"] + end)) + (Make_index (Int32_index)) + (Tx_rollup_withdraw_repr.Withdrawal_accounting) + module Message_indexed_context = Make_subcontext (Registered) (Level_tx_rollup_context.Raw_context) (struct @@ -1439,7 +1448,7 @@ module Tx_rollup = struct module Inbox_contents = Make_indexed_carbonated_data_storage (Message_indexed_context) - (Make_index (Message_index)) + (Make_index (Int32_index)) (struct type t = Tx_rollup_message_repr.hash diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index 508825b80eeddc64d1d0684c62abc5b26ea77dcb..1e671db943a46d5bd5c14e73b62c92f80f0d1339 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -602,6 +602,16 @@ module Tx_rollup : sig and type key = Tx_rollup_repr.t and type value = Tx_rollup_inbox_repr.metadata + (** A carbonated storage of the set of withdrawals consumed + of those potentially associated to each message + of an inbox. The key is the message number, which is + sequentially assigned from 0. *) + module Consumed_withdraw : + Non_iterable_indexed_carbonated_data_storage + with type t := (Raw_context.t * Tx_rollup_level_repr.t) * Tx_rollup_repr.t + and type key = int32 + and type value = Tx_rollup_withdraw_repr.Withdrawal_accounting.t + (** A carbonated storage to store the hashes of the messages appended in an inbox. The key is the batch number, which is sequentially assigned from 0. diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.ml b/src/proto_alpha/lib_protocol/test/helpers/block.ml index bf501ae72cf72a6edc1d07caafaddaedf5308964..d6452b8edf008289b4d47b4689a70f34b866dc92 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/block.ml @@ -706,8 +706,9 @@ let bake_n_with_all_balance_updates ?(baking_mode = Application) ?policy | Tx_rollup_return_bond_result _ | Tx_rollup_finalize_commitment_result _ | Tx_rollup_remove_commitment_result _ - | Tx_rollup_rejection_result _ | Sc_rollup_originate_result _ - | Sc_rollup_add_messages_result _ | Sc_rollup_cement_result _ -> + | Tx_rollup_rejection_result _ | Tx_rollup_withdraw_result _ + | Sc_rollup_originate_result _ | Sc_rollup_add_messages_result _ + | Sc_rollup_cement_result _ -> balance_updates_rev | Transaction_result (Transaction_to_contract_result {balance_updates; _}) @@ -745,6 +746,7 @@ let bake_n_with_origination_results ?(baking_mode = Application) ?policy n b = | Successful_manager_result (Tx_rollup_finalize_commitment_result _) | Successful_manager_result (Tx_rollup_remove_commitment_result _) | Successful_manager_result (Tx_rollup_rejection_result _) + | Successful_manager_result (Tx_rollup_withdraw_result _) | Successful_manager_result (Sc_rollup_originate_result _) | Successful_manager_result (Sc_rollup_add_messages_result _) | Successful_manager_result (Sc_rollup_cement_result _) -> diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.ml b/src/proto_alpha/lib_protocol/test/helpers/op.ml index 5ab258d527d84abaf8fb9d714612565b437abaca..e29cfe7ad31c30b34b872f81f14746cb7af2cedd 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/op.ml @@ -608,3 +608,32 @@ let tx_rollup_remove_commitment ?counter ?fee ?gas_limit ?storage_limit ctxt >>=? fun to_sign_op -> Context.Contract.manager ctxt source >|=? fun account -> sign account.sk ctxt to_sign_op + +let tx_rollup_withdraw ?counter ?fee ?gas_limit ?storage_limit ctxt + ~(source : Contract.t) (tx_rollup : Tx_rollup.t) (level : Tx_rollup_level.t) + ~context_hash ~message_index ~contents ~ty ~ticketer amount ~destination + withdraw_path entrypoint = + manager_operation + ?counter + ?fee + ?gas_limit + ?storage_limit + ~source + ctxt + (Tx_rollup_withdraw + { + tx_rollup; + level; + context_hash; + message_index; + withdraw_path; + contents; + ty; + ticketer; + amount; + destination; + entrypoint; + }) + >>=? fun to_sign_op -> + Context.Contract.manager ctxt source >|=? fun account -> + sign account.sk ctxt to_sign_op diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.mli b/src/proto_alpha/lib_protocol/test/helpers/op.mli index 363e10e94c1f5421bfbe5f2f481c4d515b94fb86..8d363022a637611c8d10b630827db427b31891e1 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/op.mli @@ -299,3 +299,42 @@ val tx_rollup_remove_commitment : Contract.t -> Tx_rollup.t -> Operation.packed tzresult Lwt.t + +(** [tx_rollup_withdraw] executes a tx rollup withdrawal. + + The arguments are: + + - [Context.t]: the context on which to apply the operation + - [source:Contract.t]: the source contract of the operation + - [Tx_rollup.t]: the rollup to which the withdrawal pertains + - [Tx_rollup_level.t]: the level on which the withdrawal was commited + - [context_hash:bytes]: the hash of the context of the rollup when the withdrawal was commited + - [message_index:int]: the inbox index of the message that that emitted this withdrawal + - [contents:Script.lazy_expr]: the contents of the ticket of the withdrawal + - [ty:Script.lazy_expr]: the type of the ticket of the withdrawal + - [ticketer:Contract.t]: the ticketer of the ticket of the withdrawal + - [Tx_rollup_l2_qty.t]: the qty of the ticket of the withdrawal + - [destination:Contract.t]: the destination contract that should received the ticket of the withdrawal + - [Tx_rollup_withdraw.merkle_tree_path]: the proof that this withdrawal was contained in the commitment + - [Entrypoint_repr.t]: the entrypoint of the destination contract to which the ticket should be sent + + *) +val tx_rollup_withdraw : + ?counter:counter -> + ?fee:Tez.t -> + ?gas_limit:Gas.Arith.integral -> + ?storage_limit:counter -> + Context.t -> + source:Contract.t -> + Tx_rollup.t -> + Tx_rollup_level.t -> + context_hash:bytes -> + message_index:int -> + contents:Script.lazy_expr -> + ty:Script.lazy_expr -> + ticketer:Contract.t -> + Tx_rollup_l2_qty.t -> + destination:Contract.t -> + Tx_rollup_withdraw.merkle_tree_path -> + Entrypoint_repr.t -> + (packed_operation, tztrace) result Lwt.t diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw.tz b/src/proto_alpha/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw.tz new file mode 100644 index 0000000000000000000000000000000000000000..0329b648cd2d9bd9f83c27135454fcf5ad655460 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw.tz @@ -0,0 +1,3 @@ +parameter (ticket nat); +storage (option (ticket nat)); +code { CAR ; SOME ; NIL operation ; PAIR } ; diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw_unit_tickets.tz b/src/proto_alpha/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw_unit_tickets.tz new file mode 100644 index 0000000000000000000000000000000000000000..386c94da1552809517af52c255bd1086ee65b9cd --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/integration/operations/contracts/tx_rollup_withdraw_unit_tickets.tz @@ -0,0 +1,3 @@ +parameter (ticket unit); +storage (option (ticket unit)); +code { CAR ; SOME ; NIL operation ; PAIR } ; diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml index 0988192d7674624974c8ae0257138b8d2d43c3e0..8327561a0470ac98ef8170c5790c90e9893cb6b9 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_tx_rollup.ml @@ -42,15 +42,19 @@ open Test_tez let check_tx_rollup_exists ctxt tx_rollup = Context.Tx_rollup.state ctxt tx_rollup >|=? fun _ -> () -(** [check_proto_error f t] checks that the first error of [t] +(** [check_proto_error_f f t] checks that the first error of [t] satisfies the boolean function [f]. *) -let check_proto_error f t = +let check_proto_error_f f t = match t with | Environment.Ecoproto_error e :: _ when f e -> Assert.test_error_encodings e ; return_unit | _ -> failwith "Unexpected error: %a" Error_monad.pp_print_trace t +(** [check_proto_error e t] checks that the first error of [t] + equals [e]. *) +let check_proto_error e t = check_proto_error_f (( = ) e) t + (** [test_disable_feature_flag] try to originate a tx rollup with the feature flag is deactivated and check it fails *) let test_disable_feature_flag () = @@ -61,13 +65,10 @@ let test_disable_feature_flag () = Incremental.begin_construction b >>=? fun i -> Op.tx_rollup_origination (I i) contract >>=? fun (op, _tx_rollup) -> Incremental.add_operation - ~expect_failure: - (check_proto_error (function - | Apply.Tx_rollup_feature_disabled -> true - | _ -> false)) + ~expect_apply_failure:(check_proto_error Apply.Tx_rollup_feature_disabled) i op - >>= fun _i -> return_unit + >>=? fun _i -> return_unit let message_hash_testable : Tx_rollup_message.hash Alcotest.testable = Alcotest.testable Tx_rollup_message.pp_hash ( = ) @@ -126,8 +127,16 @@ let context_init ?(tx_rollup_max_unfinalized_levels = 2100) n = context and 1 contract. *) let context_init1 () = context_init 1 >|=? function - | (_, []) -> assert false | (b, contract_1 :: _) -> (b, contract_1) + | (_, _) -> assert false + +(** [context_init2] initializes a context with no consensus rewards + to not interfere with balances prediction. It returns the created + context and 2 contracts. *) +let context_init2 () = + context_init 2 >|=? function + | (b, contract_1 :: contract_2 :: _) -> (b, contract_1, contract_2) + | (_, _) -> assert false (** [originate b contract] originates a tx_rollup from [contract], and returns the new block and the tx_rollup address. *) @@ -141,10 +150,7 @@ let originate b contract = the state with the tx_rollup, and the baked block with the batch submitted. *) let init_originate_and_submit ?(batch = String.make 5 'c') () = - context_init 1 >>=? fun (b, contracts) -> - let contract = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract) -> originate b contract >>=? fun (b, tx_rollup) -> Context.Contract.balance (B b) contract >>=? fun balance -> Context.Tx_rollup.state (B b) tx_rollup >>=? fun state -> @@ -181,21 +187,32 @@ let is_implicit_exn x = | Some x -> x | None -> raise (Invalid_argument "is_implicit_exn") -(** [make_unit_ticket_key ctxt ticketer tx_rollup] computes the key hash of - the unit ticket crafted by [ticketer] and owned by [tx_rollup]. *) -let make_unit_ticket_key ctxt ticketer tx_rollup = +(** [make_ticket_key ty contents ticketer tx_rollup] computes the ticket hash + of the ticket containing [contents] of type [ty], crafted by [ticketer] and + owned by [tx_rollup]. *) +let make_ticket_key ~ty ~contents ~ticketer tx_rollup = let open Tezos_micheline.Micheline in - let open Michelson_v1_primitives in let ticketer = Bytes (0, Data_encoding.Binary.to_bytes_exn Contract.encoding ticketer) in - let ty = Prim (0, T_unit, [], []) in - let contents = Prim (0, D_Unit, [], []) in match - Alpha_context.Tx_rollup.hash_ticket ctxt ~ticketer ~ty ~contents tx_rollup + Alpha_context.Tx_rollup.Internal_for_tests.hash_ticket_uncarbonated + ~ticketer + ~ty + ~contents + tx_rollup with - | Ok (x, _) -> x - | Error _ -> raise (Invalid_argument "make_unit_ticket_key") + | Ok x -> x + | Error _ -> raise (Invalid_argument "make_ticket_key") + +(** [make_unit_ticket_key ticketer tx_rollup] computes the ticket hash of + the unit ticket crafted by [ticketer] and owned by [tx_rollup]. *) +let make_unit_ticket_key ~ticketer tx_rollup = + let open Tezos_micheline.Micheline in + let open Michelson_v1_primitives in + let ty = Prim (0, T_unit, [], []) in + let contents = Prim (0, D_Unit, [], []) in + make_ticket_key ~ty ~contents ~ticketer tx_rollup let rng_state = Random.State.make_self_init () @@ -217,9 +234,14 @@ let assert_ok res = match res with Ok r -> r | Error _ -> assert false let raw_level level = assert_ok @@ Raw_level.of_int32 level -(* Make a valid commitment for a batch. TODO/TORU: roots are still - wrong, of course, until we get Merkle proofs*) -let make_commitment_for_batch i level tx_rollup = +let merkle_root_empty_withdraw_list = Tx_rollup_withdraw.merkelize_list [] + +(* Make a valid commitment for a batch. TODO/TORU: roots are still wrong, of + course, until we get Merkle proofs In the mean time provides the list of + withdraw in a association list of [batch_index -> withdraw_list]. + Be careful not to provide a too big withdraw_list as the construction + is expensive *) +let make_commitment_for_batch i level tx_rollup withdraw_list = let ctxt = Incremental.alpha_ctxt i in wrap (Alpha_context.Tx_rollup_inbox.Internal_for_tests.get_metadata @@ -227,16 +249,20 @@ let make_commitment_for_batch i level tx_rollup = level tx_rollup) >>=? fun (ctxt, metadata) -> - Lwt.return - @@ List.init - ~when_negative_length:[] - (Int32.to_int metadata.inbox_length) - (fun i -> - let batch : Tx_rollup_commitment.batch_commitment = - {root = Bytes.make 20 (Char.chr i)} - in - batch) - >>=? fun batches -> + List.init + ~when_negative_length:[] + (Int32.to_int metadata.inbox_length) + (fun i -> Bytes.make 20 (Char.chr i)) + >>?= fun batches_result -> + let message_result = + List.mapi + (fun i v -> + Tx_rollup_commitment.batch_commitment + v + (List.assq i withdraw_list |> Option.value ~default:[] + |> Tx_rollup_withdraw.merkelize_list)) + batches_result + in (match Tx_rollup_level.pred level with | None -> return_none | Some predecessor_level -> ( @@ -247,9 +273,9 @@ let make_commitment_for_batch i level tx_rollup = )) >>=? fun predecessor -> let commitment : Tx_rollup_commitment.t = - {level; batches; predecessor; inbox_hash = metadata.hash} + {level; batches = message_result; predecessor; inbox_hash = metadata.hash} in - return commitment + return (commitment, batches_result) let check_bond ctxt tx_rollup contract count = let pkh = is_implicit_exn contract in @@ -418,10 +444,7 @@ let test_add_batch_with_limit () = [Tez.zero], so [cost] >= [limit] *) let burn_limit = Tez.zero in let contents = String.make 5 'd' in - context_init 1 >>=? fun (b, contracts) -> - let contract = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract) -> originate b contract >>=? fun (b, tx_rollup) -> Incremental.begin_construction b >>=? fun i -> Op.tx_rollup_submit_batch (I i) contract tx_rollup contents ~burn_limit @@ -430,7 +453,7 @@ let test_add_batch_with_limit () = i op ~expect_failure: - (check_proto_error (function + (check_proto_error_f (function | Tx_rollup_errors.Submit_batch_burn_excedeed _ -> true | _ -> false)) >>=? fun _ -> return_unit @@ -483,10 +506,7 @@ let test_add_two_batches () = (** Try to add a batch too large in an inbox. *) let test_batch_too_big () = - context_init 1 >>=? fun (b, contracts) -> - let contract = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract) -> originate b contract >>=? fun (b, tx_rollup) -> Context.get_constants (B b) >>=? fun constant -> let contents = @@ -496,13 +516,12 @@ let test_batch_too_big () = in Incremental.begin_construction b >>=? fun i -> Op.tx_rollup_submit_batch (I i) contract tx_rollup contents >>=? fun op -> - Incremental.add_operation i op >>= function - | Ok _ -> assert false - | Error trace -> - check_proto_error - (function - | Tx_rollup_errors.Message_size_exceeds_limit -> true | _ -> false) - trace + Incremental.add_operation + i + ~expect_apply_failure: + (check_proto_error Tx_rollup_errors.Message_size_exceeds_limit) + op + >>=? fun _ -> return_unit (** [fill_inbox b tx_rollup contract contents k] fills the inbox of [tx_rollup] with batches containing [contents] sent by [contract]. @@ -541,10 +560,7 @@ let fill_inbox b tx_rollup contract contents k = (** Try to add enough large batches to reach the size limit of an inbox. *) let test_inbox_size_too_big () = - context_init 1 >>=? fun (b, contracts) -> - let contract = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract) -> Context.get_constants (B b) >>=? fun constant -> let tx_rollup_batch_limit = constant.parametric.tx_rollup_hard_size_limit_per_message - 1 @@ -556,17 +572,14 @@ let test_inbox_size_too_big () = i op ~expect_failure: - (check_proto_error (function + (check_proto_error_f (function | Tx_rollup_errors.Inbox_size_would_exceed_limit _ -> true | _ -> false)) >>=? fun _i -> return_unit) (** Try to add enough batches to reach the batch count limit of an inbox. *) let test_inbox_count_too_big () = - context_init 1 >>=? fun (b, contracts) -> - let contract = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract) -> Context.get_constants (B b) >>=? fun constant -> let message_count = constant.parametric.tx_rollup_max_messages_per_inbox in let contents = "some contents" in @@ -603,7 +616,7 @@ let test_inbox_count_too_big () = i op ~expect_failure: - (check_proto_error @@ function + (check_proto_error_f @@ function | Tx_rollup_errors.Inbox_count_would_exceed_limit rollup -> rollup = tx_rollup | _ -> false) @@ -616,10 +629,7 @@ let test_inbox_count_too_big () = let test_valid_deposit () = let (_, _, pkh) = gen_l2_account () in - context_init 1 >>=? fun (b, contracts) -> - let account = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, account) -> originate b account >>=? fun (b, tx_rollup) -> Contract_helpers.originate_contract "contracts/tx_rollup_deposit.tz" @@ -643,7 +653,7 @@ let test_valid_deposit () = Incremental.begin_construction b >|=? Incremental.alpha_ctxt >>=? fun ctxt -> Context.Tx_rollup.inbox (B b) tx_rollup Tx_rollup_level.root >>=? function | {contents = [hash]; _} -> - let ticket_hash = make_unit_ticket_key ctxt contract tx_rollup in + let ticket_hash = make_unit_ticket_key ~ticketer:contract tx_rollup in let (message, _size) = Tx_rollup_message.make_deposit (is_implicit_exn account) @@ -662,10 +672,7 @@ let test_valid_deposit () = sending a deposit order. *) let test_valid_deposit_inexistant_rollup () = let (_, _, pkh) = gen_l2_account () in - context_init 1 >>=? fun (b, contracts) -> - let account = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, account) -> Contract_helpers.originate_contract "contracts/tx_rollup_deposit.tz" "Unit" @@ -683,7 +690,7 @@ let test_valid_deposit_inexistant_rollup () = i op ~expect_failure: - (check_proto_error (function + (check_proto_error_f (function | Script_interpreter.Runtime_contract_error _ -> true | _ -> false)) >>=? fun _ -> return_unit @@ -693,10 +700,7 @@ let test_valid_deposit_inexistant_rollup () = let test_invalid_deposit_not_ticket () = let (_, _, pkh) = gen_l2_account () in - context_init 1 >>=? fun (b, contracts) -> - let account = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, account) -> originate b account >>=? fun (b, tx_rollup) -> Contract_helpers.originate_contract "contracts/tx_rollup_deposit_incorrect_param.tz" @@ -713,7 +717,7 @@ let test_invalid_deposit_not_ticket () = i op ~expect_failure: - (check_proto_error (function + (check_proto_error_f (function | Script_interpreter.Bad_contract_parameter _ -> true | _ -> false)) >>=? fun _ -> return_unit @@ -723,10 +727,7 @@ let test_invalid_deposit_not_ticket () = let test_invalid_entrypoint () = let (_, _, pkh) = gen_l2_account () in - context_init 1 >>=? fun (b, contracts) -> - let account = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, account) -> originate b account >>=? fun (b, tx_rollup) -> Contract_helpers.originate_contract "contracts/tx_rollup_deposit_incorrect_param.tz" @@ -743,7 +744,7 @@ let test_invalid_entrypoint () = i op ~expect_failure: - (check_proto_error (function + (check_proto_error_f (function | Script_interpreter.Bad_contract_parameter _ -> true | _ -> false)) >>=? fun _ -> return_unit @@ -751,10 +752,7 @@ let test_invalid_entrypoint () = (** [test_invalid_l2_address] checks that a smart contract cannot make a deposit order to something that is not a valid layer-2 address. *) let test_invalid_l2_address () = - context_init 1 >>=? fun (b, contracts) -> - let account = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, account) -> originate b account >>=? fun (b, tx_rollup) -> Contract_helpers.originate_contract "contracts/tx_rollup_deposit.tz" @@ -773,7 +771,7 @@ let test_invalid_l2_address () = i op ~expect_failure: - (check_proto_error (function + (check_proto_error_f (function | Script_interpreter.Bad_contract_parameter _ -> true | _ -> false)) >>=? fun _ -> return_unit @@ -782,10 +780,7 @@ let test_invalid_l2_address () = transaction rollup fails if the [amount] parameter is not null. *) let test_valid_deposit_invalid_amount () = let (_, _, pkh) = gen_l2_account () in - context_init 1 >>=? fun (b, contracts) -> - let account = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, account) -> originate b account >>=? fun (b, tx_rollup) -> Contract_helpers.originate_contract "contracts/tx_rollup_deposit_one_mutez.tz" @@ -802,19 +797,14 @@ let test_valid_deposit_invalid_amount () = i op ~expect_failure: - (check_proto_error (function - | Apply.Tx_rollup_invalid_transaction_amount -> true - | _ -> false)) + (check_proto_error Apply.Tx_rollup_invalid_transaction_amount) >>=? fun _ -> return_unit (** [test_deposit_by_non_internal_operation] checks that a transaction to the deposit entrypoint of a transaction rollup fails if it is not internal. *) let test_deposit_by_non_internal_operation () = - context_init 1 >>=? fun (b, contracts) -> - let account = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, account) -> originate b account >>=? fun (b, tx_rollup) -> Op.unsafe_transaction (B b) account (Tx_rollup tx_rollup) Tez.zero >>=? fun operation -> @@ -822,10 +812,7 @@ let test_deposit_by_non_internal_operation () = Incremental.add_operation i operation - ~expect_failure: - (check_proto_error (function - | Apply.Tx_rollup_non_internal_transaction -> true - | _ -> false)) + ~expect_failure:(check_proto_error Apply.Tx_rollup_non_internal_transaction) >>=? fun _i -> return_unit (** Test that block finalization changes gas rates *) @@ -910,13 +897,7 @@ let test_finalization () = level, and ensures that this fails. It adds a commitment with the wrong batch count and ensures that that fails. *) let test_commitment_duplication () = - context_init 2 >>=? fun (b, contracts) -> - let contract1 = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in - let contract2 = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 1 - in + context_init2 () >>=? fun (b, contract1, contract2) -> let pkh1 = is_implicit_exn contract1 in originate b contract1 >>=? fun (b, tx_rollup) -> Context.Contract.balance (B b) contract1 >>=? fun _balance -> @@ -927,11 +908,15 @@ let test_commitment_duplication () = >>=? fun operation -> Block.bake ~operation b >>=? fun b -> Incremental.begin_construction b >>=? fun i -> - make_commitment_for_batch i Tx_rollup_level.root tx_rollup - >>=? fun commitment -> + make_commitment_for_batch i Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment, _) -> (* Successfully fail to submit a different commitment from contract2 *) - let batches2 : Tx_rollup_commitment.batch_commitment list = - [{root = Bytes.make 20 '1'}; {root = Bytes.make 20 '2'}] + let batches2 : Tx_rollup_commitment.Message_result_hash.t list = + [Bytes.make 20 '1'; Bytes.make 20 '2'] + |> List.map (fun context_hash -> + Tx_rollup_commitment.batch_commitment + context_hash + merkle_root_empty_withdraw_list) in let commitment_with_wrong_count : Tx_rollup_commitment.t = {commitment with batches = batches2} @@ -941,10 +926,7 @@ let test_commitment_duplication () = Incremental.add_operation i op - ~expect_failure: - (check_proto_error @@ function - | Tx_rollup_errors.Wrong_batch_count -> true - | _ -> false) + ~expect_failure:(check_proto_error Tx_rollup_errors.Wrong_batch_count) >>=? fun i -> (* Submit the correct one *) let submitted_level = (Level.current (Incremental.alpha_ctxt i)).level in @@ -959,7 +941,7 @@ let test_commitment_duplication () = (Incremental.add_operation i op >>= function | Ok _ -> failwith "an error was expected" | Error e -> - check_proto_error + check_proto_error_f (function | Tx_rollup_errors.Level_already_has_commitment level1 -> Tx_rollup_level.root = level1 @@ -1020,10 +1002,7 @@ let tx_level level = assert_ok @@ Tx_rollup_level.of_int32 level (** [test_commitment_predecessor] tests commitment predecessor edge cases *) let test_commitment_predecessor () = - context_init 1 >>=? fun (b, contracts) -> - let contract1 = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract1) -> originate b contract1 >>=? fun (b, tx_rollup) -> (* Transactions in blocks 2, 3, 6 *) make_transactions_in tx_rollup contract1 [2; 3; 6] b >>=? fun b -> @@ -1033,8 +1012,8 @@ let test_commitment_predecessor () = Tx_rollup_commitment_hash.of_bytes_exn (Bytes.of_string "tcu1deadbeefdeadbeefdeadbeefdead") in - make_commitment_for_batch i Tx_rollup_level.root tx_rollup - >>=? fun commitment -> + make_commitment_for_batch i Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment, _) -> let commitment_for_invalid_inbox = {commitment with level = tx_level 10l} in Op.tx_rollup_commit (I i) contract1 tx_rollup commitment_for_invalid_inbox >>=? fun op -> @@ -1042,16 +1021,14 @@ let test_commitment_predecessor () = Tx_rollup_errors.Commitment_too_early {provided = tx_level 10l; expected = tx_level 0l} in - (Incremental.add_operation i op >>= function - | Ok _ -> failwith "This shouldn’t have succeeded" - | Error e -> check_proto_error (( = ) error) e) - >>=? fun () -> + Incremental.add_operation i op ~expect_apply_failure:(check_proto_error error) + >>=? fun _ -> (* Now we submit a real commitment *) Op.tx_rollup_commit (I i) contract1 tx_rollup commitment >>=? fun op -> Incremental.add_operation i op >>=? fun i -> (* Commitment without predecessor for block with predecessor*) - make_commitment_for_batch i Tx_rollup_level.(succ root) tx_rollup - >>=? fun commitment -> + make_commitment_for_batch i Tx_rollup_level.(succ root) tx_rollup [] + >>=? fun (commitment, _) -> let commitment_with_missing_predecessor = {commitment with predecessor = None} in @@ -1065,7 +1042,7 @@ let test_commitment_predecessor () = i op ~expect_failure: - (check_proto_error @@ function + (check_proto_error_f @@ function | Tx_rollup_errors.Wrong_predecessor_hash {provided = None; expected} -> expected = commitment.predecessor | _ -> false) @@ -1080,7 +1057,7 @@ let test_commitment_predecessor () = i op ~expect_failure: - (check_proto_error @@ function + (check_proto_error_f @@ function | Tx_rollup_errors.Wrong_predecessor_hash {provided = _; expected} -> expected = commitment.predecessor | _ -> false) @@ -1116,8 +1093,7 @@ let test_full_inbox () = Incremental.add_operation i op - ~expect_failure: - (check_proto_error @@ ( = ) Tx_rollup_errors.Too_many_inboxes) + ~expect_failure:(check_proto_error Tx_rollup_errors.Too_many_inboxes) >>=? fun i -> ignore i ; return () @@ -1125,10 +1101,7 @@ let test_full_inbox () = (** [test_bond_finalization] tests that level retirement in fact allows bonds to be returned. *) let test_bond_finalization () = - context_init 2 >>=? fun (b, contracts) -> - let contract1 = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract1) -> let pkh1 = is_implicit_exn contract1 in originate b contract1 >>=? fun (b, tx_rollup) -> (* Transactions in block 2, 3, 4 *) @@ -1140,12 +1113,12 @@ let test_bond_finalization () = i op ~expect_failure: - (check_proto_error @@ function + (check_proto_error_f @@ function | Tx_rollup_errors.Bond_does_not_exist a_pkh1 -> a_pkh1 = pkh1 | _ -> false) >>=? fun i -> - make_commitment_for_batch i Tx_rollup_level.root tx_rollup - >>=? fun commitment_a -> + make_commitment_for_batch i Tx_rollup_level.root tx_rollup [] + >>=? fun (commitment_a, _) -> Op.tx_rollup_commit (I i) contract1 tx_rollup commitment_a >>=? fun op -> Incremental.add_operation i op >>=? fun i -> Op.tx_rollup_return_bond (I i) contract1 tx_rollup >>=? fun op -> @@ -1153,7 +1126,7 @@ let test_bond_finalization () = i op ~expect_failure: - (check_proto_error @@ function + (check_proto_error_f @@ function | Tx_rollup_errors.Bond_in_use a_pkh1 -> a_pkh1 = pkh1 | _ -> false) >>=? fun i -> @@ -1176,10 +1149,7 @@ let test_bond_finalization () = (** [test_too_many_commitments] tests that you can't submit new commitments if there are too many finalized commitments. *) let test_too_many_commitments () = - context_init 2 >>=? fun (b, contracts) -> - let contract1 = - WithExceptions.Option.get ~loc:__LOC__ @@ List.nth contracts 0 - in + context_init1 () >>=? fun (b, contract1) -> originate b contract1 >>=? fun (b, tx_rollup) -> (* Transactions in block 2, 3, 4, 5 *) make_transactions_in tx_rollup contract1 [2; 3; 4; 5] b >>=? fun b -> @@ -1187,7 +1157,7 @@ let test_too_many_commitments () = let rec make_commitments i level n = if n = 0 then return (i, level) else - make_commitment_for_batch i level tx_rollup >>=? fun commitment -> + make_commitment_for_batch i level tx_rollup [] >>=? fun (commitment, _) -> Op.tx_rollup_commit (I i) contract1 tx_rollup commitment >>=? fun op -> Incremental.add_operation i op >>=? fun i -> make_commitments i (Tx_rollup_level.succ level) (n - 1) @@ -1200,15 +1170,13 @@ let test_too_many_commitments () = Op.tx_rollup_finalize (I i) contract1 tx_rollup >>=? fun op -> Incremental.add_operation i op >>=? fun i -> (* Fail to add a new commitment. *) - make_commitment_for_batch i level tx_rollup >>=? fun commitment -> + make_commitment_for_batch i level tx_rollup [] >>=? fun (commitment, _) -> Op.tx_rollup_commit (I i) contract1 tx_rollup commitment >>=? fun op -> Incremental.add_operation i op ~expect_failure: - (check_proto_error (function - | Tx_rollup_errors.Too_many_finalized_commitments -> true - | _ -> false)) + (check_proto_error Tx_rollup_errors.Too_many_finalized_commitments) >>=? fun i -> (* Wait out the withdrawal period. *) bake_until i 12l >>=? fun i -> @@ -1222,6 +1190,903 @@ let test_too_many_commitments () = return () +module Withdraw = struct + (** [context_init_withdraw n] initializes a context with [n + 1] accounts, one rollup and a + withdrawal recipient contract. *) + let context_init_withdraw n = + context_init (n + 1) >>=? fun (b, accounts) -> + let account1 = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth accounts 0 + in + originate b account1 >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_withdraw.tz" + "None" + account1 + b + (is_implicit_exn account1) + >>=? fun (withdraw_contract, b) -> + return (account1, accounts, tx_rollup, withdraw_contract, b) + + (** [context_init1_withdraw] initializes a context with one account, one rollup and a + withdrawal recipient contract. *) + let context_init1_withdraw () = + context_init_withdraw 0 + >>=? fun (account1, _accounts, tx_rollup, withdraw_contract, b) -> + return (account1, tx_rollup, withdraw_contract, b) + + (** [context_init2_withdraw] initializes a context with two accounts, one rollup and a + withdrawal recipient contract. *) + let context_init2_withdraw () = + context_init_withdraw 1 + >>=? fun (account1, accounts, tx_rollup, withdraw_contract, b) -> + let account2 = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth accounts 1 + in + return (account1, account2, tx_rollup, withdraw_contract, b) + + (** [context_finalize_batch_with_withdrawals account tx_rollup batch withdrawals b] + submits a batch containing the message [batch] to [tx_rollup] in the block [b]. + In the following block, it adds a commitment for that block containing + [withdrawals] (same format as in [make_commitment_for_batch]). + In the third and final block, it finalizes the commitment. + + It returns the commitment and a list of dummy context hashes + that was mocked as the result of the applying the batch. + *) + let context_finalize_batch_with_withdrawals ~account ~tx_rollup + ?(batch = "batch") ~withdrawals b = + Op.tx_rollup_submit_batch (B b) account tx_rollup batch + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* Make a commitment for the dummy batch. Mock the + list of withdrawals as per + [withdrawals]. Include the commitment in an operation and bake. *) + Incremental.begin_construction b >>=? fun i -> + make_commitment_for_batch i Tx_rollup_level.root tx_rollup withdrawals + >>=? fun (commitment, context_hash_list) -> + Op.tx_rollup_commit (I i) account tx_rollup commitment >>=? fun operation -> + Incremental.add_operation i operation >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* 3. Finalize the commitment *) + Op.tx_rollup_finalize (B b) account tx_rollup >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + return (commitment, context_hash_list, b) + + module Nat_ticket = struct + let ty = Expr.from_string "nat" + + let contents_nat = 1 + + let contents = Expr.from_string (string_of_int contents_nat) + + let amount = Tx_rollup_l2_qty.of_int64_exn 10L + + let ticket_hash ~ticketer ~tx_rollup = + make_ticket_key + ~ty:(Tezos_micheline.Micheline.root ty) + ~contents:(Tezos_micheline.Micheline.root contents) + ~ticketer + tx_rollup + + let withdrawal ~ticketer ?(recipient = ticketer) tx_rollup : + Tx_rollup_withdraw.t = + { + claimer = is_implicit_exn recipient; + ticket_hash = ticket_hash ~ticketer ~tx_rollup; + amount; + } + end + + (** [test_valid_withdraw] checks that a smart contract can deposit tickets to a + transaction rollup. *) + let test_valid_withdraw () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + (* The withdrawal execution operation must include proof that the + level it specifies allows the withdrawal it executes. + + Currently, for a withdrawal execution [(level, rollup)] + the protocol only verifies that: + - at [level], there is a commitment for [rollup] + + It does not yet verify that the effects of the inbox at [level] actually + enables a withdrawal. + + In this test, we simply add dummy batch and a commitment for that batch to + to some level, which ensures that the withdrawal can be executed. + + Instead of a dummy batch, a more complete test would add: + + - A deposit operation + - A L2->L1 operation + + This will result in a withdrawal that can be executed. + *) + + (* 1. Create a ticket and it's withdrawal *) + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + + (* 2 Add a batch message to [b], a commitment for that inbox + containing the withdrawal at index 0, and finalize that + commitment *) + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + (* -- At this point, everything is in place for + the user to execute the withdrawal -- *) + + (* 3. Now execute the withdrawal. The ticket should be received by + withdraw_contract at the default entrypoint. *) + (let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (B b) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:0 + entrypoint) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* 4. Finally, we assert that [withdraw_contract] has received the + ticket as expected *) + Incremental.begin_construction b >>=? fun i -> + let ctxt = Incremental.alpha_ctxt i in + wrap @@ Contract.get_storage ctxt withdraw_contract + >>=? fun (_ctxt, found_storage) -> + Format.printf + "found_storage %s" + (match found_storage with + | Some storage -> Expr.to_string storage + | None -> "None") ; + let expected_storage = + Format.sprintf + "(Some (Pair 0x%s (Pair %d %s)))" + (Hex.show + (Hex.of_string + (Data_encoding.Binary.to_string_exn Contract.encoding account1))) + Nat_ticket.contents_nat + (Tx_rollup_l2_qty.to_string Nat_ticket.amount) + |> Expr.from_string |> Option.some + in + if expected_storage = found_storage then return_unit + else Alcotest.fail "Storage didn't match" + + (** [test_invalid_withdraw_no_commitment] checks that attempting to + withdraw from a level with no commited inbox raises an error. *) + let test_invalid_withdraw_no_commitment () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + Incremental.begin_construction b >>=? fun i -> + let entrypoint = Entrypoint.default in + let context_hash = Bytes.make 20 'c' in + (* A dummy proof *) + let dummy_withdraw_proof = + let ticket_hash = Ticket_hash.zero in + let dummy_withdraw : Tx_rollup_withdraw.t = + { + claimer = is_implicit_exn account1; + ticket_hash; + amount = Nat_ticket.amount; + } + in + Tx_rollup_withdraw.compute_path [dummy_withdraw] 0 + in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + dummy_withdraw_proof + entrypoint + >>=? fun operation -> + Incremental.add_operation + ~expect_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.No_finalized_commitment_for_level + {level; window = None} -> + Tx_rollup_level.(level = root) + | _ -> false) + i + operation + >>=? fun _ -> return_unit + + (** [test_invalid_withdraw_missing_withdraw_in_commitment] tries + withdrawing when the commitment in question has no withdrawals + associated. *) + let test_invalid_withdraw_missing_withdraw_in_commitment () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + let batch = "batch" in + Op.tx_rollup_submit_batch (B b) account1 tx_rollup batch + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [])] + b + >>=? fun (_commitment, context_hash_list, b) -> + Incremental.begin_construction b >>=? fun i -> + (let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_path = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_path + entrypoint) + >>=? fun operation -> + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _ -> return_unit + + (** [test_invalid_withdraw_tickets] test withdrawing with tickets + that do not correspond to the given proof and asserts that errors + are raised. *) + let test_invalid_withdraw_tickets () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + let batch = "batch" in + Op.tx_rollup_submit_batch (B b) account1 tx_rollup batch + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + (* Try executing the withdrawal with invalid amounts *) + let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + Incremental.begin_construction b >>=? fun i -> + List.iter_es + (fun amount -> + (let withdraw_path = + Tx_rollup_withdraw.compute_path [{withdraw with amount}] 0 + in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + amount + ~destination:withdraw_contract + withdraw_path + entrypoint) + >>=? fun operation -> + Incremental.add_operation + ~expect_failure: + (check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _i -> return_unit) + [Tx_rollup_l2_qty.of_int64_exn 9L; Tx_rollup_l2_qty.of_int64_exn 11L] + >>=? fun () -> + (* Try with wrong type *) + (let withdraw_path = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr @@ Expr.from_string "unit") + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_path + entrypoint) + >>=? fun operation -> + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _i -> + (* Try with wrong contents *) + (let withdraw_path = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr @@ Expr.from_string "2") + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_path + entrypoint) + >>=? fun operation -> + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _i -> + (* Try with wrong ticketer *) + (let withdraw_path = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:withdraw_contract + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_path + entrypoint) + >>=? fun operation -> + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _i -> return_unit + + (** [test_invalid_withdraw_invalid_proof] tries withdrawing with + an invalid proof. *) + let test_invalid_withdraw_invalid_proof () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + let batch = "batch" in + Op.tx_rollup_submit_batch (B b) account1 tx_rollup batch + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + let withdrawal1 : Tx_rollup_withdraw.t = + Nat_ticket.withdrawal ~ticketer:account1 tx_rollup + in + let withdrawal2 : Tx_rollup_withdraw.t = + {withdrawal1 with amount = Tx_rollup_l2_qty.of_int64_exn 5L} + in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdrawal1; withdrawal2])] + b + >>=? fun (_commitment, context_hash_list, b) -> + let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + + Incremental.begin_construction b >>=? fun i -> + (let invalid_withdraw_path = + (* We're sending the parameters for withdrawal1, but we calculate + the proof for withdrawal2 *) + Tx_rollup_withdraw.compute_path [withdrawal1; withdrawal2] 1 + in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + invalid_withdraw_path + entrypoint) + >>=? fun operation -> + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _ -> + (let invalid_withdraw_path = + (* We give the proof for a list of withdrawals that does not correspond + to the list in the commitment *) + Tx_rollup_withdraw.compute_path [withdrawal1] 0 + in + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~message_index:0 + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + invalid_withdraw_path + entrypoint) + >>=? fun operation -> + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _ -> return_unit + + (** [test_invalid_withdraw_already_consumed] asserts that withdrawing the same + withdrawal twice raises [Withdraw_already_consumed]. *) + let test_invalid_withdraw_already_consumed () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + (* Execute withdraw *) + Op.tx_rollup_withdraw + (B b) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:0 + entrypoint + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* Execute again *) + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:0 + entrypoint + >>=? fun operation -> + Incremental.add_operation + ~expect_failure: + (check_proto_error Tx_rollup_errors.Withdraw_already_consumed) + i + operation + >>=? fun _ -> return_unit + + (** [test_invalid_withdraw_someone_elses] asserts that attempting to + execute a withdrawal with an erroneous [recipient] creates an + incorrect proof. *) + let test_invalid_withdraw_someone_elses () = + context_init2_withdraw () + >>=? fun (account1, account2, tx_rollup, withdraw_contract, b) -> + let withdraw = + Nat_ticket.withdrawal + ~ticketer:account1 (* Explicit for clarity *) + ~recipient:account1 + tx_rollup + in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + (* Execute again *) + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_withdraw + (I i) + (* The source of the withdrawal execution is not the recipient set in [withdraw] *) + ~source:account2 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:0 + entrypoint + >>=? fun operation -> + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _ -> return_unit + + (** [test_invalid_withdraw_illtyped_entrypoint] asserts that + attempting to withdraw nat tickets to a contract taking unit + tickets raises [Bad_contract_parameter]. *) + let test_invalid_withdraw_illtyped_entrypoint () = + context_init1 () >>=? fun (b, account1) -> + originate b account1 >>=? fun (b, tx_rollup) -> + Contract_helpers.originate_contract + "contracts/tx_rollup_withdraw_unit_tickets.tz" + "None" + account1 + b + (is_implicit_exn account1) + >>=? fun (withdraw_contract_unit_tickets, b) -> + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract_unit_tickets + withdraw_proof + ~message_index:0 + entrypoint + >>=? fun operation -> + Incremental.add_operation + ~expect_failure: + (check_proto_error + @@ Script_interpreter.Bad_contract_parameter + withdraw_contract_unit_tickets) + i + operation + >>=? fun _ -> return_unit + + (** [test_invalid_withdraw_bad_entrypoint] asserts that + attempting to withdraw nat tickets to a contract taking unit + tickets raises [Bad_contract_parameter]. *) + let test_invalid_withdraw_bad_entrypoint () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + let inexistant_entrypoint = Entrypoint.of_string_strict_exn "foobar" in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Incremental.begin_construction b >>=? fun i -> + Op.tx_rollup_withdraw + (I i) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:0 + inexistant_entrypoint + >>=? fun operation -> + Incremental.add_operation + ~expect_failure: + (check_proto_error + @@ Script_interpreter.Bad_contract_parameter withdraw_contract) + i + operation + >>=? fun _ -> return_unit + + (** [test_invalid_message_index] checks that attempting to withdraw from a + level with a wrong message index raises an error. *) + let test_invalid_message_index () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + (* 1. Create and submit two dummy batch *) + let batch1 = "batch" in + Op.tx_rollup_submit_batch (B b) account1 tx_rollup batch1 + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* 2.1 Create a ticket and its hash *) + let ty = Expr.from_string "nat" in + let contents_nat = 1 in + let contents = Expr.from_string (string_of_int contents_nat) in + let amount = Tx_rollup_l2_qty.of_int64_exn 10L in + let ticket_hash = + make_ticket_key + ~ty:(Tezos_micheline.Micheline.root ty) + ~contents:(Tezos_micheline.Micheline.root contents) + ~ticketer:account1 + tx_rollup + in + + (* 2.2 Create a withdrawal for the ticket *) + let withdraw : Tx_rollup_withdraw.t = + {claimer = is_implicit_exn account1; ticket_hash; amount} + in + + (* 2.3 Finally, make a commitment for the dummy batch. mock the + list of withdrawals to include the previously created + [withdrawal]. Include the commitment in an operation and bake + it. *) + Incremental.begin_construction b >>=? fun i -> + make_commitment_for_batch i Tx_rollup_level.root tx_rollup [(0, [withdraw])] + >>=? fun (commitment, context_hash_list) -> + Op.tx_rollup_commit (I i) account1 tx_rollup commitment + >>=? fun operation -> + Incremental.add_operation i operation >>=? fun i -> + Incremental.finalize_block i >>=? fun b -> + (* 3. Finalize the commitment *) + Op.tx_rollup_finalize (B b) account1 tx_rollup >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* -- At this point, everything is in place for + the user to execute the withdrawal -- *) + + (* 4. Now execute the withdrawal. The ticket should be received + by withdraw_contract at the default entrypoint. *) + (let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (B b) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr contents) + ~ty:(Script.lazy_expr ty) + ~ticketer:account1 + amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:1 + entrypoint) + >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + (* 5. try with wrong message_index *) + Incremental.add_operation + ~expect_failure:(check_proto_error Tx_rollup_errors.Withdraw_invalid_path) + i + operation + >>=? fun _i -> return_unit + + (** [test_too_late_withdrawal] checks that attempting to withdraw from a + level of a commitment already removed fails. *) + let test_too_late_withdrawal () = + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + (* Remove the commitment *) + Op.tx_rollup_remove_commitment (B b) account1 tx_rollup + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + (* At this point, the withdrawal can no longer be executed *) + (let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (B b) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:0 + entrypoint) + >>=? fun operation -> + Incremental.begin_construction b >>=? fun i -> + (* 5. try with correct withdraw but too late *) + Incremental.add_operation + ~expect_failure: + (check_proto_error_f @@ function + | Tx_rollup_errors.No_finalized_commitment_for_level + {level; window = None} -> + Tx_rollup_level.(level = root) + | _error -> false) + i + operation + >>=? fun _i -> return_unit + + (** [test_withdrawal_accounting_is_cleaned_up_after_removal] + Check that withdrawal accounting is cleaned + up along with the commitment. + *) + let test_withdrawal_accounting_is_cleaned_up_after_removal () = + let open Error_monad_operators in + context_init1_withdraw () + >>=? fun (account1, tx_rollup, withdraw_contract, b) -> + let assert_consumed b ~msg consumed_expected = + Incremental.begin_construction b >>=? fun i -> + let ctxt = Incremental.alpha_ctxt i in + Alpha_context.Tx_rollup_withdraw.mem + ctxt + tx_rollup + Tx_rollup_level.root + ~message_index:0 + ~withdraw_index:0 + >>=?? fun (consumed_actual, _) -> + Alcotest.(check bool msg consumed_expected consumed_actual) ; + return_unit + in + + let withdraw = Nat_ticket.withdrawal ~ticketer:account1 tx_rollup in + context_finalize_batch_with_withdrawals + ~account:account1 + ~tx_rollup + ~withdrawals:[(0, [withdraw])] + b + >>=? fun (_commitment, context_hash_list, b) -> + assert_consumed b ~msg:"should not be consumed before withdrawal" false + >>=? fun () -> + (* Exexute with withdrawal *) + (let entrypoint = Entrypoint.default in + let context_hash = + WithExceptions.Option.get ~loc:__LOC__ @@ List.nth context_hash_list 0 + in + let withdraw_proof = Tx_rollup_withdraw.compute_path [withdraw] 0 in + Op.tx_rollup_withdraw + (B b) + ~source:account1 + tx_rollup + Tx_rollup_level.root + ~context_hash + ~contents:(Script.lazy_expr Nat_ticket.contents) + ~ty:(Script.lazy_expr Nat_ticket.ty) + ~ticketer:account1 + Nat_ticket.amount + ~destination:withdraw_contract + withdraw_proof + ~message_index:0 + entrypoint) + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + assert_consumed b ~msg:"should be consumed after withdrawal" true + >>=? fun () -> + (* Remove the commitment *) + Op.tx_rollup_remove_commitment (B b) account1 tx_rollup + >>=? fun operation -> + Block.bake ~operation b >>=? fun b -> + assert_consumed + b + ~msg:"consumtion memory should be removed with commitment" + false + >>=? fun () -> return_unit + + let tests = + [ + Tztest.tztest "Test withdraw" `Quick test_valid_withdraw; + Tztest.tztest + "Test withdraw w/ missing commitment" + `Quick + test_invalid_withdraw_no_commitment; + Tztest.tztest + "Test withdraw w/ missing withdraw in commitment" + `Quick + test_invalid_withdraw_missing_withdraw_in_commitment; + Tztest.tztest + "Test withdraw w/ invalid amount" + `Quick + test_invalid_withdraw_tickets; + Tztest.tztest + "Test withdraw w/ invalid proof" + `Quick + test_invalid_withdraw_invalid_proof; + Tztest.tztest + "Test withdraw twice" + `Quick + test_invalid_withdraw_already_consumed; + Tztest.tztest + "Test withdraw someone elses's withdraw" + `Quick + test_invalid_withdraw_someone_elses; + Tztest.tztest + "Test withdraw with an ill-typed entrypoint" + `Quick + test_invalid_withdraw_illtyped_entrypoint; + Tztest.tztest + "Test withdraw with missing entrypoint" + `Quick + test_invalid_withdraw_bad_entrypoint; + Tztest.tztest + "Test withdraw w/ an invalid message index" + `Quick + test_invalid_message_index; + Tztest.tztest "Test withdrawing too late" `Quick test_too_late_withdrawal; + Tztest.tztest + "Test withdrawing is cleaned up after removal" + `Quick + test_withdrawal_accounting_is_cleaned_up_after_removal; + ] +end + let tests = [ Tztest.tztest @@ -1287,3 +2152,4 @@ let tests = test_too_many_commitments; Tztest.tztest "Test bond finalization" `Quick test_bond_finalization; ] + @ Withdraw.tests diff --git a/src/proto_alpha/lib_protocol/test/pbt/dune b/src/proto_alpha/lib_protocol/test/pbt/dune index bfc488a0342d4f330300fcb132342bb47e5ca9ca..908952ffecbc21c566741eb01339f9ac8de4c90a 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/dune +++ b/src/proto_alpha/lib_protocol/test/pbt/dune @@ -7,6 +7,7 @@ test_script_comparison test_tez_repr test_tx_rollup_l2_encoding + test_tx_rollup_l2_withdraw_storage test_carbonated_map) (libraries tezos-base tezos-micheline diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml index dd9171d83dda40f7c9cc86839328e9620fc741bc..1795cf328f69c110bd4f0410badcc5b357d9803b 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -226,13 +226,13 @@ let message_result : Message_result.message_result QCheck2.Gen.t = in frequency [(2, deposit_result_gen); (8, batch_v1_result_gen)] -let withdrawal : Message_result.withdrawal QCheck2.Gen.t = +let withdrawal : Protocol.Alpha_context.Tx_rollup_withdraw.t QCheck2.Gen.t = let open QCheck2.Gen in - let open Message_result in - let destination = public_key_hash in + let open Protocol.Alpha_context.Tx_rollup_withdraw in + let claimer = public_key_hash in let* ticket_hash = ticket_hash_gen in let* amount = qty_gen in - return {destination; ticket_hash; amount} + return {claimer; ticket_hash; amount} let message_result_withdrawal : Message_result.t QCheck2.Gen.t = let open QCheck2.Gen in diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_withdraw_storage.ml b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_withdraw_storage.ml new file mode 100644 index 0000000000000000000000000000000000000000..7b7e8f50bb57240614f934b0ab446fb4d4d9f813 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_withdraw_storage.ml @@ -0,0 +1,87 @@ +(*****************************************************************************) +(* *) +(* 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. *) +(* *) +(*****************************************************************************) + +(** Testing + ------- + Component: Protocol Library + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_withdraw_storage.exe + Subject: Tx rollup l2 withdraw storage +*) + +open Lib_test.Qcheck2_helpers + +open Protocol.Tx_rollup_withdraw_repr.Withdrawal_accounting + +let gen_ofs = QCheck2.Gen.int_bound (64 * 10) + +let gen_storage = + let open QCheck2.Gen in + let* bool_vector = list bool in + match + List.fold_left_i_e + (fun i storage v -> if v then set storage i else ok storage) + empty + bool_vector + with + | Ok v -> return v + | Error e -> + Alcotest.failf + "An unxpected error %a occurred when generating Withdrawal_accounting.t" + Protocol.Environment.Error_monad.pp_trace + e + +let test_get_set (c, ofs) = + List.for_all + (fun ofs' -> + let res = + let open Tzresult_syntax in + let* c' = set c ofs in + let* v = get c ofs' in + let* v' = get c' ofs' in + return (if ofs = ofs' then v' = true else v = v') + in + match res with + | Error e -> + Alcotest.failf + "Unexpected error: %a" + Protocol.Environment.Error_monad.pp_trace + e + | Ok res -> res) + (0 -- 63) + +let () = + Alcotest.run + "bits" + [ + ( "quantity", + qcheck_wrap + [ + QCheck2.Test.make + ~count:10000 + ~name:"get set" + QCheck2.Gen.(pair gen_storage gen_ofs) + test_get_set; + ] ); + ] diff --git a/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml b/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml index 15dc041ac94644a52b2e9be1aacdca9eb3ca4445..ea5751cf5be02a4c3479d5a7f6081c0a6df2aad7 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml @@ -158,12 +158,12 @@ let eq_addr_indexable = Alcotest.of_pp (Indexable.pp (fun _ _ -> ())) let eq_ticket_indexable = Alcotest.of_pp (Indexable.pp (fun _ _ -> ())) let pp_withdrawal fmt = function - | Message_result.{destination; ticket_hash; amount} -> + | Tx_rollup_withdraw.{claimer; ticket_hash; amount} -> Format.fprintf fmt - "{destination=%a; ticket_hash=%a; amount=%a}" + "{claimer=%a; ticket_hash=%a; amount=%a}" Signature.Public_key_hash.pp - destination + claimer Ticket_hash.pp ticket_hash Tx_rollup_l2_qty.pp @@ -395,7 +395,7 @@ let test_returned_deposit () = eq_withdrawal "Resulting withdrawal from overflowing L1->L2 deposit" withdrawal - {destination = pkh; ticket_hash = ticket1; amount}) ; + {claimer = pkh; ticket_hash = ticket1; amount}) ; return_unit | (Deposit_failure reason, _) -> let msg = @@ -662,7 +662,7 @@ let test_simple_l1_transaction () = "Resulting withdrawal from L2->L1 transfer" withdrawal { - destination = pkh2; + claimer = pkh2; ticket_hash = ticket1; amount = Tx_rollup_l2_qty.of_int64_exn 10L; }) ; @@ -853,13 +853,7 @@ let test_l1_transaction_zero () = (list eq_withdrawal) "Resulting withdrawal from L2->L1 transfer" withdrawals - [ - { - destination = pkh2; - ticket_hash = ticket1; - amount = Tx_rollup_l2_qty.zero; - }; - ]) ; + [{claimer = pkh2; ticket_hash = ticket1; amount = Tx_rollup_l2_qty.zero}]) ; match results with | [([_], Transaction_success)] -> @@ -938,7 +932,7 @@ let test_l1_transaction_partial () = withdrawals [ { - destination = pkh2; + claimer = pkh2; ticket_hash = ticket1; amount = Tx_rollup_l2_qty.of_int64_exn 5L; }; @@ -1393,12 +1387,12 @@ let test_apply_message_batch_withdrawals () = withdrawals [ { - destination = pkh2; + claimer = pkh2; ticket_hash = ticket1; amount = Tx_rollup_l2_qty.of_int64_exn 5L; }; { - destination = pkh1; + claimer = pkh1; ticket_hash = ticket2; amount = Tx_rollup_l2_qty.of_int64_exn 10L; }; diff --git a/src/proto_alpha/lib_protocol/ticket_hash_repr.ml b/src/proto_alpha/lib_protocol/ticket_hash_repr.ml index 36bb9b3c79cdea09977ce12000bf0332c405c2af..21c18691140415089203f9026c874c98861d4f2a 100644 --- a/src/proto_alpha/lib_protocol/ticket_hash_repr.ml +++ b/src/proto_alpha/lib_protocol/ticket_hash_repr.ml @@ -27,6 +27,8 @@ include Script_expr_hash let of_script_expr_hash t = t +let zero = zero + include Compare.Make (struct type nonrec t = t diff --git a/src/proto_alpha/lib_protocol/ticket_hash_repr.mli b/src/proto_alpha/lib_protocol/ticket_hash_repr.mli index 705d9e0d72dfa80ba826a314b09187fffc71ad01..fa3b36f3029c8290bb530c6726972f358fc881c4 100644 --- a/src/proto_alpha/lib_protocol/ticket_hash_repr.mli +++ b/src/proto_alpha/lib_protocol/ticket_hash_repr.mli @@ -54,6 +54,8 @@ val of_bytes_opt : bytes -> t option include Compare.S with type t := t +val zero : t + val of_script_expr_hash : Script_expr_hash.t -> t module Index : Storage_description.INDEX with type t = t diff --git a/src/proto_alpha/lib_protocol/ticket_operations_diff.ml b/src/proto_alpha/lib_protocol/ticket_operations_diff.ml index 6381cb0903d5483ed10869e8e139c46c81685b49..2654b6c83e2f5d4d84aebd021302ae2e913e29bc 100644 --- a/src/proto_alpha/lib_protocol/ticket_operations_diff.ml +++ b/src/proto_alpha/lib_protocol/ticket_operations_diff.ml @@ -272,6 +272,11 @@ let tickets_of_operation ctxt | Tx_rollup_finalize_commitment _ -> return (None, ctxt) | Tx_rollup_remove_commitment _ -> return (None, ctxt) | Tx_rollup_rejection _ -> return (None, ctxt) + (* TODO: #2488 + The ticket accounting for the recipient of rollup transactions + is currently done in the apply function, but should rather be + done in this module. *) + | Tx_rollup_withdraw _ -> return (None, ctxt) | Sc_rollup_originate _ -> return (None, ctxt) | Sc_rollup_add_messages _ -> return (None, ctxt) | Sc_rollup_cement _ -> return (None, ctxt) diff --git a/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.ml b/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.ml index c3cb8bdc7d9c111127f09860aecf546084fe6e0c..0ca14be2eeab6fa9f14a39a6b5e0c0d17b41db9c 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.ml +++ b/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.ml @@ -25,6 +25,40 @@ (* *) (*****************************************************************************) +module Message_result_hash = struct + let message_result_hash = + Tx_rollup_prefixes.message_result_hash.b58check_prefix + + module H = + Blake2B.Make + (Base58) + (struct + let name = "Message_result_hash" + + let title = "A message result" + + let b58check_prefix = message_result_hash + + let size = Some Tx_rollup_prefixes.message_result_hash.hash_size + end) + + include H + include Path_encoding.Make_hex (H) + + let () = + Tx_rollup_prefixes.(check_encoding message_result_hash b58check_encoding) +end + +let batch_commitment ctxt_root withdraw_merkle_root = + let withdraw_merkle_root_bytes = + Data_encoding.Binary.to_bytes_exn + Tx_rollup_withdraw_repr.withdrawals_merkle_root_encoding + withdraw_merkle_root + in + (* TODO/TORU: this needs to change with we use irmin *) + let ctxt_root_bytes = ctxt_root in + Message_result_hash.hash_bytes [ctxt_root_bytes; withdraw_merkle_root_bytes] + module Commitment_hash = struct let commitment_hash = Tx_rollup_prefixes.commitment_hash.b58check_prefix @@ -61,36 +95,9 @@ module Commitment_hash = struct () end -type batch_commitment = { - (* TODO: add effects and replace bytes with Irmin: - https://gitlab.com/tezos/tezos/-/issues/2444 - *) - root : bytes; -} - -module Batch = struct - type t = batch_commitment - - let encoding = - Data_encoding.( - conv (fun {root} -> root) (fun root -> {root}) (obj1 (req "root" bytes))) - - let pp : Format.formatter -> t -> unit = - fun fmt {root} -> Hex.pp fmt (Hex.of_bytes root) - - include Compare.Make (struct - type nonrec t = t - - let compare {root = root1} {root = root2} = Bytes.compare root1 root2 - end) -end - -let batch_commitment_equal : batch_commitment -> batch_commitment -> bool = - Batch.equal - type t = { level : Tx_rollup_level_repr.t; - batches : batch_commitment list; + batches : Message_result_hash.t list; predecessor : Commitment_hash.t option; inbox_hash : Tx_rollup_inbox_repr.hash; } @@ -100,7 +107,7 @@ let compare_or cmp c1 c2 f = match cmp c1 c2 with 0 -> f () | diff -> diff include Compare.Make (struct type nonrec t = t - module Compare_root_list = Compare.List (Batch) + module Compare_root_list = Compare.List (Message_result_hash) let compare r1 r2 = compare_or Tx_rollup_level_repr.compare r1.level r2.level (fun () -> @@ -120,7 +127,7 @@ let pp : Format.formatter -> t -> unit = "commitment %a : batches = %a predecessor %a for inbox %a" Tx_rollup_level_repr.pp t.level - (Format.pp_print_list Batch.pp) + (Format.pp_print_list Message_result_hash.pp) t.batches (Format.pp_print_option Commitment_hash.pp) t.predecessor @@ -139,7 +146,7 @@ let encoding = {level; batches; predecessor; inbox_hash}) (obj4 (req "level" Tx_rollup_level_repr.encoding) - (req "batches" (list Batch.encoding)) + (req "batches" (list Message_result_hash.encoding)) (req "predecessor" (option Commitment_hash.encoding)) (req "inbox_hash" Tx_rollup_inbox_repr.hash_encoding)) @@ -147,6 +154,18 @@ let hash c = let bytes = Data_encoding.Binary.to_bytes_exn encoding c in Commitment_hash.hash_bytes [bytes] +let check_batch_commitment : + t -> + context_hash:bytes -> + Tx_rollup_withdraw_repr.withdrawals_merkle_root -> + message_index:int -> + bool = + fun {batches; _} ~context_hash withdraw_merkle_root ~message_index -> + let computed = batch_commitment context_hash withdraw_merkle_root in + match List.nth batches message_index with + | Some expected -> Message_result_hash.(computed = expected) + | None -> false + module Index = struct type t = Commitment_hash.t diff --git a/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.mli b/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.mli index 81e141400b220c632d2537c222e66b4f1c339d0f..b08886dfaedba9a0cf577ffa578598a0f13a7998 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.mli +++ b/src/proto_alpha/lib_protocol/tx_rollup_commitment_repr.mli @@ -33,9 +33,19 @@ module Commitment_hash : sig include S.HASH end -type batch_commitment = {root : bytes} +(** The hash of the result of a layer-2 operation: that is, the hash + of [(l2_ctxt_hash ^ withdraw_hash)] where [l2_ctxt_hash] is the Merkle + tree root of the L2 context after any message (ie. deposit or batch), + and [withdraw_hash] is a [Tx_rollup_withdraw_repr.withdrawals_merkle_root] *) +module Message_result_hash : S.HASH -val batch_commitment_equal : batch_commitment -> batch_commitment -> bool +(** [batch_commitment context_hash withdraw_merkle_root] computes the + [Message_result_hash.t] of the given context hash and withdraw merkle + root, which is [hash(context_hash @ withdraw_merkle_root))]. *) +val batch_commitment : + bytes -> + Tx_rollup_withdraw_repr.withdrawals_merkle_root -> + Message_result_hash.t (** A commitment describes the interpretation of the messages stored in the inbox of a particular [level], on top of a particular layer-2 context. @@ -49,7 +59,7 @@ val batch_commitment_equal : batch_commitment -> batch_commitment -> bool empty tree. *) type t = { level : Tx_rollup_level_repr.t; - batches : batch_commitment list; + batches : Message_result_hash.t list; predecessor : Commitment_hash.t option; inbox_hash : Tx_rollup_inbox_repr.hash; } @@ -62,6 +72,17 @@ val encoding : t Data_encoding.t val hash : t -> Commitment_hash.t +(** [check_batch_commitment commitment context_hash withdraw_merkle_root n] + returns true if the message result hash of the [n]th batch in + [commitment] corresponds to [context_hash] and + [withdraw_merkle_root]. *) +val check_batch_commitment : + t -> + context_hash:bytes -> + Tx_rollup_withdraw_repr.withdrawals_merkle_root -> + message_index:int -> + bool + module Index : Storage_description.INDEX with type t = Commitment_hash.t module Submitted_commitment : sig diff --git a/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.ml b/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.ml index 36fab1c7fe6a0ed107514d367d161e5a8df0a6a6..c8cb69773885847c168566f4bc564020ddabfd35 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.ml +++ b/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.ml @@ -30,9 +30,6 @@ let just_ctxt (ctxt, _, _) = ctxt open Tx_rollup_commitment_repr open Tx_rollup_errors_repr -(* This indicates a programming error. *) -type error += (*`Temporary*) Commitment_bond_negative of int - let adjust_unfinalized_commitments_count ctxt tx_rollup pkh ~(dir : [`Incr | `Decr]) = let delta = match dir with `Incr -> 1 | `Decr -> -1 in @@ -85,21 +82,45 @@ let get : fun ctxt tx_rollup level -> find ctxt tx_rollup level >>=? fun (ctxt, commitment) -> match commitment with + (* TODO: why not use directly `.get` and get the default error for a missing key ? *) + | None -> fail @@ Tx_rollup_errors_repr.Commitment_does_not_exist level + | Some commitment -> return (ctxt, commitment) + +let get_finalized : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Tx_rollup_commitment_repr.Submitted_commitment.t) tzresult + Lwt.t = + fun ctxt tx_rollup level -> + Tx_rollup_state_storage.assert_exist ctxt tx_rollup >>=? fun ctxt -> + Storage.Tx_rollup.State.get ctxt tx_rollup >>=? fun (ctxt, state) -> + Tx_rollup_state_repr.finalized_commitments_range state >>?= fun window -> + (match window with + | Some (first, last) -> + error_unless + Tx_rollup_level_repr.(first <= level && level <= last) + (Tx_rollup_errors_repr.No_finalized_commitment_for_level {level; window}) + | None -> + error + (Tx_rollup_errors_repr.No_finalized_commitment_for_level {level; window})) + >>?= fun () -> + Storage.Tx_rollup.Commitment.find ctxt (level, tx_rollup) + >>=? fun (ctxt, commitment) -> + match commitment with | None -> fail @@ Tx_rollup_errors_repr.Commitment_does_not_exist level | Some commitment -> return (ctxt, commitment) -(* TODO: Lwt.t is only useful for [fail_when] *) let check_commitment_level state commitment = - Tx_rollup_state_repr.next_commitment_level state >>?= fun expected_level -> - fail_when + Tx_rollup_state_repr.next_commitment_level state >>? fun expected_level -> + error_when Tx_rollup_level_repr.(commitment.level < expected_level) (Level_already_has_commitment commitment.level) - >>=? fun () -> - fail_when + >>? fun () -> + error_when Tx_rollup_level_repr.(expected_level < commitment.level) (Commitment_too_early {provided = commitment.level; expected = expected_level}) - >>=? fun () -> return_unit (** [check_commitment_predecessor ctxt tx_rollup state commitment] will raise an error if the [predecessor] field of [commitment] is @@ -138,7 +159,7 @@ let add_commitment ctxt tx_rollup state pkh commitment = Too_many_finalized_commitments >>=? fun () -> (* Check the commitment has the correct values *) - check_commitment_level state commitment >>=? fun () -> + check_commitment_level state commitment >>?= fun () -> check_commitment_predecessor ctxt state commitment >>=? fun ctxt -> check_commitment_batches_and_inbox_hash ctxt tx_rollup commitment >>=? fun ctxt -> @@ -241,6 +262,12 @@ let remove_commitment ctxt rollup state = (* We remove the commitment *) Storage.Tx_rollup.Commitment.remove ctxt (tail, rollup) >>=? fun (ctxt, _freed_size, _existed) -> + let inbox_length = + (* safe because inbox cannot be more than int32 *) + Int32.of_int @@ List.length commitment.commitment.batches + in + Tx_rollup_withdraw_storage.remove ctxt rollup tail ~inbox_length + >>=? fun ctxt -> (* We update the state *) Tx_rollup_state_repr.record_commitment_deletion state diff --git a/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.mli b/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.mli index a2546e2a4f62bff98c0a8d85b9dec112a0bb476f..ed38ad654a57c34338ddc6d7c6e0886145b1750b 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.mli +++ b/src/proto_alpha/lib_protocol/tx_rollup_commitment_storage.mli @@ -31,7 +31,7 @@ (** [check_commitment_level state commitment] fails if [commitment] does not target the expected level. *) val check_commitment_level : - Tx_rollup_state_repr.t -> Tx_rollup_commitment_repr.t -> unit tzresult Lwt.t + Tx_rollup_state_repr.t -> Tx_rollup_commitment_repr.t -> unit tzresult (* FIXME: move in Tx_rollup_commitment_repr *) (** [add_commitment context tx_rollup contract commitment] adds a @@ -87,6 +87,17 @@ val get : (Raw_context.t * Tx_rollup_commitment_repr.Submitted_commitment.t) tzresult Lwt.t +(** [get_finalized context tx_rollup level] returns the + commitment for a level, if any exists and is finalized. If the rollup does not + exist, the error [Tx_rollup_does_not_exist] is returned. If the commitment + is not finalized the error [Tx_rollup_commitment_not_final] is returned *) +val get_finalized : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + (Raw_context.t * Tx_rollup_commitment_repr.Submitted_commitment.t) tzresult + Lwt.t + (** [pending_bonded_commitments ctxt tx_rollup contract] returns the number of commitments that [contract] has made that are still pending (that is, still subject to rejection). *) diff --git a/src/proto_alpha/lib_protocol/tx_rollup_errors_repr.ml b/src/proto_alpha/lib_protocol/tx_rollup_errors_repr.ml index 8e668f9fff79eea0e8ad762e5e0adfed3b8152d9..f76297e0d58cd6a8af3ff100e911d13b2a6ceea6 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_errors_repr.ml +++ b/src/proto_alpha/lib_protocol/tx_rollup_errors_repr.ml @@ -61,6 +61,13 @@ type error += length : int; } | Wrong_message_hash + | No_finalized_commitment_for_level of { + level : Tx_rollup_level_repr.t; + window : (Tx_rollup_level_repr.t * Tx_rollup_level_repr.t) option; + } + | Withdraw_invalid_path + | Withdraw_already_consumed + | Commitment_bond_negative of int let () = let open Data_encoding in @@ -373,4 +380,84 @@ let () = stored one" unit (function Wrong_message_hash -> Some () | _ -> None) - (fun () -> Wrong_message_hash) + (fun () -> Wrong_message_hash) ; + (* No_finalized_commitment_for_level *) + register_error_kind + `Temporary + ~id:"operation.tx_rollup_no_finalized_commitment_for_level" + ~title:"Operation is about a commitment that is not yet finalized" + ~description:"This operation must be about a finalized commitment" + ~pp:(fun ppf (level, window) -> + match window with + | Some (first, last) -> + Format.fprintf + ppf + "This operation is only allowed on finalized and existing \ + commitments, but its level %a is not in the existing and \ + finalized window of commitments: [%a; %a]." + Tx_rollup_level_repr.pp + level + Tx_rollup_level_repr.pp + first + Tx_rollup_level_repr.pp + last + | None -> + Format.fprintf + ppf + "This operation was about level %a but no finalized commitment \ + exists yet." + Tx_rollup_level_repr.pp + level) + Data_encoding.( + obj2 + (req "received" Tx_rollup_level_repr.encoding) + (req + "commitment_head_level" + (option + (tup2 Tx_rollup_level_repr.encoding Tx_rollup_level_repr.encoding)))) + (function + | No_finalized_commitment_for_level {level; window} -> Some (level, window) + | _ -> None) + (fun (level, window) -> No_finalized_commitment_for_level {level; window}) ; + register_error_kind + `Branch + ~id:"tx_rollup_withdraw_invalid_path" + ~title:"The validation path submitted for a withdrawal is invalid" + ~description: + "The validation path submitted for a withdrawal is not valid for the \ + given withdrawal and message index" + empty + (function Withdraw_invalid_path -> Some () | _ -> None) + (fun () -> Withdraw_invalid_path) ; + register_error_kind + `Temporary + ~id:"operation.withdraw_already_consumed" + ~title:"withdraw already consumed" + ~description:"The submitted withdraw has already been consumed" + ~pp:(fun ppf () -> + Format.fprintf + ppf + "The submitted withdraw exists but it has already been consumed \ + earlier.") + Data_encoding.unit + (function Withdraw_already_consumed -> Some () | _ -> None) + (fun () -> Withdraw_already_consumed) ; + register_error_kind + `Permanent + ~id:"tx_rollup_commitment_bond_negative" + ~title: + "The number of commitments associated with an implicit account is \ + negative" + ~description: + "A negative number of commitment is associated with an implicit account \ + and its associated bound. This error is internal and should never \ + happen." + ~pp:(fun ppf count -> + Format.fprintf + ppf + "The number of commitments %d associated with this implicit account is \ + negative" + count) + (obj1 (req "count" Data_encoding.int31)) + (function Commitment_bond_negative count -> Some count | _ -> None) + (fun count -> Commitment_bond_negative count) diff --git a/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.ml b/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.ml index 9e0959b4ed698a73055399fdabe08589928f8beb..5795dbf1a080c82c312850717c64cf26845635f9 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.ml +++ b/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.ml @@ -182,24 +182,6 @@ let encoding_indexes : indexes Data_encoding.t = Tx_rollup_l2_context_sig.Ticket_indexable.index_encoding)) module Message_result = struct - type withdrawal = { - destination : Signature.Public_key_hash.t; - ticket_hash : Ticket_hash.t; - amount : Tx_rollup_l2_qty.t; - } - - let withdrawal_encoding : withdrawal Data_encoding.t = - let open Data_encoding in - conv - (fun {destination; ticket_hash; amount} -> - (destination, ticket_hash, amount)) - (fun (destination, ticket_hash, amount) -> - {destination; ticket_hash; amount}) - (obj3 - (req "destination" Signature.Public_key_hash.encoding) - (req "ticket_hash" Ticket_hash.encoding) - (req "amount" Tx_rollup_l2_qty.encoding)) - type transaction_result = | Transaction_success | Transaction_failure of {index : int; reason : error} @@ -303,10 +285,11 @@ module Message_result = struct (fun result -> Batch_V1_result result)); ] - type t = message_result * withdrawal list + type t = message_result * Tx_rollup_withdraw.t list let encoding = - Data_encoding.(tup2 message_result_encoding (list withdrawal_encoding)) + Data_encoding.( + tup2 message_result_encoding (list Tx_rollup_withdraw.encoding)) end module Make (Context : CONTEXT) = struct @@ -587,7 +570,7 @@ module Make (Context : CONTEXT) = struct indexes -> Signer_indexable.index -> 'content operation_content -> - (ctxt * indexes * withdrawal option) m = + (ctxt * indexes * Tx_rollup_withdraw.withdrawal option) m = fun ctxt indexes source_idx {destination; ticket_hash; qty} -> match destination with | Layer1 l1_dest -> @@ -609,7 +592,9 @@ module Make (Context : CONTEXT) = struct (* spend the ticket -- this is responsible for checking that the source has the required balance *) let* ctxt = Ticket_ledger.spend ctxt tidx source_idx qty in - let withdrawal = {destination = l1_dest; ticket_hash; amount = qty} in + let withdrawal = + Tx_rollup_withdraw.{claimer = l1_dest; ticket_hash; amount = qty} + in return (ctxt, indexes, Some withdrawal) | Layer2 l2_dest -> let* (ctxt, created_addr, dest_idx) = address_index ctxt l2_dest in @@ -642,7 +627,7 @@ module Make (Context : CONTEXT) = struct ctxt -> indexes -> (Indexable.index_only, Indexable.unknown) operation -> - (ctxt * indexes * withdrawal list) m = + (ctxt * indexes * Tx_rollup_withdraw.withdrawal list) m = fun ctxt indexes {signer; counter; contents} -> (* Before applying any operation, we check the counter *) let* () = check_counter ctxt signer counter in @@ -668,7 +653,11 @@ module Make (Context : CONTEXT) = struct ctxt -> indexes -> (Indexable.index_only, Indexable.unknown) transaction -> - (ctxt * indexes * transaction_result * withdrawal list) m = + (ctxt + * indexes + * transaction_result + * Tx_rollup_withdraw.withdrawal list) + m = fun initial_ctxt initial_indexes transaction -> let rec fold (ctxt, prev_indexes, withdrawals) index ops = match ops with @@ -712,7 +701,8 @@ module Make (Context : CONTEXT) = struct let apply_batch : ctxt -> (Indexable.unknown, Indexable.unknown) t -> - (ctxt * Message_result.Batch_V1.t * withdrawal list) m = + (ctxt * Message_result.Batch_V1.t * Tx_rollup_withdraw.withdrawal list) + m = fun ctxt batch -> let* (ctxt, indexes, batch) = check_signature ctxt batch in let {contents; _} = batch in @@ -741,7 +731,7 @@ module Make (Context : CONTEXT) = struct let apply_deposit : ctxt -> Tx_rollup_message.deposit -> - (ctxt * deposit_result * withdrawal option) m = + (ctxt * deposit_result * Tx_rollup_withdraw.withdrawal option) m = fun initial_ctxt Tx_rollup_message.{sender; destination; ticket_hash; amount} -> let apply_deposit () = let* (ctxt, created_addr, aidx) = @@ -763,7 +753,9 @@ module Make (Context : CONTEXT) = struct (* Should there be an error during the deposit, then return the full [amount] to [sender] in the form of a withdrawal. *) - let withdrawal = {destination = sender; ticket_hash; amount} in + let withdrawal = + Tx_rollup_withdraw.{claimer = sender; ticket_hash; amount} + in return (initial_ctxt, Deposit_failure reason, Some withdrawal)) let apply_message : ctxt -> Tx_rollup_message.t -> (ctxt * Message_result.t) m diff --git a/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.mli b/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.mli index 4b58afd7f1f898bd551c86dbaa40e9bad07a7b5d..e05d7e7bd0cf0297731e71a957acd9ecd2d5a1a4 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.mli +++ b/src/proto_alpha/lib_protocol/tx_rollup_l2_apply.mli @@ -80,12 +80,6 @@ type indexes = { } module Message_result : sig - type withdrawal = { - destination : Signature.Public_key_hash.t; - ticket_hash : Ticket_hash.t; - amount : Tx_rollup_l2_qty.t; - } - (** A transaction inside a batch can either be a success or a failure. In the case of a failure, we store the operation's index which failed @@ -120,7 +114,7 @@ module Message_result : sig (* In addition to [message_result] the result contains the list of withdrawals that result from failing deposits and layer2-to-layer1 transfers. *) - type t = message_result * withdrawal list + type t = message_result * Tx_rollup_withdraw.withdrawal list val encoding : t Data_encoding.t end @@ -155,7 +149,7 @@ module Make (Context : CONTEXT) : sig val apply_batch : ctxt -> (Indexable.unknown, Indexable.unknown) t -> - (ctxt * Message_result.Batch_V1.t * Message_result.withdrawal list) m + (ctxt * Message_result.Batch_V1.t * Tx_rollup_withdraw.withdrawal list) m (** [check_signature ctxt batch] asserts that [batch] is correctly signed. @@ -202,7 +196,10 @@ module Make (Context : CONTEXT) : sig val apply_deposit : ctxt -> Tx_rollup_message.deposit -> - (ctxt * Message_result.deposit_result * Message_result.withdrawal option) m + (ctxt + * Message_result.deposit_result + * Tx_rollup_withdraw.withdrawal option) + m (** [apply_message ctxt message] interpets the [message] in the [ctxt]. diff --git a/src/proto_alpha/lib_protocol/tx_rollup_message_repr.mli b/src/proto_alpha/lib_protocol/tx_rollup_message_repr.mli index daf43b3ed6407b89286916425ac671d97acb6be6..289b3c5dff1de3b52102393a65bc84256ab692d1 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_message_repr.mli +++ b/src/proto_alpha/lib_protocol/tx_rollup_message_repr.mli @@ -59,6 +59,8 @@ type t = Batch of string | Deposit of deposit inbox by [msg]. *) val size : t -> int +val deposit_encoding : deposit Data_encoding.t + val encoding : t Data_encoding.t val pp : Format.formatter -> t -> unit diff --git a/src/proto_alpha/lib_protocol/tx_rollup_prefixes.ml b/src/proto_alpha/lib_protocol/tx_rollup_prefixes.ml index 5806b9a6811816267fc5b5655d3a1d4ba370b341..6586032562842f2b72c7866b07241cbc57c47f71 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_prefixes.ml +++ b/src/proto_alpha/lib_protocol/tx_rollup_prefixes.ml @@ -70,5 +70,21 @@ let commitment_hash = b58check_size = 53; } +let message_result_hash = + { + b58check_prefix = "\018\007\206\087"; + prefix = "txmr"; + hash_size = 32; + b58check_size = 54; + } + +let withdraw_list_hash = + { + b58check_prefix = "\079\150\072"; + prefix = "txw"; + hash_size = 32; + b58check_size = 53; + } + let check_encoding {prefix; b58check_size; _} encoding = Base58.check_encoded_prefix encoding prefix b58check_size diff --git a/src/proto_alpha/lib_protocol/tx_rollup_prefixes.mli b/src/proto_alpha/lib_protocol/tx_rollup_prefixes.mli index e2648fbe11360645e3a493185568cd0b79622547..1a07e3695d7de3506c6820362c39bb6c5a46006b 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_prefixes.mli +++ b/src/proto_alpha/lib_protocol/tx_rollup_prefixes.mli @@ -45,6 +45,12 @@ val message_hash : t (** See {!Tx_rollup_commitment_repr}. *) val commitment_hash : t +(** See {!Tx_rollup_commitment_repr}. *) +val message_result_hash : t + +(** See {!Tx_rollup_withdraw_repr}. *) +val withdraw_list_hash : t + (** [check_encoding spec encoding] checks that [encoding] satisfies [spec]. Raises an exception otherwise. *) val check_encoding : t -> 'a Base58.encoding -> unit diff --git a/src/proto_alpha/lib_protocol/tx_rollup_state_repr.ml b/src/proto_alpha/lib_protocol/tx_rollup_state_repr.ml index a2154fc7287e510749ffe9c67fd66c1ffa6b2115..cf2cb6ae41932ffc3c0146a0492392ce4aaee0d5 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_state_repr.ml +++ b/src/proto_alpha/lib_protocol/tx_rollup_state_repr.ml @@ -463,6 +463,23 @@ let burn_cost ~limit state size = error (Submit_batch_burn_excedeed {burn; limit}) | _ -> ok burn +let finalized_commitments_range state = + if Compare.Int.(0 < finalized_commitments_count state) then + match (state.commitment_tail_level, state.oldest_inbox_level) with + | (Some commitment_tail, Some oldest_inbox) -> ( + match Tx_rollup_level_repr.pred oldest_inbox with + | Some res -> ok (Some (commitment_tail, res)) + | None -> + error + (Internal_error + "oldest inbox has no predecessor, but commitments have been \ + finalized")) + | (_, _) -> + error + (Internal_error + "unreachable code per definition of [finalized_commitments_count]") + else ok None + module Internal_for_tests = struct let make : ?burn_per_byte:Tez_repr.t -> diff --git a/src/proto_alpha/lib_protocol/tx_rollup_state_repr.mli b/src/proto_alpha/lib_protocol/tx_rollup_state_repr.mli index edbb669de24672439b8f76a5fbbb854cea8fadde..65a97b68760ec5968bfeb438a83252ef29826afd 100644 --- a/src/proto_alpha/lib_protocol/tx_rollup_state_repr.mli +++ b/src/proto_alpha/lib_protocol/tx_rollup_state_repr.mli @@ -161,6 +161,14 @@ val record_commitment_deletion : Tx_rollup_commitment_repr.Commitment_hash.t -> t tzresult +(** [finalized_commitments_range state] returns the window of finalized + commitments that have not yet been cleaned out + + This function returns an [Internal_error] if the state is inconsistent, + which should not be possible. *) +val finalized_commitments_range : + t -> (Tx_rollup_level_repr.t * Tx_rollup_level_repr.t) option tzresult + module Internal_for_tests : sig (** [make] returns a state for tests *) val make : diff --git a/src/proto_alpha/lib_protocol/tx_rollup_withdraw_repr.ml b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_repr.ml new file mode 100644 index 0000000000000000000000000000000000000000..1c68f64600ff6e8ddaeb617eabbd2db4938d93ed --- /dev/null +++ b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_repr.ml @@ -0,0 +1,178 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold *) +(* Copyright (c) 2022 Nomadic Labs *) +(* Copyright (c) 2022 Oxhead Alpha *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type withdrawal = { + claimer : Signature.Public_key_hash.t; + ticket_hash : Ticket_hash_repr.t; + amount : Tx_rollup_l2_qty.t; +} + +type t = withdrawal + +let encoding : withdrawal Data_encoding.t = + let open Data_encoding in + conv + (fun {claimer; ticket_hash; amount} -> (claimer, ticket_hash, amount)) + (fun (claimer, ticket_hash, amount) -> {claimer; ticket_hash; amount}) + (obj3 + (req "claimer" Signature.Public_key_hash.encoding) + (req "ticket_hash" Ticket_hash_repr.encoding) + (req "amount" Tx_rollup_l2_qty.encoding)) + +module Withdraw_list_hash = struct + let withdraw_list_hash = Tx_rollup_prefixes.withdraw_list_hash.b58check_prefix + + include + Blake2B.Make_merkle_tree + (Base58) + (struct + let name = "Withdraw_list_hash" + + let title = "A hash of withdraw's list" + + let b58check_prefix = withdraw_list_hash + + let size = Some Tx_rollup_prefixes.withdraw_list_hash.hash_size + end) + (struct + type t = withdrawal + + let to_bytes = Data_encoding.Binary.to_bytes_exn encoding + end) + + let () = + Tx_rollup_prefixes.(check_encoding withdraw_list_hash b58check_encoding) +end + +type withdrawals_merkle_root = Withdraw_list_hash.t + +let withdrawals_merkle_root_encoding = Withdraw_list_hash.encoding + +type merkle_tree_path = Withdraw_list_hash.path + +let merkle_tree_path_encoding = Withdraw_list_hash.path_encoding + +let merkelize_list : t list -> withdrawals_merkle_root = + Withdraw_list_hash.compute + +let compute_path : t list -> int -> merkle_tree_path = + Withdraw_list_hash.compute_path + +let check_path : merkle_tree_path -> t -> withdrawals_merkle_root * int = + Withdraw_list_hash.check_path + +type error += Negative_withdrawal_index of int | Too_big_withdrawal_index of int + +let () = + let open Data_encoding in + register_error_kind + `Permanent + ~id:"tx_rollup_negative_withdrawal_index" + ~title:"The withdrawal index must be non-negative" + ~description:"The withdrawal index must be non-negative" + (obj1 (req "withdraw_index" int31)) + (function Negative_withdrawal_index i -> Some i | _ -> None) + (fun i -> Negative_withdrawal_index i) ; + register_error_kind + `Permanent + ~id:"tx_rollup_invalid_withdrawal_argument" + ~title:"The withdrawal index must be less than 64" + ~description:"The withdrawal index must be less than 64" + (obj1 (req "withdraw_index" int31)) + (function Too_big_withdrawal_index i -> Some i | _ -> None) + (fun i -> Too_big_withdrawal_index i) + +module Withdrawal_accounting = struct + (** Internally, the withdrawal accounting is implemented through a + list of [int64], encoding an "infinite" bitvector [bitv], so that, intuitively: + + bitv[[ofs]] = 1 <-> [ofs]th withdrawal is consumed. + + where [bitv[[ofs]]] is the [ofs % 64]th bit of the [ofs/64]th element of [bitv]. + *) + type t = int64 list + + let empty = [] + + let encoding = Data_encoding.(list int64) + + let error_when_negative ofs = + error_when Compare.Int.(ofs < 0) (Negative_withdrawal_index ofs) + + let error_when_out_of_bound ofs = + error_when_negative ofs >>? fun () -> + error_when Compare.Int.(ofs > 63) (Too_big_withdrawal_index ofs) + + (** [int64_get i ofs] returns [true] if the [ofs]th bit of [i] is + [1]. Fails if [ofs] is negative or larger than 63. *) + let int64_get (i : int64) (ofs : int) = + error_when_out_of_bound ofs >>? fun () -> + let open Int64 in + let i = shift_right_logical i ofs in + let i = logand i one in + ok @@ equal i one + + (** [int64_set i ofs] sets the [ofs]th bit of [i] to [1]. + Fails if [ofs] is negative or larger than 63. *) + let int64_set (i : int64) (ofs : int) = + error_when_out_of_bound ofs >>? fun () -> + let open Int64 in + ok @@ logor i (shift_left one ofs) + + (** [get bitv ofs] returns true if the [ofs]th bit of the + concatenation of the bitvector [bitv] is [1]. + + More precisely, it returns true if the [ofs % 64]th bit of the + [ofs/64]th element of [bitv] is [1]. + + Fails if [ofs] is negative. *) + let get (bitv : t) (ofs : int) = + error_when_negative ofs >>? fun () -> + match List.nth_opt bitv (ofs / 64) with + | Some i -> int64_get i (ofs mod 64) + | None -> ok false + + (** [set bitv ofs] sets the [ofs]th bit in the concatenation of the + bitvector [bitv] to [1]. + + More precisely, it sets the [ofs % 64]th bit of the [ofs/64]th + element of [bitv] to [1]. If [bitv] has less than + [ofs/64] elements, than [bitv] is right-padded with empty + elements ([0L]) until it reaches [ofs/64] elements. + + Fails if [ofs] is negative. *) + let rec set (bitv : t) (ofs : int) = + error_when_negative ofs >>? fun () -> + if Compare.Int.(ofs < 64) then + match bitv with + | [] -> int64_set Int64.zero ofs >|? fun i -> [i] + | i :: bitv' -> int64_set i ofs >|? fun i -> i :: bitv' + else + match bitv with + | [] -> set [] (ofs - 64) >|? fun i -> Int64.zero :: i + | i :: bitv' -> set bitv' (ofs - 64) >|? fun bitv' -> i :: bitv' +end diff --git a/src/proto_alpha/lib_protocol/tx_rollup_withdraw_repr.mli b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_repr.mli new file mode 100644 index 0000000000000000000000000000000000000000..44a67572ffef0cc5bb76586c6d21126f1ec92f0a --- /dev/null +++ b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_repr.mli @@ -0,0 +1,99 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold *) +(* Copyright (c) 2022 Nomadic Labs *) +(* Copyright (c) 2022 Oxhead Alpha *) +(* *) +(* 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. *) +(* *) +(*****************************************************************************) + +(** A [withdrawal] gives right to a L1 address [claimer] to + retrieve the quantity [amount] of a ticket whose hash is [ticket_hash]. + Withdrawals result from layer-2-to-layer-1 transfers, and from + failed layer-2 deposits.*) +type withdrawal = { + claimer : Signature.Public_key_hash.t; + ticket_hash : Ticket_hash_repr.t; + amount : Tx_rollup_l2_qty.t; +} + +type t = withdrawal + +val encoding : t Data_encoding.t + +(** A [withdrawals_merkle_root] is the hash of a list of withdrawals (as returned by + [Tx_rollup_l2_apply.apply_message]), stored in commitments and used + to validate the executions of withdrawals. + + Internally [withdrawals_merkle_root] is the root element of + a merkle tree whose leaves are [withdrawal] hashes. +*) +type withdrawals_merkle_root + +val withdrawals_merkle_root_encoding : withdrawals_merkle_root Data_encoding.t + +(** A [merkle_tree_path] is the minimal information needed to + recompute a [withdrawals_merkle_root] without having all + withdrawals. + + Internally [merkle_tree_path] is the merkle tree path of sub-tree + hash of a [withdrawals_merkle_root] *) +type merkle_tree_path + +val merkle_tree_path_encoding : merkle_tree_path Data_encoding.t + +(** [merkelize_list withdrawal_list] merkelizes [withdrawal_list] into + a full binary tree and returns the [withdrawals_merkle_root] of + that tree. *) +val merkelize_list : t list -> withdrawals_merkle_root + +(** [compute_path withdrawal_list index] computes the + [merkle_tree_path] in the tree given by [merkelize_list + withdrawal_list] of the [index]th element of the + [withdrawal_list]. *) +val compute_path : t list -> int -> merkle_tree_path + +(** [check_path merkle_tree_path withdrawal] returns the + [withdrawals_merkle_root] computed for [withdrawal] and the index + on the list. *) +val check_path : merkle_tree_path -> t -> withdrawals_merkle_root * int + +(** [Withdrawal_accounting] provides an interface for the storage to + account for which withdrawals (as identified by their index) have + been consumed. *) +module Withdrawal_accounting : sig + type t + + val encoding : t Data_encoding.t + + (** The state of withdrawal accounting where no + withdrawals have been consumed. *) + val empty : t + + (** [get l index] returns [true] if the withdrawal identified by + [index] has been been consumed (as registered through + {!Withdrawal_accounting.set}). Fails when [index] is negative. *) + val get : t -> int -> bool tzresult + + (** [set l index] registers that the withdrawal identified by + [index] has been consumed. Fails when [index] is negative. *) + val set : t -> int -> t tzresult +end diff --git a/src/proto_alpha/lib_protocol/tx_rollup_withdraw_storage.ml b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_storage.ml new file mode 100644 index 0000000000000000000000000000000000000000..110594e3c05b4968dba2a7d2deb1303f55263c20 --- /dev/null +++ b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_storage.ml @@ -0,0 +1,92 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold *) +(* Copyright (c) 2022 Nomadic Labs *) +(* Copyright (c) 2022 Oxhead Alpha *) +(* *) +(* 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. *) +(* *) +(*****************************************************************************) +open Tx_rollup_withdraw_repr + +let add : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + message_index:int -> + withdraw_index:int -> + Raw_context.t tzresult Lwt.t = + fun ctxt tx_rollup commitment_lvl ~message_index ~withdraw_index -> + Storage.Tx_rollup.Consumed_withdraw.find + ((ctxt, commitment_lvl), tx_rollup) + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2627 + + inbox length is in int32 replace message_index by int32 *) + (Int32.of_int message_index) + >>=? fun (ctxt, consumed_withdraw_opt) -> + Withdrawal_accounting.set + (Option.value ~default:Withdrawal_accounting.empty consumed_withdraw_opt) + withdraw_index + >>?= fun consumed_withdraw -> + Storage.Tx_rollup.Consumed_withdraw.add + ((ctxt, commitment_lvl), tx_rollup) + (Int32.of_int message_index) + consumed_withdraw + >|=? fun (ctxt, _new_size, _is_new) -> ctxt + +let mem : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + message_index:int -> + withdraw_index:int -> + (bool * Raw_context.t) tzresult Lwt.t = + fun ctxt tx_rollup commitment_lvl ~message_index ~withdraw_index -> + Storage.Tx_rollup.Consumed_withdraw.find + ((ctxt, commitment_lvl), tx_rollup) + (* TODO/TORU: https://gitlab.com/tezos/tezos/-/issues/2627 + + inbox length is in int32 replace message_index by int32 *) + (Int32.of_int message_index) + >>=? fun (ctxt, consumed_withdraw_opt) -> + Option.map_e + (fun s -> Withdrawal_accounting.get s withdraw_index) + consumed_withdraw_opt + >>?= fun consumed_withdraw_opt -> + let already_consumed = Option.value ~default:false consumed_withdraw_opt in + return (already_consumed, ctxt) + +let remove : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + inbox_length:int32 -> + Raw_context.t tzresult Lwt.t = + fun ctxt rollup level ~inbox_length -> + let rec remove_withdrawal_accounting ctxt i len = + if Compare.Int32.(i < len) then + Storage.Tx_rollup.Consumed_withdraw.remove ((ctxt, level), rollup) i + >>=? fun (ctxt, _, _) -> + remove_withdrawal_accounting ctxt (Int32.succ i) len + else return ctxt + in + (* for each message in the inbox, the storage contains one set of + executed withdrawals that should be removed *) + remove_withdrawal_accounting ctxt 0l inbox_length diff --git a/src/proto_alpha/lib_protocol/tx_rollup_withdraw_storage.mli b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_storage.mli new file mode 100644 index 0000000000000000000000000000000000000000..4fa98771a21ebb3568889dba959ecb6aa2390a7e --- /dev/null +++ b/src/proto_alpha/lib_protocol/tx_rollup_withdraw_storage.mli @@ -0,0 +1,61 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold *) +(* Copyright (c) 2022 Nomadic Labs *) +(* Copyright (c) 2022 Oxhead Alpha *) +(* *) +(* 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. *) +(* *) +(*****************************************************************************) + +(** [add ctxt tx_rollup lvl message_index withdraw_index] adds + [withdraw_index] to the list of already consumed withdrawawals for + [tx_rollup] at [lvl] for the message_result at [message_index]. *) +val add : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + message_index:int -> + withdraw_index:int -> + Raw_context.t tzresult Lwt.t + +(** [mem ctxt tx_rollup lvl message_index withdraw_index] checks if + [withdraw_index] has already been consumed for [tx_rollup] at [lvl] for the + message_result at [message_index]. This function consumes gas + and so returns a new context. *) +val mem : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + message_index:int -> + withdraw_index:int -> + (bool * Raw_context.t) tzresult Lwt.t + +(** [remove ctxt tx_rollup lvl] removes all withdrawal accounting for + [tx_rollup] at [lvl]. This must not be called before the + corresponding commitment is deleted. Otherwise, it would be + possible to retrieve the same withdrawal multiple times. This + function consumes gas and so returns a new context. *) +val remove : + Raw_context.t -> + Tx_rollup_repr.t -> + Tx_rollup_level_repr.t -> + inbox_length:int32 -> + Raw_context.t tzresult Lwt.t diff --git a/tezt/_regressions/rpc/alpha.client.mempool.out b/tezt/_regressions/rpc/alpha.client.mempool.out index bdc5ae0a9b1852be562f793219c1340e8ee1dc81..4b88ec55a5f912e46c52ac2a2467040080521303 100644 --- a/tezt/_regressions/rpc/alpha.client.mempool.out +++ b/tezt/_regressions/rpc/alpha.client.mempool.out @@ -651,6 +651,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "An Ed25519 public key hash (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Message_result_hash": { + "title": "A message result (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "Operation_hash": { "title": "A Tezos operation ID (Base58Check-encoded)", "$ref": "#/definitions/unistring" @@ -683,6 +687,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "The hash of a BLS public key used to identify a L2 ticket holders (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Withdraw_list_hash": { + "title": "A hash of withdraw's list (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "alpha.block_header.alpha.full_header": { "title": "Shell header", "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", @@ -757,6 +765,11 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' ], "additionalProperties": false }, + "alpha.contract_id": { + "title": "A contract handle", + "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", + "$ref": "#/definitions/unistring" + }, "alpha.entrypoint": { "title": "entrypoint", "description": "Named entrypoint to a Michelson smart contract", @@ -1925,17 +1938,7 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "batches": { "type": "array", "items": { - "type": "object", - "properties": { - "root": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "root" - ], - "additionalProperties": false + "$ref": "#/definitions/Message_result_hash" } }, "predecessor": { @@ -2281,13 +2284,13 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "additionalProperties": false }, { - "title": "Sc_rollup_originate", + "title": "Tx_rollup_withdraw", "type": "object", "properties": { "kind": { "type": "string", "enum": [ - "sc_rollup_originate" + "tx_rollup_withdraw" ] }, "source": { @@ -2305,20 +2308,322 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "storage_limit": { "$ref": "#/definitions/positive_bignum" }, - "kind": { + "tx_rollup": { + "$ref": "#/definitions/alpha.tx_rollup_id" + }, + "level": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "context_hash": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + }, + "message_index": { + "type": "integer", + "minimum": -1073741824, + "maximum": 1073741823 + }, + "withdraw_path": { "oneOf": [ { - "title": "Example_arith smart contract rollup kind" + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" } ] }, - "boot_sector": { + "ticket_contents": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] + }, + "ticket_ty": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] + }, + "ticket_ticketer": { + "$ref": "#/definitions/alpha.contract_id" + }, + "ticket_amount": { + "oneOf": [ + { + "title": "small", + "description": "An int64 which fits within a uint8", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 255 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "medium", + "description": "An int64 which fits within a uint16", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "biggish", + "description": "An int64 which fits within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "bigger", + "description": "An int64 which doesn't fit within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "$ref": "#/definitions/int64" + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + } + ] + }, + "destination": { + "$ref": "#/definitions/alpha.contract_id" + }, + "entrypoint": { "$ref": "#/definitions/unistring" } }, "required": [ - "boot_sector", - "kind", + "entrypoint", + "destination", + "ticket_amount", + "ticket_ticketer", + "ticket_ty", + "ticket_contents", + "withdraw_path", + "message_index", + "context_hash", + "level", + "tx_rollup", "storage_limit", "gas_limit", "counter", @@ -2329,13 +2634,13 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "additionalProperties": false }, { - "title": "Sc_rollup_add_messages", + "title": "Sc_rollup_originate", "type": "object", "properties": { "kind": { "type": "string", "enum": [ - "sc_rollup_add_messages" + "sc_rollup_originate" ] }, "source": { @@ -2353,7 +2658,55 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "storage_limit": { "$ref": "#/definitions/positive_bignum" }, - "rollup": { + "kind": { + "oneOf": [ + { + "title": "Example_arith smart contract rollup kind" + } + ] + }, + "boot_sector": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "boot_sector", + "kind", + "storage_limit", + "gas_limit", + "counter", + "fee", + "source", + "kind" + ], + "additionalProperties": false + }, + { + "title": "Sc_rollup_add_messages", + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "sc_rollup_add_messages" + ] + }, + "source": { + "$ref": "#/definitions/Signature.Public_key_hash" + }, + "fee": { + "$ref": "#/definitions/alpha.mutez" + }, + "counter": { + "$ref": "#/definitions/positive_bignum" + }, + "gas_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "storage_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "rollup": { "$ref": "#/definitions/alpha.rollup_address" }, "message": { @@ -2711,6 +3064,47 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' } ] }, + "path": { + "oneOf": [ + { + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" + } + ] + }, "positive_bignum": { "title": "Positive big number", "description": "Decimal representation of a positive big number", @@ -2782,110 +3176,139 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "fields": [ { "description": { - "title": "X_1" + "title": "X_0" }, "encoding": { "fields": [ + { + "name": "hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "branch", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 2, + "size": "Uint30" + }, + { + "name": "contents", + "layout": { + "layout": { + "name": "alpha.operation.alpha.contents", + "kind": "Ref" + }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 64, + "kind": "Float" + }, + "kind": "named" + }, { "kind": "dyn", + "name": "error_opt", "num_fields": 1, "size": "Uint30" }, { + "name": "error", "layout": { "kind": "String" }, - "kind": "anon", "data_kind": { "kind": "Variable" - } + }, + "kind": "named" } ] } }, { "description": { - "title": "X_2" + "title": "alpha.operation.alpha.contents" }, "encoding": { - "tag_size": "Uint16", + "tag_size": "Uint8", "kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "cases": [ { - "tag": 0, + "tag": 1, "fields": [ { "name": "Tag", "layout": { - "size": "Uint16", + "size": "Uint8", "kind": "Int" }, "data_kind": { - "size": 2, + "size": 1, "kind": "Float" }, "kind": "named" }, { + "name": "level", "layout": { - "kind": "Zero_width" - }, - "kind": "anon", - "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "Example_arith smart contract rollup kind" - } - ] - } - }, - { - "description": { - "title": "X_4" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 0, - "fields": [ - { - "name": "Tag", - "layout": { - "size": "Uint8", + "size": "Int32", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { + "name": "nonce", "layout": { - "size": "Uint8", - "kind": "Int" + "kind": "Bytes" }, - "kind": "anon", "data_kind": { - "size": 1, + "size": 32, "kind": "Float" - } + }, + "kind": "named" } ], - "name": "case 0" + "name": "Seed_nonce_revelation" }, { - "tag": 1, + "tag": 2, "fields": [ { "name": "Tag", @@ -2900,47 +3323,39 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "layout": { - "size": "Uint16", - "kind": "Int" - }, - "kind": "anon", - "data_kind": { - "size": 2, - "kind": "Float" - } - } - ], - "name": "case 1" - }, - { - "tag": 2, - "fields": [ + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, { - "name": "Tag", + "name": "op1", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "alpha.inlined.endorsement", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Variable" }, "kind": "named" }, { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "op2", "layout": { - "size": "Int32", - "kind": "Int" + "name": "alpha.inlined.endorsement", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 4, - "kind": "Float" - } + "kind": "Variable" + }, + "kind": "named" } ], - "name": "case 2" + "name": "Double_endorsement_evidence" }, { "tag": 3, @@ -2958,88 +3373,42 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "bh1", "layout": { - "size": "Int64", - "kind": "Int" + "name": "alpha.block_header.alpha.full_header", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 8, - "kind": "Float" - } + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "bh2", + "layout": { + "name": "alpha.block_header.alpha.full_header", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" } ], - "name": "case 3" - } - ] - } - }, - { - "description": { - "title": "X_3" - }, - "encoding": { - "fields": [ - { - "name": "sender", - "layout": { - "name": "public_key_hash", - "kind": "Ref" - }, - "data_kind": { - "size": 21, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "destination", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 20, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "ticket_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" + "name": "Double_baking_evidence" }, { - "name": "amount", - "layout": { - "name": "X_4", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "X_5" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 0, + "tag": 4, "fields": [ { "name": "Tag", @@ -3054,25 +3423,32 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "pkh", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 20, + "kind": "Float" + }, + "kind": "named" }, { - "name": "batch", + "name": "secret", "layout": { - "kind": "String" + "kind": "Bytes" }, "data_kind": { - "kind": "Variable" + "size": 20, + "kind": "Float" }, "kind": "named" } ], - "name": "Batch" + "name": "Activate_account" }, { - "tag": 1, + "tag": 5, "fields": [ { "name": "Tag", @@ -3087,34 +3463,52 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "deposit", + "name": "source", "layout": { - "name": "X_3", + "name": "public_key_hash", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 21, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "period", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "proposals", + "layout": { + "layout": { + "kind": "Bytes" + }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" }, "kind": "named" } ], - "name": "Deposit" - } - ] - } - }, - { - "description": { - "title": "X_8" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ + "name": "Proposals" + }, { - "tag": 0, + "tag": 6, "fields": [ { "name": "Tag", @@ -3129,20 +3523,57 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "name": "source", "layout": { - "kind": "Zero_width" + "name": "public_key_hash", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 0, + "size": 21, "kind": "Float" - } + }, + "kind": "named" + }, + { + "name": "period", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "proposal", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "ballot", + "layout": { + "size": "Int8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" } ], - "name": "None" + "name": "Ballot" }, { - "tag": 1, + "tag": 7, "fields": [ { "name": "Tag", @@ -3157,136 +3588,42 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Commitment_hash", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "op1", "layout": { - "kind": "Bytes" + "name": "alpha.inlined.preendorsement", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Variable" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "op2", + "layout": { + "name": "alpha.inlined.preendorsement", + "kind": "Ref" + }, + "data_kind": { + "kind": "Variable" }, "kind": "named" } ], - "name": "Some" - } - ] - } - }, - { - "description": { - "title": "X_6" - }, - "encoding": { - "fields": [ - { - "name": "level", - "layout": { - "size": "Int32", - "kind": "Int" - }, - "data_kind": { - "size": 4, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "batches", - "layout": { - "layout": { - "name": "fitness.elem", - "kind": "Ref" - }, - "kind": "Seq" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "name": "predecessor", - "layout": { - "name": "X_8", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, - { - "name": "inbox_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.scripted.contracts" - }, - "encoding": { - "fields": [ - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "code", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "Double_preendorsement_evidence" }, { - "name": "storage", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.transaction_destination" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 22, - "kind": "Float" - }, - "cases": [ - { - "tag": 0, + "tag": 17, "fields": [ { "name": "Tag", @@ -3301,22 +3638,25 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Signature.Public_key_hash", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "arbitrary", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Variable" }, "kind": "named" } ], - "name": "Implicit" + "name": "Failing_noop" }, { - "tag": 1, + "tag": 20, "fields": [ { "name": "Tag", @@ -3331,85 +3671,57 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Contract_hash", + "name": "slot", "layout": { - "kind": "Bytes" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "size": 20, + "size": 2, "kind": "Float" }, "kind": "named" }, { - "name": "padding", - "layout": { - "kind": "Padding" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - } - ], - "name": "Originated" - }, - { - "tag": 2, - "fields": [ - { - "name": "Tag", + "name": "level", "layout": { - "size": "Uint8", + "size": "Int32", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "Rollup_hash", + "name": "round", "layout": { - "kind": "Bytes" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "size": 20, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "padding", + "name": "block_payload_hash", "layout": { - "kind": "Padding" + "kind": "Bytes" }, "data_kind": { - "size": 1, + "size": 32, "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup" - } - ] - } - }, - { - "description": { - "title": "alpha.entrypoint" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ + "name": "Preendorsement" + }, { - "tag": 0, + "tag": 21, "fields": [ { "name": "Tag", @@ -3424,76 +3736,57 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "name": "slot", "layout": { - "kind": "Zero_width" - }, - "kind": "anon", - "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "default" - }, - { - "tag": 1, - "fields": [ - { - "name": "Tag", - "layout": { - "size": "Uint8", + "size": "Uint16", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 2, "kind": "Float" }, "kind": "named" }, { + "name": "level", "layout": { - "kind": "Zero_width" + "size": "Int32", + "kind": "Int" }, - "kind": "anon", "data_kind": { - "size": 0, + "size": 4, "kind": "Float" - } - } - ], - "name": "root" - }, - { - "tag": 2, - "fields": [ + }, + "kind": "named" + }, { - "name": "Tag", + "name": "round", "layout": { - "size": "Uint8", + "size": "Int32", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { + "name": "block_payload_hash", "layout": { - "kind": "Zero_width" + "kind": "Bytes" }, - "kind": "anon", "data_kind": { - "size": 0, + "size": 32, "kind": "Float" - } + }, + "kind": "named" } ], - "name": "do" + "name": "Endorsement" }, { - "tag": 3, + "tag": 107, "fields": [ { "name": "Tag", @@ -3508,177 +3801,77 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "name": "source", "layout": { - "kind": "Zero_width" + "name": "public_key_hash", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "set_delegate" - }, - { - "tag": 4, - "fields": [ - { - "name": "Tag", - "layout": { - "size": "Uint8", - "kind": "Int" - }, - "data_kind": { - "size": 1, + "size": 21, "kind": "Float" }, "kind": "named" }, { + "name": "fee", "layout": { - "kind": "Zero_width" + "name": "N.t", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "remove_delegate" - }, - { - "tag": 255, - "fields": [ + "kind": "Dynamic" + }, + "kind": "named" + }, { - "name": "Tag", + "name": "counter", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint8" - }, - { + "name": "gas_limit", "layout": { - "kind": "String" + "name": "N.t", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "kind": "Variable" - } - } - ], - "name": "named" - } - ] - } - }, - { - "description": { - "title": "X_9" - }, - "encoding": { - "fields": [ - { - "name": "entrypoint", - "layout": { - "name": "alpha.entrypoint", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "value", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "N.t", - "description": "A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order." - }, - "encoding": { - "fields": [ - { - "name": "N.t", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "public_key" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 0, - "fields": [ + "kind": "Dynamic" + }, + "kind": "named" + }, { - "name": "Tag", + "name": "storage_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "Ed25519.Public_key", + "name": "public_key", "layout": { - "kind": "Bytes" + "name": "public_key", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Ed25519" + "name": "Reveal" }, { - "tag": 1, + "tag": 108, "fields": [ { "name": "Tag", @@ -3693,185 +3886,104 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Secp256k1.Public_key", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 33, + "size": 21, "kind": "Float" }, "kind": "named" - } - ], - "name": "Secp256k1" - }, - { - "tag": 2, - "fields": [ + }, { - "name": "Tag", + "name": "fee", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "P256.Public_key", + "name": "counter", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 33, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "P256" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.preendorsement.contents" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 43, - "kind": "Float" - }, - "cases": [ - { - "tag": 20, - "fields": [ + }, { - "name": "Tag", + "name": "gas_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "slot", + "name": "storage_limit", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "level", + "name": "amount", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "destination", "layout": { - "size": "Int32", - "kind": "Int" + "name": "alpha.transaction_destination", + "kind": "Ref" }, "data_kind": { - "size": 4, + "size": 22, "kind": "Float" }, "kind": "named" }, { - "name": "block_payload_hash", + "kind": "option_indicator", + "name": "parameters" + }, + { + "name": "parameters", "layout": { - "kind": "Bytes" + "name": "X_12", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Preendorsement" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.preendorsement" - }, - "encoding": { - "fields": [ - { - "name": "branch", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "operations", - "layout": { - "name": "alpha.inlined.preendorsement.contents", - "kind": "Ref" - }, - "data_kind": { - "size": 43, - "kind": "Float" - }, - "kind": "named" + "name": "Transaction" }, { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "public_key_hash" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 21, - "kind": "Float" - }, - "cases": [ - { - "tag": 0, + "tag": 109, "fields": [ { "name": "Tag", @@ -3886,21 +3998,104 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Ed25519.Public_key_hash", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "fee", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "balance", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "kind": "option_indicator", + "name": "delegate" + }, + { + "name": "delegate", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, "kind": "Float" }, "kind": "named" + }, + { + "name": "script", + "layout": { + "name": "alpha.scripted.contracts", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" } ], - "name": "Ed25519" + "name": "Origination" }, { - "tag": 1, + "tag": 110, "fields": [ { "name": "Tag", @@ -3915,21 +4110,82 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Secp256k1.Public_key_hash", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "fee", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "kind": "option_indicator", + "name": "delegate" + }, + { + "name": "delegate", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, "kind": "Float" }, "kind": "named" } ], - "name": "Secp256k1" + "name": "Delegation" }, { - "tag": 2, + "tag": 111, "fields": [ { "name": "Tag", @@ -3944,360 +4200,81 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "P256.Public_key_hash", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, "kind": "Float" }, "kind": "named" - } - ], - "name": "P256" - } - ] - } - }, - { - "description": { - "title": "fitness.elem" - }, - "encoding": { - "fields": [ - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "layout": { - "kind": "Bytes" - }, - "kind": "anon", - "data_kind": { - "kind": "Variable" - } - } - ] - } - }, - { - "description": { - "title": "alpha.block_header.alpha.full_header" - }, - "encoding": { - "fields": [ - { - "name": "level", - "layout": { - "size": "Int32", - "kind": "Int" - }, - "data_kind": { - "size": 4, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "proto", - "layout": { - "size": "Uint8", - "kind": "Int" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "predecessor", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "timestamp", - "layout": { - "size": "Int64", - "kind": "Int" - }, - "data_kind": { - "size": 8, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "validation_pass", - "layout": { - "size": "Uint8", - "kind": "Int" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "operations_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "name": "fitness", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "fitness", - "layout": { - "layout": { - "name": "fitness.elem", - "kind": "Ref" }, - "kind": "Seq" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "name": "context", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "payload_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "payload_round", - "layout": { - "size": "Int32", - "kind": "Int" - }, - "data_kind": { - "size": 4, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "proof_of_work_nonce", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 8, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "option_indicator", - "name": "seed_nonce_hash" - }, - { - "name": "seed_nonce_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "liquidity_baking_toggle_vote", - "layout": { - "size": "Int8", - "kind": "Int" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 64, - "kind": "Float" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.endorsement_mempool.contents" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 43, - "kind": "Float" - }, - "cases": [ - { - "tag": 21, - "fields": [ { - "name": "Tag", + "name": "fee", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "slot", + "name": "counter", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "level", + "name": "gas_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "storage_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "block_payload_hash", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "value", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Variable" }, "kind": "named" } ], - "name": "Endorsement" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.endorsement" - }, - "encoding": { - "fields": [ - { - "name": "branch", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "operations", - "layout": { - "name": "alpha.inlined.endorsement_mempool.contents", - "kind": "Ref" - }, - "data_kind": { - "size": 43, - "kind": "Float" - }, - "kind": "named" + "name": "Register_global_constant" }, { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.operation.alpha.contents" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 1, + "tag": 112, "fields": [ { "name": "Tag", @@ -4312,83 +4289,81 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "level", + "name": "source", "layout": { - "size": "Int32", - "kind": "Int" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 4, + "size": 21, "kind": "Float" }, "kind": "named" }, { - "name": "nonce", + "name": "fee", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "Seed_nonce_revelation" - }, - { - "tag": 2, - "fields": [ + }, { - "name": "Tag", + "name": "counter", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "name": "op1", + "name": "storage_limit", "layout": { - "name": "alpha.inlined.endorsement", + "name": "N.t", "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "kind": "option_indicator", + "name": "limit" }, { - "name": "op2", + "name": "limit", "layout": { - "name": "alpha.inlined.endorsement", + "name": "N.t", "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Double_endorsement_evidence" + "name": "Set_deposits_limit" }, { - "tag": 3, + "tag": 150, "fields": [ { "name": "Tag", @@ -4403,14 +4378,21 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "source", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, + "kind": "Float" + }, + "kind": "named" }, { - "name": "bh1", + "name": "fee", "layout": { - "name": "alpha.block_header.alpha.full_header", + "name": "N.t", "kind": "Ref" }, "data_kind": { @@ -4419,14 +4401,31 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "name": "bh2", + "name": "gas_limit", "layout": { - "name": "alpha.block_header.alpha.full_header", + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", "kind": "Ref" }, "data_kind": { @@ -4435,10 +4434,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" } ], - "name": "Double_baking_evidence" + "name": "Tx_rollup_origination" }, { - "tag": 4, + "tag": 151, "fields": [ { "name": "Tag", @@ -4453,65 +4452,68 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "pkh", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, "kind": "Float" }, "kind": "named" }, { - "name": "secret", + "name": "fee", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 20, - "kind": "Float" + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "Activate_account" - }, - { - "tag": 5, - "fields": [ + }, { - "name": "Tag", + "name": "gas_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "source", + "name": "storage_limit", "layout": { - "name": "public_key_hash", + "name": "N.t", "kind": "Ref" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "period", + "name": "rollup", "layout": { - "size": "Int32", - "kind": "Int" + "kind": "Bytes" }, "data_kind": { - "size": 4, + "size": 20, "kind": "Float" }, "kind": "named" @@ -4522,23 +4524,35 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "size": "Uint30" }, { - "name": "proposals", + "name": "content", "layout": { - "layout": { - "kind": "Bytes" - }, - "kind": "Seq" + "kind": "Bytes" }, "data_kind": { "kind": "Variable" }, "kind": "named" + }, + { + "kind": "option_indicator", + "name": "burn_limit" + }, + { + "name": "burn_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" } ], - "name": "Proposals" + "name": "Tx_rollup_submit_batch" }, { - "tag": 6, + "tag": 152, "fields": [ { "name": "Tag", @@ -4565,95 +4579,76 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "period", + "name": "fee", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "proposal", + "name": "counter", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "ballot", + "name": "gas_limit", "layout": { - "size": "Int8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "Ballot" - }, - { - "tag": 7, - "fields": [ + }, { - "name": "Tag", + "name": "storage_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "op1", + "name": "rollup", "layout": { - "name": "alpha.inlined.preendorsement", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Variable" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "op2", + "name": "commitment", "layout": { - "name": "alpha.inlined.preendorsement", + "name": "X_10", "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Double_preendorsement_evidence" + "name": "Tx_rollup_commit" }, { - "tag": 17, + "tag": 153, "fields": [ { "name": "Tag", @@ -4668,90 +4663,77 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "arbitrary", + "name": "source", "layout": { - "kind": "String" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "size": 21, + "kind": "Float" }, "kind": "named" - } - ], - "name": "Failing_noop" - }, - { - "tag": 20, - "fields": [ + }, { - "name": "Tag", + "name": "fee", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "slot", + "name": "counter", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "level", + "name": "gas_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "storage_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "block_payload_hash", + "name": "rollup", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 32, + "size": 20, "kind": "Float" }, "kind": "named" } ], - "name": "Preendorsement" + "name": "Tx_rollup_return_bond" }, { - "tag": 21, + "tag": 154, "fields": [ { "name": "Tag", @@ -4766,57 +4748,77 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "slot", + "name": "source", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 2, + "size": 21, "kind": "Float" }, "kind": "named" }, { - "name": "level", + "name": "fee", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "counter", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "block_payload_hash", + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "rollup", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 32, + "size": 20, "kind": "Float" }, "kind": "named" } ], - "name": "Endorsement" + "name": "Tx_rollup_finalize_commitment" }, { - "tag": 107, + "tag": 155, "fields": [ { "name": "Tag", @@ -4887,21 +4889,21 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "public_key", + "name": "rollup", "layout": { - "name": "public_key", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" } ], - "name": "Reveal" + "name": "Tx_rollup_remove_commitment" }, { - "tag": 108, + "tag": 156, "fields": [ { "name": "Tag", @@ -4972,48 +4974,66 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "amount", + "name": "rollup", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "name": "destination", + "name": "level", "layout": { - "name": "alpha.transaction_destination", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "size": 22, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "parameters" + "name": "message", + "layout": { + "name": "X_9", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "name": "parameters", + "name": "message_position", "layout": { - "name": "X_9", + "name": "N.t", "kind": "Ref" }, "data_kind": { "kind": "Dynamic" }, "kind": "named" + }, + { + "name": "proof", + "layout": { + "kind": "Bool" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" } ], - "name": "Transaction" + "name": "Tx_rollup_rejection" }, { - "tag": 109, + "tag": 157, "fields": [ { "name": "Tag", @@ -5084,99 +5104,113 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "balance", + "name": "tx_rollup", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "delegate" - }, - { - "name": "delegate", + "name": "level", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "size": 21, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "script", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "context_hash", "layout": { - "name": "alpha.scripted.contracts", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" }, "kind": "named" - } - ], - "name": "Origination" - }, - { - "tag": 110, - "fields": [ + }, { - "name": "Tag", + "name": "message_index", "layout": { - "size": "Uint8", - "kind": "Int" + "min": -1073741824, + "max": 1073741823, + "kind": "RangedInt" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "source", + "name": "withdraw_path", "layout": { - "name": "public_key_hash", + "name": "path", "kind": "Ref" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "fee", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "ticket_contents", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" }, "kind": "named" }, { - "name": "counter", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "ticket_ty", "layout": { - "name": "N.t", + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "ticket_ticketer", + "layout": { + "name": "alpha.contract_id", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 22, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "ticket_amount", "layout": { - "name": "N.t", + "name": "X_8", "kind": "Ref" }, "data_kind": { @@ -5185,37 +5219,37 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "storage_limit", + "name": "destination", "layout": { - "name": "N.t", + "name": "alpha.contract_id", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 22, + "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "delegate" + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" }, { - "name": "delegate", + "name": "entrypoint", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Variable" }, "kind": "named" } ], - "name": "Delegation" + "name": "Tx_rollup_withdraw" }, { - "tag": 111, + "tag": 200, "fields": [ { "name": "Tag", @@ -5285,15 +5319,27 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' }, "kind": "named" }, + { + "name": "kind", + "layout": { + "name": "X_2", + "kind": "Ref" + }, + "data_kind": { + "size": 2, + "kind": "Float" + }, + "kind": "named" + }, { "kind": "dyn", "num_fields": 1, "size": "Uint30" }, { - "name": "value", + "name": "boot_sector", "layout": { - "kind": "Bytes" + "kind": "String" }, "data_kind": { "kind": "Variable" @@ -5301,10 +5347,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" } ], - "name": "Register_global_constant" + "name": "Sc_rollup_originate" }, { - "tag": 112, + "tag": 201, "fields": [ { "name": "Tag", @@ -5375,25 +5421,45 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "option_indicator", - "name": "limit" + "kind": "dyn", + "name": "alpha.rollup_address", + "num_fields": 1, + "size": "Uint30" }, { - "name": "limit", + "name": "rollup", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "message", + "layout": { + "layout": { + "name": "X_1", + "kind": "Ref" + }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" }, "kind": "named" } ], - "name": "Set_deposits_limit" + "name": "Sc_rollup_add_messages" }, { - "tag": 150, + "tag": 202, "fields": [ { "name": "Tag", @@ -5462,12 +5528,95 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "Dynamic" }, "kind": "named" + }, + { + "kind": "dyn", + "name": "alpha.rollup_address", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "rollup", + "layout": { + "kind": "String" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "commitment", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" } ], - "name": "Tx_rollup_origination" + "name": "Sc_rollup_cement" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.endorsement" + }, + "encoding": { + "fields": [ + { + "name": "branch", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "operations", + "layout": { + "name": "alpha.inlined.endorsement_mempool.contents", + "kind": "Ref" + }, + "data_kind": { + "size": 43, + "kind": "Float" + }, + "kind": "named" }, { - "tag": 151, + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.endorsement_mempool.contents" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 43, + "kind": "Float" + }, + "cases": [ + { + "tag": 21, "fields": [ { "name": "Tag", @@ -5482,63 +5631,291 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "slot", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "size": 21, + "size": 2, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "name": "level", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", + "name": "round", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "block_payload_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 32, + "kind": "Float" }, "kind": "named" + } + ], + "name": "Endorsement" + } + ] + } + }, + { + "description": { + "title": "alpha.block_header.alpha.full_header" + }, + "encoding": { + "fields": [ + { + "name": "level", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "proto", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "predecessor", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "timestamp", + "layout": { + "size": "Int64", + "kind": "Int" + }, + "data_kind": { + "size": 8, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "validation_pass", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "operations_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "name": "fitness", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "fitness", + "layout": { + "layout": { + "name": "fitness.elem", + "kind": "Ref" }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "context", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "payload_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "payload_round", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "proof_of_work_nonce", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 8, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "option_indicator", + "name": "seed_nonce_hash" + }, + { + "name": "seed_nonce_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "liquidity_baking_toggle_vote", + "layout": { + "size": "Int8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 64, + "kind": "Float" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "fitness.elem" + }, + "encoding": { + "fields": [ + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "layout": { + "kind": "Bytes" + }, + "kind": "anon", + "data_kind": { + "kind": "Variable" + } + } + ] + } + }, + { + "description": { + "title": "public_key_hash" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 21, + "kind": "Float" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "storage_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "Ed25519.Public_key_hash", "layout": { "kind": "Bytes" }, @@ -5547,42 +5924,41 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "Float" }, "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, + } + ], + "name": "Ed25519" + }, + { + "tag": 1, + "fields": [ { - "name": "content", + "name": "Tag", "layout": { - "kind": "Bytes" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Variable" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "burn_limit" - }, - { - "name": "burn_limit", + "name": "Secp256k1.Public_key_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup_submit_batch" + "name": "Secp256k1" }, { - "tag": 152, + "tag": 2, "fields": [ { "name": "Tag", @@ -5597,88 +5973,155 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "P256.Public_key_hash", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 20, "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "P256" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.preendorsement" + }, + "encoding": { + "fields": [ + { + "name": "branch", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "operations", + "layout": { + "name": "alpha.inlined.preendorsement.contents", + "kind": "Ref" + }, + "data_kind": { + "size": 43, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.preendorsement.contents" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 43, + "kind": "Float" + }, + "cases": [ + { + "tag": 20, + "fields": [ { - "name": "fee", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", + "name": "slot", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 2, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "level", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", + "name": "round", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "block_payload_hash", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 20, + "size": 32, "kind": "Float" }, "kind": "named" - }, - { - "name": "commitment", - "layout": { - "name": "X_6", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" } ], - "name": "Tx_rollup_commit" - }, + "name": "Preendorsement" + } + ] + } + }, + { + "description": { + "title": "public_key" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ { - "tag": 153, + "tag": 0, "fields": [ { "name": "Tag", @@ -5693,77 +6136,147 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "Ed25519.Public_key", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 32, "kind": "Float" }, "kind": "named" - }, - { - "name": "fee", - "layout": { - "name": "N.t", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + } + ], + "name": "Ed25519" + }, + { + "tag": 1, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "Secp256k1.Public_key", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 33, + "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "Secp256k1" + }, + { + "tag": 2, + "fields": [ { - "name": "storage_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "P256.Public_key", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 20, + "size": 33, "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup_return_bond" + "name": "P256" + } + ] + } + }, + { + "description": { + "title": "N.t", + "description": "A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order." + }, + "encoding": { + "fields": [ + { + "name": "N.t", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_12" + }, + "encoding": { + "fields": [ + { + "name": "entrypoint", + "layout": { + "name": "alpha.entrypoint", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "tag": 154, + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "value", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.entrypoint" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, "fields": [ { "name": "Tag", @@ -5778,77 +6291,104 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 21, + "size": 0, "kind": "Float" - }, - "kind": "named" - }, + } + } + ], + "name": "default" + }, + { + "tag": 1, + "fields": [ { - "name": "fee", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 0, + "kind": "Float" + } + } + ], + "name": "root" + }, + { + "tag": 2, + "fields": [ { - "name": "gas_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" + "size": 0, + "kind": "Float" + } + } + ], + "name": "do" + }, + { + "tag": 3, + "fields": [ + { + "name": "Tag", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", "layout": { - "kind": "Bytes" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 20, + "size": 0, "kind": "Float" - }, - "kind": "named" + } } ], - "name": "Tx_rollup_finalize_commitment" + "name": "set_delegate" }, { - "tag": 155, + "tag": 4, "fields": [ { "name": "Tag", @@ -5863,77 +6403,136 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 21, + "size": 0, + "kind": "Float" + } + } + ], + "name": "remove_delegate" + }, + { + "tag": 255, + "fields": [ + { + "name": "Tag", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "kind": "dyn", + "num_fields": 1, + "size": "Uint8" + }, + { + "layout": { + "kind": "String" + }, + "kind": "anon", + "data_kind": { + "kind": "Variable" + } + } + ], + "name": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.transaction_destination" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 22, + "kind": "Float" + }, + "cases": [ + { + "tag": 0, + "fields": [ + { + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", + "name": "Signature.Public_key_hash", "layout": { - "name": "N.t", + "name": "public_key_hash", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 21, + "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "Implicit" + }, + { + "tag": 1, + "fields": [ { - "name": "gas_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", + "name": "Contract_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "padding", "layout": { - "kind": "Bytes" + "kind": "Padding" }, "data_kind": { - "size": 20, + "size": 1, "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup_remove_commitment" + "name": "Originated" }, { - "tag": 156, + "tag": 2, "fields": [ { "name": "Tag", @@ -5948,122 +6547,344 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "Rollup_hash", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 20, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "name": "padding", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Padding" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" + } + ], + "name": "Tx_rollup" + } + ] + } + }, + { + "description": { + "title": "alpha.scripted.contracts" + }, + "encoding": { + "fields": [ + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "code", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "storage", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_10" + }, + "encoding": { + "fields": [ + { + "name": "level", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "batches", + "layout": { + "layout": { + "kind": "Bytes" }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "predecessor", + "layout": { + "name": "X_11", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "inbox_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_11" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 0, + "kind": "Float" + } + } + ], + "name": "None" + }, + { + "tag": 1, + "fields": [ { - "name": "storage_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "Commitment_hash", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 20, + "size": 32, "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "Some" + } + ] + } + }, + { + "description": { + "title": "X_9" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "level", + "name": "Tag", "layout": { - "size": "Int32", + "size": "Uint8", "kind": "Int" }, "data_kind": { - "size": 4, + "size": 1, "kind": "Float" }, "kind": "named" }, { - "name": "message", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "batch", "layout": { - "name": "X_5", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" }, "kind": "named" - }, + } + ], + "name": "Batch" + }, + { + "tag": 1, + "fields": [ { - "name": "message_position", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "proof", + "name": "deposit", "layout": { - "kind": "Bool" + "name": "X_7", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Tx_rollup_rejection" + "name": "Deposit" + } + ] + } + }, + { + "description": { + "title": "X_7" + }, + "encoding": { + "fields": [ + { + "name": "sender", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, + "kind": "Float" + }, + "kind": "named" }, { - "tag": 200, + "name": "destination", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 20, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "ticket_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "amount", + "layout": { + "name": "X_8", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_8" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, "fields": [ { "name": "Tag", @@ -6078,93 +6899,122 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "size": 21, + "size": 1, "kind": "Float" - }, - "kind": "named" - }, + } + } + ], + "name": "case 0" + }, + { + "tag": 1, + "fields": [ { - "name": "fee", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint16", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 2, + "kind": "Float" + } + } + ], + "name": "case 1" + }, + { + "tag": 2, + "fields": [ { - "name": "gas_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 4, + "kind": "Float" + } + } + ], + "name": "case 2" + }, + { + "tag": 3, + "fields": [ { - "name": "kind", + "name": "Tag", "layout": { - "name": "X_2", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "size": 2, + "size": 1, "kind": "Float" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "boot_sector", "layout": { - "kind": "String" + "size": "Int64", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "kind": "Variable" - }, - "kind": "named" + "size": 8, + "kind": "Float" + } } ], - "name": "Sc_rollup_originate" - }, + "name": "case 3" + } + ] + } + }, + { + "description": { + "title": "alpha.contract_id" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 22, + "kind": "Float" + }, + "cases": [ { - "tag": 201, + "tag": 0, "fields": [ { "name": "Tag", @@ -6179,7 +7029,7 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "Signature.Public_key_hash", "layout": { "name": "public_key_hash", "kind": "Ref" @@ -6189,91 +7039,93 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "Float" }, "kind": "named" - }, - { - "name": "fee", - "layout": { - "name": "N.t", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + } + ], + "name": "Implicit" + }, + { + "tag": 1, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "Contract_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", + "name": "padding", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Padding" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" - }, - { - "kind": "dyn", - "name": "alpha.rollup_address", - "num_fields": 1, - "size": "Uint30" - }, + } + ], + "name": "Originated" + } + ] + } + }, + { + "description": { + "title": "path" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "rollup", + "name": "Tag", "layout": { - "kind": "String" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Variable" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "message", "layout": { - "layout": { - "name": "X_1", - "kind": "Ref" - }, - "kind": "Seq" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Variable" - }, - "kind": "named" + "size": 0, + "kind": "Float" + } } ], - "name": "Sc_rollup_add_messages" + "name": "Op" }, { - "tag": 202, + "tag": 15, "fields": [ { "name": "Tag", @@ -6288,43 +7140,49 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "left", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 32, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "name": "path", "layout": { - "name": "N.t", + "name": "path", "kind": "Ref" }, "data_kind": { "kind": "Dynamic" }, "kind": "named" - }, + } + ], + "name": "Right" + }, + { + "tag": 240, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "path", "layout": { - "name": "N.t", + "name": "path", "kind": "Ref" }, "data_kind": { @@ -6333,127 +7191,83 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "storage_limit", + "name": "right", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 32, + "kind": "Float" }, "kind": "named" - }, - { - "kind": "dyn", - "name": "alpha.rollup_address", - "num_fields": 1, - "size": "Uint30" - }, + } + ], + "name": "Left" + } + ] + } + }, + { + "description": { + "title": "X_2" + }, + "encoding": { + "tag_size": "Uint16", + "kind": { + "size": 2, + "kind": "Float" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "rollup", + "name": "Tag", "layout": { - "kind": "String" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "kind": "Variable" + "size": 2, + "kind": "Float" }, "kind": "named" }, { - "name": "commitment", "layout": { - "kind": "Bytes" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 32, + "size": 0, "kind": "Float" - }, - "kind": "named" + } } ], - "name": "Sc_rollup_cement" + "name": "Example_arith smart contract rollup kind" } ] } }, { "description": { - "title": "X_0" + "title": "X_1" }, "encoding": { "fields": [ - { - "name": "hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "branch", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 2, - "size": "Uint30" - }, - { - "name": "contents", - "layout": { - "layout": { - "name": "alpha.operation.alpha.contents", - "kind": "Ref" - }, - "kind": "Seq" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 64, - "kind": "Float" - }, - "kind": "named" - }, { "kind": "dyn", - "name": "error_opt", "num_fields": 1, "size": "Uint30" }, { - "name": "error", "layout": { "kind": "String" }, + "kind": "anon", "data_kind": { "kind": "Variable" - }, - "kind": "named" + } } ] } @@ -7082,6 +7896,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "An Ed25519 public key hash (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Message_result_hash": { + "title": "A message result (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "Operation_hash": { "title": "A Tezos operation ID (Base58Check-encoded)", "$ref": "#/definitions/unistring" @@ -7114,6 +7932,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "The hash of a BLS public key used to identify a L2 ticket holders (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Withdraw_list_hash": { + "title": "A hash of withdraw's list (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "alpha.block_header.alpha.full_header": { "title": "Shell header", "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", @@ -7188,6 +8010,11 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' ], "additionalProperties": false }, + "alpha.contract_id": { + "title": "A contract handle", + "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", + "$ref": "#/definitions/unistring" + }, "alpha.entrypoint": { "title": "entrypoint", "description": "Named entrypoint to a Michelson smart contract", @@ -8356,17 +9183,7 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "batches": { "type": "array", "items": { - "type": "object", - "properties": { - "root": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "root" - ], - "additionalProperties": false + "$ref": "#/definitions/Message_result_hash" } }, "predecessor": { @@ -8493,7 +9310,47 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": { "type": "string", "enum": [ - "tx_rollup_remove_commitment" + "tx_rollup_remove_commitment" + ] + }, + "source": { + "$ref": "#/definitions/Signature.Public_key_hash" + }, + "fee": { + "$ref": "#/definitions/alpha.mutez" + }, + "counter": { + "$ref": "#/definitions/positive_bignum" + }, + "gas_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "storage_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "rollup": { + "$ref": "#/definitions/alpha.tx_rollup_id" + } + }, + "required": [ + "rollup", + "storage_limit", + "gas_limit", + "counter", + "fee", + "source", + "kind" + ], + "additionalProperties": false + }, + { + "title": "Tx_rollup_rejection", + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "tx_rollup_rejection" ] }, "source": { @@ -8513,9 +9370,154 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' }, "rollup": { "$ref": "#/definitions/alpha.tx_rollup_id" + }, + "level": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "message": { + "oneOf": [ + { + "title": "Batch", + "type": "object", + "properties": { + "batch": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "batch" + ], + "additionalProperties": false + }, + { + "title": "Deposit", + "type": "object", + "properties": { + "deposit": { + "type": "object", + "properties": { + "sender": { + "$ref": "#/definitions/Signature.Public_key_hash" + }, + "destination": { + "$ref": "#/definitions/Tx_rollup_l2_address" + }, + "ticket_hash": { + "$ref": "#/definitions/script_expr" + }, + "amount": { + "oneOf": [ + { + "title": "small", + "description": "An int64 which fits within a uint8", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 255 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "medium", + "description": "An int64 which fits within a uint16", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "biggish", + "description": "An int64 which fits within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "bigger", + "description": "An int64 which doesn't fit within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "$ref": "#/definitions/int64" + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "amount", + "ticket_hash", + "destination", + "sender" + ], + "additionalProperties": false + } + }, + "required": [ + "deposit" + ], + "additionalProperties": false + } + ] + }, + "message_position": { + "$ref": "#/definitions/positive_bignum" + }, + "proof": { + "type": "boolean" } }, "required": [ + "proof", + "message_position", + "message", + "level", "rollup", "storage_limit", "gas_limit", @@ -8527,13 +9529,13 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "additionalProperties": false }, { - "title": "Tx_rollup_rejection", + "title": "Tx_rollup_withdraw", "type": "object", "properties": { "kind": { "type": "string", "enum": [ - "tx_rollup_rejection" + "tx_rollup_withdraw" ] }, "source": { @@ -8551,157 +9553,322 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "storage_limit": { "$ref": "#/definitions/positive_bignum" }, - "rollup": { - "$ref": "#/definitions/alpha.tx_rollup_id" + "tx_rollup": { + "$ref": "#/definitions/alpha.tx_rollup_id" + }, + "level": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "context_hash": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + }, + "message_index": { + "type": "integer", + "minimum": -1073741824, + "maximum": 1073741823 + }, + "withdraw_path": { + "oneOf": [ + { + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" + } + ] + }, + "ticket_contents": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] + }, + "ticket_ty": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 + "ticket_ticketer": { + "$ref": "#/definitions/alpha.contract_id" }, - "message": { + "ticket_amount": { "oneOf": [ { - "title": "Batch", + "title": "small", + "description": "An int64 which fits within a uint8", "type": "object", "properties": { - "batch": { + "kind": { "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 255 } }, "required": [ - "batch" + "value", + "kind" ], "additionalProperties": false }, { - "title": "Deposit", + "title": "medium", + "description": "An int64 which fits within a uint16", "type": "object", "properties": { - "deposit": { - "type": "object", - "properties": { - "sender": { - "$ref": "#/definitions/Signature.Public_key_hash" - }, - "destination": { - "$ref": "#/definitions/Tx_rollup_l2_address" - }, - "ticket_hash": { - "$ref": "#/definitions/script_expr" - }, - "amount": { - "oneOf": [ - { - "title": "small", - "description": "An int64 which fits within a uint8", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "type": "integer", - "minimum": 0, - "maximum": 255 - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - }, - { - "title": "medium", - "description": "An int64 which fits within a uint16", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - }, - { - "title": "biggish", - "description": "An int64 which fits within a uint32", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - }, - { - "title": "bigger", - "description": "An int64 which doesn't fit within a uint32", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "$ref": "#/definitions/int64" - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "amount", - "ticket_hash", - "destination", - "sender" - ], - "additionalProperties": false + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 65535 } }, "required": [ - "deposit" + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "biggish", + "description": "An int64 which fits within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "bigger", + "description": "An int64 which doesn't fit within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "$ref": "#/definitions/int64" + } + }, + "required": [ + "value", + "kind" ], "additionalProperties": false } ] }, - "message_position": { - "$ref": "#/definitions/positive_bignum" + "destination": { + "$ref": "#/definitions/alpha.contract_id" }, - "proof": { - "type": "boolean" + "entrypoint": { + "$ref": "#/definitions/unistring" } }, "required": [ - "proof", - "message_position", - "message", + "entrypoint", + "destination", + "ticket_amount", + "ticket_ticketer", + "ticket_ty", + "ticket_contents", + "withdraw_path", + "message_index", + "context_hash", "level", - "rollup", + "tx_rollup", "storage_limit", "gas_limit", "counter", @@ -9173,6 +10340,47 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' ], "additionalProperties": false }, + "path": { + "oneOf": [ + { + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" + } + ] + }, "positive_bignum": { "title": "Positive big number", "description": "Decimal representation of a positive big number", diff --git a/tezt/_regressions/rpc/alpha.proxy.mempool.out b/tezt/_regressions/rpc/alpha.proxy.mempool.out index 0cf990f0e394684830047740e906de394f902419..7901ce16aecdb1a4240313cc4af1188f53d06304 100644 --- a/tezt/_regressions/rpc/alpha.proxy.mempool.out +++ b/tezt/_regressions/rpc/alpha.proxy.mempool.out @@ -672,6 +672,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "An Ed25519 public key hash (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Message_result_hash": { + "title": "A message result (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "Operation_hash": { "title": "A Tezos operation ID (Base58Check-encoded)", "$ref": "#/definitions/unistring" @@ -704,6 +708,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "The hash of a BLS public key used to identify a L2 ticket holders (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Withdraw_list_hash": { + "title": "A hash of withdraw's list (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "alpha.block_header.alpha.full_header": { "title": "Shell header", "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", @@ -778,6 +786,11 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' ], "additionalProperties": false }, + "alpha.contract_id": { + "title": "A contract handle", + "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", + "$ref": "#/definitions/unistring" + }, "alpha.entrypoint": { "title": "entrypoint", "description": "Named entrypoint to a Michelson smart contract", @@ -1946,17 +1959,7 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "batches": { "type": "array", "items": { - "type": "object", - "properties": { - "root": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "root" - ], - "additionalProperties": false + "$ref": "#/definitions/Message_result_hash" } }, "predecessor": { @@ -2302,13 +2305,13 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "additionalProperties": false }, { - "title": "Sc_rollup_originate", + "title": "Tx_rollup_withdraw", "type": "object", "properties": { "kind": { "type": "string", "enum": [ - "sc_rollup_originate" + "tx_rollup_withdraw" ] }, "source": { @@ -2326,20 +2329,322 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "storage_limit": { "$ref": "#/definitions/positive_bignum" }, - "kind": { + "tx_rollup": { + "$ref": "#/definitions/alpha.tx_rollup_id" + }, + "level": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "context_hash": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + }, + "message_index": { + "type": "integer", + "minimum": -1073741824, + "maximum": 1073741823 + }, + "withdraw_path": { "oneOf": [ { - "title": "Example_arith smart contract rollup kind" + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" } ] }, - "boot_sector": { + "ticket_contents": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] + }, + "ticket_ty": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] + }, + "ticket_ticketer": { + "$ref": "#/definitions/alpha.contract_id" + }, + "ticket_amount": { + "oneOf": [ + { + "title": "small", + "description": "An int64 which fits within a uint8", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 255 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "medium", + "description": "An int64 which fits within a uint16", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "biggish", + "description": "An int64 which fits within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "bigger", + "description": "An int64 which doesn't fit within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "$ref": "#/definitions/int64" + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + } + ] + }, + "destination": { + "$ref": "#/definitions/alpha.contract_id" + }, + "entrypoint": { "$ref": "#/definitions/unistring" } }, "required": [ - "boot_sector", - "kind", + "entrypoint", + "destination", + "ticket_amount", + "ticket_ticketer", + "ticket_ty", + "ticket_contents", + "withdraw_path", + "message_index", + "context_hash", + "level", + "tx_rollup", "storage_limit", "gas_limit", "counter", @@ -2350,13 +2655,13 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "additionalProperties": false }, { - "title": "Sc_rollup_add_messages", + "title": "Sc_rollup_originate", "type": "object", "properties": { "kind": { "type": "string", "enum": [ - "sc_rollup_add_messages" + "sc_rollup_originate" ] }, "source": { @@ -2374,7 +2679,55 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "storage_limit": { "$ref": "#/definitions/positive_bignum" }, - "rollup": { + "kind": { + "oneOf": [ + { + "title": "Example_arith smart contract rollup kind" + } + ] + }, + "boot_sector": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "boot_sector", + "kind", + "storage_limit", + "gas_limit", + "counter", + "fee", + "source", + "kind" + ], + "additionalProperties": false + }, + { + "title": "Sc_rollup_add_messages", + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "sc_rollup_add_messages" + ] + }, + "source": { + "$ref": "#/definitions/Signature.Public_key_hash" + }, + "fee": { + "$ref": "#/definitions/alpha.mutez" + }, + "counter": { + "$ref": "#/definitions/positive_bignum" + }, + "gas_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "storage_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "rollup": { "$ref": "#/definitions/alpha.rollup_address" }, "message": { @@ -2732,6 +3085,47 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' } ] }, + "path": { + "oneOf": [ + { + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" + } + ] + }, "positive_bignum": { "title": "Positive big number", "description": "Decimal representation of a positive big number", @@ -2803,110 +3197,139 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "fields": [ { "description": { - "title": "X_1" + "title": "X_0" }, "encoding": { "fields": [ + { + "name": "hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "branch", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 2, + "size": "Uint30" + }, + { + "name": "contents", + "layout": { + "layout": { + "name": "alpha.operation.alpha.contents", + "kind": "Ref" + }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 64, + "kind": "Float" + }, + "kind": "named" + }, { "kind": "dyn", + "name": "error_opt", "num_fields": 1, "size": "Uint30" }, { + "name": "error", "layout": { "kind": "String" }, - "kind": "anon", "data_kind": { "kind": "Variable" - } + }, + "kind": "named" } ] } }, { "description": { - "title": "X_2" + "title": "alpha.operation.alpha.contents" }, "encoding": { - "tag_size": "Uint16", + "tag_size": "Uint8", "kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "cases": [ { - "tag": 0, + "tag": 1, "fields": [ { "name": "Tag", "layout": { - "size": "Uint16", + "size": "Uint8", "kind": "Int" }, "data_kind": { - "size": 2, + "size": 1, "kind": "Float" }, "kind": "named" }, { + "name": "level", "layout": { - "kind": "Zero_width" - }, - "kind": "anon", - "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "Example_arith smart contract rollup kind" - } - ] - } - }, - { - "description": { - "title": "X_4" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 0, - "fields": [ - { - "name": "Tag", - "layout": { - "size": "Uint8", + "size": "Int32", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { + "name": "nonce", "layout": { - "size": "Uint8", - "kind": "Int" + "kind": "Bytes" }, - "kind": "anon", "data_kind": { - "size": 1, + "size": 32, "kind": "Float" - } + }, + "kind": "named" } ], - "name": "case 0" + "name": "Seed_nonce_revelation" }, { - "tag": 1, + "tag": 2, "fields": [ { "name": "Tag", @@ -2921,47 +3344,39 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "layout": { - "size": "Uint16", - "kind": "Int" - }, - "kind": "anon", - "data_kind": { - "size": 2, - "kind": "Float" - } - } - ], - "name": "case 1" - }, - { - "tag": 2, - "fields": [ + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, { - "name": "Tag", + "name": "op1", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "alpha.inlined.endorsement", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Variable" }, "kind": "named" }, { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "op2", "layout": { - "size": "Int32", - "kind": "Int" + "name": "alpha.inlined.endorsement", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 4, - "kind": "Float" - } + "kind": "Variable" + }, + "kind": "named" } ], - "name": "case 2" + "name": "Double_endorsement_evidence" }, { "tag": 3, @@ -2979,88 +3394,42 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "bh1", "layout": { - "size": "Int64", - "kind": "Int" + "name": "alpha.block_header.alpha.full_header", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 8, - "kind": "Float" - } + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "bh2", + "layout": { + "name": "alpha.block_header.alpha.full_header", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" } ], - "name": "case 3" - } - ] - } - }, - { - "description": { - "title": "X_3" - }, - "encoding": { - "fields": [ - { - "name": "sender", - "layout": { - "name": "public_key_hash", - "kind": "Ref" - }, - "data_kind": { - "size": 21, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "destination", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 20, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "ticket_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" + "name": "Double_baking_evidence" }, { - "name": "amount", - "layout": { - "name": "X_4", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "X_5" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 0, + "tag": 4, "fields": [ { "name": "Tag", @@ -3075,25 +3444,32 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "pkh", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 20, + "kind": "Float" + }, + "kind": "named" }, { - "name": "batch", + "name": "secret", "layout": { - "kind": "String" + "kind": "Bytes" }, "data_kind": { - "kind": "Variable" + "size": 20, + "kind": "Float" }, "kind": "named" } ], - "name": "Batch" + "name": "Activate_account" }, { - "tag": 1, + "tag": 5, "fields": [ { "name": "Tag", @@ -3108,34 +3484,52 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "deposit", + "name": "source", "layout": { - "name": "X_3", + "name": "public_key_hash", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 21, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "period", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "proposals", + "layout": { + "layout": { + "kind": "Bytes" + }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" }, "kind": "named" } ], - "name": "Deposit" - } - ] - } - }, - { - "description": { - "title": "X_8" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ + "name": "Proposals" + }, { - "tag": 0, + "tag": 6, "fields": [ { "name": "Tag", @@ -3150,20 +3544,57 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "name": "source", "layout": { - "kind": "Zero_width" + "name": "public_key_hash", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 0, + "size": 21, "kind": "Float" - } + }, + "kind": "named" + }, + { + "name": "period", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "proposal", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "ballot", + "layout": { + "size": "Int8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" } ], - "name": "None" + "name": "Ballot" }, { - "tag": 1, + "tag": 7, "fields": [ { "name": "Tag", @@ -3178,136 +3609,42 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Commitment_hash", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "op1", "layout": { - "kind": "Bytes" + "name": "alpha.inlined.preendorsement", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Variable" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "op2", + "layout": { + "name": "alpha.inlined.preendorsement", + "kind": "Ref" + }, + "data_kind": { + "kind": "Variable" }, "kind": "named" } ], - "name": "Some" - } - ] - } - }, - { - "description": { - "title": "X_6" - }, - "encoding": { - "fields": [ - { - "name": "level", - "layout": { - "size": "Int32", - "kind": "Int" - }, - "data_kind": { - "size": 4, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "batches", - "layout": { - "layout": { - "name": "fitness.elem", - "kind": "Ref" - }, - "kind": "Seq" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "name": "predecessor", - "layout": { - "name": "X_8", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, - { - "name": "inbox_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.scripted.contracts" - }, - "encoding": { - "fields": [ - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "code", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "Double_preendorsement_evidence" }, { - "name": "storage", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.transaction_destination" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 22, - "kind": "Float" - }, - "cases": [ - { - "tag": 0, + "tag": 17, "fields": [ { "name": "Tag", @@ -3322,22 +3659,25 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Signature.Public_key_hash", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "arbitrary", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Variable" }, "kind": "named" } ], - "name": "Implicit" + "name": "Failing_noop" }, { - "tag": 1, + "tag": 20, "fields": [ { "name": "Tag", @@ -3352,85 +3692,57 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Contract_hash", + "name": "slot", "layout": { - "kind": "Bytes" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "size": 20, + "size": 2, "kind": "Float" }, "kind": "named" }, { - "name": "padding", - "layout": { - "kind": "Padding" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - } - ], - "name": "Originated" - }, - { - "tag": 2, - "fields": [ - { - "name": "Tag", + "name": "level", "layout": { - "size": "Uint8", + "size": "Int32", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "Rollup_hash", + "name": "round", "layout": { - "kind": "Bytes" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "size": 20, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "padding", + "name": "block_payload_hash", "layout": { - "kind": "Padding" + "kind": "Bytes" }, "data_kind": { - "size": 1, + "size": 32, "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup" - } - ] - } - }, - { - "description": { - "title": "alpha.entrypoint" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ + "name": "Preendorsement" + }, { - "tag": 0, + "tag": 21, "fields": [ { "name": "Tag", @@ -3445,76 +3757,57 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "name": "slot", "layout": { - "kind": "Zero_width" - }, - "kind": "anon", - "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "default" - }, - { - "tag": 1, - "fields": [ - { - "name": "Tag", - "layout": { - "size": "Uint8", + "size": "Uint16", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 2, "kind": "Float" }, "kind": "named" }, { + "name": "level", "layout": { - "kind": "Zero_width" + "size": "Int32", + "kind": "Int" }, - "kind": "anon", "data_kind": { - "size": 0, + "size": 4, "kind": "Float" - } - } - ], - "name": "root" - }, - { - "tag": 2, - "fields": [ + }, + "kind": "named" + }, { - "name": "Tag", + "name": "round", "layout": { - "size": "Uint8", + "size": "Int32", "kind": "Int" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { + "name": "block_payload_hash", "layout": { - "kind": "Zero_width" + "kind": "Bytes" }, - "kind": "anon", "data_kind": { - "size": 0, + "size": 32, "kind": "Float" - } + }, + "kind": "named" } ], - "name": "do" + "name": "Endorsement" }, { - "tag": 3, + "tag": 107, "fields": [ { "name": "Tag", @@ -3529,177 +3822,77 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { + "name": "source", "layout": { - "kind": "Zero_width" + "name": "public_key_hash", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "set_delegate" - }, - { - "tag": 4, - "fields": [ - { - "name": "Tag", - "layout": { - "size": "Uint8", - "kind": "Int" - }, - "data_kind": { - "size": 1, + "size": 21, "kind": "Float" }, "kind": "named" }, { + "name": "fee", "layout": { - "kind": "Zero_width" + "name": "N.t", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "size": 0, - "kind": "Float" - } - } - ], - "name": "remove_delegate" - }, - { - "tag": 255, - "fields": [ + "kind": "Dynamic" + }, + "kind": "named" + }, { - "name": "Tag", + "name": "counter", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint8" - }, - { + "name": "gas_limit", "layout": { - "kind": "String" + "name": "N.t", + "kind": "Ref" }, - "kind": "anon", "data_kind": { - "kind": "Variable" - } - } - ], - "name": "named" - } - ] - } - }, - { - "description": { - "title": "X_9" - }, - "encoding": { - "fields": [ - { - "name": "entrypoint", - "layout": { - "name": "alpha.entrypoint", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "value", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "N.t", - "description": "A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order." - }, - "encoding": { - "fields": [ - { - "name": "N.t", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "public_key" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 0, - "fields": [ + "kind": "Dynamic" + }, + "kind": "named" + }, { - "name": "Tag", + "name": "storage_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "Ed25519.Public_key", + "name": "public_key", "layout": { - "kind": "Bytes" + "name": "public_key", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Ed25519" + "name": "Reveal" }, { - "tag": 1, + "tag": 108, "fields": [ { "name": "Tag", @@ -3714,185 +3907,104 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Secp256k1.Public_key", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 33, + "size": 21, "kind": "Float" }, "kind": "named" - } - ], - "name": "Secp256k1" - }, - { - "tag": 2, - "fields": [ + }, { - "name": "Tag", + "name": "fee", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "P256.Public_key", + "name": "counter", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 33, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "P256" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.preendorsement.contents" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 43, - "kind": "Float" - }, - "cases": [ - { - "tag": 20, - "fields": [ + }, { - "name": "Tag", + "name": "gas_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "slot", + "name": "storage_limit", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "level", + "name": "amount", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "destination", "layout": { - "size": "Int32", - "kind": "Int" + "name": "alpha.transaction_destination", + "kind": "Ref" }, "data_kind": { - "size": 4, + "size": 22, "kind": "Float" }, "kind": "named" }, { - "name": "block_payload_hash", + "kind": "option_indicator", + "name": "parameters" + }, + { + "name": "parameters", "layout": { - "kind": "Bytes" + "name": "X_12", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Preendorsement" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.preendorsement" - }, - "encoding": { - "fields": [ - { - "name": "branch", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "operations", - "layout": { - "name": "alpha.inlined.preendorsement.contents", - "kind": "Ref" - }, - "data_kind": { - "size": 43, - "kind": "Float" - }, - "kind": "named" + "name": "Transaction" }, { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "public_key_hash" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 21, - "kind": "Float" - }, - "cases": [ - { - "tag": 0, + "tag": 109, "fields": [ { "name": "Tag", @@ -3907,21 +4019,104 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Ed25519.Public_key_hash", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "fee", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "balance", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "kind": "option_indicator", + "name": "delegate" + }, + { + "name": "delegate", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, "kind": "Float" }, "kind": "named" + }, + { + "name": "script", + "layout": { + "name": "alpha.scripted.contracts", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" } ], - "name": "Ed25519" + "name": "Origination" }, { - "tag": 1, + "tag": 110, "fields": [ { "name": "Tag", @@ -3936,21 +4131,82 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "Secp256k1.Public_key_hash", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "fee", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "kind": "option_indicator", + "name": "delegate" + }, + { + "name": "delegate", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, "kind": "Float" }, "kind": "named" } ], - "name": "Secp256k1" + "name": "Delegation" }, { - "tag": 2, + "tag": 111, "fields": [ { "name": "Tag", @@ -3965,360 +4221,81 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "P256.Public_key_hash", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, "kind": "Float" }, "kind": "named" - } - ], - "name": "P256" - } - ] - } - }, - { - "description": { - "title": "fitness.elem" - }, - "encoding": { - "fields": [ - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "layout": { - "kind": "Bytes" - }, - "kind": "anon", - "data_kind": { - "kind": "Variable" - } - } - ] - } - }, - { - "description": { - "title": "alpha.block_header.alpha.full_header" - }, - "encoding": { - "fields": [ - { - "name": "level", - "layout": { - "size": "Int32", - "kind": "Int" - }, - "data_kind": { - "size": 4, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "proto", - "layout": { - "size": "Uint8", - "kind": "Int" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "predecessor", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "timestamp", - "layout": { - "size": "Int64", - "kind": "Int" - }, - "data_kind": { - "size": 8, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "validation_pass", - "layout": { - "size": "Uint8", - "kind": "Int" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "operations_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "name": "fitness", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "fitness", - "layout": { - "layout": { - "name": "fitness.elem", - "kind": "Ref" }, - "kind": "Seq" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "name": "context", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "payload_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "payload_round", - "layout": { - "size": "Int32", - "kind": "Int" - }, - "data_kind": { - "size": 4, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "proof_of_work_nonce", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 8, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "option_indicator", - "name": "seed_nonce_hash" - }, - { - "name": "seed_nonce_hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "liquidity_baking_toggle_vote", - "layout": { - "size": "Int8", - "kind": "Int" - }, - "data_kind": { - "size": 1, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 64, - "kind": "Float" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.endorsement_mempool.contents" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "size": 43, - "kind": "Float" - }, - "cases": [ - { - "tag": 21, - "fields": [ { - "name": "Tag", + "name": "fee", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "slot", + "name": "counter", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "level", + "name": "gas_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "storage_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "block_payload_hash", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "value", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Variable" }, "kind": "named" } ], - "name": "Endorsement" - } - ] - } - }, - { - "description": { - "title": "alpha.inlined.endorsement" - }, - "encoding": { - "fields": [ - { - "name": "branch", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "name": "operations", - "layout": { - "name": "alpha.inlined.endorsement_mempool.contents", - "kind": "Ref" - }, - "data_kind": { - "size": 43, - "kind": "Float" - }, - "kind": "named" + "name": "Register_global_constant" }, { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - } - ] - } - }, - { - "description": { - "title": "alpha.operation.alpha.contents" - }, - "encoding": { - "tag_size": "Uint8", - "kind": { - "kind": "Dynamic" - }, - "cases": [ - { - "tag": 1, + "tag": 112, "fields": [ { "name": "Tag", @@ -4333,83 +4310,81 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "level", + "name": "source", "layout": { - "size": "Int32", - "kind": "Int" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 4, + "size": 21, "kind": "Float" }, "kind": "named" }, { - "name": "nonce", + "name": "fee", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "Seed_nonce_revelation" - }, - { - "tag": 2, - "fields": [ + }, { - "name": "Tag", + "name": "counter", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "name": "op1", + "name": "storage_limit", "layout": { - "name": "alpha.inlined.endorsement", + "name": "N.t", "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "kind": "option_indicator", + "name": "limit" }, { - "name": "op2", + "name": "limit", "layout": { - "name": "alpha.inlined.endorsement", + "name": "N.t", "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Double_endorsement_evidence" + "name": "Set_deposits_limit" }, { - "tag": 3, + "tag": 150, "fields": [ { "name": "Tag", @@ -4424,14 +4399,21 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "source", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, + "kind": "Float" + }, + "kind": "named" }, { - "name": "bh1", + "name": "fee", "layout": { - "name": "alpha.block_header.alpha.full_header", + "name": "N.t", "kind": "Ref" }, "data_kind": { @@ -4440,14 +4422,31 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "name": "bh2", + "name": "gas_limit", "layout": { - "name": "alpha.block_header.alpha.full_header", + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", "kind": "Ref" }, "data_kind": { @@ -4456,10 +4455,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" } ], - "name": "Double_baking_evidence" + "name": "Tx_rollup_origination" }, { - "tag": 4, + "tag": 151, "fields": [ { "name": "Tag", @@ -4474,65 +4473,68 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "pkh", + "name": "source", "layout": { - "kind": "Bytes" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 20, + "size": 21, "kind": "Float" }, "kind": "named" }, { - "name": "secret", + "name": "fee", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 20, - "kind": "Float" + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "counter", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "Activate_account" - }, - { - "tag": 5, - "fields": [ + }, { - "name": "Tag", + "name": "gas_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "source", + "name": "storage_limit", "layout": { - "name": "public_key_hash", + "name": "N.t", "kind": "Ref" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "period", + "name": "rollup", "layout": { - "size": "Int32", - "kind": "Int" + "kind": "Bytes" }, "data_kind": { - "size": 4, + "size": 20, "kind": "Float" }, "kind": "named" @@ -4543,23 +4545,35 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "size": "Uint30" }, { - "name": "proposals", + "name": "content", "layout": { - "layout": { - "kind": "Bytes" - }, - "kind": "Seq" + "kind": "Bytes" }, "data_kind": { "kind": "Variable" }, "kind": "named" + }, + { + "kind": "option_indicator", + "name": "burn_limit" + }, + { + "name": "burn_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" } ], - "name": "Proposals" + "name": "Tx_rollup_submit_batch" }, { - "tag": 6, + "tag": 152, "fields": [ { "name": "Tag", @@ -4586,95 +4600,76 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "period", + "name": "fee", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "proposal", + "name": "counter", "layout": { - "kind": "Bytes" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 32, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "ballot", + "name": "gas_limit", "layout": { - "size": "Int8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" - } - ], - "name": "Ballot" - }, - { - "tag": 7, - "fields": [ + }, { - "name": "Tag", + "name": "storage_limit", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "op1", + "name": "rollup", "layout": { - "name": "alpha.inlined.preendorsement", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Variable" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "op2", + "name": "commitment", "layout": { - "name": "alpha.inlined.preendorsement", + "name": "X_10", "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Double_preendorsement_evidence" + "name": "Tx_rollup_commit" }, { - "tag": 17, + "tag": 153, "fields": [ { "name": "Tag", @@ -4689,90 +4684,77 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "arbitrary", + "name": "source", "layout": { - "kind": "String" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "kind": "Variable" + "size": 21, + "kind": "Float" }, "kind": "named" - } - ], - "name": "Failing_noop" - }, - { - "tag": 20, - "fields": [ + }, { - "name": "Tag", + "name": "fee", "layout": { - "size": "Uint8", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "slot", + "name": "counter", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 2, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "level", + "name": "gas_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "storage_limit", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "block_payload_hash", + "name": "rollup", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 32, + "size": 20, "kind": "Float" }, "kind": "named" } ], - "name": "Preendorsement" + "name": "Tx_rollup_return_bond" }, { - "tag": 21, + "tag": 154, "fields": [ { "name": "Tag", @@ -4787,57 +4769,77 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "slot", + "name": "source", "layout": { - "size": "Uint16", - "kind": "Int" + "name": "public_key_hash", + "kind": "Ref" }, "data_kind": { - "size": 2, + "size": 21, "kind": "Float" }, "kind": "named" }, { - "name": "level", + "name": "fee", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "round", + "name": "counter", "layout": { - "size": "Int32", - "kind": "Int" + "name": "N.t", + "kind": "Ref" }, "data_kind": { - "size": 4, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "block_payload_hash", + "name": "gas_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "storage_limit", + "layout": { + "name": "N.t", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "rollup", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 32, + "size": 20, "kind": "Float" }, "kind": "named" } ], - "name": "Endorsement" + "name": "Tx_rollup_finalize_commitment" }, { - "tag": 107, + "tag": 155, "fields": [ { "name": "Tag", @@ -4908,21 +4910,21 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "public_key", + "name": "rollup", "layout": { - "name": "public_key", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" } ], - "name": "Reveal" + "name": "Tx_rollup_remove_commitment" }, { - "tag": 108, + "tag": 156, "fields": [ { "name": "Tag", @@ -4993,48 +4995,66 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "amount", + "name": "rollup", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "name": "destination", + "name": "level", "layout": { - "name": "alpha.transaction_destination", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "size": 22, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "parameters" + "name": "message", + "layout": { + "name": "X_9", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "name": "parameters", + "name": "message_position", "layout": { - "name": "X_9", + "name": "N.t", "kind": "Ref" }, "data_kind": { "kind": "Dynamic" }, "kind": "named" + }, + { + "name": "proof", + "layout": { + "kind": "Bool" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" } ], - "name": "Transaction" + "name": "Tx_rollup_rejection" }, { - "tag": 109, + "tag": 157, "fields": [ { "name": "Tag", @@ -5105,99 +5125,113 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "balance", + "name": "tx_rollup", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "delegate" - }, - { - "name": "delegate", + "name": "level", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "size": 21, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "script", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "context_hash", "layout": { - "name": "alpha.scripted.contracts", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" }, "kind": "named" - } - ], - "name": "Origination" - }, - { - "tag": 110, - "fields": [ + }, { - "name": "Tag", + "name": "message_index", "layout": { - "size": "Uint8", - "kind": "Int" + "min": -1073741824, + "max": 1073741823, + "kind": "RangedInt" }, "data_kind": { - "size": 1, + "size": 4, "kind": "Float" }, "kind": "named" }, { - "name": "source", + "name": "withdraw_path", "layout": { - "name": "public_key_hash", + "name": "path", "kind": "Ref" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" }, { - "name": "fee", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "ticket_contents", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" }, "kind": "named" }, { - "name": "counter", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "ticket_ty", "layout": { - "name": "N.t", + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "ticket_ticketer", + "layout": { + "name": "alpha.contract_id", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 22, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "ticket_amount", "layout": { - "name": "N.t", + "name": "X_8", "kind": "Ref" }, "data_kind": { @@ -5206,37 +5240,37 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "storage_limit", + "name": "destination", "layout": { - "name": "N.t", + "name": "alpha.contract_id", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 22, + "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "delegate" + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" }, { - "name": "delegate", + "name": "entrypoint", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "size": 21, - "kind": "Float" + "kind": "Variable" }, "kind": "named" } ], - "name": "Delegation" + "name": "Tx_rollup_withdraw" }, { - "tag": 111, + "tag": 200, "fields": [ { "name": "Tag", @@ -5306,15 +5340,27 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' }, "kind": "named" }, + { + "name": "kind", + "layout": { + "name": "X_2", + "kind": "Ref" + }, + "data_kind": { + "size": 2, + "kind": "Float" + }, + "kind": "named" + }, { "kind": "dyn", "num_fields": 1, "size": "Uint30" }, { - "name": "value", + "name": "boot_sector", "layout": { - "kind": "Bytes" + "kind": "String" }, "data_kind": { "kind": "Variable" @@ -5322,10 +5368,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" } ], - "name": "Register_global_constant" + "name": "Sc_rollup_originate" }, { - "tag": 112, + "tag": 201, "fields": [ { "name": "Tag", @@ -5396,25 +5442,45 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "kind": "option_indicator", - "name": "limit" + "kind": "dyn", + "name": "alpha.rollup_address", + "num_fields": 1, + "size": "Uint30" }, { - "name": "limit", + "name": "rollup", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "message", + "layout": { + "layout": { + "name": "X_1", + "kind": "Ref" + }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" }, "kind": "named" } ], - "name": "Set_deposits_limit" + "name": "Sc_rollup_add_messages" }, { - "tag": 150, + "tag": 202, "fields": [ { "name": "Tag", @@ -5483,12 +5549,95 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "Dynamic" }, "kind": "named" + }, + { + "kind": "dyn", + "name": "alpha.rollup_address", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "rollup", + "layout": { + "kind": "String" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "commitment", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" } ], - "name": "Tx_rollup_origination" + "name": "Sc_rollup_cement" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.endorsement" + }, + "encoding": { + "fields": [ + { + "name": "branch", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "operations", + "layout": { + "name": "alpha.inlined.endorsement_mempool.contents", + "kind": "Ref" + }, + "data_kind": { + "size": 43, + "kind": "Float" + }, + "kind": "named" }, { - "tag": 151, + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.endorsement_mempool.contents" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 43, + "kind": "Float" + }, + "cases": [ + { + "tag": 21, "fields": [ { "name": "Tag", @@ -5503,63 +5652,291 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "slot", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "size": 21, + "size": 2, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "name": "level", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", + "name": "round", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "block_payload_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 32, + "kind": "Float" }, "kind": "named" + } + ], + "name": "Endorsement" + } + ] + } + }, + { + "description": { + "title": "alpha.block_header.alpha.full_header" + }, + "encoding": { + "fields": [ + { + "name": "level", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "proto", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "predecessor", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "timestamp", + "layout": { + "size": "Int64", + "kind": "Int" + }, + "data_kind": { + "size": 8, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "validation_pass", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "operations_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "name": "fitness", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "fitness", + "layout": { + "layout": { + "name": "fitness.elem", + "kind": "Ref" }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "context", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "payload_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "payload_round", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "proof_of_work_nonce", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 8, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "option_indicator", + "name": "seed_nonce_hash" + }, + { + "name": "seed_nonce_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "liquidity_baking_toggle_vote", + "layout": { + "size": "Int8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 64, + "kind": "Float" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "fitness.elem" + }, + "encoding": { + "fields": [ + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "layout": { + "kind": "Bytes" + }, + "kind": "anon", + "data_kind": { + "kind": "Variable" + } + } + ] + } + }, + { + "description": { + "title": "public_key_hash" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 21, + "kind": "Float" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "storage_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "Ed25519.Public_key_hash", "layout": { "kind": "Bytes" }, @@ -5568,42 +5945,41 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "Float" }, "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, + } + ], + "name": "Ed25519" + }, + { + "tag": 1, + "fields": [ { - "name": "content", + "name": "Tag", "layout": { - "kind": "Bytes" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Variable" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "kind": "option_indicator", - "name": "burn_limit" - }, - { - "name": "burn_limit", + "name": "Secp256k1.Public_key_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup_submit_batch" + "name": "Secp256k1" }, { - "tag": 152, + "tag": 2, "fields": [ { "name": "Tag", @@ -5618,88 +5994,155 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "P256.Public_key_hash", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 20, "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "P256" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.preendorsement" + }, + "encoding": { + "fields": [ + { + "name": "branch", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "operations", + "layout": { + "name": "alpha.inlined.preendorsement.contents", + "kind": "Ref" + }, + "data_kind": { + "size": 43, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "signature", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.inlined.preendorsement.contents" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 43, + "kind": "Float" + }, + "cases": [ + { + "tag": 20, + "fields": [ { - "name": "fee", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", + "name": "slot", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 2, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "level", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", + "name": "round", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 4, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "block_payload_hash", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 20, + "size": 32, "kind": "Float" }, "kind": "named" - }, - { - "name": "commitment", - "layout": { - "name": "X_6", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" } ], - "name": "Tx_rollup_commit" - }, + "name": "Preendorsement" + } + ] + } + }, + { + "description": { + "title": "public_key" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ { - "tag": 153, + "tag": 0, "fields": [ { "name": "Tag", @@ -5714,77 +6157,147 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "Ed25519.Public_key", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 32, "kind": "Float" }, "kind": "named" - }, - { - "name": "fee", - "layout": { - "name": "N.t", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + } + ], + "name": "Ed25519" + }, + { + "tag": 1, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "Secp256k1.Public_key", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 33, + "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "Secp256k1" + }, + { + "tag": 2, + "fields": [ { - "name": "storage_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "P256.Public_key", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 20, + "size": 33, "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup_return_bond" + "name": "P256" + } + ] + } + }, + { + "description": { + "title": "N.t", + "description": "A variable-length sequence of bytes encoding a Zarith natural number. Each byte has a running unary size bit: the most significant bit of each byte indicates whether this is the last byte in the sequence (0) or whether the sequence continues (1). Size bits ignored, the data is the binary representation of the number in little-endian order." + }, + "encoding": { + "fields": [ + { + "name": "N.t", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_12" + }, + "encoding": { + "fields": [ + { + "name": "entrypoint", + "layout": { + "name": "alpha.entrypoint", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" }, { - "tag": 154, + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "value", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.entrypoint" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, "fields": [ { "name": "Tag", @@ -5799,77 +6312,104 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 21, + "size": 0, "kind": "Float" - }, - "kind": "named" - }, + } + } + ], + "name": "default" + }, + { + "tag": 1, + "fields": [ { - "name": "fee", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 0, + "kind": "Float" + } + } + ], + "name": "root" + }, + { + "tag": 2, + "fields": [ { - "name": "gas_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" + "size": 0, + "kind": "Float" + } + } + ], + "name": "do" + }, + { + "tag": 3, + "fields": [ + { + "name": "Tag", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", "layout": { - "kind": "Bytes" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 20, + "size": 0, "kind": "Float" - }, - "kind": "named" + } } ], - "name": "Tx_rollup_finalize_commitment" + "name": "set_delegate" }, { - "tag": 155, + "tag": 4, "fields": [ { "name": "Tag", @@ -5884,77 +6424,136 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 21, + "size": 0, + "kind": "Float" + } + } + ], + "name": "remove_delegate" + }, + { + "tag": 255, + "fields": [ + { + "name": "Tag", + "layout": { + "size": "Uint8", + "kind": "Int" + }, + "data_kind": { + "size": 1, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "kind": "dyn", + "num_fields": 1, + "size": "Uint8" + }, + { + "layout": { + "kind": "String" + }, + "kind": "anon", + "data_kind": { + "kind": "Variable" + } + } + ], + "name": "named" + } + ] + } + }, + { + "description": { + "title": "alpha.transaction_destination" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 22, + "kind": "Float" + }, + "cases": [ + { + "tag": 0, + "fields": [ + { + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", + "name": "Signature.Public_key_hash", "layout": { - "name": "N.t", + "name": "public_key_hash", "kind": "Ref" }, "data_kind": { - "kind": "Dynamic" + "size": 21, + "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "Implicit" + }, + { + "tag": 1, + "fields": [ { - "name": "gas_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", + "name": "Contract_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "padding", "layout": { - "kind": "Bytes" + "kind": "Padding" }, "data_kind": { - "size": 20, + "size": 1, "kind": "Float" }, "kind": "named" } ], - "name": "Tx_rollup_remove_commitment" + "name": "Originated" }, { - "tag": 156, + "tag": 2, "fields": [ { "name": "Tag", @@ -5969,122 +6568,344 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "Rollup_hash", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 20, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "name": "padding", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Padding" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" + } + ], + "name": "Tx_rollup" + } + ] + } + }, + { + "description": { + "title": "alpha.scripted.contracts" + }, + "encoding": { + "fields": [ + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "code", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "storage", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_10" + }, + "encoding": { + "fields": [ + { + "name": "level", + "layout": { + "size": "Int32", + "kind": "Int" + }, + "data_kind": { + "size": 4, + "kind": "Float" + }, + "kind": "named" + }, + { + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "batches", + "layout": { + "layout": { + "kind": "Bytes" }, + "kind": "Seq" + }, + "data_kind": { + "kind": "Variable" + }, + "kind": "named" + }, + { + "name": "predecessor", + "layout": { + "name": "X_11", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + }, + { + "name": "inbox_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_11" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 0, + "kind": "Float" + } + } + ], + "name": "None" + }, + { + "tag": 1, + "fields": [ { - "name": "storage_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "rollup", + "name": "Commitment_hash", "layout": { "kind": "Bytes" }, "data_kind": { - "size": 20, + "size": 32, "kind": "Float" }, "kind": "named" - }, + } + ], + "name": "Some" + } + ] + } + }, + { + "description": { + "title": "X_9" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "level", + "name": "Tag", "layout": { - "size": "Int32", + "size": "Uint8", "kind": "Int" }, "data_kind": { - "size": 4, + "size": 1, "kind": "Float" }, "kind": "named" }, { - "name": "message", + "kind": "dyn", + "num_fields": 1, + "size": "Uint30" + }, + { + "name": "batch", "layout": { - "name": "X_5", - "kind": "Ref" + "kind": "String" }, "data_kind": { - "kind": "Dynamic" + "kind": "Variable" }, "kind": "named" - }, + } + ], + "name": "Batch" + }, + { + "tag": 1, + "fields": [ { - "name": "message_position", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "proof", + "name": "deposit", "layout": { - "kind": "Bool" + "name": "X_7", + "kind": "Ref" }, "data_kind": { - "size": 1, - "kind": "Float" + "kind": "Dynamic" }, "kind": "named" } ], - "name": "Tx_rollup_rejection" + "name": "Deposit" + } + ] + } + }, + { + "description": { + "title": "X_7" + }, + "encoding": { + "fields": [ + { + "name": "sender", + "layout": { + "name": "public_key_hash", + "kind": "Ref" + }, + "data_kind": { + "size": 21, + "kind": "Float" + }, + "kind": "named" }, { - "tag": 200, + "name": "destination", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 20, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "ticket_hash", + "layout": { + "kind": "Bytes" + }, + "data_kind": { + "size": 32, + "kind": "Float" + }, + "kind": "named" + }, + { + "name": "amount", + "layout": { + "name": "X_8", + "kind": "Ref" + }, + "data_kind": { + "kind": "Dynamic" + }, + "kind": "named" + } + ] + } + }, + { + "description": { + "title": "X_8" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, "fields": [ { "name": "Tag", @@ -6099,93 +6920,122 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "size": 21, + "size": 1, "kind": "Float" - }, - "kind": "named" - }, + } + } + ], + "name": "case 0" + }, + { + "tag": 1, + "fields": [ { - "name": "fee", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "counter", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint16", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 2, + "kind": "Float" + } + } + ], + "name": "case 1" + }, + { + "tag": 2, + "fields": [ { - "name": "gas_limit", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Int32", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + "size": 4, + "kind": "Float" + } + } + ], + "name": "case 2" + }, + { + "tag": 3, + "fields": [ { - "name": "kind", + "name": "Tag", "layout": { - "name": "X_2", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "size": 2, + "size": 1, "kind": "Float" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "boot_sector", "layout": { - "kind": "String" + "size": "Int64", + "kind": "Int" }, + "kind": "anon", "data_kind": { - "kind": "Variable" - }, - "kind": "named" + "size": 8, + "kind": "Float" + } } ], - "name": "Sc_rollup_originate" - }, + "name": "case 3" + } + ] + } + }, + { + "description": { + "title": "alpha.contract_id" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "size": 22, + "kind": "Float" + }, + "cases": [ { - "tag": 201, + "tag": 0, "fields": [ { "name": "Tag", @@ -6200,7 +7050,7 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "Signature.Public_key_hash", "layout": { "name": "public_key_hash", "kind": "Ref" @@ -6210,91 +7060,93 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "Float" }, "kind": "named" - }, - { - "name": "fee", - "layout": { - "name": "N.t", - "kind": "Ref" - }, - "data_kind": { - "kind": "Dynamic" - }, - "kind": "named" - }, + } + ], + "name": "Implicit" + }, + { + "tag": 1, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "Contract_hash", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 20, + "kind": "Float" }, "kind": "named" }, { - "name": "storage_limit", + "name": "padding", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Padding" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" - }, - { - "kind": "dyn", - "name": "alpha.rollup_address", - "num_fields": 1, - "size": "Uint30" - }, + } + ], + "name": "Originated" + } + ] + } + }, + { + "description": { + "title": "path" + }, + "encoding": { + "tag_size": "Uint8", + "kind": { + "kind": "Dynamic" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "rollup", + "name": "Tag", "layout": { - "kind": "String" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Variable" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "message", "layout": { - "layout": { - "name": "X_1", - "kind": "Ref" - }, - "kind": "Seq" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "kind": "Variable" - }, - "kind": "named" + "size": 0, + "kind": "Float" + } } ], - "name": "Sc_rollup_add_messages" + "name": "Op" }, { - "tag": 202, + "tag": 15, "fields": [ { "name": "Tag", @@ -6309,43 +7161,49 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "source", + "name": "left", "layout": { - "name": "public_key_hash", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "size": 21, + "size": 32, "kind": "Float" }, "kind": "named" }, { - "name": "fee", + "name": "path", "layout": { - "name": "N.t", + "name": "path", "kind": "Ref" }, "data_kind": { "kind": "Dynamic" }, "kind": "named" - }, + } + ], + "name": "Right" + }, + { + "tag": 240, + "fields": [ { - "name": "counter", + "name": "Tag", "layout": { - "name": "N.t", - "kind": "Ref" + "size": "Uint8", + "kind": "Int" }, "data_kind": { - "kind": "Dynamic" + "size": 1, + "kind": "Float" }, "kind": "named" }, { - "name": "gas_limit", + "name": "path", "layout": { - "name": "N.t", + "name": "path", "kind": "Ref" }, "data_kind": { @@ -6354,127 +7212,83 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": "named" }, { - "name": "storage_limit", + "name": "right", "layout": { - "name": "N.t", - "kind": "Ref" + "kind": "Bytes" }, "data_kind": { - "kind": "Dynamic" + "size": 32, + "kind": "Float" }, "kind": "named" - }, - { - "kind": "dyn", - "name": "alpha.rollup_address", - "num_fields": 1, - "size": "Uint30" - }, + } + ], + "name": "Left" + } + ] + } + }, + { + "description": { + "title": "X_2" + }, + "encoding": { + "tag_size": "Uint16", + "kind": { + "size": 2, + "kind": "Float" + }, + "cases": [ + { + "tag": 0, + "fields": [ { - "name": "rollup", + "name": "Tag", "layout": { - "kind": "String" + "size": "Uint16", + "kind": "Int" }, "data_kind": { - "kind": "Variable" + "size": 2, + "kind": "Float" }, "kind": "named" }, { - "name": "commitment", "layout": { - "kind": "Bytes" + "kind": "Zero_width" }, + "kind": "anon", "data_kind": { - "size": 32, + "size": 0, "kind": "Float" - }, - "kind": "named" + } } ], - "name": "Sc_rollup_cement" + "name": "Example_arith smart contract rollup kind" } ] } }, { "description": { - "title": "X_0" + "title": "X_1" }, "encoding": { "fields": [ - { - "name": "hash", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 1, - "size": "Uint30" - }, - { - "name": "branch", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 32, - "kind": "Float" - }, - "kind": "named" - }, - { - "kind": "dyn", - "num_fields": 2, - "size": "Uint30" - }, - { - "name": "contents", - "layout": { - "layout": { - "name": "alpha.operation.alpha.contents", - "kind": "Ref" - }, - "kind": "Seq" - }, - "data_kind": { - "kind": "Variable" - }, - "kind": "named" - }, - { - "name": "signature", - "layout": { - "kind": "Bytes" - }, - "data_kind": { - "size": 64, - "kind": "Float" - }, - "kind": "named" - }, { "kind": "dyn", - "name": "error_opt", "num_fields": 1, "size": "Uint30" }, { - "name": "error", "layout": { "kind": "String" }, + "kind": "anon", "data_kind": { "kind": "Variable" - }, - "kind": "named" + } } ] } @@ -7103,6 +7917,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "An Ed25519 public key hash (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Message_result_hash": { + "title": "A message result (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "Operation_hash": { "title": "A Tezos operation ID (Base58Check-encoded)", "$ref": "#/definitions/unistring" @@ -7135,6 +7953,10 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "title": "The hash of a BLS public key used to identify a L2 ticket holders (Base58Check-encoded)", "$ref": "#/definitions/unistring" }, + "Withdraw_list_hash": { + "title": "A hash of withdraw's list (Base58Check-encoded)", + "$ref": "#/definitions/unistring" + }, "alpha.block_header.alpha.full_header": { "title": "Shell header", "description": "Block header's shell-related content. It contains information such as the block level, its predecessor and timestamp.", @@ -7209,6 +8031,11 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' ], "additionalProperties": false }, + "alpha.contract_id": { + "title": "A contract handle", + "description": "A contract notation as given to an RPC or inside scripts. Can be a base58 implicit contract hash or a base58 originated contract hash.", + "$ref": "#/definitions/unistring" + }, "alpha.entrypoint": { "title": "entrypoint", "description": "Named entrypoint to a Michelson smart contract", @@ -8377,17 +9204,7 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "batches": { "type": "array", "items": { - "type": "object", - "properties": { - "root": { - "type": "string", - "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" - } - }, - "required": [ - "root" - ], - "additionalProperties": false + "$ref": "#/definitions/Message_result_hash" } }, "predecessor": { @@ -8514,7 +9331,47 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "kind": { "type": "string", "enum": [ - "tx_rollup_remove_commitment" + "tx_rollup_remove_commitment" + ] + }, + "source": { + "$ref": "#/definitions/Signature.Public_key_hash" + }, + "fee": { + "$ref": "#/definitions/alpha.mutez" + }, + "counter": { + "$ref": "#/definitions/positive_bignum" + }, + "gas_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "storage_limit": { + "$ref": "#/definitions/positive_bignum" + }, + "rollup": { + "$ref": "#/definitions/alpha.tx_rollup_id" + } + }, + "required": [ + "rollup", + "storage_limit", + "gas_limit", + "counter", + "fee", + "source", + "kind" + ], + "additionalProperties": false + }, + { + "title": "Tx_rollup_rejection", + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "tx_rollup_rejection" ] }, "source": { @@ -8534,9 +9391,154 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' }, "rollup": { "$ref": "#/definitions/alpha.tx_rollup_id" + }, + "level": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "message": { + "oneOf": [ + { + "title": "Batch", + "type": "object", + "properties": { + "batch": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "batch" + ], + "additionalProperties": false + }, + { + "title": "Deposit", + "type": "object", + "properties": { + "deposit": { + "type": "object", + "properties": { + "sender": { + "$ref": "#/definitions/Signature.Public_key_hash" + }, + "destination": { + "$ref": "#/definitions/Tx_rollup_l2_address" + }, + "ticket_hash": { + "$ref": "#/definitions/script_expr" + }, + "amount": { + "oneOf": [ + { + "title": "small", + "description": "An int64 which fits within a uint8", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 255 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "medium", + "description": "An int64 which fits within a uint16", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "biggish", + "description": "An int64 which fits within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "bigger", + "description": "An int64 which doesn't fit within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "$ref": "#/definitions/int64" + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "amount", + "ticket_hash", + "destination", + "sender" + ], + "additionalProperties": false + } + }, + "required": [ + "deposit" + ], + "additionalProperties": false + } + ] + }, + "message_position": { + "$ref": "#/definitions/positive_bignum" + }, + "proof": { + "type": "boolean" } }, "required": [ + "proof", + "message_position", + "message", + "level", "rollup", "storage_limit", "gas_limit", @@ -8548,13 +9550,13 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "additionalProperties": false }, { - "title": "Tx_rollup_rejection", + "title": "Tx_rollup_withdraw", "type": "object", "properties": { "kind": { "type": "string", "enum": [ - "tx_rollup_rejection" + "tx_rollup_withdraw" ] }, "source": { @@ -8572,157 +9574,322 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' "storage_limit": { "$ref": "#/definitions/positive_bignum" }, - "rollup": { - "$ref": "#/definitions/alpha.tx_rollup_id" + "tx_rollup": { + "$ref": "#/definitions/alpha.tx_rollup_id" + }, + "level": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + }, + "context_hash": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + }, + "message_index": { + "type": "integer", + "minimum": -1073741824, + "maximum": 1073741823 + }, + "withdraw_path": { + "oneOf": [ + { + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" + } + ] + }, + "ticket_contents": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] + }, + "ticket_ty": { + "oneOf": [ + { + "title": "Int", + "type": "object", + "properties": { + "int": { + "$ref": "#/definitions/bignum" + } + }, + "required": [ + "int" + ], + "additionalProperties": false + }, + { + "title": "String", + "type": "object", + "properties": { + "string": { + "$ref": "#/definitions/unistring" + } + }, + "required": [ + "string" + ], + "additionalProperties": false + }, + { + "title": "Bytes", + "type": "object", + "properties": { + "bytes": { + "type": "string", + "pattern": "^([a-zA-Z0-9][a-zA-Z0-9])*$" + } + }, + "required": [ + "bytes" + ], + "additionalProperties": false + }, + { + "title": "Sequence", + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + { + "title": "Prim__generic", + "description": "Generic primitive (any number of args with or without annotations)", + "type": "object", + "properties": { + "prim": { + "$ref": "#/definitions/alpha.michelson.v1.primitives" + }, + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/micheline.alpha.michelson_v1.expression" + } + }, + "annots": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "prim" + ], + "additionalProperties": false + } + ] }, - "level": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 + "ticket_ticketer": { + "$ref": "#/definitions/alpha.contract_id" }, - "message": { + "ticket_amount": { "oneOf": [ { - "title": "Batch", + "title": "small", + "description": "An int64 which fits within a uint8", "type": "object", "properties": { - "batch": { + "kind": { "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 255 } }, "required": [ - "batch" + "value", + "kind" ], "additionalProperties": false }, { - "title": "Deposit", + "title": "medium", + "description": "An int64 which fits within a uint16", "type": "object", "properties": { - "deposit": { - "type": "object", - "properties": { - "sender": { - "$ref": "#/definitions/Signature.Public_key_hash" - }, - "destination": { - "$ref": "#/definitions/Tx_rollup_l2_address" - }, - "ticket_hash": { - "$ref": "#/definitions/script_expr" - }, - "amount": { - "oneOf": [ - { - "title": "small", - "description": "An int64 which fits within a uint8", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "type": "integer", - "minimum": 0, - "maximum": 255 - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - }, - { - "title": "medium", - "description": "An int64 which fits within a uint16", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - }, - { - "title": "biggish", - "description": "An int64 which fits within a uint32", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "type": "integer", - "minimum": -2147483648, - "maximum": 2147483647 - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - }, - { - "title": "bigger", - "description": "An int64 which doesn't fit within a uint32", - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/unistring" - }, - "value": { - "$ref": "#/definitions/int64" - } - }, - "required": [ - "value", - "kind" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "amount", - "ticket_hash", - "destination", - "sender" - ], - "additionalProperties": false + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": 0, + "maximum": 65535 } }, "required": [ - "deposit" + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "biggish", + "description": "An int64 which fits within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "type": "integer", + "minimum": -2147483648, + "maximum": 2147483647 + } + }, + "required": [ + "value", + "kind" + ], + "additionalProperties": false + }, + { + "title": "bigger", + "description": "An int64 which doesn't fit within a uint32", + "type": "object", + "properties": { + "kind": { + "$ref": "#/definitions/unistring" + }, + "value": { + "$ref": "#/definitions/int64" + } + }, + "required": [ + "value", + "kind" ], "additionalProperties": false } ] }, - "message_position": { - "$ref": "#/definitions/positive_bignum" + "destination": { + "$ref": "#/definitions/alpha.contract_id" }, - "proof": { - "type": "boolean" + "entrypoint": { + "$ref": "#/definitions/unistring" } }, "required": [ - "proof", - "message_position", - "message", + "entrypoint", + "destination", + "ticket_amount", + "ticket_ticketer", + "ticket_ty", + "ticket_contents", + "withdraw_path", + "message_index", + "context_hash", "level", - "rollup", + "tx_rollup", "storage_limit", "gas_limit", "counter", @@ -9194,6 +10361,47 @@ curl -s 'http://localhost:[PORT]/describe/chains/main/mempool?recurse=yes' ], "additionalProperties": false }, + "path": { + "oneOf": [ + { + "title": "Left", + "type": "object", + "properties": { + "path": { + "$ref": "#/definitions/path" + }, + "right": { + "$ref": "#/definitions/Withdraw_list_hash" + } + }, + "required": [ + "right", + "path" + ], + "additionalProperties": false + }, + { + "title": "Right", + "type": "object", + "properties": { + "left": { + "$ref": "#/definitions/Withdraw_list_hash" + }, + "path": { + "$ref": "#/definitions/path" + } + }, + "required": [ + "path", + "left" + ], + "additionalProperties": false + }, + { + "title": "Op" + } + ] + }, "positive_bignum": { "title": "Positive big number", "description": "Decimal representation of a positive big number", diff --git a/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out b/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out index 83b277fd7df69363e56a0c20af1a6400c5930bb8..c524a4fa76784ae4e7386a921eed84891de6885a 100644 --- a/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out +++ b/tezt/_regressions/tx_rollup_finalize_too_recent_commitment.out @@ -34,7 +34,7 @@ This sequence of operations was run: ./tezos-client --wait none submit tx rollup commitment 0 '[TX_ROLLUP_INBOX_HASH]' 726f6f74 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' Node is bootstrapped. -Estimated gas: 3280.860 units (will add 100 for safety) +Estimated gas: 3280.956 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -45,19 +45,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.000632 + Fee to the baker: ꜩ0.000656 Expected counter: 3 Gas limit: 3381 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000632 - payload fees(the block proposer) ....... +ꜩ0.000632 - Tx rollup commitment:[TX_ROLLUP_HASH], commitment 0 : batches = 726f6f74 predecessor for inbox [TX_ROLLUP_INBOX_HASH] + [PUBLIC_KEY_HASH] ... -ꜩ0.000656 + payload fees(the block proposer) ....... +ꜩ0.000656 + Tx rollup commitment:[TX_ROLLUP_HASH], commitment 0 : batches = [TX_ROLLUP_MESSAGE_RESULT_HASH] predecessor for inbox [TX_ROLLUP_INBOX_HASH] From: [PUBLIC_KEY_HASH] This tx rollup commit operation was successfully applied Balance updates: - Consumed gas: 3280.860 + Consumed gas: 3280.956 ./tezos-client --wait none submit tx rollup finalize commitment to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' diff --git a/tezt/_regressions/tx_rollup_rpc_commitment.out b/tezt/_regressions/tx_rollup_rpc_commitment.out index bc129eea1f8b2972fd7ae199a4275b61405394db..08dc9930941e3b0cfec1e00f6db336ee9058dcbd 100644 --- a/tezt/_regressions/tx_rollup_rpc_commitment.out +++ b/tezt/_regressions/tx_rollup_rpc_commitment.out @@ -29,7 +29,7 @@ This sequence of operations was run: ./tezos-client --wait none submit tx rollup commitment 0 '[TX_ROLLUP_INBOX_HASH]' 726f6f74 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' Node is bootstrapped. -Estimated gas: 3280.860 units (will add 100 for safety) +Estimated gas: 3280.956 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -40,24 +40,26 @@ 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.000632 + Fee to the baker: ꜩ0.000656 Expected counter: 3 Gas limit: 3381 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000632 - payload fees(the block proposer) ....... +ꜩ0.000632 - Tx rollup commitment:[TX_ROLLUP_HASH], commitment 0 : batches = 726f6f74 predecessor for inbox [TX_ROLLUP_INBOX_HASH] + [PUBLIC_KEY_HASH] ... -ꜩ0.000656 + payload fees(the block proposer) ....... +ꜩ0.000656 + Tx rollup commitment:[TX_ROLLUP_HASH], commitment 0 : batches = [TX_ROLLUP_MESSAGE_RESULT_HASH] predecessor for inbox [TX_ROLLUP_INBOX_HASH] From: [PUBLIC_KEY_HASH] This tx rollup commit operation was successfully applied Balance updates: - Consumed gas: 3280.860 + Consumed gas: 3280.956 ./tezos-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/commitment/0' { "commitment": - { "level": 0, "batches": [ { "root": "726f6f74" } ], "predecessor": null, + { "level": 0, + "batches": [ "[TX_ROLLUP_MESSAGE_RESULT_HASH]" ], + "predecessor": null, "inbox_hash": "[TX_ROLLUP_INBOX_HASH]" }, "commitment_hash": "[TX_ROLLUP_COMMITMENT_HASH]", "committer": "[PUBLIC_KEY_HASH]", "submitted_at": 5 } diff --git a/tezt/_regressions/tx_rollup_rpc_pending_bonded_commitments.out b/tezt/_regressions/tx_rollup_rpc_pending_bonded_commitments.out index fc3dffba2660fa8e52158d2590ea82754b6bb854..19348f725c23fb9d326868745425b75a141771d0 100644 --- a/tezt/_regressions/tx_rollup_rpc_pending_bonded_commitments.out +++ b/tezt/_regressions/tx_rollup_rpc_pending_bonded_commitments.out @@ -29,7 +29,7 @@ This sequence of operations was run: ./tezos-client --wait none submit tx rollup commitment 0 '[TX_ROLLUP_INBOX_HASH]' 726f6f74 to '[TX_ROLLUP_HASH]' from '[PUBLIC_KEY_HASH]' Node is bootstrapped. -Estimated gas: 3280.860 units (will add 100 for safety) +Estimated gas: 3280.956 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -40,19 +40,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.000632 + Fee to the baker: ꜩ0.000656 Expected counter: 3 Gas limit: 3381 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000632 - payload fees(the block proposer) ....... +ꜩ0.000632 - Tx rollup commitment:[TX_ROLLUP_HASH], commitment 0 : batches = 726f6f74 predecessor for inbox [TX_ROLLUP_INBOX_HASH] + [PUBLIC_KEY_HASH] ... -ꜩ0.000656 + payload fees(the block proposer) ....... +ꜩ0.000656 + Tx rollup commitment:[TX_ROLLUP_HASH], commitment 0 : batches = [TX_ROLLUP_MESSAGE_RESULT_HASH] predecessor for inbox [TX_ROLLUP_INBOX_HASH] From: [PUBLIC_KEY_HASH] This tx rollup commit operation was successfully applied Balance updates: - Consumed gas: 3280.860 + Consumed gas: 3280.956 ./tezos-client rpc get '/chains/main/blocks/head/context/tx_rollup/[TX_ROLLUP_HASH]/pending_bonded_commitments/[PUBLIC_KEY_HASH]' diff --git a/tezt/lib_tezos/tezos_regression.ml b/tezt/lib_tezos/tezos_regression.ml index 1b9b40d152d598fdb3c51e83b63987f21718ae01..4cc0efad192aae2071210680c0dc044a85741ee9 100644 --- a/tezt/lib_tezos/tezos_regression.ml +++ b/tezt/lib_tezos/tezos_regression.ml @@ -34,6 +34,7 @@ let hooks = ("tz4\\w{33}\\b", "[TX_ROLLUP_PUBLIC_KEY_HASH]"); ("txi\\w{50}\\b", "[TX_ROLLUP_INBOX_HASH]"); ("txm\\w{50}\\b", "[TX_ROLLUP_MESSAGE_HASH]"); + ("txmr\\w{50}\\b", "[TX_ROLLUP_MESSAGE_RESULT_HASH]"); ("txc\\w{50}\\b", "[TX_ROLLUP_COMMITMENT_HASH]"); ("edpk\\w{50}\\b", "[PUBLIC_KEY]"); ("KT1\\w{33}\\b", "[CONTRACT_HASH]");