mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Add gossip validation spec tests for proposer/attester slashings (#9323)
Addresses #9232 partially. This PR covers two topics only. * #9232 Wires up networking test vectors for `gossip_proposer_slashing` and `gossip_attester_slashing` topics. The tests also revealed minor spec non-compliance where invalid slashings were ignored rather than rejected. - Refactor `process_gossip_proposer_slashing` and `process_gossip_attester_slashing` to return `MessageAcceptance`, so it can be verified in the tests - Add `GossipValidation` test case, handler, and test entries - Spec compliance fix: distinguish between internal errors and validation error - return `Reject` when the slashing is invalid and only penalise on invalid messages Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -1189,3 +1189,15 @@ fn compute_columns_for_custody_group() {
|
||||
ComputeColumnsForCustodyGroupHandler::<MainnetEthSpec>::default().run();
|
||||
ComputeColumnsForCustodyGroupHandler::<MinimalEthSpec>::default().run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gossip_proposer_slashing() {
|
||||
GossipValidationHandler::<MinimalEthSpec>::new("gossip_proposer_slashing").run();
|
||||
GossipValidationHandler::<MainnetEthSpec>::new("gossip_proposer_slashing").run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gossip_attester_slashing() {
|
||||
GossipValidationHandler::<MinimalEthSpec>::new("gossip_attester_slashing").run();
|
||||
GossipValidationHandler::<MainnetEthSpec>::new("gossip_attester_slashing").run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user