Merge pull request #487 from terenc3t/patch-38

use get_randao_mix for partial update
This commit is contained in:
Danny Ryan 2019-01-22 14:25:35 -06:00 committed by GitHub
commit cd72016c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1777,7 +1777,7 @@ and perform the following updates:
If a validator registry update does _not_ happen do the following:
* Let `epochs_since_last_registry_change = (state.slot - state.validator_registry_update_slot) // EPOCH_LENGTH`.
* If `epochs_since_last_registry_change` is an exact power of 2, set `state.current_epoch_calculation_slot = state.slot` and `state.current_epoch_randao_mix = state.latest_randao_mixes[(state.current_epoch_calculation_slot - SEED_LOOKAHEAD) % LATEST_RANDAO_MIXES_LENGTH]`. Note that `state.current_epoch_start_shard` is left unchanged.
* If `epochs_since_last_registry_change` is an exact power of 2, set `state.current_epoch_calculation_slot = state.slot` and `state.current_epoch_randao_mix = get_randao_mix(state, state.current_epoch_calculation_slot - SEED_LOOKAHEAD)`. Note that `state.current_epoch_start_shard` is left unchanged.
Regardless of whether or not a validator set change happens, run the following: