mirror of https://github.com/vacp2p/nim-libp2p.git
clarify validation messages (#431)
* clarify validation messages * add codecov threshold
This commit is contained in:
parent
e85569800c
commit
a9948b0b05
|
@ -0,0 +1,8 @@
|
|||
coverage:
|
||||
status:
|
||||
project:
|
||||
default: # This can be anything, but it needs to exist as the name
|
||||
# basic settings
|
||||
target: auto
|
||||
threshold: 5%
|
||||
base: auto
|
|
@ -87,8 +87,11 @@ method rpcHandler*(f: FloodSub,
|
|||
|
||||
let validation = await f.validate(msg)
|
||||
case validation
|
||||
of ValidationResult.Reject, ValidationResult.Ignore:
|
||||
debug "Dropping message due to ignored validation", msgId, peer
|
||||
of ValidationResult.Reject:
|
||||
debug "Dropping message after validation, reason: reject", msgId, peer
|
||||
continue
|
||||
of ValidationResult.Ignore:
|
||||
debug "Dropping message after validation, reason: ignore", msgId, peer
|
||||
continue
|
||||
of ValidationResult.Accept:
|
||||
discard
|
||||
|
|
|
@ -1109,11 +1109,11 @@ method rpcHandler*(g: GossipSub,
|
|||
let validation = await g.validate(msg)
|
||||
case validation
|
||||
of ValidationResult.Reject:
|
||||
debug "Dropping message due to failed validation", msgId, peer
|
||||
debug "Dropping message after validation, reason: reject", msgId, peer
|
||||
g.punishPeer(peer, msg.topicIDs)
|
||||
continue
|
||||
of ValidationResult.Ignore:
|
||||
debug "Dropping message due to ignored validation", msgId, peer
|
||||
debug "Dropping message after validation, reason: ignore", msgId, peer
|
||||
continue
|
||||
of ValidationResult.Accept:
|
||||
discard
|
||||
|
|
|
@ -466,8 +466,11 @@ method rpcHandler*(g: GossipSub,
|
|||
|
||||
let validation = await g.validate(msg)
|
||||
case validation
|
||||
of ValidationResult.Reject, ValidationResult.Ignore:
|
||||
debug "Dropping message due to ignored validation", msgId, peer
|
||||
of ValidationResult.Reject:
|
||||
debug "Dropping message after validation, reason: reject", msgId, peer
|
||||
continue
|
||||
of ValidationResult.Ignore:
|
||||
debug "Dropping message after validation, reason: ignore", msgId, peer
|
||||
continue
|
||||
of ValidationResult.Accept:
|
||||
discard
|
||||
|
|
Loading…
Reference in New Issue