You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current state transition function structure (as #1018 makes clear) is:
defstate_transition(state: BeaconState, block: BeaconBlock) ->BeaconBlock:
# Process slots (including those with no blocks) since blockprocess_slots(state, block.slot)
# Process blockprocess_block(state, block)
# Return post-statereturnstate
defprocess_slots(state: BeaconState, slot: Slot) ->None:
assertstate.slot<slotwhilestate.slot<slot:
process_slot(state)
# Process epoch on the last slot of every epochif (state.slot+1) %SLOTS_PER_EPOCH==0:
process_epoch(state)
state.slot+=1
Notice on the last slot of every epoch, i.e. when (state.slot + 1) % SLOTS_PER_EPOCH == 0, process_epoch is run before process_block. This is bad because the attestations (and other operations such as eth1 votes) in the last block are ignored by process_epoch.
My best guess is that we want something like:
defstate_transition(state: BeaconState, block: BeaconBlock) ->BeaconBlock:
assertstate.slot<block.slotwhilestate.slot<block.slot:
process_slot(state)
if (state.slot+1) ==block.slot:
process_block(state, block)
if (state.slot+1) %SLOTS_PER_EPOCH==0:
process_epoch(state)
state.slot+=1returnstate
Notice that we are actually quite constrained:
process_slot must come first, to "catch up" the skip slots
process_block must come before the final process_epoch as highlighted by this issue
The above two imply that we want process_slot, then process_block, then the final process_epoch.
The text was updated successfully, but these errors were encountered:
The current state transition function structure (as #1018 makes clear) is:
Notice on the last slot of every epoch, i.e. when
(state.slot + 1) % SLOTS_PER_EPOCH == 0
,process_epoch
is run beforeprocess_block
. This is bad because the attestations (and other operations such as eth1 votes) in the last block are ignored byprocess_epoch
.My best guess is that we want something like:
Notice that we are actually quite constrained:
process_slot
must come first, to "catch up" the skip slotsprocess_block
must come before the finalprocess_epoch
as highlighted by this issueThe above two imply that we want
process_slot
, thenprocess_block
, then the finalprocess_epoch
.The text was updated successfully, but these errors were encountered: