From 6fce2a992939fbf0709e85306e23ec8c7100649e Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Fri, 16 May 2025 11:37:50 +0200 Subject: [PATCH] Proto: remove tmp_to_old_committee and tmp_of_old_committee --- src/proto_alpha/lib_protocol/alpha_context.mli | 4 ---- src/proto_alpha/lib_protocol/operation_repr.ml | 5 ----- src/proto_alpha/lib_protocol/operation_repr.mli | 12 ------------ src/proto_alpha/lib_protocol/test/helpers/op.ml | 12 ++++++++---- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index fc3c9ac07828..71ac86c95628 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -5180,10 +5180,6 @@ module Operation : sig (** See {!Operation_repr.committee_slots}. *) val committee_slots : (Slot.t * dal_content option) list -> Slot.t list - - val tmp_to_old_committee : (Slot.t * dal_content option) list -> Slot.t list - - val tmp_of_old_committee : Slot.t list -> (Slot.t * dal_content option) list end (** This module re-exports definitions from {!Stake_storage}, diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 6a9e3cfea6ac..6e92f7f03ab8 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -553,11 +553,6 @@ let of_list l = let committee_slots committee = List.map fst committee -let tmp_to_old_committee committee = List.map fst committee - -let tmp_of_old_committee committee = - List.map (fun slot -> (slot, None)) committee - let tx_rollup_operation_tag_offset = 150 let tx_rollup_operation_origination_tag = tx_rollup_operation_tag_offset + 0 diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index 5dc6ccb29d11..4ae10f95c8dc 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -589,18 +589,6 @@ val manager_kind : 'kind manager_operation -> 'kind Kind.manager val committee_slots : (Slot_repr.t * dal_content option) list -> Slot_repr.t list -(* TODO: https://gitlab.com/tezos/tezos/-/issues/7935 - The following two functions are used so that despite the type - having been updated with DAL contents, attestations aggregate still - has the old logic without DAL. They should be removed once the new - logic has been implemented everywhere. *) - -val tmp_to_old_committee : - (Slot_repr.t * dal_content option) list -> Slot_repr.t list - -val tmp_of_old_committee : - Slot_repr.t list -> (Slot_repr.t * dal_content option) list - val encoding : packed_operation Data_encoding.t val contents_encoding : packed_contents Data_encoding.t diff --git a/src/proto_alpha/lib_protocol/test/helpers/op.ml b/src/proto_alpha/lib_protocol/test/helpers/op.ml index b3067be7284b..6117bf472d83 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/op.ml @@ -146,15 +146,20 @@ let aggregate attestations = List.fold_left (fun acc ({shell; protocol_data = {contents; signature}} : _ Operation.t) -> match (contents, signature) with - | Single (Attestation {consensus_content; _}), Some (Bls bls_sig) -> ( + | ( Single (Attestation {consensus_content; dal_content}), + Some (Bls bls_sig) ) -> ( let {slot; _} = consensus_content in match acc with | Some (shell, proposal, slots, signatures) -> - Some (shell, proposal, slot :: slots, bls_sig :: signatures) + Some + ( shell, + proposal, + (slot, dal_content) :: slots, + bls_sig :: signatures ) | None -> let {level; round; block_payload_hash; _} = consensus_content in let proposal = {level; round; block_payload_hash} in - Some (shell, proposal, [slot], [bls_sig])) + Some (shell, proposal, [(slot, dal_content)], [bls_sig])) | _, _ -> acc) None attestations @@ -165,7 +170,6 @@ let aggregate attestations = Bls12_381_signature.MinPk.aggregate_signature_opt signatures in let contents = - let committee = Operation.tmp_of_old_committee committee in Single (Attestations_aggregate (* Reverse committee to preserve [attestations] order *) -- GitLab