Skip to content

Commit

Permalink
fix(rln-relay): mark duplicated messages as spam (#1867)
Browse files Browse the repository at this point in the history
* fix(rln-relay): mark duplicated messages as spam

* chore: fix fn desc
  • Loading branch information
rymnc committed Aug 2, 2023
1 parent afb93e2 commit 4756ccc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions waku/v2/waku_rln_relay/rln_relay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ method stop*(rlnPeer: WakuRLNRelay) {.async.} =
proc hasDuplicate*(rlnPeer: WakuRLNRelay,
proofMetadata: ProofMetadata): RlnRelayResult[bool] =
## returns true if there is another message in the `nullifierLog` of the `rlnPeer` with the same
## epoch and nullifier as `proofMetadata`'s epoch and nullifier but different Shamir secret shares
## epoch and nullifier as `proofMetadata`'s epoch and nullifier
## otherwise, returns false
## Returns an error if it cannot check for duplicates

Expand All @@ -110,8 +110,8 @@ proc hasDuplicate*(rlnPeer: WakuRLNRelay,
return ok(false)
try:
if rlnPeer.nullifierLog[externalNullifier].contains(proofMetadata):
# there is an identical record, ignore rhe mag
return ok(false)
# there is an identical record, mark it as spam
return ok(true)

# check for a message with the same nullifier but different secret shares
let matched = rlnPeer.nullifierLog[externalNullifier].filterIt((
Expand Down

0 comments on commit 4756ccc

Please sign in to comment.