diff --git a/src/bin_dal_node/accuser.ml b/src/bin_dal_node/accuser.ml index fdcce62421f0a83cb4eb002e5e1d20b8345a9ccf..b37b2e4b8e64b5155c8d8010d7e59908712c2312 100644 --- a/src/bin_dal_node/accuser.ml +++ b/src/bin_dal_node/accuser.ml @@ -29,10 +29,8 @@ let get_attestation_map (type block_info attestation_operation dal_attestation) (* [filter_injectable_traps] filters a list of traps to identify which ones are injectable by checking if each trap's delegate has both an attestation and DAL attestation in [attestation_map]. *) -let filter_injectable_traps ~attested_level ~published_level attestation_map - traps = - let open Lwt_result_syntax in - List.filter_map_s +let filter_injectable_traps attestation_map traps = + List.filter_map (fun trap -> let Types.{delegate; slot_index; shard; shard_proof} = trap in let attestation_opt = @@ -40,20 +38,14 @@ let filter_injectable_traps ~attested_level ~published_level attestation_map in match attestation_opt with | None -> - let*! () = - Event.emit_trap_delegate_attestation_not_found - ~delegate - ~slot_index - ~shard_index:shard.Cryptobox.index - ~published_level - ~attested_level - in - Lwt.return_none + (* The delegate did not TB attest or we have not found the delegate in + the attestation operation's receipt. *) + None | Some (_attestation, None) -> - (* The delegate did not DAL attest at all. *) - Lwt.return_none + (* The delegate did not DAL attest. *) + None | Some (attestation, Some dal_attestation) -> - Lwt.return_some + Some ( delegate, slot_index, attestation, @@ -91,13 +83,7 @@ let inject_entrapment_evidences (type block_info) | [] -> return_unit | traps -> let attestation_map = get_attestation_map (module Plugin) block in - let*! traps_to_inject = - filter_injectable_traps - ~attested_level - ~published_level - attestation_map - traps - in + let traps_to_inject = filter_injectable_traps attestation_map traps in List.iter_es (fun ( delegate, slot_index, diff --git a/src/bin_dal_node/event.ml b/src/bin_dal_node/event.ml index c64cac31550a22e6df9d5b47f6fb92921c9d6ebe..e82e218ade7ee4a6e09fcd10d67cf487a0c71e95 100644 --- a/src/bin_dal_node/event.ml +++ b/src/bin_dal_node/event.ml @@ -944,23 +944,6 @@ open struct ("slot_index", Data_encoding.int31) ("shard_index", Data_encoding.int31) - let trap_delegate_attestation_not_found = - declare_5 - ~section - ~prefix_name_with_section:true - ~name:"trap_delegate_attestation_not_found" - ~msg: - "Unable to associate an attestation with delegate {delegate} for \ - attested level {attested_level}. Failed while injecting trap evidence \ - from published level {published_level} at slot index {slot_index} and \ - shard index {shard_index}" - ~level:Warning - ("delegate", Signature.Public_key_hash.encoding) - ("slot_index", Data_encoding.int31) - ("shard_index", Data_encoding.int31) - ("published_level", Data_encoding.int32) - ("attested_level", Data_encoding.int32) - let registered_pkh_not_a_delegate = declare_1 ~section @@ -1268,12 +1251,6 @@ let emit_dont_wait__trap_registration_fail ~delegate ~slot_index ~shard_index = trap_registration_fail (delegate, slot_index, shard_index) -let emit_trap_delegate_attestation_not_found ~delegate ~slot_index ~shard_index - ~published_level ~attested_level = - emit - trap_delegate_attestation_not_found - (delegate, slot_index, shard_index, published_level, attested_level) - let emit_registered_pkh_not_a_delegate ~pkh = emit registered_pkh_not_a_delegate pkh