Added deduplication
This commit is contained in:
parent
65c5a1a1b7
commit
8097b2373b
|
@ -78,10 +78,12 @@ def get_persistent_commmitee(state: BeaconState,
|
|||
PERSISTENT_COMMITTEE_PERIOD
|
||||
)
|
||||
|
||||
return (
|
||||
# Take not-yet-cycled-out validators from earlier committee and already-cycled-in validators from
|
||||
# later committee; return a sorted list of the union of the two, deduplicated
|
||||
return sorted(list(set(
|
||||
[i for i in earlier_committee if epoch % PERSISTENT_COMMITTEE_PERIOD < get_switchover_epoch(i)] +
|
||||
[i for i in later_committee if epoch % PERSISTENT_COMMITTEE_PERIOD >= get_switchover_epoch(i)]
|
||||
)
|
||||
)))
|
||||
```
|
||||
|
||||
## Data Structures
|
||||
|
|
Loading…
Reference in New Issue