Stricter aggregation_bitfield validation

Make sure that there's at least one vote in attestations (`bls_verify_multiple` can return `True` with zero votes)
This commit is contained in:
Justin 2019-01-28 21:13:25 +00:00 committed by GitHub
parent d78fb66aac
commit b2855f9be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1606,6 +1606,7 @@ For each `attestation` in `block.body.attestations`:
```python ```python
assert attestation.custody_bitfield == b'\x00' * len(attestation.custody_bitfield) # [TO BE REMOVED IN PHASE 1] assert attestation.custody_bitfield == b'\x00' * len(attestation.custody_bitfield) # [TO BE REMOVED IN PHASE 1]
assert attestation.aggregation_bitfield != b'\x00' * len(attestation.aggregation_bitfield)
for i in range(len(crosslink_committee)): for i in range(len(crosslink_committee)):
if get_bitfield_bit(attestation.aggregation_bitfield) == 0b0: if get_bitfield_bit(attestation.aggregation_bitfield) == 0b0: