diff --git a/src/proto_alpha/lib_delegate/baking_lib.ml b/src/proto_alpha/lib_delegate/baking_lib.ml index 2677f6cf8fd9a3365a87bbaa5acff77f8a0fe891..8d6994eeb907cbcda6607bd8f05980cc7138a79b 100644 --- a/src/proto_alpha/lib_delegate/baking_lib.ml +++ b/src/proto_alpha/lib_delegate/baking_lib.ml @@ -202,7 +202,7 @@ let state_endorsing_power = protocol_data = {contents = Single (Endorsement consensus_content); _}; _; } : - Kind.endorsement operation) + Kind.attestation operation) -> consensus_content) let do_action (state, action) = @@ -425,7 +425,7 @@ let baking_minimal_timestamp state = {contents = Single (Endorsement consensus_content); _}; _; } : - Kind.endorsement operation) + Kind.attestation operation) -> if Round.(consensus_content.round = latest_proposal.block.round) diff --git a/src/proto_alpha/lib_delegate/baking_state.ml b/src/proto_alpha/lib_delegate/baking_state.ml index 3009cb53ba408d82baee09223d18cb48b0519b4b..9892bc9fc4f65563a058697a02ea8ab002030722 100644 --- a/src/proto_alpha/lib_delegate/baking_state.ml +++ b/src/proto_alpha/lib_delegate/baking_state.ml @@ -97,7 +97,7 @@ type prequorum = { level : int32; round : Round.t; block_payload_hash : Block_payload_hash.t; - preendorsements : Kind.preendorsement operation list; + preendorsements : Kind.preattestation operation list; } type block_info = { @@ -107,7 +107,7 @@ type block_info = { payload_round : Round.t; round : Round.t; prequorum : prequorum option; - quorum : Kind.endorsement operation list; + quorum : Kind.attestation operation list; dal_attestations : Kind.dal_attestation operation list; payload : Operation_pool.payload; } @@ -283,7 +283,7 @@ let endorsable_payload_encoding = type elected_block = { proposal : proposal; - endorsement_qc : Kind.endorsement Operation.t list; + endorsement_qc : Kind.attestation Operation.t list; } (* Updated only when we receive a block at a different level. @@ -347,7 +347,7 @@ type round_state = { current_round : Round.t; current_phase : phase; delayed_prequorum : - (Operation_worker.candidate * Kind.preendorsement operation list) option; + (Operation_worker.candidate * Kind.preattestation operation list) option; } type state = { @@ -394,9 +394,9 @@ type event = | New_valid_proposal of proposal | New_head_proposal of proposal | Prequorum_reached of - Operation_worker.candidate * Kind.preendorsement operation list + Operation_worker.candidate * Kind.preattestation operation list | Quorum_reached of - Operation_worker.candidate * Kind.endorsement operation list + Operation_worker.candidate * Kind.attestation operation list | Timeout of timeout_kind let event_encoding = diff --git a/src/proto_alpha/lib_delegate/baking_state.mli b/src/proto_alpha/lib_delegate/baking_state.mli index c0340a6ddaa61cb76ebdd49f219a47a2ed6ec9fe..585b2fe4762a37f5d89a9d2aa8d6d7ffa535c98d 100644 --- a/src/proto_alpha/lib_delegate/baking_state.mli +++ b/src/proto_alpha/lib_delegate/baking_state.mli @@ -51,7 +51,7 @@ type prequorum = { level : int32; round : Round.t; block_payload_hash : Block_payload_hash.t; - preendorsements : Kind.preendorsement operation list; + preendorsements : Kind.preattestation operation list; } type block_info = { @@ -61,7 +61,7 @@ type block_info = { payload_round : Round.t; round : Round.t; prequorum : prequorum option; - quorum : Kind.endorsement operation list; + quorum : Kind.attestation operation list; dal_attestations : Kind.dal_attestation operation list; payload : Operation_pool.payload; } @@ -123,7 +123,7 @@ val endorsable_payload_encoding : endorsable_payload Data_encoding.t type elected_block = { proposal : proposal; - endorsement_qc : Kind.endorsement operation list; + endorsement_qc : Kind.attestation operation list; } type level_state = { @@ -150,7 +150,7 @@ type round_state = { current_round : Round.t; current_phase : phase; delayed_prequorum : - (Operation_worker.candidate * Kind.preendorsement operation list) option; + (Operation_worker.candidate * Kind.preattestation operation list) option; } type state = { @@ -173,9 +173,9 @@ type event = | New_valid_proposal of proposal | New_head_proposal of proposal | Prequorum_reached of - Operation_worker.candidate * Kind.preendorsement operation list + Operation_worker.candidate * Kind.preattestation operation list | Quorum_reached of - Operation_worker.candidate * Kind.endorsement operation list + Operation_worker.candidate * Kind.attestation operation list | Timeout of timeout_kind val event_encoding : event Data_encoding.t diff --git a/src/proto_alpha/lib_delegate/client_baking_denunciation.ml b/src/proto_alpha/lib_delegate/client_baking_denunciation.ml index b5d30179cb4cd755360467951263641d012a28e4..bf70015af1d1bc8e1d62acd7b7f3bc0769d778bc 100644 --- a/src/proto_alpha/lib_delegate/client_baking_denunciation.ml +++ b/src/proto_alpha/lib_delegate/client_baking_denunciation.ml @@ -64,8 +64,8 @@ type 'kind recorded_consensus = } type recorded_consensus_operations = { - endorsement : Kind.endorsement recorded_consensus; - preendorsement : Kind.preendorsement recorded_consensus; + endorsement : Kind.attestation recorded_consensus; + preendorsement : Kind.preattestation recorded_consensus; } type 'a state = { @@ -332,7 +332,7 @@ let process_operations (cctxt : #Protocol_client_context.full) state | Operation_data ({contents = Single (Preendorsement {round; slot; level; _}); _} as protocol_data) -> - let new_preendorsement : Kind.preendorsement Alpha_context.operation = + let new_preendorsement : Kind.preattestation Alpha_context.operation = {shell; protocol_data} in process_consensus_op @@ -347,7 +347,7 @@ let process_operations (cctxt : #Protocol_client_context.full) state | Operation_data ({contents = Single (Endorsement {round; slot; level; _}); _} as protocol_data) -> - let new_endorsement : Kind.endorsement Alpha_context.operation = + let new_endorsement : Kind.attestation Alpha_context.operation = {shell; protocol_data} in process_consensus_op diff --git a/src/proto_alpha/lib_delegate/node_rpc.ml b/src/proto_alpha/lib_delegate/node_rpc.ml index 7a06360d3283289db5ff548b181abf7bd3865680..b1d990b11939e0b8320a2e5ab69a81fdc3a2003a 100644 --- a/src/proto_alpha/lib_delegate/node_rpc.ml +++ b/src/proto_alpha/lib_delegate/node_rpc.ml @@ -64,7 +64,7 @@ let extract_prequorum preendorsements = | h :: _ -> let ({protocol_data = {contents = Single (Preendorsement content); _}; _}) = - (h : Kind.preendorsement Operation.t) + (h : Kind.preattestation Operation.t) in Some { diff --git a/src/proto_alpha/lib_delegate/operation_pool.ml b/src/proto_alpha/lib_delegate/operation_pool.ml index 71a5035c41c455be9072d4b1fa8cd4726b865f73..2aafc9cfbf66d0e155035554f51cbc860c98c43d 100644 --- a/src/proto_alpha/lib_delegate/operation_pool.ml +++ b/src/proto_alpha/lib_delegate/operation_pool.ml @@ -258,14 +258,14 @@ let unpack_preendorsement packed_preendorsement = let {shell; protocol_data = Operation_data data} = packed_preendorsement in match data with | {contents = Single (Preendorsement _); _} -> - Some ({shell; protocol_data = data} : Kind.preendorsement Operation.t) + Some ({shell; protocol_data = data} : Kind.preattestation Operation.t) | _ -> None let unpack_endorsement packed_endorsement = let {shell; protocol_data = Operation_data data} = packed_endorsement in match data with | {contents = Single (Endorsement _); _} -> - Some ({shell; protocol_data = data} : Kind.endorsement Operation.t) + Some ({shell; protocol_data = data} : Kind.attestation Operation.t) | _ -> None let unpack_dal_attestation packed_dal_attestation = @@ -287,7 +287,7 @@ let filter_preendorsements ops = } -> Some ({shell = {branch}; protocol_data = content} - : Kind.preendorsement operation) + : Kind.preattestation operation) | _ -> None) ops @@ -302,7 +302,7 @@ let filter_endorsements ops = } -> Some ({shell = {branch}; protocol_data = content} - : Kind.endorsement operation) + : Kind.attestation operation) | _ -> None) ops @@ -334,8 +334,8 @@ let extract_operations_of_list_list = function | [consensus; votes_payload; anonymous_payload; managers_payload] -> let preendorsements, endorsements, dal_attestations = List.fold_left - (fun ( (preendorsements : Kind.preendorsement Operation.t list), - (endorsements : Kind.endorsement Operation.t list), + (fun ( (preendorsements : Kind.preattestation Operation.t list), + (endorsements : Kind.attestation Operation.t list), (dal_attestations : Kind.dal_attestation Operation.t list) ) packed_op -> let {shell; protocol_data = Operation_data data} = packed_op in diff --git a/src/proto_alpha/lib_delegate/operation_pool.mli b/src/proto_alpha/lib_delegate/operation_pool.mli index 67ddb289a78bbfccf29faf2eb189ef167b0acc2b..289061f11ae64415bbd557c6f3864d4b67231363 100644 --- a/src/proto_alpha/lib_delegate/operation_pool.mli +++ b/src/proto_alpha/lib_delegate/operation_pool.mli @@ -93,28 +93,28 @@ val filter_with_relevant_consensus_ops : Operation_set.t val unpack_preendorsement : - packed_operation -> Kind.preendorsement operation option + packed_operation -> Kind.preattestation operation option -val unpack_endorsement : packed_operation -> Kind.endorsement operation option +val unpack_endorsement : packed_operation -> Kind.attestation operation option val unpack_dal_attestation : packed_operation -> Kind.dal_attestation operation option val filter_preendorsements : - packed_operation list -> Kind.preendorsement operation list + packed_operation list -> Kind.preattestation operation list val filter_endorsements : - packed_operation list -> Kind.endorsement operation list + packed_operation list -> Kind.attestation operation list val ordered_to_list_list : ordered_pool -> packed_operation list list val ordered_of_list_list : packed_operation list list -> ordered_pool option -(** [preendorsements] <> None => (List.length preendorsements > 0) *) +(** [preattestation] <> None => (List.length preattestations > 0) *) val extract_operations_of_list_list : packed_operation list list -> - (Kind.preendorsement operation list option - * Kind.endorsement operation list + (Kind.preattestation operation list option + * Kind.attestation operation list * Kind.dal_attestation operation list * payload) option diff --git a/src/proto_alpha/lib_delegate/operation_worker.ml b/src/proto_alpha/lib_delegate/operation_worker.ml index e4c53d7e28b9343d7ddf9c2ba01676c1fc23b5cf..3e4544814e5d23851f73b176ae88d6251f9e2e31 100644 --- a/src/proto_alpha/lib_delegate/operation_worker.ml +++ b/src/proto_alpha/lib_delegate/operation_worker.ml @@ -156,8 +156,8 @@ let candidate_encoding = (req "payload_hash_watched" Block_payload_hash.encoding)) type event = - | Prequorum_reached of candidate * Kind.preendorsement operation list - | Quorum_reached of candidate * Kind.endorsement operation list + | Prequorum_reached of candidate * Kind.preattestation operation list + | Quorum_reached of candidate * Kind.attestation operation list let compare_consensus_contents (op1 : consensus_content) (op2 : consensus_content) = @@ -167,7 +167,7 @@ let compare_consensus_contents (op1 : consensus_content) Block_payload_hash.compare op1.block_payload_hash op2.block_payload_hash module Preendorsement_set = Set.Make (struct - type t = Kind.preendorsement operation + type t = Kind.preattestation operation let compare ({protocol_data = {contents = Single (Preendorsement op1); _}; shell = _} : @@ -178,7 +178,7 @@ module Preendorsement_set = Set.Make (struct end) module Endorsement_set = Set.Make (struct - type t = Kind.endorsement operation + type t = Kind.attestation operation let compare ({protocol_data = {contents = Single (Endorsement op1); _}; shell = _} : @@ -315,7 +315,7 @@ let update_monitoring ?(should_lock = true) state ops = in let preendorsements_count, voting_power = List.fold_left - (fun (count, power) (op : Kind.preendorsement Operation.t) -> + (fun (count, power) (op : Kind.preattestation Operation.t) -> let { shell = _; protocol_data = @@ -387,7 +387,7 @@ let update_monitoring ?(should_lock = true) state ops = in let endorsements_count, voting_power = List.fold_left - (fun (count, power) (op : Kind.endorsement Operation.t) -> + (fun (count, power) (op : Kind.attestation Operation.t) -> let { shell = _; protocol_data = diff --git a/src/proto_alpha/lib_delegate/operation_worker.mli b/src/proto_alpha/lib_delegate/operation_worker.mli index b62caa996da2472930610566d64081fecb754b8c..f0bbb39d830a3bb24b79bae827e88b936116da54 100644 --- a/src/proto_alpha/lib_delegate/operation_worker.mli +++ b/src/proto_alpha/lib_delegate/operation_worker.mli @@ -42,8 +42,8 @@ type candidate = { val candidate_encoding : candidate Data_encoding.t type event = - | Prequorum_reached of candidate * Kind.preendorsement operation list - | Quorum_reached of candidate * Kind.endorsement operation list + | Prequorum_reached of candidate * Kind.preattestation operation list + | Quorum_reached of candidate * Kind.attestation operation list (** {1 Constructors}*) diff --git a/src/proto_alpha/lib_delegate/state_transitions.ml b/src/proto_alpha/lib_delegate/state_transitions.ml index f462710ba872c5dbc65ab644479c220a0e0a500a..5d5c719501769ae9b23ca7975b3c7fb379d3949a 100644 --- a/src/proto_alpha/lib_delegate/state_transitions.ml +++ b/src/proto_alpha/lib_delegate/state_transitions.ml @@ -145,7 +145,7 @@ let extract_pqc state (new_proposal : proposal) = match new_proposal.block.prequorum with | None -> None | Some pqc -> - let add_voting_power acc (op : Kind.preendorsement Operation.t) = + let add_voting_power acc (op : Kind.preattestation Operation.t) = let open Protocol.Alpha_context.Operation in let { shell = _; diff --git a/src/proto_alpha/lib_delegate/state_transitions.mli b/src/proto_alpha/lib_delegate/state_transitions.mli index 1ea303458ca984face9b5b299d35cf952cb132fd..b103418841f43a72e5c32056c2bd6f843155445e 100644 --- a/src/proto_alpha/lib_delegate/state_transitions.mli +++ b/src/proto_alpha/lib_delegate/state_transitions.mli @@ -47,7 +47,7 @@ val may_update_proposal : val preendorse : state -> proposal -> (state * action) Lwt.t val extract_pqc : - state -> proposal -> (Kind.preendorsement operation list * Round.t) option + state -> proposal -> (Kind.preattestation operation list * Round.t) option val handle_proposal : is_proposal_applied:bool -> state -> proposal -> (state * action) Lwt.t @@ -59,7 +59,7 @@ val round_proposer : (consensus_key_and_delegate * endorsing_slot) option val propose_fresh_block_action : - endorsements:Kind.endorsement Operation.t list -> + endorsements:Kind.attestation Operation.t list -> dal_attestations:Kind.dal_attestation Operation.t list -> ?last_proposal:block_info -> predecessor:block_info -> @@ -85,13 +85,13 @@ val make_endorse_action : state -> proposal -> action val prequorum_reached_when_awaiting_preendorsements : state -> Operation_worker.candidate -> - Kind.preendorsement operation list -> + Kind.preattestation operation list -> (state * action) Lwt.t val quorum_reached_when_waiting_endorsements : state -> Operation_worker.candidate -> - Kind.endorsement operation list -> + Kind.attestation operation list -> (state * action) Lwt.t val step : state -> event -> (state * action) Lwt.t diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index f5e2274213fb3c38914a1a7f0d6cc70a85b8ebae..e3ecc5ff833bd15a3be7f6b4196c2a091f0fb569 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -3999,17 +3999,17 @@ end (** This module re-exports definitions from {!Operation_repr.Kind}. *) module Kind : sig - type preendorsement_consensus_kind = Preendorsement_consensus_kind + type preattestation_consensus_kind = Preattestation_consensus_kind - type endorsement_consensus_kind = Endorsement_consensus_kind + type attestation_consensus_kind = Attestation_consensus_kind type 'a consensus = - | Preendorsement_kind : preendorsement_consensus_kind consensus - | Endorsement_kind : endorsement_consensus_kind consensus + | Preattestation_kind : preattestation_consensus_kind consensus + | Attestation_kind : attestation_consensus_kind consensus - type preendorsement = preendorsement_consensus_kind consensus + type preattestation = preattestation_consensus_kind consensus - type endorsement = endorsement_consensus_kind consensus + type attestation = attestation_consensus_kind consensus type dal_attestation = Dal_attestation_kind @@ -4020,11 +4020,11 @@ module Kind : sig type 'a double_consensus_operation_evidence = | Double_consensus_operation_evidence - type double_endorsement_evidence = - endorsement_consensus_kind double_consensus_operation_evidence + type double_attestation_evidence = + attestation_consensus_kind double_consensus_operation_evidence - type double_preendorsement_evidence = - preendorsement_consensus_kind double_consensus_operation_evidence + type double_preattestation_evidence = + preattestation_consensus_kind double_consensus_operation_evidence type double_baking_evidence = Double_baking_evidence_kind @@ -4109,8 +4109,8 @@ end (** All the definitions below are re-exported from {!Operation_repr}. *) type 'a consensus_operation_type = - | Endorsement : Kind.endorsement consensus_operation_type - | Preendorsement : Kind.preendorsement consensus_operation_type + | Endorsement : Kind.attestation consensus_operation_type + | Preendorsement : Kind.preattestation consensus_operation_type type consensus_content = { slot : Slot.t; @@ -4143,8 +4143,8 @@ and _ contents_list = -> ('kind * 'rest) Kind.manager contents_list and _ contents = - | Preendorsement : consensus_content -> Kind.preendorsement contents - | Endorsement : consensus_content -> Kind.endorsement contents + | Preendorsement : consensus_content -> Kind.preattestation contents + | Endorsement : consensus_content -> Kind.attestation contents | Dal_attestation : Dal.Attestation.operation -> Kind.dal_attestation contents | Seed_nonce_revelation : { level : Raw_level.t; @@ -4156,15 +4156,15 @@ and _ contents = } -> Kind.vdf_revelation contents | Double_preendorsement_evidence : { - op1 : Kind.preendorsement operation; - op2 : Kind.preendorsement operation; + op1 : Kind.preattestation operation; + op2 : Kind.preattestation operation; } - -> Kind.double_preendorsement_evidence contents + -> Kind.double_preattestation_evidence contents | Double_endorsement_evidence : { - op1 : Kind.endorsement operation; - op2 : Kind.endorsement operation; + op1 : Kind.attestation operation; + op2 : Kind.attestation operation; } - -> Kind.double_endorsement_evidence contents + -> Kind.double_attestation_evidence contents | Double_baking_evidence : { bh1 : Block_header.t; bh2 : Block_header.t; @@ -4420,13 +4420,13 @@ module Operation : sig } -> 'b case - val preendorsement_case : Kind.preendorsement case + val preendorsement_case : Kind.preattestation case - val preattestation_case : Kind.preendorsement case + val preattestation_case : Kind.preattestation case - val endorsement_case : Kind.endorsement case + val endorsement_case : Kind.attestation case - val attestation_case : Kind.endorsement case + val attestation_case : Kind.attestation case val dal_attestation_case : Kind.dal_attestation case @@ -4435,14 +4435,14 @@ module Operation : sig val vdf_revelation_case : Kind.vdf_revelation case val double_preendorsement_evidence_case : - Kind.double_preendorsement_evidence case + Kind.double_preattestation_evidence case val double_preattestation_evidence_case : - Kind.double_preendorsement_evidence case + Kind.double_preattestation_evidence case - val double_endorsement_evidence_case : Kind.double_endorsement_evidence case + val double_endorsement_evidence_case : Kind.double_attestation_evidence case - val double_attestation_evidence_case : Kind.double_endorsement_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/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index 167e17afb475cedc2c5f5bedc133874939deea61..baed815465d0d73069664484a1534e1fbf794c54 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -1978,7 +1978,7 @@ let find_in_slot_map consensus_content slot_map = | Some (consensus_key, power) -> ok (consensus_key, power)) let record_preendorsement ctxt (mode : mode) (content : consensus_content) : - (context * Kind.preendorsement contents_result_list) tzresult Lwt.t = + (context * Kind.preattestation contents_result_list) tzresult Lwt.t = let open Lwt_result_syntax in let ctxt = match mode with @@ -2027,7 +2027,7 @@ let record_preendorsement ctxt (mode : mode) (content : consensus_content) : return (ctxt, mk_preendorsement_result consensus_key 0 (* Fake power. *)) let record_endorsement ctxt (mode : mode) (content : consensus_content) : - (context * Kind.endorsement contents_result_list) tzresult Lwt.t = + (context * Kind.attestation contents_result_list) tzresult Lwt.t = let open Lwt_result_syntax in let mk_endorsement_result ({delegate; consensus_pkh; _} : Consensus_key.pk) consensus_power = diff --git a/src/proto_alpha/lib_protocol/apply_results.ml b/src/proto_alpha/lib_protocol/apply_results.ml index e9298c5001cb661b455d42084ba330648c83c91a..8e3c3148090dcaf7110c88a3d3520234bd53bd8b 100644 --- a/src/proto_alpha/lib_protocol/apply_results.ml +++ b/src/proto_alpha/lib_protocol/apply_results.ml @@ -856,14 +856,14 @@ type 'kind contents_result = consensus_key : Signature.public_key_hash; consensus_power : int; } - -> Kind.preendorsement contents_result + -> Kind.preattestation contents_result | Endorsement_result : { balance_updates : Receipt.balance_updates; delegate : Signature.public_key_hash; consensus_key : Signature.public_key_hash; consensus_power : int; } - -> Kind.endorsement contents_result + -> Kind.attestation contents_result | Dal_attestation_result : { delegate : Signature.Public_key_hash.t; } @@ -876,10 +876,10 @@ type 'kind contents_result = -> Kind.vdf_revelation contents_result | Double_endorsement_evidence_result : Receipt.balance_updates - -> Kind.double_endorsement_evidence contents_result + -> Kind.double_attestation_evidence contents_result | Double_preendorsement_evidence_result : Receipt.balance_updates - -> Kind.double_preendorsement_evidence contents_result + -> Kind.double_preattestation_evidence contents_result | Double_baking_evidence_result : Receipt.balance_updates -> Kind.double_baking_evidence contents_result diff --git a/src/proto_alpha/lib_protocol/apply_results.mli b/src/proto_alpha/lib_protocol/apply_results.mli index 8a4e17940b5a8682abcff91914a633304d73a66b..09bb74fa7ed8418baa10573adac364b4324c5a1a 100644 --- a/src/proto_alpha/lib_protocol/apply_results.mli +++ b/src/proto_alpha/lib_protocol/apply_results.mli @@ -64,14 +64,14 @@ and 'kind contents_result = consensus_key : Signature.public_key_hash; consensus_power : int; } - -> Kind.preendorsement contents_result + -> Kind.preattestation contents_result | Endorsement_result : { balance_updates : Receipt.balance_updates; delegate : Signature.public_key_hash; consensus_key : Signature.public_key_hash; consensus_power : int; } - -> Kind.endorsement contents_result + -> Kind.attestation contents_result | Dal_attestation_result : { delegate : Signature.Public_key_hash.t; } @@ -84,10 +84,10 @@ and 'kind contents_result = -> Kind.vdf_revelation contents_result | Double_endorsement_evidence_result : Receipt.balance_updates - -> Kind.double_endorsement_evidence contents_result + -> Kind.double_attestation_evidence contents_result | Double_preendorsement_evidence_result : Receipt.balance_updates - -> Kind.double_preendorsement_evidence contents_result + -> Kind.double_preattestation_evidence contents_result | Double_baking_evidence_result : Receipt.balance_updates -> Kind.double_baking_evidence contents_result diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 9a53e929989aa6a071532a03edef53468bccbf2b..bcc30c07a45c4fea2765bed009f36c7fff78e094 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -27,17 +27,17 @@ (* Tezos Protocol Implementation - Low level Repr. of Operations *) module Kind = struct - type preendorsement_consensus_kind = Preendorsement_consensus_kind + type preattestation_consensus_kind = Preattestation_consensus_kind - type endorsement_consensus_kind = Endorsement_consensus_kind + type attestation_consensus_kind = Attestation_consensus_kind type 'a consensus = - | Preendorsement_kind : preendorsement_consensus_kind consensus - | Endorsement_kind : endorsement_consensus_kind consensus + | Preattestation_kind : preattestation_consensus_kind consensus + | Attestation_kind : attestation_consensus_kind consensus - type preendorsement = preendorsement_consensus_kind consensus + type preattestation = preattestation_consensus_kind consensus - type endorsement = endorsement_consensus_kind consensus + type attestation = attestation_consensus_kind consensus type dal_attestation = Dal_attestation_kind @@ -48,11 +48,11 @@ module Kind = struct type 'a double_consensus_operation_evidence = | Double_consensus_operation_evidence - type double_endorsement_evidence = - endorsement_consensus_kind double_consensus_operation_evidence + type double_attestation_evidence = + attestation_consensus_kind double_consensus_operation_evidence - type double_preendorsement_evidence = - preendorsement_consensus_kind double_consensus_operation_evidence + type double_preattestation_evidence = + preattestation_consensus_kind double_consensus_operation_evidence type double_baking_evidence = Double_baking_evidence_kind @@ -135,8 +135,8 @@ module Kind = struct end type 'a consensus_operation_type = - | Endorsement : Kind.endorsement consensus_operation_type - | Preendorsement : Kind.preendorsement consensus_operation_type + | Endorsement : Kind.attestation consensus_operation_type + | Preendorsement : Kind.preattestation consensus_operation_type type consensus_content = { slot : Slot_repr.t; @@ -234,8 +234,8 @@ and _ contents_list = -> ('kind * 'rest) Kind.manager contents_list and _ contents = - | Preendorsement : consensus_content -> Kind.preendorsement contents - | Endorsement : consensus_content -> Kind.endorsement contents + | Preendorsement : consensus_content -> Kind.preattestation contents + | Endorsement : consensus_content -> Kind.attestation contents | Dal_attestation : Dal_attestation_repr.operation -> Kind.dal_attestation contents @@ -249,15 +249,15 @@ and _ contents = } -> Kind.vdf_revelation contents | Double_preendorsement_evidence : { - op1 : Kind.preendorsement operation; - op2 : Kind.preendorsement operation; + op1 : Kind.preattestation operation; + op2 : Kind.preattestation operation; } - -> Kind.double_preendorsement_evidence contents + -> Kind.double_preattestation_evidence contents | Double_endorsement_evidence : { - op1 : Kind.endorsement operation; - op2 : Kind.endorsement operation; + op1 : Kind.attestation operation; + op2 : Kind.attestation operation; } - -> Kind.double_endorsement_evidence contents + -> Kind.double_attestation_evidence contents | Double_baking_evidence : { bh1 : Block_header_repr.t; bh2 : Block_header_repr.t; @@ -1019,10 +1019,10 @@ module Encoding = struct 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.preendorsement contents_list -> _ = function + let to_list : Kind.preattestation contents_list -> _ = function | Single o -> o in - let of_list : Kind.preendorsement contents -> _ = function + let of_list : Kind.preattestation contents -> _ = function | o -> Single o in def "inlined.preendorsement" @@ -1045,10 +1045,10 @@ module Encoding = struct 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.preendorsement contents_list -> _ = function + let to_list : Kind.preattestation contents_list -> _ = function | Single o -> o in - let of_list : Kind.preendorsement contents -> _ = function + let of_list : Kind.preattestation contents -> _ = function | o -> Single o in def "inlined.preattestation" @@ -1116,8 +1116,8 @@ module Encoding = struct 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.endorsement contents_list -> _ = fun (Single o) -> o in - let of_list : Kind.endorsement contents -> _ = fun o -> Single o 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) -> @@ -1138,8 +1138,8 @@ module Encoding = struct 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.endorsement contents_list -> _ = fun (Single o) -> o in - let of_list : Kind.endorsement contents -> _ = fun o -> Single o 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.attestation" @@ conv (fun ({shell; protocol_data = {contents; signature}} : _ operation) -> @@ -1208,7 +1208,7 @@ module Encoding = struct } let double_preendorsement_evidence_case : - Kind.double_preendorsement_evidence case = + Kind.double_preattestation_evidence case = Case { tag = 7; @@ -1226,7 +1226,7 @@ module Encoding = struct } let double_preattestation_evidence_case : - Kind.double_preendorsement_evidence case = + Kind.double_preattestation_evidence case = Case { tag = 7; @@ -1243,7 +1243,7 @@ module Encoding = struct inj = (fun (op1, op2) -> Double_preendorsement_evidence {op1; op2}); } - let double_endorsement_evidence_case : Kind.double_endorsement_evidence case = + let double_endorsement_evidence_case : Kind.double_attestation_evidence case = Case { tag = 2; @@ -1260,7 +1260,7 @@ module Encoding = struct inj = (fun (op1, op2) -> Double_endorsement_evidence {op1; op2}); } - let double_attestation_evidence_case : Kind.double_endorsement_evidence case = + let double_attestation_evidence_case : Kind.double_attestation_evidence case = Case { tag = 2; diff --git a/src/proto_alpha/lib_protocol/operation_repr.mli b/src/proto_alpha/lib_protocol/operation_repr.mli index 56d827f7eb79f7a7b9e86af1f3bf11e717dba3fa..6198049308b8a419a177b1da07b94caef5996849 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.mli +++ b/src/proto_alpha/lib_protocol/operation_repr.mli @@ -27,11 +27,11 @@ (** Tezos Protocol Implementation - Low level Repr. of Operations Defines kinds of operations that can be performed on chain: - - preendorsement - - endorsement + - preattestation + - attestation - double baking evidence - - double preendorsing evidence - - double endorsing evidence + - double preattestation evidence + - double attestation evidence - seed nonce revelation - account activation - proposal (see: [Voting_repr]) @@ -61,17 +61,17 @@ list. *) module Kind : sig - type preendorsement_consensus_kind = Preendorsement_consensus_kind + type preattestation_consensus_kind = Preattestation_consensus_kind - type endorsement_consensus_kind = Endorsement_consensus_kind + type attestation_consensus_kind = Attestation_consensus_kind type 'a consensus = - | Preendorsement_kind : preendorsement_consensus_kind consensus - | Endorsement_kind : endorsement_consensus_kind consensus + | Preattestation_kind : preattestation_consensus_kind consensus + | Attestation_kind : attestation_consensus_kind consensus - type preendorsement = preendorsement_consensus_kind consensus + type preattestation = preattestation_consensus_kind consensus - type endorsement = endorsement_consensus_kind consensus + type attestation = attestation_consensus_kind consensus type dal_attestation = Dal_attestation_kind @@ -82,11 +82,11 @@ module Kind : sig type 'a double_consensus_operation_evidence = | Double_consensus_operation_evidence - type double_endorsement_evidence = - endorsement_consensus_kind double_consensus_operation_evidence + type double_attestation_evidence = + attestation_consensus_kind double_consensus_operation_evidence - type double_preendorsement_evidence = - preendorsement_consensus_kind double_consensus_operation_evidence + type double_preattestation_evidence = + preattestation_consensus_kind double_consensus_operation_evidence type double_baking_evidence = Double_baking_evidence_kind @@ -169,8 +169,8 @@ module Kind : sig end type 'a consensus_operation_type = - | Endorsement : Kind.endorsement consensus_operation_type - | Preendorsement : Kind.preendorsement consensus_operation_type + | Endorsement : Kind.attestation consensus_operation_type + | Preendorsement : Kind.preattestation consensus_operation_type type consensus_content = { slot : Slot_repr.t; @@ -230,10 +230,10 @@ and _ contents_list = and _ contents = (* Preendorsement: About consensus, preendorsement of a block held by a validator (specific to Tenderbake). *) - | Preendorsement : consensus_content -> Kind.preendorsement contents + | Preendorsement : consensus_content -> Kind.preattestation contents (* Endorsement: About consensus, endorsement of a block held by a validator. *) - | Endorsement : consensus_content -> Kind.endorsement contents + | Endorsement : consensus_content -> Kind.attestation contents (* DAL/FIXME https://gitlab.com/tezos/tezos/-/issues/3115 Temporary operation to avoid modifying endorsement encoding. *) @@ -262,17 +262,17 @@ and _ contents = twice. This behavior may be reported and the byzantine will have its security deposit forfeited. *) | Double_preendorsement_evidence : { - op1 : Kind.preendorsement operation; - op2 : Kind.preendorsement operation; + op1 : Kind.preattestation operation; + op2 : Kind.preattestation operation; } - -> Kind.double_preendorsement_evidence contents + -> Kind.double_preattestation_evidence contents (* Double_endorsement_evidence: Similar to double-preendorsement but for endorsements. *) | Double_endorsement_evidence : { - op1 : Kind.endorsement operation; - op2 : Kind.endorsement operation; + op1 : Kind.attestation operation; + op2 : Kind.attestation operation; } - -> Kind.double_endorsement_evidence contents + -> Kind.double_attestation_evidence contents (* Double_baking_evidence: Similarly to double-endorsement but the byzantine attempts to fork by signing two different blocks at the same level. *) @@ -669,13 +669,13 @@ module Encoding : sig } -> 'b case - val preendorsement_case : Kind.preendorsement case + val preendorsement_case : Kind.preattestation case - val preattestation_case : Kind.preendorsement case + val preattestation_case : Kind.preattestation case - val endorsement_case : Kind.endorsement case + val endorsement_case : Kind.attestation case - val attestation_case : Kind.endorsement case + val attestation_case : Kind.attestation case val dal_attestation_case : Kind.dal_attestation case @@ -684,14 +684,14 @@ module Encoding : sig val vdf_revelation_case : Kind.vdf_revelation case val double_preendorsement_evidence_case : - Kind.double_preendorsement_evidence case + Kind.double_preattestation_evidence case val double_preattestation_evidence_case : - Kind.double_preendorsement_evidence case + Kind.double_preattestation_evidence case - val double_endorsement_evidence_case : Kind.double_endorsement_evidence case + val double_endorsement_evidence_case : Kind.double_attestation_evidence case - val double_attestation_evidence_case : Kind.double_endorsement_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/test/helpers/op.mli b/src/proto_alpha/lib_protocol/test/helpers/op.mli index 39fb652e5dc67f37ec23d423c7f41689343e6b6a..54e017c7f5e2c168eb44eff7e21df12eda6c139b 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/op.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/op.mli @@ -51,16 +51,16 @@ val sign : packed_contents_list -> packed_operation -(** Create an unpacked endorsement that is expected for given [Block.t]. +(** Create an unpacked attestation that is expected for given [Block.t]. - Optional parameters allow to specify the endorsed values: [level], + Optional parameters allow to specify the attested values: [level], [round] and/or [block_payload_hash]. - They also allow to specify the endorser ([delegate]), and/or the + They also allow to specify the attester ([delegate]), and/or the [slot]. These default to the first slot and its delegate. Finally, the operation [branch] can be specified. It defaults to the - predecessor of the endorsed block. *) + predecessor of the attested block. *) val raw_endorsement : ?delegate:public_key_hash -> ?slot:Slot.t -> @@ -69,9 +69,9 @@ val raw_endorsement : ?block_payload_hash:Block_payload_hash.t -> ?branch:Block_hash.t -> Block.t -> - Kind.endorsement Operation.t tzresult Lwt.t + Kind.attestation Operation.t tzresult Lwt.t -(** Create an unpacked preendorsement that is expected for a given +(** Create an unpacked preattestation that is expected for a given [Block.t]. Optional parameters are the same than {!raw_endorsement}. *) @@ -83,9 +83,9 @@ val raw_preendorsement : ?block_payload_hash:Block_payload_hash.t -> ?branch:Block_hash.t -> Block.t -> - Kind.preendorsement Operation.t tzresult Lwt.t + Kind.preattestation Operation.t tzresult Lwt.t -(** Create a packed endorsement that is expected for a given +(** Create a packed attestation that is expected for a given [Block.t] by packing the result of {!raw_endorsement}. *) val endorsement : ?delegate:public_key_hash -> @@ -97,7 +97,7 @@ val endorsement : Block.t -> Operation.packed tzresult Lwt.t -(** Create a packed preendorsement that is expected for a given +(** Create a packed preattestation that is expected for a given [Block.t] by packing the result of {!raw_preendorsement}. *) val preendorsement : ?delegate:public_key_hash -> @@ -275,14 +275,14 @@ val register_global_constant : val double_endorsement : Context.t -> - Kind.endorsement Operation.t -> - Kind.endorsement Operation.t -> + Kind.attestation Operation.t -> + Kind.attestation Operation.t -> Operation.packed val double_preendorsement : Context.t -> - Kind.preendorsement Operation.t -> - Kind.preendorsement Operation.t -> + Kind.preattestation Operation.t -> + Kind.preattestation Operation.t -> Operation.packed val double_baking : diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.ml b/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.ml index 6300c610dc8ede0c26bf605bf3d26ed2ab548c6b..9c2bdf022ec8d742206e9b10731835e2cbe24c05 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.ml @@ -30,8 +30,8 @@ open Validate_helpers type dbl_endorsement_state = { temporary : (Block.t * Block.t) option; slashable_preend : - (Kind.preendorsement operation * Kind.preendorsement operation) list; - slashable_end : (Kind.endorsement operation * Kind.endorsement operation) list; + (Kind.preattestation operation * Kind.preattestation operation) list; + slashable_end : (Kind.attestation operation * Kind.attestation operation) list; } type state = { @@ -314,7 +314,7 @@ let seed_nonce_descriptor = List.map_es gen state.seed_nonce_to_reveal); } -(** The heads on which two slashable endorsements or preendorsement +(** The heads on which two slashable attestations or preattestation should be made are from the previous level. Hence, the temporary field of a double_evidence_state is used to transmit them to the next level in order to make the slashable operations. *) @@ -326,15 +326,15 @@ let register_temporary ba bb state : (Block.t * Block.t) option * state = (** During the slashable period, at each level, two different heads for the same round are baked by the same baker. At the next level, - a delegate that either preendorses or endorses both heads makes a - pair of slashable pre- or endorsements. + a delegate that either preattests or attests both heads makes a + pair of slashable pre- or attestations. The pair of heads is placed in the temporary of the double_evidence_state. If a pair of heads was already in this field, hence they were baked at the previous level. - Consequently, two pairs of slashable operations: two endorsements - and two preendorsement, can be made by two distinct endorsers. Each + Consequently, two pairs of slashable operations: two attestations + and two preattestation, can be made by two distinct attestations. Each pair is ordered in operation_hash order. Consequently, each pair can appear in a denunciation operation and will be valid. *) let dbl_endorsement_prelude state = diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.mli b/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.mli index 515df860cfa42d1811b170453edd4eefe8875de9..5bf43d64d9b9ac091fce16794a1e9d157b87eae6 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.mli +++ b/src/proto_alpha/lib_protocol/test/integration/validate/generator_descriptors.mli @@ -36,8 +36,8 @@ open Validate_helpers type dbl_endorsement_state = { temporary : (Block.t * Block.t) option; slashable_preend : - (Kind.preendorsement operation * Kind.preendorsement operation) list; - slashable_end : (Kind.endorsement operation * Kind.endorsement operation) list; + (Kind.preattestation operation * Kind.preattestation operation) list; + slashable_end : (Kind.attestation operation * Kind.attestation operation) list; } (** Generic generation state collecting diff --git a/src/proto_alpha/lib_protocol/validate.ml b/src/proto_alpha/lib_protocol/validate.ml index b4829f684dc6f42e285a4139da12c3285473c431..57ac6056814776e87ae03fd97a9cc1c1f2968362 100644 --- a/src/proto_alpha/lib_protocol/validate.ml +++ b/src/proto_alpha/lib_protocol/validate.ml @@ -578,7 +578,7 @@ module Consensus = struct mempool's context. *) let check_preendorsement vi ~check_signature - (operation : Kind.preendorsement operation) = + (operation : Kind.preattestation operation) = let open Lwt_result_syntax in let*? consensus_info = Option.value_e @@ -619,7 +619,7 @@ module Consensus = struct in return voting_power - let check_preendorsement_conflict vs oph (op : Kind.preendorsement operation) + let check_preendorsement_conflict vs oph (op : Kind.preattestation operation) = let (Single (Preendorsement {slot; level; round; _})) = op.protocol_data.contents @@ -640,7 +640,7 @@ module Consensus = struct Validate_errors.Consensus.( Conflicting_consensus_operation {kind = Preattestation; conflict}) - let add_preendorsement vs oph (op : Kind.preendorsement operation) = + let add_preendorsement vs oph (op : Kind.preattestation operation) = let (Single (Preendorsement {slot; level; round; _})) = op.protocol_data.contents in @@ -672,7 +672,7 @@ module Consensus = struct {block_state with locked_round_evidence} (* Hypothesis: this function will only be called in mempool mode *) - let remove_preendorsement vs (operation : Kind.preendorsement operation) = + let remove_preendorsement vs (operation : Kind.preattestation operation) = (* As we are in mempool mode, we do not update [locked_round_evidence]. *) let (Single (Preendorsement {slot; level; round; _})) = @@ -716,7 +716,7 @@ module Consensus = struct return (consensus_key, voting_power) let check_endorsement vi ~check_signature - (operation : Kind.endorsement operation) = + (operation : Kind.attestation operation) = let open Lwt_result_syntax in let*? consensus_info = Option.value_e @@ -747,7 +747,7 @@ module Consensus = struct in return voting_power - let check_endorsement_conflict vs oph (operation : Kind.endorsement operation) + let check_endorsement_conflict vs oph (operation : Kind.attestation operation) = let (Single (Endorsement {slot; level; round; _})) = operation.protocol_data.contents @@ -768,7 +768,7 @@ module Consensus = struct Validate_errors.Consensus.( Conflicting_consensus_operation {kind = Attestation; conflict}) - let add_endorsement vs oph (op : Kind.endorsement operation) = + let add_endorsement vs oph (op : Kind.attestation operation) = let (Single (Endorsement {slot; level; round; _})) = op.protocol_data.contents in @@ -790,7 +790,7 @@ module Consensus = struct } (* Hypothesis: this function will only be called in mempool mode *) - let remove_endorsement vs (operation : Kind.endorsement operation) = + let remove_endorsement vs (operation : Kind.attestation operation) = (* We do not remove the endorsement power because it is not relevant for the mempool mode. *) let (Single (Endorsement {slot; level; round; _})) = @@ -896,7 +896,7 @@ module Consensus = struct | Application _ | Partial_validation _ | Mempool -> return_unit let validate_preendorsement ~check_signature info operation_state block_state - oph (operation : Kind.preendorsement operation) = + oph (operation : Kind.preattestation operation) = let open Lwt_result_syntax in let (Single (Preendorsement consensus_content)) = operation.protocol_data.contents @@ -1405,7 +1405,7 @@ module Anonymous = struct return_unit let check_double_preendorsement_evidence vi - (operation : Kind.double_preendorsement_evidence operation) = + (operation : Kind.double_preattestation_evidence operation) = let (Single (Double_preendorsement_evidence {op1; op2})) = operation.protocol_data.contents in @@ -1416,7 +1416,7 @@ module Anonymous = struct op2 let check_double_endorsement_evidence vi - (operation : Kind.double_endorsement_evidence operation) = + (operation : Kind.double_attestation_evidence operation) = let (Single (Double_endorsement_evidence {op1; op2})) = operation.protocol_data.contents in @@ -1436,14 +1436,14 @@ module Anonymous = struct Error (Operation_conflict {existing; new_operation = oph})) let check_double_preendorsement_evidence_conflict vs oph - (operation : Kind.double_preendorsement_evidence operation) = + (operation : Kind.double_preattestation_evidence operation) = let (Single (Double_preendorsement_evidence {op1; _})) = operation.protocol_data.contents in check_double_endorsing_evidence_conflict vs oph op1 let check_double_endorsement_evidence_conflict vs oph - (operation : Kind.double_endorsement_evidence operation) = + (operation : Kind.double_attestation_evidence operation) = let (Single (Double_endorsement_evidence {op1; _})) = operation.protocol_data.contents in @@ -1470,14 +1470,14 @@ module Anonymous = struct } let add_double_endorsement_evidence vs oph - (operation : Kind.double_endorsement_evidence operation) = + (operation : Kind.double_attestation_evidence operation) = let (Single (Double_endorsement_evidence {op1; _})) = operation.protocol_data.contents in add_double_endorsing_evidence vs oph op1 let add_double_preendorsement_evidence vs oph - (operation : Kind.double_preendorsement_evidence operation) = + (operation : Kind.double_preattestation_evidence operation) = let (Single (Double_preendorsement_evidence {op1; _})) = operation.protocol_data.contents in @@ -1498,14 +1498,14 @@ module Anonymous = struct {vs with anonymous_state} let remove_double_preendorsement_evidence vs - (operation : Kind.double_preendorsement_evidence operation) = + (operation : Kind.double_preattestation_evidence operation) = let (Single (Double_preendorsement_evidence {op1; _})) = operation.protocol_data.contents in remove_double_endorsing_evidence vs op1 let remove_double_endorsement_evidence vs - (operation : Kind.double_endorsement_evidence operation) = + (operation : Kind.double_attestation_evidence operation) = let (Single (Double_endorsement_evidence {op1; _})) = operation.protocol_data.contents in