Deduplicate indices

This commit is contained in:
Justin 2019-09-03 22:15:52 +01:00 committed by GitHub
parent 2eda4c5dbc
commit 91e73c1f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,7 +195,8 @@ def get_shard_committee(beacon_state: BeaconState, shard: Shard, epoch: Epoch) -
# Every epoch cycle out validators from the older committee and cycle in validators from the newer committee
older_subcommittee = [i for i in older_committee if i % EPOCHS_PER_SHARD_PERIOD > epoch % EPOCHS_PER_SHARD_PERIOD]
newer_subcommittee = [i for i in newer_committee if i % EPOCHS_PER_SHARD_PERIOD <= epoch % EPOCHS_PER_SHARD_PERIOD]
return older_subcommittee + newer_subcommittee
# Deduplicate and sort indices
return sorted(set(older_subcommittee + newer_subcommittee))
```
#### `get_shard_proposer_index`