From af0153c4177e10eb35a16eefcafb5f2002d32ed9 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Wed, 2 Oct 2024 08:09:35 +0200 Subject: [PATCH 1/4] DAL/Proto: PVM Sig extension to add Request_adal_page case --- src/lib_wasm_debugger/commands.ml | 5 ++++ .../lib_protocol/alpha_context.mli | 1 + .../lib_protocol/sc_rollup_PVM_sig.ml | 29 +++++++++++++++++-- .../lib_protocol/sc_rollup_arith.ml | 11 ++++++- .../lib_protocol/sc_rollup_proof_repr.ml | 12 ++++++++ .../test/helpers/sc_rollup_helpers.ml | 8 ++++- .../lib_sc_rollup_node/fueled_pvm.ml | 11 +++++++ .../lib_sc_rollup_node/wasm_2_0_0_pvm.ml | 7 ++++- 8 files changed, 79 insertions(+), 5 deletions(-) diff --git a/src/lib_wasm_debugger/commands.ml b/src/lib_wasm_debugger/commands.ml index da513686471a..116f95e9b3e7 100644 --- a/src/lib_wasm_debugger/commands.ml +++ b/src/lib_wasm_debugger/commands.ml @@ -433,6 +433,11 @@ let reveals config request = supported by the debugger." | Request_dal_page {slot_id = {published_level; index}; page_index} -> request_dal_page config num_retries published_level index page_index + | Request_adal_page _ -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 + + Handle this case for adaptive DAL. *) + assert false let write_debug_default config = match config.Config.timings_file with diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index de30bace905e..51b28ca35c86 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -3258,6 +3258,7 @@ module Sc_rollup : sig | Reveal_raw_data of Sc_rollup_reveal_hash.t | Reveal_metadata | Request_dal_page of Dal.Page.t + | Request_adal_page of unit | Reveal_dal_parameters type is_reveal_enabled = current_block_level:Raw_level.t -> reveal -> bool diff --git a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml index 2fe94f9cbf47..01aa4ed03b78 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml @@ -218,6 +218,7 @@ type reveal = | Reveal_raw_data of Sc_rollup_reveal_hash.t | Reveal_metadata | Request_dal_page of Dal_slot_repr.Page.t + | Request_adal_page of unit (* TODO in next commit *) | Reveal_dal_parameters (** Request DAL parameters that were used for the slots published at the current inbox level. *) @@ -260,7 +261,22 @@ let reveal_encoding = (function Reveal_dal_parameters -> Some () | _ -> None) (fun () -> Reveal_dal_parameters) in - union [case_raw_data; case_metadata; case_dal_page; case_dal_parameters] + let case_adal_page = + case + ~title:"Request_adaptive_dal_page" + (Tag 4) + (obj2 (kind "request_adaptive_dal_page") (req "todo" Data_encoding.unit)) + (function Request_adal_page () -> Some ((), ()) | _ -> None) + (fun ((), ()) -> Request_adal_page ()) + in + union + [ + case_raw_data; + case_metadata; + case_dal_page; + case_dal_parameters; + case_adal_page; + ] (** [is_reveal_enabled] is the type of a predicate that tells if a kind of reveal is activated at a certain block level. *) @@ -277,6 +293,12 @@ let is_reveal_enabled_predicate | Blake2B -> t.raw_data.blake2B) | Reveal_metadata -> t.metadata | Request_dal_page _ -> t.dal_page + | Request_adal_page _ -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 + + Handle this case for adaptive DAL. We should probably add activation + level in the parameters. *) + assert false | Reveal_dal_parameters -> t.dal_parameters in Raw_level_repr.(current_block_level >= activation_level) @@ -340,7 +362,8 @@ let input_request_encoding = let pp_reveal fmt = function | Reveal_raw_data hash -> Sc_rollup_reveal_hash.pp fmt hash | Reveal_metadata -> Format.pp_print_string fmt "Reveal metadata" - | Request_dal_page id -> Dal_slot_repr.Page.pp fmt id + | Request_dal_page id -> Format.fprintf fmt "DAL:%a" Dal_slot_repr.Page.pp id + | Request_adal_page () -> Format.fprintf fmt "ADAL:TODO" | Reveal_dal_parameters -> Format.pp_print_string fmt "Reveal DAL parameters" (** [pp_input_request fmt i] pretty prints the given input [i] to the formatter @@ -368,6 +391,8 @@ let reveal_equal p1 p2 = | Reveal_metadata, _ -> false | Request_dal_page a, Request_dal_page b -> Dal_slot_repr.Page.equal a b | Request_dal_page _, _ -> false + | Request_adal_page (), Request_adal_page () -> true + | Request_adal_page _, _ -> false | Reveal_dal_parameters, Reveal_dal_parameters -> true | Reveal_dal_parameters, _ -> false diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index 6962e7fec37d..4387d3c6861b 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -999,6 +999,8 @@ module Make (Context : Sc_rollup_PVM_sig.Generic_pvm_context_sig) : return PS.(Needs_reveal Reveal_metadata) | Waiting_for_reveal (Request_dal_page page) -> return PS.(Needs_reveal (Request_dal_page page)) + | Waiting_for_reveal (Request_adal_page arg) -> + return PS.(Needs_reveal (Request_adal_page arg)) | Waiting_for_reveal Reveal_dal_parameters -> return PS.(Needs_reveal Reveal_dal_parameters) | Halted | Parsing | Evaluating -> return PS.No_input_required @@ -1134,8 +1136,11 @@ module Make (Context : Sc_rollup_PVM_sig.Generic_pvm_context_sig) : | None, Some (Request_dal_page page_id) -> (* We are in the same level, fetch the next page. *) next_dal_page dal_params ~target:(`Page_after page_id) - | _, Some Reveal_metadata | _, Some Reveal_dal_parameters -> + | _, Some Reveal_metadata + | _, Some Reveal_dal_parameters + | _, Some (Request_adal_page _) -> (* Should not happen. *) + (* These cases are not supported by the "toy" Arith PVM. *) assert false | _, Some (Reveal_raw_data _) -> (* Note that, providing a DAC input via a DAL page will interrupt @@ -1609,7 +1614,11 @@ module Make (Context : Sc_rollup_PVM_sig.Generic_pvm_context_sig) : error "Invalid set_input: expecting a dal page reveal, got an inbox \ message or a raw data reveal." + | PS.Needs_reveal (PS.Request_adal_page _), _ -> + error + "Invalid set_input: Flexible DAL is not supported in the arith PVM." in + return (state, request) type error += Arith_proof_verification_failed diff --git a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml index 1edd697386cc..2b5f35ecac8d 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_proof_repr.ml @@ -444,10 +444,17 @@ let valid (type state proof output) | ( Some (Reveal_proof Dal_parameters_proof), Needs_reveal Reveal_dal_parameters ) -> return_unit + | Some (Reveal_proof _), Needs_reveal (Request_dal_page _pid) -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 implement + refutation games for adaptive DAL. *) + assert false | None, (Initial | First_after _ | Needs_reveal _) | Some _, No_input_required | Some (Inbox_proof _), Needs_reveal _ | _ -> + (* ADAL/TODO: https://gitlab.com/tezos/tezos/-/milestones/410 + + Remove this fragile pattern matching. *) proof_error "Inbox proof and input request are dissociated." in return (input, input_requested) @@ -569,6 +576,11 @@ let produce ~metadata pvm_and_state commit_inbox_level ~is_reveal_enabled = ~get_history ~dal_attested_slots_validity_lag confirmed_slots_history + | Needs_reveal (Request_adal_page _info) -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 + + Implement refutations for adaptive DAL *) + assert false | Needs_reveal Reveal_dal_parameters -> let open Dal_with_history in return diff --git a/src/proto_alpha/lib_protocol/test/helpers/sc_rollup_helpers.ml b/src/proto_alpha/lib_protocol/test/helpers/sc_rollup_helpers.ml index 133a589ecd60..d0b53961f950 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/sc_rollup_helpers.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/sc_rollup_helpers.ml @@ -874,8 +874,14 @@ struct | Needs_reveal Reveal_metadata | Needs_reveal Reveal_dal_parameters | Initial | First_after _ -> - return (state, fuel, tick, our_states)) + return (state, fuel, tick, our_states) + | Needs_reveal (Request_adal_page _) -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 + + to be implemented when needed. *) + assert false) in + go ~our_states fuel start_tick state let eval_metadata ~fuel ~our_states tick state ~metadata = diff --git a/src/proto_alpha/lib_sc_rollup_node/fueled_pvm.ml b/src/proto_alpha/lib_sc_rollup_node/fueled_pvm.ml index f45d1d0518a7..7eaf212f6faa 100644 --- a/src/proto_alpha/lib_sc_rollup_node/fueled_pvm.ml +++ b/src/proto_alpha/lib_sc_rollup_node/fueled_pvm.ml @@ -174,7 +174,13 @@ module Make_fueled (F : Fuel.S) : FUELED_PVM with type fuel = F.t = struct (Data_encoding.Binary.to_string_exn Sc_rollup.Dal_parameters.encoding dal_parameters) + | Request_adal_page _ -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 + + To be implemented. *) + assert false in + let eval_tick_consume_fuel fuel failing_ticks state = let normal_eval state fuel = let max_steps = F.max_ticks fuel in @@ -311,6 +317,11 @@ module Make_fueled (F : Fuel.S) : FUELED_PVM with type fuel = F.t = struct go fuel (Int64.succ current_tick) failing_ticks state) | Initial | First_after _ -> return @@ Completed {fuel; current_tick; failing_ticks} + | Needs_reveal (Request_adal_page _) -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 + + to be implemented. *) + assert false in go fuel start_tick failing_ticks state diff --git a/src/proto_alpha/lib_sc_rollup_node/wasm_2_0_0_pvm.ml b/src/proto_alpha/lib_sc_rollup_node/wasm_2_0_0_pvm.ml index 0510ed5ac27f..0b7dd6504335 100644 --- a/src/proto_alpha/lib_sc_rollup_node/wasm_2_0_0_pvm.ml +++ b/src/proto_alpha/lib_sc_rollup_node/wasm_2_0_0_pvm.ml @@ -201,6 +201,11 @@ module Impl : Pvm_sig.S with type Unsafe_patches.t = unsafe_patch = struct | Waiting_for_reveal Sc_rollup.Reveal_dal_parameters -> "Waiting for DAL parameters" | Computing -> "Computing" + | Waiting_for_reveal (Request_adal_page _) -> + (* ADAL/FIXME: https://gitlab.com/tezos/tezos/-/milestones/410 + + To be implemented. *) + assert false let eval_many ~reveal_builtins ~write_debug ~is_reveal_enabled:_ = Backend.compute_step_many @@ -209,7 +214,7 @@ module Impl : Pvm_sig.S with type Unsafe_patches.t = unsafe_patch = struct ~write_debug ?hooks:None - (** WASM PVM Mutable API works by holding a reference to an immutable state + (** WASM PVM Mutable API works by holding a reference to an immutable state and wrapping all immutable functionality around the reference *) module Mutable_state : Pvm_sig.MUTABLE_STATE_S -- GitLab From 7474185ba24d6cf494337b745ac82a03f0cc4ca0 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Mon, 4 Nov 2024 15:12:13 +0100 Subject: [PATCH 2/4] DAL/Proto: provide a payload for Request_adal_page variant --- .../lib_protocol/alpha_context.mli | 6 +++- .../lib_protocol/sc_rollup_PVM_sig.ml | 36 +++++++++++++++---- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 51b28ca35c86..5ed4862b6879 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -3258,7 +3258,11 @@ module Sc_rollup : sig | Reveal_raw_data of Sc_rollup_reveal_hash.t | Reveal_metadata | Request_dal_page of Dal.Page.t - | Request_adal_page of unit + | Request_adal_page of { + page_id : Dal.Page.t; + min_attested_shards : int; + expected_total_shards : int; + } | Reveal_dal_parameters type is_reveal_enabled = current_block_level:Raw_level.t -> reveal -> bool diff --git a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml index 01aa4ed03b78..2423beda81f8 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml @@ -218,7 +218,11 @@ type reveal = | Reveal_raw_data of Sc_rollup_reveal_hash.t | Reveal_metadata | Request_dal_page of Dal_slot_repr.Page.t - | Request_adal_page of unit (* TODO in next commit *) + | Request_adal_page of { + page_id : Dal_slot_repr.Page.t; + min_attested_shards : int; + expected_total_shards : int; + } | Reveal_dal_parameters (** Request DAL parameters that were used for the slots published at the current inbox level. *) @@ -265,9 +269,18 @@ let reveal_encoding = case ~title:"Request_adaptive_dal_page" (Tag 4) - (obj2 (kind "request_adaptive_dal_page") (req "todo" Data_encoding.unit)) - (function Request_adal_page () -> Some ((), ()) | _ -> None) - (fun ((), ()) -> Request_adal_page ()) + (obj4 + (kind "request_adaptive_dal_page") + (req "page_id" Dal_slot_repr.Page.encoding) + (req "min_attested_shards" Data_encoding.uint16) + (req "expected_total_shards" Data_encoding.uint16)) + (function + | Request_adal_page + {page_id; min_attested_shards; expected_total_shards} -> + Some ((), page_id, min_attested_shards, expected_total_shards) + | _ -> None) + (fun ((), page_id, min_attested_shards, expected_total_shards) -> + Request_adal_page {page_id; min_attested_shards; expected_total_shards}) in union [ @@ -363,7 +376,14 @@ let pp_reveal fmt = function | Reveal_raw_data hash -> Sc_rollup_reveal_hash.pp fmt hash | Reveal_metadata -> Format.pp_print_string fmt "Reveal metadata" | Request_dal_page id -> Format.fprintf fmt "DAL:%a" Dal_slot_repr.Page.pp id - | Request_adal_page () -> Format.fprintf fmt "ADAL:TODO" + | Request_adal_page {page_id; min_attested_shards; expected_total_shards} -> + Format.fprintf + fmt + "ADAL:{page:%a; min_attested_shards:%d; expected_total_shards:%d}" + Dal_slot_repr.Page.pp + page_id + min_attested_shards + expected_total_shards | Reveal_dal_parameters -> Format.pp_print_string fmt "Reveal DAL parameters" (** [pp_input_request fmt i] pretty prints the given input [i] to the formatter @@ -391,7 +411,11 @@ let reveal_equal p1 p2 = | Reveal_metadata, _ -> false | Request_dal_page a, Request_dal_page b -> Dal_slot_repr.Page.equal a b | Request_dal_page _, _ -> false - | Request_adal_page (), Request_adal_page () -> true + | ( Request_adal_page {page_id; min_attested_shards; expected_total_shards}, + Request_adal_page b ) -> + Dal_slot_repr.Page.equal page_id b.page_id + && Compare.Int.equal min_attested_shards b.min_attested_shards + && Compare.Int.equal expected_total_shards b.expected_total_shards | Request_adal_page _, _ -> false | Reveal_dal_parameters, Reveal_dal_parameters -> true | Reveal_dal_parameters, _ -> false -- GitLab From 1d4f73aa189f57bd87b3abda6820d8e3a1fbafc0 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Mon, 4 Nov 2024 15:40:20 +0100 Subject: [PATCH 3/4] DAL/Proto: Request_adal_page can ask to filter by commitments publishers --- .../lib_protocol/alpha_context.mli | 1 + .../lib_protocol/sc_rollup_PVM_sig.ml | 73 ++++++++++++++++--- 2 files changed, 63 insertions(+), 11 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 5ed4862b6879..af251499a08d 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -3262,6 +3262,7 @@ module Sc_rollup : sig page_id : Dal.Page.t; min_attested_shards : int; expected_total_shards : int; + restricted_commitments_publishers : Contract.t list option; } | Reveal_dal_parameters diff --git a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml index 2423beda81f8..2321f852d392 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_PVM_sig.ml @@ -220,12 +220,16 @@ type reveal = | Request_dal_page of Dal_slot_repr.Page.t | Request_adal_page of { page_id : Dal_slot_repr.Page.t; + (* The id of the DAL page we want to import. *) min_attested_shards : int; - expected_total_shards : int; + (* The expected minimal number of attested shards of the slot. *) + expected_total_shards : int; (* The total number of shards of the slot. *) + restricted_commitments_publishers : Contract_repr.t list option; + (* If none, no filtering by commitments publishers is made. *) } | Reveal_dal_parameters (** Request DAL parameters that were used for the slots published at - the current inbox level. *) + the current inbox level. *) let reveal_encoding = let open Data_encoding in @@ -269,18 +273,42 @@ let reveal_encoding = case ~title:"Request_adaptive_dal_page" (Tag 4) - (obj4 + (obj5 (kind "request_adaptive_dal_page") (req "page_id" Dal_slot_repr.Page.encoding) (req "min_attested_shards" Data_encoding.uint16) - (req "expected_total_shards" Data_encoding.uint16)) + (req "expected_total_shards" Data_encoding.uint16) + (dft + "restricted_commitments_publishers" + (option (list ~max_length:10 Contract_repr.encoding)) + None)) (function | Request_adal_page - {page_id; min_attested_shards; expected_total_shards} -> - Some ((), page_id, min_attested_shards, expected_total_shards) + { + page_id; + min_attested_shards; + expected_total_shards; + restricted_commitments_publishers; + } -> + Some + ( (), + page_id, + min_attested_shards, + expected_total_shards, + restricted_commitments_publishers ) | _ -> None) - (fun ((), page_id, min_attested_shards, expected_total_shards) -> - Request_adal_page {page_id; min_attested_shards; expected_total_shards}) + (fun ( (), + page_id, + min_attested_shards, + expected_total_shards, + restricted_commitments_publishers ) -> + Request_adal_page + { + page_id; + min_attested_shards; + expected_total_shards; + restricted_commitments_publishers; + }) in union [ @@ -376,14 +404,27 @@ let pp_reveal fmt = function | Reveal_raw_data hash -> Sc_rollup_reveal_hash.pp fmt hash | Reveal_metadata -> Format.pp_print_string fmt "Reveal metadata" | Request_dal_page id -> Format.fprintf fmt "DAL:%a" Dal_slot_repr.Page.pp id - | Request_adal_page {page_id; min_attested_shards; expected_total_shards} -> + | Request_adal_page + { + page_id; + min_attested_shards; + expected_total_shards; + restricted_commitments_publishers; + } -> Format.fprintf fmt - "ADAL:{page:%a; min_attested_shards:%d; expected_total_shards:%d}" + "ADAL:{page:%a; min_attested_shards:%d; expected_total_shards:%d; \ + publishers:%a}" Dal_slot_repr.Page.pp page_id min_attested_shards expected_total_shards + (Format.pp_print_option + ~none:(fun fmt () -> Format.fprintf fmt "Any") + (Format.pp_print_list + ~pp_sep:(fun fmt () -> Format.pp_print_string fmt ", ") + Contract_repr.pp_short)) + restricted_commitments_publishers | Reveal_dal_parameters -> Format.pp_print_string fmt "Reveal DAL parameters" (** [pp_input_request fmt i] pretty prints the given input [i] to the formatter @@ -411,11 +452,21 @@ let reveal_equal p1 p2 = | Reveal_metadata, _ -> false | Request_dal_page a, Request_dal_page b -> Dal_slot_repr.Page.equal a b | Request_dal_page _, _ -> false - | ( Request_adal_page {page_id; min_attested_shards; expected_total_shards}, + | ( Request_adal_page + { + page_id; + min_attested_shards; + expected_total_shards; + restricted_commitments_publishers; + }, Request_adal_page b ) -> Dal_slot_repr.Page.equal page_id b.page_id && Compare.Int.equal min_attested_shards b.min_attested_shards && Compare.Int.equal expected_total_shards b.expected_total_shards + && Option.equal + (List.equal Contract_repr.equal) + restricted_commitments_publishers + b.restricted_commitments_publishers | Request_adal_page _, _ -> false | Reveal_dal_parameters, Reveal_dal_parameters -> true | Reveal_dal_parameters, _ -> false -- GitLab From 2f7a7dfca182e8f572ba9eea2658a5bf0961ef51 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Thu, 7 Nov 2024 14:14:57 +0100 Subject: [PATCH 4/4] Fix Kaitai files --- .../files/alpha__smart_rollup__reveal.ksy | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/client-libs/kaitai-struct-files/files/alpha__smart_rollup__reveal.ksy b/client-libs/kaitai-struct-files/files/alpha__smart_rollup__reveal.ksy index 68847120ac50..7e96ef15559e 100644 --- a/client-libs/kaitai-struct-files/files/alpha__smart_rollup__reveal.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__smart_rollup__reveal.ksy @@ -3,6 +3,18 @@ meta: endian: be doc: ! 'Encoding id: alpha.smart_rollup.reveal' types: + alpha__contract_id: + seq: + - id: alpha__contract_id_tag + type: u1 + enum: alpha__contract_id_tag + - id: implicit + type: public_key_hash + if: (alpha__contract_id_tag == alpha__contract_id_tag::implicit) + doc: A Ed25519, Secp256k1, P256, or BLS public key hash + - id: originated + type: originated + if: (alpha__contract_id_tag == alpha__contract_id_tag::originated) input_hash: seq: - id: input_hash_tag @@ -11,6 +23,13 @@ types: - id: reveal_data_hash_v0 size: 32 if: (input_hash_tag == input_hash_tag::reveal_data_hash_v0) + originated: + seq: + - id: contract_hash + size: 20 + - id: originated_padding + size: 1 + doc: This field is for padding, ignore page_id: seq: - id: published_level @@ -19,14 +38,82 @@ types: type: u1 - id: page_index type: s2be + public_key_hash: + seq: + - id: public_key_hash_tag + type: u1 + enum: public_key_hash_tag + - id: ed25519 + size: 20 + if: (public_key_hash_tag == public_key_hash_tag::ed25519) + - id: secp256k1 + size: 20 + if: (public_key_hash_tag == public_key_hash_tag::secp256k1) + - id: p256 + size: 20 + if: (public_key_hash_tag == public_key_hash_tag::p256) + - id: bls + size: 20 + if: (public_key_hash_tag == public_key_hash_tag::bls) + request_adaptive_dal_page: + seq: + - id: page_id + type: page_id + - id: min_attested_shards + type: u2be + - id: expected_total_shards + type: u2be + - id: restricted_commitments_publishers + type: restricted_commitments_publishers + restricted_commitments_publishers: + seq: + - id: restricted_commitments_publishers_tag + type: u1 + enum: restricted_commitments_publishers_tag + - id: some + type: some_0 + if: (restricted_commitments_publishers_tag == restricted_commitments_publishers_tag::some) + some: + seq: + - id: some_entries + type: some_entries + repeat: eos + some_0: + seq: + - id: len_some + type: u4be + valid: + max: 220 + - id: some + type: some + size: len_some + some_entries: + seq: + - id: alpha__contract_id + type: alpha__contract_id + doc: ! >- + A contract handle: A contract notation as given to an RPC or inside scripts. + Can be a base58 implicit contract hash or a base58 originated contract hash. enums: + alpha__contract_id_tag: + 0: implicit + 1: originated alpha__smart_rollup__reveal_tag: 0: reveal_raw_data 1: reveal_metadata 2: request_dal_page 3: reveal_dal_parameters + 4: request_adaptive_dal_page input_hash_tag: 0: reveal_data_hash_v0 + public_key_hash_tag: + 0: ed25519 + 1: secp256k1 + 2: p256 + 3: bls + restricted_commitments_publishers_tag: + 0: none + 1: some seq: - id: alpha__smart_rollup__reveal_tag type: u1 @@ -37,3 +124,6 @@ seq: - id: request_dal_page type: page_id if: (alpha__smart_rollup__reveal_tag == alpha__smart_rollup__reveal_tag::request_dal_page) +- id: request_adaptive_dal_page + type: request_adaptive_dal_page + if: (alpha__smart_rollup__reveal_tag == alpha__smart_rollup__reveal_tag::request_adaptive_dal_page) -- GitLab