Open MatheusFranco99 opened 3 weeks ago
Maybe p2p/SPEC.md needs some update at line 268-283 about Basic Validation
@alan-ssvlabs Indeed. Thanks!
@GalRogozinski @alan-ssvlabs
In the p2p/SCORING.md
file I have a code snippet for the message rate estimation. What do you guys think of creating a file with this code? The fact that p2p scoring needs it may be enough reason to add it. Also, the SSV
repo uses exactly this function.
@GalRogozinski @alan-ssvlabs Moved the msg estimation code to a go file and added some tests.
Overview
This PR updates the message validation module.
It adds a
MessageValidator
structure that implements theValidatorForTopic
function, as defined by the libp2p framework.Its main validation function starts a chain of validation checks for the pub-sub, syntax, semantics, QBFT and duty logic rules.
Documentation and message rate estimation
The PR also updates the message validation and scoring documentation in
p2p/SPEC.md
andp2p/SCORING.md
. The go code for the message rate estimation is added (along with tests) since this estimation is referenced by the scoring documentation.Tests
This PR also adds tests for each implemented rule, as can be seen in the following list.
PubSub
Syntax validation
ssz
decodingssz
encoding errors.General semantics validation
Consensus semantics validation
Consensus QBFT logic validation
Consensus duty logic validation
Partial signature semantics validation
ssz
encoding errorsPartial signature duty logic validation
General duty logic validation
Wrong signature
Valid