From a69ca2a546168ebafd58fa103f57b6d258216c52 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Sun, 27 Oct 2024 19:37:20 +0100 Subject: [PATCH 1/5] DAL/Proto: generalize the skip list cells' publisher field to Contract_repr.t This will allow publishing DAL commitments from smart contracts, if we want to implement this feature (e.g. via a multi-sig) --- src/proto_alpha/lib_protocol/dal_slot_repr.ml | 29 ++++++++++++------- .../lib_protocol/dal_slot_repr.mli | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/proto_alpha/lib_protocol/dal_slot_repr.ml b/src/proto_alpha/lib_protocol/dal_slot_repr.ml index 4539b1cba983..43d46c00b017 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_repr.ml +++ b/src/proto_alpha/lib_protocol/dal_slot_repr.ml @@ -358,14 +358,22 @@ module History = struct module Content_v2 = struct (** Each cell of the skip list is either a slot id (i.e. a published level and a slot index) for which no slot header is published or a published - slot header associated to the address which signed the L1 operation, the - attestation status from the protocol point of view, the number of - attested shards and the total number of shards. *) + slot header associated to the address which published the operation + (implicit account or smart contract), the attestation status from the + protocol point of view, the number of attested shards and the total + number of shards. + + In fact, we take the opportunity of this skip list upgrade to allow the + publisher to be a smart contract, even if it's not currently + implemented. In case we decide to publish commitments via smart + contracts (combined with Adaptive DAL, this would allow implementing a + kind of DAC using the DAL infra), the skip list will not require a + migration. *) type t = | Unpublished of Header.id | Published of { header : Header.t; - publisher : Signature.public_key_hash; + publisher : Contract_repr.t; is_proto_attested : bool; attested_shards : int; total_shards : int; @@ -419,7 +427,8 @@ module History = struct Published { header = slot_header; - publisher = Signature.Public_key_hash.zero; + publisher = + Contract_repr.Implicit Signature.Public_key_hash.zero; is_proto_attested = true; attested_shards = 1; total_shards = 1; @@ -440,7 +449,7 @@ module History = struct (merge_objs (obj5 (req "kind" (constant "published")) - (req "publisher" Signature.Public_key_hash.encoding) + (req "publisher" Contract_repr.encoding) (req "is_proto_attested" bool) (req "attested_shards" uint16) (req "total_shards" uint16)) @@ -491,7 +500,7 @@ module History = struct }, Published sh ) -> Header.equal header sh.header - && Signature.Public_key_hash.equal publisher sh.publisher + && Contract_repr.equal publisher sh.publisher && Compare.Bool.equal is_proto_attested sh.is_proto_attested && Compare.Int.equal attested_shards sh.attested_shards && Compare.Int.equal total_shards sh.total_shards @@ -516,7 +525,7 @@ module History = struct @[total_shards: %d@@] }" Header.pp header - Signature.Public_key_hash.pp + Contract_repr.pp publisher is_proto_attested attested_shards @@ -789,7 +798,7 @@ module History = struct Published { header = s; - publisher; + publisher = Contract_repr.Implicit publisher; is_proto_attested; attested_shards; total_shards; @@ -1311,7 +1320,7 @@ module History = struct | Unpublished of Header.id | Published of { header : Header.t; - publisher : Signature.public_key_hash; + publisher : Contract_repr.t; is_proto_attested : bool; attested_shards : int; total_shards : int; diff --git a/src/proto_alpha/lib_protocol/dal_slot_repr.mli b/src/proto_alpha/lib_protocol/dal_slot_repr.mli index 7405cc7be001..f5aab73bc2c4 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_repr.mli +++ b/src/proto_alpha/lib_protocol/dal_slot_repr.mli @@ -410,7 +410,7 @@ module History : sig | Unpublished of Header.id | Published of { header : Header.t; - publisher : Signature.public_key_hash; + publisher : Contract_repr.t; is_proto_attested : bool; attested_shards : int; total_shards : int; -- GitLab From 002432c99879146a404f0caf78f9a70c5428b525 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Sun, 27 Oct 2024 19:54:41 +0100 Subject: [PATCH 2/5] Proto: add a helper 'Contract_repr.zero' for `Implicit Signature.Public_key_hash.zero` --- src/proto_alpha/lib_protocol/contract_repr.ml | 2 ++ src/proto_alpha/lib_protocol/contract_repr.mli | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/proto_alpha/lib_protocol/contract_repr.ml b/src/proto_alpha/lib_protocol/contract_repr.ml index c1475e7c90b9..96d9cc493312 100644 --- a/src/proto_alpha/lib_protocol/contract_repr.ml +++ b/src/proto_alpha/lib_protocol/contract_repr.ml @@ -233,3 +233,5 @@ end (* Renamed exports. *) let of_b58data = contract_of_b58data + +let zero = Implicit Signature.Public_key_hash.zero diff --git a/src/proto_alpha/lib_protocol/contract_repr.mli b/src/proto_alpha/lib_protocol/contract_repr.mli index 3d0278f2ff2e..fc70f29012a9 100644 --- a/src/proto_alpha/lib_protocol/contract_repr.mli +++ b/src/proto_alpha/lib_protocol/contract_repr.mli @@ -101,3 +101,7 @@ val cases : ('a -> t option) -> (t -> 'a) -> 'a Data_encoding.case list val rpc_arg : t RPC_arg.arg module Index : Storage_description.INDEX with type t = t + +(** A value [zero] for type {!t}. It's equal to [Implicit + Signature.Public_key_hash.zero]. *) +val zero : t -- GitLab From 59ed85c2b7bfb78b04c2b33fce52ff1fd3362a1b Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Sun, 27 Oct 2024 19:55:33 +0100 Subject: [PATCH 3/5] DAL/Proto: all the backend until skip list update takes Contract_repr.t --- src/proto_alpha/lib_protocol/alpha_context.mli | 12 +++--------- src/proto_alpha/lib_protocol/dal_slot_repr.ml | 9 ++++----- src/proto_alpha/lib_protocol/dal_slot_repr.mli | 8 ++++---- src/proto_alpha/lib_protocol/dal_slot_storage.mli | 7 +++---- src/proto_alpha/lib_protocol/raw_context.mli | 3 +-- src/proto_alpha/lib_protocol/storage.ml | 4 ++-- src/proto_alpha/lib_protocol/storage.mli | 3 +-- .../lib_protocol/test/pbt/test_dal_slot_proof.ml | 4 +++- .../lib_protocol/test/pbt/test_sc_rollup_encoding.ml | 4 ++-- .../lib_protocol/test/unit/test_dal_slot_proof.ml | 4 ++-- .../test/test_octez_conversions.ml | 4 ++-- 11 files changed, 27 insertions(+), 35 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 24dd772e6c17..3ed9c73a6711 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2877,7 +2877,7 @@ module Dal : sig val find_slot_headers : context -> Raw_level.t -> - (Header.t * Signature.public_key_hash) list option tzresult Lwt.t + (Header.t * Contract.t) list option tzresult Lwt.t val finalize_current_slot_headers : context -> context Lwt.t @@ -2931,10 +2931,7 @@ module Dal : sig ?with_migration:Raw_level.t * int -> published_level:Raw_level.t -> number_of_slots:int -> - (Slot.Header.t - * Signature.public_key_hash - * Attestation.attestation_status) - list -> + (Slot.Header.t * Contract.t * Attestation.attestation_status) list -> t tzresult val update_skip_list : @@ -2943,10 +2940,7 @@ module Dal : sig ?with_migration:Raw_level.t * int -> published_level:Raw_level.t -> number_of_slots:int -> - (Slot.Header.t - * Signature.public_key_hash - * Attestation.attestation_status) - list -> + (Slot.Header.t * Contract.t * Attestation.attestation_status) list -> (t * History_cache.t) tzresult type proof diff --git a/src/proto_alpha/lib_protocol/dal_slot_repr.ml b/src/proto_alpha/lib_protocol/dal_slot_repr.ml index 43d46c00b017..5ce418934969 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_repr.ml +++ b/src/proto_alpha/lib_protocol/dal_slot_repr.ml @@ -220,7 +220,7 @@ module Slot_market = struct type t = { length : int; - slot_headers : (Header.t * Signature.public_key_hash) Slot_index_map.t; + slot_headers : (Header.t * Contract_repr.t) Slot_index_map.t; } let init ~length = @@ -244,7 +244,7 @@ module Slot_market = struct let update = function | None -> has_changed := true ; - Some (new_slot_header, source) + Some (new_slot_header, Contract_repr.Implicit source) | Some x -> Some x in let slot_headers = @@ -427,8 +427,7 @@ module History = struct Published { header = slot_header; - publisher = - Contract_repr.Implicit Signature.Public_key_hash.zero; + publisher = Contract_repr.zero; is_proto_attested = true; attested_shards = 1; total_shards = 1; @@ -798,7 +797,7 @@ module History = struct Published { header = s; - publisher = Contract_repr.Implicit publisher; + publisher; is_proto_attested; attested_shards; total_shards; diff --git a/src/proto_alpha/lib_protocol/dal_slot_repr.mli b/src/proto_alpha/lib_protocol/dal_slot_repr.mli index f5aab73bc2c4..6efcb7313642 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_repr.mli +++ b/src/proto_alpha/lib_protocol/dal_slot_repr.mli @@ -197,8 +197,8 @@ module Slot_market : sig t -> Header.t -> source:Signature.public_key_hash -> (t * bool) option (** [candidates t] returns a list of slot header candidates associated to the - public key hashes of the managers who published them. *) - val candidates : t -> (Header.t * Signature.public_key_hash) list + contract address who published them. *) + val candidates : t -> (Header.t * Contract_repr.t) list end (** This module provides an abstract data structure (type {!History.t}) that @@ -284,7 +284,7 @@ module History : sig published_level:Raw_level_repr.t -> number_of_slots:int -> (Header.t - * Signature.public_key_hash + * Contract_repr.t * Dal_attestation_repr.Accountability.attestation_status) list -> (t * History_cache.t) tzresult @@ -297,7 +297,7 @@ module History : sig published_level:Raw_level_repr.t -> number_of_slots:int -> (Header.t - * Signature.public_key_hash + * Contract_repr.t * Dal_attestation_repr.Accountability.attestation_status) list -> t tzresult diff --git a/src/proto_alpha/lib_protocol/dal_slot_storage.mli b/src/proto_alpha/lib_protocol/dal_slot_storage.mli index 746520a82800..2ad95e5146fe 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_storage.mli +++ b/src/proto_alpha/lib_protocol/dal_slot_storage.mli @@ -45,15 +45,14 @@ any slot in the storage. *) (** [find_slot_headers ctxt level] returns [Some slot_headers] where - [slot_headers] are pending slots at level [level] alongside the public key - hashes that published them. [None] is returned if no [slot_header] was + [slot_headers] are pending slots at level [level] alongside the contracts + addresses that published them. [None] is returned if no [slot_header] was registered at this level. The function fails if the reading into the context fails. *) val find_slot_headers : Raw_context.t -> Raw_level_repr.t -> - (Dal_slot_repr.Header.t * Signature.public_key_hash) list option tzresult - Lwt.t + (Dal_slot_repr.Header.t * Contract_repr.t) list option tzresult Lwt.t (** [find_level_histories ctxt] returns the cells of the DAL skip list produced at the current level alongside their hashes. Returns [None] if no entry is diff --git a/src/proto_alpha/lib_protocol/raw_context.mli b/src/proto_alpha/lib_protocol/raw_context.mli index deb8d9ce56e2..ea9711d2eef7 100644 --- a/src/proto_alpha/lib_protocol/raw_context.mli +++ b/src/proto_alpha/lib_protocol/raw_context.mli @@ -454,8 +454,7 @@ module Dal : sig (** [candidates ctxt] returns the current list of slot for which there is at least one candidate alongside the addresses that published them. *) - val candidates : - t -> (Dal_slot_repr.Header.t * Signature.public_key_hash) list + val candidates : t -> (Dal_slot_repr.Header.t * Contract_repr.t) list (** [is_slot_index_attested ctxt slot_index] returns [true] if the [slot_index] is declared available by the protocol. [false] otherwise. If diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 3486b1c0f644..d9c4caed4854 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -2168,14 +2168,14 @@ module Dal = struct (* The size of the list below is at most equal to the [number_of_slots] as declared in the DAL parameters of the protocol. *) - type t = (Dal_slot_repr.Header.t * Signature.public_key_hash) list + type t = (Dal_slot_repr.Header.t * Contract_repr.t) list let encoding = let open Data_encoding in list (obj2 (req "slot_header" Dal_slot_repr.Header.encoding) - (req "publisher" Signature.Public_key_hash.encoding)) + (req "publisher" Contract_repr.encoding)) end) module History = diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index 26e919be8848..8d9350b94d8f 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -1015,8 +1015,7 @@ module Dal : sig Non_iterable_indexed_data_storage with type t = Raw_context.t and type key = Raw_level_repr.t - and type value = - (Dal_slot_repr.Header.t * Signature.public_key_hash) list + and type value = (Dal_slot_repr.Header.t * Contract_repr.t) list (** This is a permanent storage for slot headers confirmed by the L1. *) module History : diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml b/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml index 59edf5542cb2..8cd94e4ce89c 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml @@ -112,7 +112,9 @@ struct } in if skip_slot then None - else Some (slot, slot_publisher, attestation_status)) + else + Some + (slot, Contract_repr.Implicit slot_publisher, attestation_status)) slots_headers in let*?@ cell, cache = diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml index 8b98b97d28a7..f37a2ad16c60 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml @@ -124,7 +124,7 @@ let pack_slots_headers_by_level list = let module SSH = Set.Make (struct type t = Dal_slot_repr.Header.t - * Signature.public_key_hash + * Contract_repr.t * Dal_attestation_repr.Accountability.attestation_status let compare (a, _, _) (b, _, _) = @@ -196,7 +196,7 @@ let gen_dal_slots_history () = |> Option.value ~default:Index.zero in ( Header.{id = {published_level; index}; commitment = Commitment.zero}, - publisher, + Contract_repr.Implicit publisher, attestation_status )) list in diff --git a/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml b/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml index 3f6892bf612f..cef8c27b053f 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml @@ -70,7 +70,7 @@ struct Hist.update_skip_list_no_cache skip_list ~published_level:level - [(slot, Signature.Public_key_hash.zero, mk_attested)] + [(slot, Contract_repr.zero, mk_attested)] ~number_of_slots:Parameters.dal_parameters.number_of_slots in check_result result @@ -196,7 +196,7 @@ struct genesis_history genesis_history_cache ~published_level:level - [(slot, Signature.Public_key_hash.zero, mk_attested)] + [(slot, Contract_repr.zero, mk_attested)] in let* page_info, page_id = mk_page_info slot polynomial in produce_and_verify_proof diff --git a/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml b/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml index ace13311a1ea..a52144ba564c 100644 --- a/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml +++ b/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml @@ -267,7 +267,7 @@ let gen_slot_history = List.map (fun (h, publisher, status) -> ( Sc_rollup_proto_types.Dal.Slot_header.of_octez ~number_of_slots h, - publisher, + Contract.Implicit publisher, status )) h )) l @@ -298,7 +298,7 @@ let gen_slot_history_cache = List.map (fun (h, publisher, status) -> ( Sc_rollup_proto_types.Dal.Slot_header.of_octez ~number_of_slots h, - publisher, + Contract.Implicit publisher, status )) h )) l -- GitLab From 467ec9e1006ddc293c402d3209d759eb87a60e94 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Sun, 27 Oct 2024 20:04:39 +0100 Subject: [PATCH 4/5] DAL/Proto: update the protocol front of adding DAL commitments to use Contract.t instead of pkh --- src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml | 4 +++- src/proto_alpha/lib_protocol/alpha_context.mli | 2 +- src/proto_alpha/lib_protocol/apply.ml | 5 ++++- src/proto_alpha/lib_protocol/dal_apply.mli | 6 +++--- src/proto_alpha/lib_protocol/dal_slot_repr.ml | 2 +- src/proto_alpha/lib_protocol/dal_slot_repr.mli | 3 +-- src/proto_alpha/lib_protocol/raw_context.mli | 5 +---- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml index 8e2f3b535e2f..650dec45f175 100644 --- a/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/dal_benchmarks.ml @@ -111,7 +111,9 @@ module Publish_commitment : Benchmark.S = struct Dal_apply.apply_publish_commitment ctxt op - ~source:Environment.Signature.Public_key_hash.zero + ~source: + (Protocol.Alpha_context.Contract.Implicit + Environment.Signature.Public_key_hash.zero) with | Error errs -> Format.eprintf "%a@." Environment.Error_monad.pp_trace errs ; diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 3ed9c73a6711..64c1795caf6d 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2872,7 +2872,7 @@ module Dal : sig end val register_slot_header : - context -> Header.t -> source:public_key_hash -> context tzresult + context -> Header.t -> source:Contract.t -> context tzresult val find_slot_headers : context -> diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index 939399085882..eb5ea70a8182 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -1438,7 +1438,10 @@ let apply_manager_operation : [] ) | Dal_publish_commitment slot_header -> let*? ctxt, slot_header = - Dal_apply.apply_publish_commitment ctxt slot_header ~source + Dal_apply.apply_publish_commitment + ctxt + slot_header + ~source:(Contract.Implicit source) in let consumed_gas = Gas.consumed ~since:ctxt_before_op ~until:ctxt in let result = diff --git a/src/proto_alpha/lib_protocol/dal_apply.mli b/src/proto_alpha/lib_protocol/dal_apply.mli index 138e9b998214..7dcb0d7b9f98 100644 --- a/src/proto_alpha/lib_protocol/dal_apply.mli +++ b/src/proto_alpha/lib_protocol/dal_apply.mli @@ -58,12 +58,12 @@ val validate_publish_commitment : t -> Dal.Operations.Publish_commitment.t -> unit tzresult (** [apply_publish_commitment ctxt slot_header ~source] applies the publication - of slot header [slot_header] signed by [source] on top of [ctxt]. Fails if - the slot already contains a slot header. *) + of slot header [slot_header] associated to [source] on top of [ctxt]. Fails + if the slot already contains a slot header. *) val apply_publish_commitment : t -> Dal.Operations.Publish_commitment.t -> - source:public_key_hash -> + source:Contract.t -> (t * Dal.Slot.Header.t) tzresult (** [finalisation ctxt] should be executed at block finalisation diff --git a/src/proto_alpha/lib_protocol/dal_slot_repr.ml b/src/proto_alpha/lib_protocol/dal_slot_repr.ml index 5ce418934969..5fc7d39ec131 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_repr.ml +++ b/src/proto_alpha/lib_protocol/dal_slot_repr.ml @@ -244,7 +244,7 @@ module Slot_market = struct let update = function | None -> has_changed := true ; - Some (new_slot_header, Contract_repr.Implicit source) + Some (new_slot_header, source) | Some x -> Some x in let slot_headers = diff --git a/src/proto_alpha/lib_protocol/dal_slot_repr.mli b/src/proto_alpha/lib_protocol/dal_slot_repr.mli index 6efcb7313642..cf9c1dcfda5b 100644 --- a/src/proto_alpha/lib_protocol/dal_slot_repr.mli +++ b/src/proto_alpha/lib_protocol/dal_slot_repr.mli @@ -193,8 +193,7 @@ module Slot_market : sig The function returns [Some (_, true)] if the candidate is registered. Returns [Some (_, false)] otherwise. Returns [None] if [slot_header.id] is not a valid slot id. *) - val register : - t -> Header.t -> source:Signature.public_key_hash -> (t * bool) option + val register : t -> Header.t -> source:Contract_repr.t -> (t * bool) option (** [candidates t] returns a list of slot header candidates associated to the contract address who published them. *) diff --git a/src/proto_alpha/lib_protocol/raw_context.mli b/src/proto_alpha/lib_protocol/raw_context.mli index ea9711d2eef7..c073e3d2b43e 100644 --- a/src/proto_alpha/lib_protocol/raw_context.mli +++ b/src/proto_alpha/lib_protocol/raw_context.mli @@ -447,10 +447,7 @@ module Dal : sig candidate is registered. [Some (ctxt,false)] if another candidate was already registered previously. Returns an error if the slot is invalid. *) val register_slot_header : - t -> - Dal_slot_repr.Header.t -> - source:Signature.public_key_hash -> - t tzresult + t -> Dal_slot_repr.Header.t -> source:Contract_repr.t -> t tzresult (** [candidates ctxt] returns the current list of slot for which there is at least one candidate alongside the addresses that published them. *) -- GitLab From 2c27222534480caffcc9f60a06c8b91aa6333273 Mon Sep 17 00:00:00 2001 From: "iguerNL@Functori" Date: Sun, 27 Oct 2024 20:53:10 +0100 Subject: [PATCH 5/5] Kaitai: update files --- .../files/alpha__smart_rollup__game.ksy | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/client-libs/kaitai-struct-files/files/alpha__smart_rollup__game.ksy b/client-libs/kaitai-struct-files/files/alpha__smart_rollup__game.ksy index dfc069ff0f67..732ab7f8c46d 100644 --- a/client-libs/kaitai-struct-files/files/alpha__smart_rollup__game.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__smart_rollup__game.ksy @@ -13,6 +13,18 @@ types: if: (state_tag == bool::true) - id: tick type: n + 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) attested: seq: - id: attested_tag @@ -158,6 +170,13 @@ types: type: b1be - id: payload type: b7be + originated: + seq: + - id: contract_hash + size: 20 + - id: originated_padding + size: 1 + doc: This field is for padding, ignore public_key_hash: seq: - id: public_key_hash_tag @@ -178,8 +197,10 @@ types: published: seq: - id: publisher - type: public_key_hash - doc: A Ed25519, Secp256k1, P256, or BLS public key hash + 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. - id: is_proto_attested type: u1 enum: bool @@ -232,6 +253,9 @@ types: - id: commitment size: 48 enums: + alpha__contract_id_tag: + 0: implicit + 1: originated attested_tag: 0: v0 bool: -- GitLab