Update 0_beacon-chain.md

This commit is contained in:
Justin 2019-01-02 15:21:22 +00:00 committed by GitHub
parent 429e5721f2
commit 3efe1b3b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -863,12 +863,12 @@ def split(values: List[Any], split_count: int) -> List[Any]:
#### `get_new_shuffling`
```python
def get_new_shuffling(seed: Hash32,
def get_new_shuffling(randao_mix: Hash32,
slot: int,
validators: List[ValidatorRecord],
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)
@ -880,8 +880,9 @@ def get_new_shuffling(seed: Hash32,
)
)
# Shuffle with seed
shuffled_active_validator_indices = shuffle(active_validator_indices, xor(seed, Hash32(slot))
# Shuffle
seed = xor(randao_mix, Hash32(slot))
shuffled_active_validator_indices = shuffle(active_validator_indices, seed)
# Split the shuffled list into epoch_length pieces
validators_per_slot = split(shuffled_active_validator_indices, EPOCH_LENGTH)