clarify validation messages (#431)

* clarify validation messages

* add codecov threshold
This commit is contained in:
Giovanni Petrantoni 2020-11-12 01:42:12 +09:00 committed by GitHub
parent e85569800c
commit a9948b0b05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 6 deletions

8
codecov.yml Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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