Repo currently doesn't handle the case in which a block's parent spans multiple state recalc points. For example if the parent of slot 258 was at slot 65. Then processing block at 258 would trigger a state recalc for 128, 192, and 256. The mechanism to solve this is described in the spec:
Repeat while slot - last_state_recalc >= CYCLE_LENGTH:
Proposed implementation
Add a while loop around the initialize_new_cycle part of compute_state_transition instead of the current if
Issue
Repo currently doesn't handle the case in which a block's parent spans multiple state recalc points. For example if the parent of slot 258 was at slot 65. Then processing block at 258 would trigger a state recalc for 128, 192, and 256. The mechanism to solve this is described in the spec:
Proposed implementation
Add a
while
loop around theinitialize_new_cycle
part ofcompute_state_transition
instead of the currentif
See here: https://github.com/ethereum/beacon_chain/blob/master/beacon_chain/state/state_transition.py#L333