Merge pull request #1738 from ethereum/JustinDrake-patch-3

Fix #1735—remove redundant check
This commit is contained in:
Danny Ryan 2020-04-21 08:17:02 -06:00 committed by GitHub
commit 5cb6ec9471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -684,14 +684,10 @@ def is_slashable_attestation_data(data_1: AttestationData, data_2: AttestationDa
```python ```python
def is_valid_indexed_attestation(state: BeaconState, indexed_attestation: IndexedAttestation) -> bool: def is_valid_indexed_attestation(state: BeaconState, indexed_attestation: IndexedAttestation) -> bool:
""" """
Check if ``indexed_attestation`` has valid indices and signature. Check if ``indexed_attestation`` has sorted and unique indices and a valid aggregate signature.
""" """
indices = indexed_attestation.attesting_indices
# Verify max number of indices
if not len(indices) <= MAX_VALIDATORS_PER_COMMITTEE:
return False
# Verify indices are sorted and unique # Verify indices are sorted and unique
indices = indexed_attestation.attesting_indices
if not indices == sorted(set(indices)): if not indices == sorted(set(indices)):
return False return False
# Verify aggregate signature # Verify aggregate signature