Prysm experienced a bad bug with attester slashings where the intersection effectively always returned the full committee of the first attestation, due to intersection being called with the duplicate inputs: OffchainLabs/prysm#5229
The spec-tests cover indices missing/extra in various ways, but missed more variants of the valid case where different indices are slashed: https://github.com/ethereum/eth2.0-specs/blob/dev/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py
And the sanity tests seems to be testing this, but the utility code actually returns a full-participation attestation, so it went unnoticed through this test as well. https://github.com/ethereum/eth2.0-specs/blob/9f7a5491d749ced2f2fe9b44f2b467bb6db8c746/tests/core/pyspec/eth2spec/test/helpers/attester_slashings.py#L4
More valid test cases should be introduced to cover combinations of:
- full attestations
- partial participation attestations, different permutations
- empty attestations
Thanks to @mcdee for finding this gap in tests and helping Prysm.
Prysm experienced a bad bug with attester slashings where the intersection effectively always returned the full committee of the first attestation, due to intersection being called with the duplicate inputs: OffchainLabs/prysm#5229
The spec-tests cover indices missing/extra in various ways, but missed more variants of the valid case where different indices are slashed: https://github.com/ethereum/eth2.0-specs/blob/dev/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py
And the sanity tests seems to be testing this, but the utility code actually returns a full-participation attestation, so it went unnoticed through this test as well. https://github.com/ethereum/eth2.0-specs/blob/9f7a5491d749ced2f2fe9b44f2b467bb6db8c746/tests/core/pyspec/eth2spec/test/helpers/attester_slashings.py#L4
More valid test cases should be introduced to cover combinations of:
Thanks to @mcdee for finding this gap in tests and helping Prysm.