From 365437d4c20c2db686ab7d11d5c6417ef263ae2b Mon Sep 17 00:00:00 2001 From: vbuterin Date: Mon, 17 Dec 2018 04:46:28 -0500 Subject: [PATCH] Forgot to update randao mixes in one place --- specs/core/0_beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index e2748214d..ee5c3ff2f 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1766,8 +1766,8 @@ num_validators_to_reshuffle = len(active_validator_indices) // SHARD_PERSISTENT_ for i in range(num_validators_to_reshuffle): # Multiplying i to 2 to ensure we have different input to all the required hashes in the shuffling # and none of the hashes used for entropy in this loop will be the same - validator_index = active_validator_indices[hash(state.latest_randao_mixes[-1] + bytes8(i * 2)) % len(active_validator_indices)] - new_shard = hash(state.latest_randao_mixes[-1] + bytes8(i * 2 + 1)) % SHARD_COUNT + validator_index = active_validator_indices[hash(state.latest_randao_mixes[block.slot % LATEST_BLOCK_ROOTS_LENGTH] + bytes8(i * 2)) % len(active_validator_indices)] + new_shard = hash(state.latest_randao_mixes[block.slot % LATEST_BLOCK_ROOTS_LENGTH] + bytes8(i * 2 + 1)) % SHARD_COUNT shard_reassignment_record = ShardReassignmentRecord( validator_index=validator_index, shard=new_shard,