Skip to content

Commit

Permalink
refactor: move Likely Duplicitous Event bodies to DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbull committed Dec 26, 2024
1 parent 2b7e0ca commit 30a51b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/keri/core/eventing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3208,7 +3208,8 @@ def processEvent(self, serder, sigers, *, wigers=None,

else: # escrow likely duplicitous event
self.escrowLDEvent(serder=serder, sigers=sigers)
raise LikelyDuplicitousError("Likely Duplicitous event={}.".format(ked))
logger.debug("Likely Duplicitous event Body=%s", serder.pretty())
raise LikelyDuplicitousError(f"Likely Duplicitous event={serder.said}")

else: # rot, drt, or ixn, so sn matters
kever = self.kevers[pre] # get existing kever for pre
Expand All @@ -3218,7 +3219,8 @@ def processEvent(self, serder, sigers, *, wigers=None,
# escrow out-of-order event
self.escrowOOEvent(serder=serder, sigers=sigers,
seqner=delseqner, saider=delsaider, wigers=wigers)
raise OutOfOrderError("Out-of-order event={}.".format(ked))
logger.debug("Out of Order event Body=%s", serder.pretty())
raise OutOfOrderError(f"Out-of-order event={serder.said}")

elif ((sn == sno) or # inorder event (ixn, rot, drt) or
(ilk == Ilks.rot and # superseding recovery rot or
Expand Down Expand Up @@ -3280,7 +3282,8 @@ def processEvent(self, serder, sigers, *, wigers=None,

else: # escrow likely duplicitous event
self.escrowLDEvent(serder=serder, sigers=sigers)
raise LikelyDuplicitousError("Likely Duplicitous event={}.".format(ked))
logger.debug("Likely Duplicitous event Body=%s", serder.pretty())
raise LikelyDuplicitousError(f"Likely Duplicitous event={serder.said}")

def processReceiptWitness(self, serder, wigers):
"""
Expand Down Expand Up @@ -4611,7 +4614,7 @@ def processEscrowOutOfOrders(self):
# error other than out of order so remove from OO escrow
self.db.delOoe(snKey(pre, sn), edig) # removes one escrow at key val
if logger.isEnabledFor(logging.DEBUG):
logger.trace("Kevery: ooo escrow other error on escrow: %s\n", ex.args[0])
logger.debug("Kevery: ooo escrow other error on escrow: %s\n", ex.args[0])
logger.exception("Kevery: ooo escrow other error on : %s\n", ex.args[0])

else: # unescrow succeeded, remove from escrow
Expand Down
6 changes: 4 additions & 2 deletions src/keri/vdr/eventing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,8 @@ def processEvent(self, serder, seqner=None, saider=None, wigers=None):
if ilk in (Ilks.vcp,):
# we don't have multiple signatures to verify so this
# is already first seen and then lifely duplicitious
raise LikelyDuplicitousError("Likely Duplicitous event={}.".format(ked))
logger.debug("Likely Duplicitous event Body=%s", serder.pretty())
raise LikelyDuplicitousError(f"Likely Duplicitous event={serder.said}")

tever = self.tevers[regk]
tever.cues = self.cues
Expand All @@ -1614,7 +1615,8 @@ def processEvent(self, serder, seqner=None, saider=None, wigers=None):
# self.cues.append(dict(kin="receipt", serder=serder))
pass
else: # duplicitious
raise LikelyDuplicitousError("Likely Duplicitous event={} with sn {}.".format(ked, sn))
logger.debug("Likely Duplicitous event Body=%s", serder.pretty())
raise LikelyDuplicitousError(f"Likely Duplicitous event={serder.said} with sn {serder.sn}")

def processQuery(self, serder, source=None, sigers=None, cigars=None):
""" Process TEL query event message (qry)
Expand Down

0 comments on commit 30a51b1

Please sign in to comment.