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

minor bug process_attester_slashings #873

Merged
merged 4 commits into from
Apr 3, 2019
Merged

minor bug process_attester_slashings #873

merged 4 commits into from
Apr 3, 2019

Conversation

djrtwo
Copy link
Contributor

@djrtwo djrtwo commented Apr 2, 2019

Fixes a minor bug in process_attester_slashings in which it is using the incorrect (outdated) validator_indices field instead of custody_bit_0_indices and custody_bit_1_indices.
Adds a number of attester slashing tests.

Thanks for finding this @protolambda

@protolambda
Copy link
Collaborator

Good to see more tests for this, the sanity check missed it 👍

@djrtwo
Copy link
Contributor Author

djrtwo commented Apr 2, 2019

I apparently skipped attester-slashing tests when I did the first pass on sanity tests 😬

Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good to me!

A question:

Do we have to check that len(set(custody_bit_0_indices).intersaction(set(custody_bit_1_indices))) == 0 in verify_indexed_attestation or other check already covers this case?

I think it's rational that normally, AttesterSlashings are created by convert_to_indexed(state, Attestation) as your test case; but is it possible to create an IndexedAttestation with one index appears in both custody_bit_0_indices and custody_bit_1_indices after phase 1? If so, IMO we should make it clear and invalid in case of consensus error.

specs/core/0_beacon-chain.md Outdated Show resolved Hide resolved
tests/phase0/test_sanity.py Show resolved Hide resolved
tests/phase0/test_sanity.py Show resolved Hide resolved
@djrtwo djrtwo merged commit 75f0af4 into dev Apr 3, 2019
@djrtwo djrtwo deleted the validator-indices-bug branch April 3, 2019 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants