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:
Jimmy Chen
2026-05-28 10:27:16 +10:00
committed by GitHub
parent dfb259171a
commit 5636030b49
10 changed files with 374 additions and 63 deletions

View File

@@ -75,8 +75,15 @@ excluded_paths = [
"tests/.*/compute_challenge/.*",
# We don't need these manifest files at the moment.
"tests/.*/manifest.yaml",
# TODO: gossip condition tests not implemented yet
"tests/.*/.*/networking/.*",
# TODO: Remaining gossip validation topics not yet implemented
"tests/.*/.*/networking/gossip_beacon_block/.*",
"tests/.*/.*/networking/gossip_beacon_attestation/.*",
"tests/.*/.*/networking/gossip_beacon_aggregate_and_proof/.*",
"tests/.*/.*/networking/gossip_voluntary_exit/.*",
"tests/.*/.*/networking/gossip_bls_to_execution_change/.*",
"tests/.*/.*/networking/gossip_sync_committee_message/.*",
"tests/.*/.*/networking/gossip_sync_committee_contribution_and_proof/.*",
"tests/.*/.*/networking/gossip_blob_sidecar/.*",
# TODO: fast confirmation rule not merged yet
"tests/.*/.*/fast_confirmation",
]