ensure that next committee assignemtns is stable when need to be
This commit is contained in:
parent
e2f4e32332
commit
c9ac8170f0
|
@ -876,18 +876,21 @@ def get_crosslink_committees_at_slot(state: BeaconState,
|
||||||
shuffling_epoch = state.previous_shuffling_epoch
|
shuffling_epoch = state.previous_shuffling_epoch
|
||||||
shuffling_start_shard = state.previous_shuffling_start_shard
|
shuffling_start_shard = state.previous_shuffling_start_shard
|
||||||
elif epoch == next_epoch:
|
elif epoch == next_epoch:
|
||||||
current_committees_per_epoch = get_current_epoch_committee_count(state)
|
|
||||||
committees_per_epoch = get_next_epoch_committee_count(state)
|
|
||||||
shuffling_epoch = next_epoch
|
|
||||||
|
|
||||||
epochs_since_last_registry_update = current_epoch - state.validator_registry_update_epoch
|
epochs_since_last_registry_update = current_epoch - state.validator_registry_update_epoch
|
||||||
if registry_change:
|
if registry_change:
|
||||||
|
committees_per_epoch = get_next_epoch_committee_count(state)
|
||||||
|
shuffling_epoch = next_epoch
|
||||||
seed = generate_seed(state, next_epoch)
|
seed = generate_seed(state, next_epoch)
|
||||||
|
current_committees_per_epoch = get_current_epoch_committee_count(state)
|
||||||
shuffling_start_shard = (state.current_shuffling_start_shard + current_committees_per_epoch) % SHARD_COUNT
|
shuffling_start_shard = (state.current_shuffling_start_shard + current_committees_per_epoch) % SHARD_COUNT
|
||||||
elif epochs_since_last_registry_update > 1 and is_power_of_two(epochs_since_last_registry_update):
|
elif epochs_since_last_registry_update > 1 and is_power_of_two(epochs_since_last_registry_update):
|
||||||
|
committees_per_epoch = get_next_epoch_committee_count(state)
|
||||||
|
shuffling_epoch = next_epoch
|
||||||
seed = generate_seed(state, next_epoch)
|
seed = generate_seed(state, next_epoch)
|
||||||
shuffling_start_shard = state.current_shuffling_start_shard
|
shuffling_start_shard = state.current_shuffling_start_shard
|
||||||
else:
|
else:
|
||||||
|
committees_per_epoch = get_current_epoch_committee_count(state)
|
||||||
|
shuffling_epoch = state.current_shuffling_epoch
|
||||||
seed = state.current_shuffling_seed
|
seed = state.current_shuffling_seed
|
||||||
shuffling_start_shard = state.current_shuffling_start_shard
|
shuffling_start_shard = state.current_shuffling_start_shard
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue