-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Break up crosslink_committees_at_slot #707
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me happy. Thanks Danny!
slot: Slot, | ||
start_shard: Shard, | ||
committees_per_epoch: int) -> List[Tuple[List[ValidatorIndex], Shard]]: | ||
offset = slot % SLOTS_PER_EPOCH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add an assert to check shuffling_epoch
out of bound condition?
assert get_previous_epoch(state) <= shuffling_epoch <= get_current_epoch(state)+1
epochs_since_last_registry_update = current_epoch - state.validator_registry_update_epoch | ||
if registry_change: | ||
committees_per_epoch = get_next_epoch_committee_count(state) | ||
seed = generate_seed(state, next_epoch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to define next_epoch
seed, | ||
shuffling_epoch, | ||
slot, | ||
start_shard, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start_shard, | |
shuffling_start_shard, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👍 Will take another look when it's ready for review.
def get_crosslink_committees(state: BeaconState, | ||
seed: Bytes32, | ||
shuffling_epoch: Epoch, | ||
slot: Slot, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: move slot
next to state
to align with the order of the caller functions.
def get_crosslink_committees(state: BeaconState,
slot: Slot,
seed: Bytes32,
...
) | ||
for i in range(committees_per_slot) | ||
] | ||
return get_next_epoch_committee_count(state, slot, registry_change) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return get_next_epoch_committee_count(state, slot, registry_change) | |
return get_next_epoch_committees_at_slot(state, slot, registry_change) |
Implemented here: prysmaticlabs/prysm#1771 |
Closing in favour of #808 🔥 |
Attempt to "simplify"
get_crosslink_committees_at_slot
.Broke it up into (maybe) more manageable functions. Not really convinced this helps much but throwing it up here while I think more
cc: @JustinDrake, @terenc3t