mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-26 09:15:17 +00:00
clena up get_crosslink_committees_at_slots
This commit is contained in:
parent
dd075edd06
commit
b18de2c86c
@ -942,24 +942,25 @@ def get_crosslink_committees_at_slot(state: BeaconState,
|
|||||||
state_epoch_slot = state.slot - (state.slot % EPOCH_LENGTH)
|
state_epoch_slot = state.slot - (state.slot % EPOCH_LENGTH)
|
||||||
assert state_epoch_slot <= slot + EPOCH_LENGTH
|
assert state_epoch_slot <= slot + EPOCH_LENGTH
|
||||||
assert slot < state_epoch_slot + EPOCH_LENGTH
|
assert slot < state_epoch_slot + EPOCH_LENGTH
|
||||||
offset = slot % EPOCH_LENGTH
|
|
||||||
|
|
||||||
if slot < state_epoch_slot:
|
if slot < state_epoch_slot:
|
||||||
committees_per_slot = get_previous_epoch_committee_count_per_slot(state)
|
committees_per_slot = get_previous_epoch_committee_count_per_slot(state)
|
||||||
shuffling = get_shuffling(
|
seed = state.previous_epoch_randao_mix
|
||||||
state.previous_epoch_randao_mix,
|
shuffling_slot = state.previous_epoch_calculation_slot
|
||||||
state.validator_registry,
|
shuffling_start_shard = state.previous_epoch_start_shard
|
||||||
state.previous_epoch_calculation_slot,
|
|
||||||
)
|
|
||||||
slot_start_shard = (state.previous_epoch_start_shard + committees_per_slot * offset) % SHARD_COUNT
|
|
||||||
else:
|
else:
|
||||||
committees_per_slot = get_current_epoch_committee_count_per_slot(state)
|
committees_per_slot = get_current_epoch_committee_count_per_slot(state)
|
||||||
shuffling = get_shuffling(
|
seed = state.current_epoch_randao_mix
|
||||||
state.current_epoch_randao_mix,
|
shuffling_slot = state.current_epoch_calculation_slot
|
||||||
state.validator_registry,
|
shuffling_start_shard = state.current_epoch_start_shard
|
||||||
state.current_epoch_calculation_slot,
|
|
||||||
)
|
shuffling = get_shuffling(
|
||||||
slot_start_shard = (state.current_epoch_start_shard + committees_per_slot * offset) % SHARD_COUNT
|
seed,
|
||||||
|
state.validator_registry,
|
||||||
|
shuffling_slot,
|
||||||
|
)
|
||||||
|
offset = slot % EPOCH_LENGTH
|
||||||
|
slot_start_shard = (shuffling_start_shard + committees_per_slot * offset) % SHARD_COUNT
|
||||||
|
|
||||||
return [
|
return [
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user