Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for attester-slashing bitfield intersection variations #1690

Open
protolambda opened this issue Mar 27, 2020 · 0 comments
Open

Tests for attester-slashing bitfield intersection variations #1690

protolambda opened this issue Mar 27, 2020 · 0 comments

Comments

@protolambda
Copy link
Collaborator

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: prysmaticlabs/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant