Add gossip validation spec tests for proposer/attester slashings#9323
Merged
Conversation
…tor `process_gossip_*_slashing` methods to return `MessageAcceptance` for testability.
Validation errors were returning `Ignore` instead of `Reject`, which is incorrect per the spec. Internal errors still return `Ignore`.
a1a58a3 to
921c1a5
Compare
dknopik
reviewed
May 20, 2026
michaelsproul
left a comment
Member
There was a problem hiding this comment.
Overall approach looks really good.
|
This pull request has merge conflicts. Could you please resolve them @jimmygchen? 🙏 |
# Conflicts: # Cargo.lock # beacon_node/network/src/network_beacon_processor/mod.rs # testing/ef_tests/Cargo.toml
Merge Queue Status
This pull request spent 30 minutes 15 seconds in the queue, including 28 minutes 14 seconds running CI. Required conditions to merge
|
8 tasks
jimmygchen
added a commit
to jimmygchen/lighthouse
that referenced
this pull request
May 29, 2026
…p#9323) Addresses sigp#9232 partially. This PR covers two topics only. * sigp#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 <[email protected]>
jimmygchen
added a commit
to jimmygchen/lighthouse
that referenced
this pull request
May 29, 2026
…p#9323) Addresses sigp#9232 partially. This PR covers two topics only. * sigp#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 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Addressed
Addresses #9232 partially. This PR covers two topics only.
Wires up networking test vectors for
gossip_proposer_slashingandgossip_attester_slashingtopics.The tests also revealed minor spec non-compliance where invalid slashings were ignored rather than rejected.
Proposed Changes
process_gossip_proposer_slashingandprocess_gossip_attester_slashingto returnMessageAcceptance, so it can be verified in the testsGossipValidationtest case, handler, and test entriesRejectwhen the slashing is invalid and only penalise on invalid messagesAI Assistance Disclosure
Tools used (required — write
noneif no AI was used): claude for the test boilerplate. Rewrote most of the production changes manually.Attestation (required):