From e82fd1b476bd5368194b06f840950914fb269eed Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 1 Jul 2024 09:47:44 +0200 Subject: [PATCH 1/6] alpha: remove legacy attestation encoding in protocol_data operation --- .../lib_protocol/alpha_context.mli | 5 --- src/proto_alpha/lib_protocol/main.ml | 2 +- .../lib_protocol/operation_repr.ml | 32 ------------------- .../lib_protocol/operation_repr.mli | 13 -------- 4 files changed, 1 insertion(+), 51 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index db6ca8e6febe..ca174484d6ba 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -4735,9 +4735,6 @@ module Operation : sig val protocol_data_encoding : packed_protocol_data Data_encoding.t - val protocol_data_encoding_with_legacy_attestation_name : - packed_protocol_data Data_encoding.t - val unsigned_encoding : (Operation.shell_header * packed_contents_list) Data_encoding.t @@ -4762,8 +4759,6 @@ module Operation : sig val encoding : packed Data_encoding.t - val encoding_with_legacy_attestation_name : packed Data_encoding.t - val raw : _ operation -> raw val hash : _ operation -> Operation_hash.t diff --git a/src/proto_alpha/lib_protocol/main.ml b/src/proto_alpha/lib_protocol/main.ml index a927b7f6b8ef..a024d1506633 100644 --- a/src/proto_alpha/lib_protocol/main.ml +++ b/src/proto_alpha/lib_protocol/main.ml @@ -50,7 +50,7 @@ type operation_data = Alpha_context.packed_protocol_data = let operation_data_encoding = Alpha_context.Operation.protocol_data_encoding let operation_data_encoding_with_legacy_attestation_name = - Alpha_context.Operation.protocol_data_encoding_with_legacy_attestation_name + Alpha_context.Operation.protocol_data_encoding type operation_receipt = Apply_results.packed_operation_metadata = | Operation_metadata : diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 7c59bfc4596c..3f7822e5bb88 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -1744,18 +1744,6 @@ module Encoding = struct (req "contents" (dynamic_size contents_list_encoding)) (opt "signature" Signature.encoding)) - let protocol_data_json_encoding_with_legacy_attestation_name = - conv - (fun (Operation_data {contents; signature}) -> - (Contents_list contents, signature)) - (fun (Contents_list contents, signature) -> - Operation_data {contents; signature}) - (obj2 - (req - "contents" - (dynamic_size contents_list_encoding_with_legacy_attestation_name)) - (opt "signature" Signature.encoding)) - type contents_or_signature_prefix = | Actual_contents of packed_contents | Signature_prefix of Signature.prefix @@ -1903,26 +1891,12 @@ module Encoding = struct ~json:protocol_data_json_encoding ~binary:protocol_data_binary_encoding - let protocol_data_encoding_with_legacy_attestation_name = - def "operation_with_legacy_attestation_name.alpha.contents_and_signature" - @@ splitted - ~json:protocol_data_json_encoding_with_legacy_attestation_name - ~binary:protocol_data_binary_encoding - let operation_encoding = conv (fun {shell; protocol_data} -> (shell, protocol_data)) (fun (shell, protocol_data) -> {shell; protocol_data}) (merge_objs Operation.shell_header_encoding protocol_data_encoding) - let operation_encoding_with_legacy_attestation_name = - conv - (fun {shell; protocol_data} -> (shell, protocol_data)) - (fun (shell, protocol_data) -> {shell; protocol_data}) - (merge_objs - Operation.shell_header_encoding - protocol_data_encoding_with_legacy_attestation_name) - let unsigned_operation_encoding = def "operation.alpha.unsigned_operation" @@ merge_objs @@ -1939,9 +1913,6 @@ end let encoding = Encoding.operation_encoding -let encoding_with_legacy_attestation_name = - Encoding.operation_encoding_with_legacy_attestation_name - let contents_encoding = Encoding.contents_encoding let contents_encoding_with_legacy_attestation_name = @@ -1954,9 +1925,6 @@ let contents_list_encoding_with_legacy_attestation_name = let protocol_data_encoding = Encoding.protocol_data_encoding -let protocol_data_encoding_with_legacy_attestation_name = - Encoding.protocol_data_encoding_with_legacy_attestation_name - let unsigned_operation_encoding = Encoding.unsigned_operation_encoding let unsigned_operation_encoding_with_legacy_attestation_name = diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index bfe9e8bff835..f10c8897472c 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -526,16 +526,6 @@ val manager_kind : 'kind manager_operation -> 'kind Kind.manager val encoding : packed_operation Data_encoding.t -(** Operation encoding that accepts legacy attestation name : `endorsement` - (and preendorsement, double__evidence) in JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements kinds - in JSON will not be accepted any more by the protocol. -*) -val encoding_with_legacy_attestation_name : packed_operation Data_encoding.t - val contents_encoding : packed_contents Data_encoding.t val contents_encoding_with_legacy_attestation_name : @@ -548,9 +538,6 @@ val contents_list_encoding_with_legacy_attestation_name : val protocol_data_encoding : packed_protocol_data Data_encoding.t -val protocol_data_encoding_with_legacy_attestation_name : - packed_protocol_data Data_encoding.t - val unsigned_operation_encoding : (Operation.shell_header * packed_contents_list) Data_encoding.t -- GitLab From fa70d5ed2a3e3a267d642e7587a19efd9ed5a79e Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 1 Jul 2024 09:51:55 +0200 Subject: [PATCH 2/6] alpha: remove legacy attestation encoding in operations contents --- src/proto_alpha/lib_protocol/alpha_context.mli | 6 ------ src/proto_alpha/lib_protocol/operation_repr.ml | 6 ------ src/proto_alpha/lib_protocol/operation_repr.mli | 6 ------ 3 files changed, 18 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index ca174484d6ba..16bccdd75e46 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -4718,9 +4718,6 @@ module Operation : sig val contents_encoding : packed_contents Data_encoding.t - val contents_encoding_with_legacy_attestation_name : - packed_contents Data_encoding.t - type nonrec 'kind protocol_data = 'kind protocol_data type nonrec packed_protocol_data = packed_protocol_data @@ -4747,9 +4744,6 @@ module Operation : sig val contents_list_encoding : packed_contents_list Data_encoding.t - val contents_list_encoding_with_legacy_attestation_name : - packed_contents_list Data_encoding.t - type 'kind t = 'kind operation = { shell : Operation.shell_header; protocol_data : 'kind protocol_data; diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 3f7822e5bb88..b98db905f77e 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -1915,14 +1915,8 @@ let encoding = Encoding.operation_encoding let contents_encoding = Encoding.contents_encoding -let contents_encoding_with_legacy_attestation_name = - Encoding.contents_encoding_with_legacy_attestation_name - let contents_list_encoding = Encoding.contents_list_encoding -let contents_list_encoding_with_legacy_attestation_name = - Encoding.contents_list_encoding_with_legacy_attestation_name - let protocol_data_encoding = Encoding.protocol_data_encoding let unsigned_operation_encoding = Encoding.unsigned_operation_encoding diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index f10c8897472c..1fea4424f0c8 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -528,14 +528,8 @@ val encoding : packed_operation Data_encoding.t val contents_encoding : packed_contents Data_encoding.t -val contents_encoding_with_legacy_attestation_name : - packed_contents Data_encoding.t - val contents_list_encoding : packed_contents_list Data_encoding.t -val contents_list_encoding_with_legacy_attestation_name : - packed_contents_list Data_encoding.t - val protocol_data_encoding : packed_protocol_data Data_encoding.t val unsigned_operation_encoding : -- GitLab From ed1a97634699df89b0efd6d44cfe88baef488371 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 1 Jul 2024 10:00:20 +0200 Subject: [PATCH 3/6] alpha: remove legacy attestation encoding in unsigned operation --- src/proto_alpha/lib_protocol/alpha_context.ml | 3 - .../lib_protocol/alpha_context.mli | 3 - .../lib_protocol/operation_repr.ml | 56 ++----------------- .../lib_protocol/operation_repr.mli | 3 - 4 files changed, 6 insertions(+), 59 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.ml b/src/proto_alpha/lib_protocol/alpha_context.ml index 85fd9d3b2ca9..21329113956e 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.ml +++ b/src/proto_alpha/lib_protocol/alpha_context.ml @@ -197,9 +197,6 @@ module Operation = struct let unsigned_encoding = unsigned_operation_encoding - let unsigned_encoding_with_legacy_attestation_name = - unsigned_operation_encoding_with_legacy_attestation_name - include Operation_repr end diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 16bccdd75e46..df1458ee2ea4 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -4735,9 +4735,6 @@ module Operation : sig val unsigned_encoding : (Operation.shell_header * packed_contents_list) Data_encoding.t - val unsigned_encoding_with_legacy_attestation_name : - (Operation.shell_header * packed_contents_list) Data_encoding.t - type raw = Operation.t = {shell : Operation.shell_header; proto : bytes} val raw_encoding : raw Data_encoding.t diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index b98db905f77e..334ef7e3e9be 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -1647,8 +1647,13 @@ module Encoding = struct type packed_case = PCase : 'b case -> packed_case - let common_cases = + let contents_cases = [ + PCase preattestation_case; + PCase attestation_case; + PCase attestation_with_dal_case; + PCase double_preattestation_evidence_case; + PCase double_attestation_evidence_case; PCase seed_nonce_revelation_case; PCase vdf_revelation_case; PCase double_baking_evidence_case; @@ -1680,26 +1685,6 @@ module Encoding = struct PCase zk_rollup_update_case; ] - let contents_cases = - PCase preattestation_case :: PCase attestation_case - :: PCase attestation_with_dal_case - :: PCase double_preattestation_evidence_case - :: PCase double_attestation_evidence_case :: common_cases - - (** Encoding cases that accepts legacy attestation name : `endorsement` (and - preendorsement, double__evidence) in JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements - kinds in JSON will not be accepted any more by the protocol (Planned for - protocol Q). *) - let contents_cases_with_legacy_attestation_name = - PCase preendorsement_case :: PCase endorsement_case - :: PCase endorsement_with_dal_case - :: PCase double_preendorsement_evidence_case - :: PCase double_endorsement_evidence_case :: common_cases - let contents_encoding = let make (PCase (Case {tag; name; encoding; select; proj; inj})) = assert (not @@ reserved_tag tag) ; @@ -1712,28 +1697,9 @@ module Encoding = struct in def "operation.alpha.contents" @@ union (List.map make contents_cases) - let contents_encoding_with_legacy_attestation_name = - let make (PCase (Case {tag; name; encoding; select; proj; inj})) = - assert (not @@ reserved_tag tag) ; - case - (Tag tag) - name - encoding - (fun o -> match select o with None -> None | Some o -> Some (proj o)) - (fun x -> Contents (inj x)) - in - def "operation_with_legacy_attestation_name.alpha.contents" - @@ union (List.map make contents_cases_with_legacy_attestation_name) - let contents_list_encoding = conv_with_guard to_list of_list_internal (Variable.list contents_encoding) - let contents_list_encoding_with_legacy_attestation_name = - conv_with_guard - to_list - of_list_internal - (Variable.list contents_encoding_with_legacy_attestation_name) - let protocol_data_json_encoding = conv (fun (Operation_data {contents; signature}) -> @@ -1902,13 +1868,6 @@ module Encoding = struct @@ merge_objs Operation.shell_header_encoding (obj1 (req "contents" contents_list_encoding)) - - let unsigned_operation_encoding_with_legacy_attestation_name = - def "operation_with_legacy_attestation_name.alpha.unsigned_operation" - @@ merge_objs - Operation.shell_header_encoding - (obj1 - (req "contents" contents_list_encoding_with_legacy_attestation_name)) end let encoding = Encoding.operation_encoding @@ -1921,9 +1880,6 @@ let protocol_data_encoding = Encoding.protocol_data_encoding let unsigned_operation_encoding = Encoding.unsigned_operation_encoding -let unsigned_operation_encoding_with_legacy_attestation_name = - Encoding.unsigned_operation_encoding_with_legacy_attestation_name - let raw ({shell; protocol_data} : _ operation) = let proto = Data_encoding.Binary.to_bytes_exn diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index 1fea4424f0c8..a2532b51640d 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -535,9 +535,6 @@ val protocol_data_encoding : packed_protocol_data Data_encoding.t val unsigned_operation_encoding : (Operation.shell_header * packed_contents_list) Data_encoding.t -val unsigned_operation_encoding_with_legacy_attestation_name : - (Operation.shell_header * packed_contents_list) Data_encoding.t - val raw : _ operation -> raw val hash_raw : raw -> Operation_hash.t -- GitLab From 00f0f7ff4b3f9b476e863dba6dc7c4523938d9f8 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 1 Jul 2024 10:09:15 +0200 Subject: [PATCH 4/6] alpha: remove legacy attestation encoding operation cases --- .../lib_protocol/alpha_context.mli | 11 - .../lib_protocol/operation_repr.ml | 192 +----------------- .../lib_protocol/operation_repr.mli | 11 - 3 files changed, 3 insertions(+), 211 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index df1458ee2ea4..9e1eaee87dde 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -4793,30 +4793,19 @@ module Operation : sig } -> 'b case - val preendorsement_case : Kind.preattestation case - val preattestation_case : Kind.preattestation case - val endorsement_case : Kind.attestation case - val attestation_case : Kind.attestation case - val endorsement_with_dal_case : Kind.attestation case - val attestation_with_dal_case : Kind.attestation case val seed_nonce_revelation_case : Kind.seed_nonce_revelation case val vdf_revelation_case : Kind.vdf_revelation case - val double_preendorsement_evidence_case : - Kind.double_preattestation_evidence case - val double_preattestation_evidence_case : Kind.double_preattestation_evidence case - val double_endorsement_evidence_case : Kind.double_attestation_evidence case - val double_attestation_evidence_case : Kind.double_attestation_evidence case val double_baking_evidence_case : Kind.double_baking_evidence case diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 334ef7e3e9be..301e0370d9cc 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -1006,26 +1006,6 @@ module Encoding = struct } -> 'b case - (* Encoding case that accepts legacy preattestation name : `preendorsement` in - JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements - kinds in JSON will not be accepted any more by the protocol (Planned for - protocol Q). *) - let preendorsement_case = - Case - { - tag = 20; - name = "preendorsement"; - encoding = consensus_content_encoding; - select = - (function Contents (Preattestation _ as op) -> Some op | _ -> None); - proj = (fun (Preattestation preattestation) -> preattestation); - inj = (fun preattestation -> Preattestation preattestation); - } - let preattestation_case = Case { @@ -1038,39 +1018,6 @@ module Encoding = struct inj = (fun preattestation -> Preattestation preattestation); } - (* Encoding that accepts legacy preattestation name : `preendorsement` in JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements - kinds in JSON will not be accepted any more by the protocol (Planned for - protocol Q). *) - let preendorsement_encoding = - let make (Case {tag; name; encoding; select = _; proj; inj}) = - case (Tag tag) name encoding (fun o -> Some (proj o)) (fun x -> inj x) - in - let to_list : Kind.preattestation contents_list -> _ = function - | Single o -> o - in - let of_list : Kind.preattestation contents -> _ = function - | o -> Single o - in - def "inlined.preendorsement" - @@ conv - (fun ({shell; protocol_data = {contents; signature}} : _ operation) -> - (shell, (contents, signature))) - (fun (shell, (contents, signature)) : _ operation -> - {shell; protocol_data = {contents; signature}}) - (merge_objs - Operation.shell_header_encoding - (obj2 - (req - "operations" - (conv to_list of_list - @@ def "inlined.preendorsement.contents" - @@ union [make preendorsement_case])) - (varopt "signature" Signature.encoding))) - let preattestation_encoding = let make (Case {tag; name; encoding; select = _; proj; inj}) = case (Tag tag) name encoding (fun o -> Some (proj o)) (fun x -> inj x) @@ -1107,9 +1054,7 @@ module Encoding = struct let dal_content_encoding = obj1 (req "dal_attestation" Dal_attestation_repr.encoding) - let endorsement_encoding = consensus_content_encoding - - let endorsement_with_dal_encoding = + let consensus_content_with_dal_encoding = merge_objs consensus_content_encoding dal_content_encoding (* Precondition: [dal_content = None]. *) @@ -1147,33 +1092,12 @@ module Encoding = struct dal_content = Some {attestation}; } - (* Encoding case that accepts legacy attestation name : `endorsement` in JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements - kinds in JSON will not be accepted any more by the protocol (Planned for - protocol Q). *) - let endorsement_case = - Case - { - tag = 21; - name = "endorsement"; - encoding = endorsement_encoding; - select = - (function - | Contents (Attestation {dal_content = None; _} as op) -> Some op - | _ -> None); - proj = attestation_encoding_proj; - inj = attestation_encoding_inj; - } - let attestation_case = Case { tag = 21; name = "attestation"; - encoding = endorsement_encoding; + encoding = consensus_content_encoding; select = (function | Contents (Attestation {dal_content = None; _} as op) -> Some op @@ -1182,26 +1106,12 @@ module Encoding = struct inj = attestation_encoding_inj; } - let endorsement_with_dal_case = - Case - { - tag = 23; - name = "endorsement_with_dal"; - encoding = endorsement_with_dal_encoding; - select = - (function - | Contents (Attestation {dal_content = Some _; _} as op) -> Some op - | _ -> None); - proj = attestation_with_dal_encoding_proj; - inj = attestation_with_dal_encoding_inj; - } - let attestation_with_dal_case = Case { tag = 23; name = "attestation_with_dal"; - encoding = endorsement_with_dal_encoding; + encoding = consensus_content_with_dal_encoding; select = (function | Contents (Attestation {dal_content = Some _; _} as op) -> Some op @@ -1210,51 +1120,6 @@ module Encoding = struct inj = attestation_with_dal_encoding_inj; } - (* Encoding that accepts legacy attestation name : `endorsement` in JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements - kinds in JSON will not be accepted any more by the protocol (Planned for - protocol Q). *) - let endorsement_encoding = - let make kind (Case {tag; name; encoding; select = _; proj; inj}) = - case - (Tag tag) - name - encoding - (function - | o -> ( - match (kind, o) with - | `Simple, (Attestation {dal_content = None; _} as op) -> - Some (proj op) - | `Full, (Attestation {dal_content = Some _; _} as op) -> - Some (proj op) - | _ -> None)) - (fun x -> inj x) - in - let to_list : Kind.attestation contents_list -> _ = fun (Single o) -> o in - let of_list : Kind.attestation contents -> _ = fun o -> Single o in - def "inlined.endorsement" - @@ conv - (fun ({shell; protocol_data = {contents; signature}} : _ operation) -> - (shell, (contents, signature))) - (fun (shell, (contents, signature)) : _ operation -> - {shell; protocol_data = {contents; signature}}) - (merge_objs - Operation.shell_header_encoding - (obj2 - (req - "operations" - (conv to_list of_list - @@ def "inlined.endorsement_mempool.contents" - @@ union - [ - make `Simple endorsement_case; - make `Full endorsement_with_dal_case; - ])) - (varopt "signature" Signature.encoding))) - let attestation_encoding = let make kind (Case {tag; name; encoding; select = _; proj; inj}) = case @@ -1321,32 +1186,6 @@ module Encoding = struct inj = (fun solution -> Vdf_revelation {solution}); } - (* Encoding case that accepts legacy double preattestation evidence name : - `double_preendorsement_evidence` in JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements - kinds in JSON will not be accepted any more by the protocol (Planned for - protocol Q). *) - let double_preendorsement_evidence_case : - Kind.double_preattestation_evidence case = - Case - { - tag = 7; - name = "double_preendorsement_evidence"; - encoding = - obj2 - (req "op1" (dynamic_size preendorsement_encoding)) - (req "op2" (dynamic_size preendorsement_encoding)); - select = - (function - | Contents (Double_preattestation_evidence _ as op) -> Some op - | _ -> None); - proj = (fun (Double_preattestation_evidence {op1; op2}) -> (op1, op2)); - inj = (fun (op1, op2) -> Double_preattestation_evidence {op1; op2}); - } - let double_preattestation_evidence_case : Kind.double_preattestation_evidence case = Case @@ -1365,31 +1204,6 @@ module Encoding = struct inj = (fun (op1, op2) -> Double_preattestation_evidence {op1; op2}); } - (* Encoding case that accepts legacy double attestation evidence name : - `double_endorsement_evidence` in JSON - - https://gitlab.com/tezos/tezos/-/issues/5529 - - This encoding is temporary and should be removed when the endorsements - kinds in JSON will not be accepted any more by the protocol (Planned for - protocol Q). *) - let double_endorsement_evidence_case : Kind.double_attestation_evidence case = - Case - { - tag = 2; - name = "double_endorsement_evidence"; - encoding = - obj2 - (req "op1" (dynamic_size endorsement_encoding)) - (req "op2" (dynamic_size endorsement_encoding)); - select = - (function - | Contents (Double_attestation_evidence _ as op) -> Some op - | _ -> None); - proj = (fun (Double_attestation_evidence {op1; op2}) -> (op1, op2)); - inj = (fun (op1, op2) -> Double_attestation_evidence {op1; op2}); - } - let double_attestation_evidence_case : Kind.double_attestation_evidence case = Case { diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index a2532b51640d..f8052915800c 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -657,30 +657,19 @@ module Encoding : sig } -> 'b case - val preendorsement_case : Kind.preattestation case - val preattestation_case : Kind.preattestation case - val endorsement_case : Kind.attestation case - val attestation_case : Kind.attestation case - val endorsement_with_dal_case : Kind.attestation case - val attestation_with_dal_case : Kind.attestation case val seed_nonce_revelation_case : Kind.seed_nonce_revelation case val vdf_revelation_case : Kind.vdf_revelation case - val double_preendorsement_evidence_case : - Kind.double_preattestation_evidence case - val double_preattestation_evidence_case : Kind.double_preattestation_evidence case - val double_endorsement_evidence_case : Kind.double_attestation_evidence case - val double_attestation_evidence_case : Kind.double_attestation_evidence case val double_baking_evidence_case : Kind.double_baking_evidence case -- GitLab From 99c5c7a296170670272a8d380cd45b36528a4f3e Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 1 Jul 2024 10:32:45 +0200 Subject: [PATCH 5/6] alpha: remove encoding with legacy attestation name in tests --- .../lib_protocol/test/pbt/test_operation_encoding.ml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml index dcd48ac2cb03..8278a082bacf 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml @@ -62,10 +62,4 @@ let () = [ ( "roundtrip", qcheck_wrap [test_operation Alpha_context.Operation.encoding] ); - ( "legacy : roundtrip", - qcheck_wrap - [ - test_operation - Alpha_context.Operation.encoding_with_legacy_attestation_name; - ] ); ] -- GitLab From d1a25039343fa3e1c6bba1a1f507dd88554011f4 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Thu, 4 Jul 2024 12:46:57 +0200 Subject: [PATCH 6/6] Changes: add entry for removal of endorsement kind in operations --- docs/protocols/alpha.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index ba5769c75362..bbcc9186e5d1 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -140,3 +140,6 @@ Internal - Encoding that supports ``endorsement`` kind in apply_result JSON has been removed. (MR :gl:`!13974`) + +- Encoding that supports ``endorsement`` kind in operation JSON has been + removed. (MR :gl:`!13976`) -- GitLab