diff --git a/CHANGES.rst b/CHANGES.rst index aad1a3fdc07464af47fcc45e4b9846acc5f20413..516d14480e4ced81f9ba500f26e0a0881f0deedd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -136,6 +136,8 @@ the README from ``src/bin_agnostic_baker``. Accuser ------- +- Consensus operations with different slots are no longer denunced, as this no + longer considered a punishable misbehaviour (MR :gl:`!18049`). Agnostic Accuser ---------------- diff --git a/src/proto_alpha/lib_delegate/client_baking_denunciation.ml b/src/proto_alpha/lib_delegate/client_baking_denunciation.ml index 407afd6d8e55513983f8c1606522536092f42bb2..de5aa94bffffe5ef8f92d0165d7abe26da1758d1 100644 --- a/src/proto_alpha/lib_delegate/client_baking_denunciation.ml +++ b/src/proto_alpha/lib_delegate/client_baking_denunciation.ml @@ -157,13 +157,6 @@ let get_payload_hash (type kind) | Attestation, Single (Attestation {consensus_content; _}) -> consensus_content.block_payload_hash -let get_slot (type kind) (op_kind : kind denunciable_consensus_operation) - (op : kind Operation.t) = - match (op_kind, op.protocol_data.contents) with - | Preattestation, Single (Preattestation consensus_content) - | Attestation, Single (Attestation {consensus_content; _}) -> - consensus_content.slot - let double_consensus_op_evidence (type kind) : kind denunciable_consensus_operation -> #Protocol_client_context.full -> @@ -241,11 +234,6 @@ let events_of_kind (type kind) (op_kind : kind denunciable_consensus_operation) double_preattestation_denounced, preattestation_conflict_ignored ) -let should_different_slots_be_denunced (type kind) state = - (* consensus operations with different slots are not denunced under - aggregate_attestation feature flag *) - not state.constants.parametric.aggregate_attestation - let process_consensus_op (type kind) state cctxt (op_kind : kind denunciable_consensus_operation) (new_op : kind Operation.t) chain_id level round slot = @@ -298,15 +286,12 @@ let process_consensus_op (type kind) state cctxt in let existing_payload_hash = get_payload_hash op_kind existing_op in let new_payload_hash = get_payload_hash op_kind new_op in - let existing_slot = get_slot op_kind existing_op in if Block_payload_hash.(existing_payload_hash <> new_payload_hash) - || Slot.(existing_slot <> slot) - && should_different_slots_be_denunced state || Block_hash.(existing_op.shell.branch <> new_op.shell.branch) then ( (* Same level, round, and delegate, and: - different payload hash OR different slot OR different branch *) + different payload hash different branch *) let op1, op2 = if Operation_hash.(new_op_hash < existing_op_hash) then (new_op, existing_op) diff --git a/tezt/tests/double_consensus.ml b/tezt/tests/double_consensus.ml index 7b1efc9f365fc44a9ace2b22dbfa9080348200c1..f44562e0c0f60a35d0ebcdd353f617df1925e284 100644 --- a/tezt/tests/double_consensus.ml +++ b/tezt/tests/double_consensus.ml @@ -111,57 +111,6 @@ let double_attestation_init in return ((client, accuser), (branch, level, round, slots, block_payload_hash)) -let double_consensus_wrong_slot - (consensus_for, mk_consensus, consensus_waiter, consensus_name) protocol = - let* (client, accuser), (branch, level, round, slots, block_payload_hash) = - double_attestation_init consensus_for consensus_name protocol () - in - (* Under [aggregate_attestation] feature flag, consensus operations with - non-minimal slots are not propagated by mempools and no longer denunced. *) - let* aggregate_attestation = - let* constants = - Client.RPC.call_via_endpoint client - @@ RPC.get_chain_block_context_constants () - in - return JSON.(constants |-> "aggregate_attestation" |> as_bool_opt) - in - if aggregate_attestation = Some true then unit - else ( - Log.info "Inject an invalid %s and wait for denounciation" consensus_name ; - let op = - mk_consensus ~slot:(List.nth slots 1) ~level ~round ~block_payload_hash - in - let waiter = consensus_waiter accuser in - let* _ = - Operation.Consensus.inject - ~protocol - ~branch - ~signer:Constant.bootstrap1 - op - client - in - let* () = waiter in - Log.info - "Inject another invalid %s and wait for already_denounced event" - consensus_name ; - let op = - mk_consensus ~slot:(List.nth slots 2) ~level ~round ~block_payload_hash - in - let* oph = get_double_consensus_denounciation_hash consensus_name client in - let waiter_already_denounced = - double_consensus_already_denounced_waiter accuser oph - in - let* _ = - Operation.Consensus.inject - ~protocol - ~branch - ~signer:Constant.bootstrap1 - op - client - in - let* () = waiter_already_denounced in - unit) - let attest_utils = ( Client.attest_for, (fun ~slot ~level ~round ~block_payload_hash -> @@ -175,22 +124,6 @@ let preattest_utils = double_preattestation_waiter, "preattestation" ) -let double_attestation_wrong_slot = - Protocol.register_test - ~__FILE__ - ~title:"double attestation using wrong slot" - ~tags:[Tag.layer1; "double"; "attestation"; "accuser"; "slot"; "node"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) - @@ fun protocol -> double_consensus_wrong_slot attest_utils protocol - -let double_preattestation_wrong_slot = - Protocol.register_test - ~__FILE__ - ~title:"double preattestation using wrong slot" - ~tags:[Tag.layer1; "double"; "preattestation"; "accuser"; "slot"; "node"] - ~uses:(fun protocol -> [Protocol.accuser protocol]) - @@ fun protocol -> double_consensus_wrong_slot preattest_utils protocol - let double_consensus_wrong_block_payload_hash (consensus_for, mk_consensus, consensus_waiter, consensus_name) protocol = let* (client, accuser), (branch, level, round, slots, _block_payload_hash) = @@ -476,8 +409,6 @@ let operation_too_far_in_future = unit let register ~protocols = - double_attestation_wrong_slot protocols ; - double_preattestation_wrong_slot protocols ; double_attestation_wrong_block_payload_hash protocols ; double_preattestation_wrong_block_payload_hash protocols ; double_attestation_wrong_branch protocols ;