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)
|
let validation = await f.validate(msg)
|
||||||
case validation
|
case validation
|
||||||
of ValidationResult.Reject, ValidationResult.Ignore:
|
of ValidationResult.Reject:
|
||||||
debug "Dropping message due to ignored validation", msgId, peer
|
debug "Dropping message after validation, reason: reject", msgId, peer
|
||||||
|
continue
|
||||||
|
of ValidationResult.Ignore:
|
||||||
|
debug "Dropping message after validation, reason: ignore", msgId, peer
|
||||||
continue
|
continue
|
||||||
of ValidationResult.Accept:
|
of ValidationResult.Accept:
|
||||||
discard
|
discard
|
||||||
|
|
|
@ -1109,11 +1109,11 @@ method rpcHandler*(g: GossipSub,
|
||||||
let validation = await g.validate(msg)
|
let validation = await g.validate(msg)
|
||||||
case validation
|
case validation
|
||||||
of ValidationResult.Reject:
|
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)
|
g.punishPeer(peer, msg.topicIDs)
|
||||||
continue
|
continue
|
||||||
of ValidationResult.Ignore:
|
of ValidationResult.Ignore:
|
||||||
debug "Dropping message due to ignored validation", msgId, peer
|
debug "Dropping message after validation, reason: ignore", msgId, peer
|
||||||
continue
|
continue
|
||||||
of ValidationResult.Accept:
|
of ValidationResult.Accept:
|
||||||
discard
|
discard
|
||||||
|
|
|
@ -466,8 +466,11 @@ method rpcHandler*(g: GossipSub,
|
||||||
|
|
||||||
let validation = await g.validate(msg)
|
let validation = await g.validate(msg)
|
||||||
case validation
|
case validation
|
||||||
of ValidationResult.Reject, ValidationResult.Ignore:
|
of ValidationResult.Reject:
|
||||||
debug "Dropping message due to ignored validation", msgId, peer
|
debug "Dropping message after validation, reason: reject", msgId, peer
|
||||||
|
continue
|
||||||
|
of ValidationResult.Ignore:
|
||||||
|
debug "Dropping message after validation, reason: ignore", msgId, peer
|
||||||
continue
|
continue
|
||||||
of ValidationResult.Accept:
|
of ValidationResult.Accept:
|
||||||
discard
|
discard
|
||||||
|
|
Loading…
Reference in New Issue