Update 0_beacon-chain.md
This commit is contained in:
parent
429e5721f2
commit
3efe1b3b6c
|
@ -863,12 +863,12 @@ def split(values: List[Any], split_count: int) -> List[Any]:
|
||||||
#### `get_new_shuffling`
|
#### `get_new_shuffling`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def get_new_shuffling(seed: Hash32,
|
def get_new_shuffling(randao_mix: Hash32,
|
||||||
slot: int,
|
slot: int,
|
||||||
validators: List[ValidatorRecord],
|
validators: List[ValidatorRecord],
|
||||||
crosslinking_start_shard: int) -> List[List[ShardCommittee]]:
|
crosslinking_start_shard: int) -> List[List[ShardCommittee]]:
|
||||||
"""
|
"""
|
||||||
Shuffles ``validators`` into shard committees using ``seed`` and ``slot`` as entropy.
|
Shuffles ``validators`` into shard committees seeded by ``randao_mix`` and ``slot``.
|
||||||
"""
|
"""
|
||||||
active_validator_indices = get_active_validator_indices(validators)
|
active_validator_indices = get_active_validator_indices(validators)
|
||||||
|
|
||||||
|
@ -880,8 +880,9 @@ def get_new_shuffling(seed: Hash32,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Shuffle with seed
|
# Shuffle
|
||||||
shuffled_active_validator_indices = shuffle(active_validator_indices, xor(seed, Hash32(slot))
|
seed = xor(randao_mix, Hash32(slot))
|
||||||
|
shuffled_active_validator_indices = shuffle(active_validator_indices, seed)
|
||||||
|
|
||||||
# Split the shuffled list into epoch_length pieces
|
# Split the shuffled list into epoch_length pieces
|
||||||
validators_per_slot = split(shuffled_active_validator_indices, EPOCH_LENGTH)
|
validators_per_slot = split(shuffled_active_validator_indices, EPOCH_LENGTH)
|
||||||
|
|
Loading…
Reference in New Issue