-
Notifications
You must be signed in to change notification settings - Fork 933
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
Clarify "per-epoch processing" #946
Comments
We have def get_current_epoch(state: BeaconState) -> Epoch:
return state.slot // SLOTS_PER_EPOCH and (see state_transition.py) def state_transition_to(state: BeaconState, up_to: Slot) -> BeaconState:
while state.slot < up_to:
spec.cache_state(state)
if (state.slot + 1) % spec.SLOTS_PER_EPOCH == 0:
process_epoch_transition(state)
spec.advance_slot(state) In other words, This does seem to contradict this sentence in the spec:
@djrtwo: Should it say "The per-epoch transitions, which happens at the start of the last slot of every epoch."? |
I think it should actually be
(I prefer the first variant and suggest, to make it clearer, to call them "end of epoch" transition, because the epoch number at the time of the transition is the old epoch rather than the new one) |
At the start of the state transition of the first slot of every epoch. yes, the slot isn't incremented yet at that point in the state transition but it is certainly during the state transition of the 1st slot of the epoch. That said, the debate really seems to be in #1043 😂 |
Closing in favour of #1043 |
When reading through the spec, I noticed that during epoch processing, the "current epoch" actually refers to the previous epoch, whereas in the block processing, the "current slot" corresponds to the slot of the given block.
To make this less confusing, I suggest renaming it to "end of epoch processing"?
The text was updated successfully, but these errors were encountered: