justified_head_state which is used to get the active validator set for lmd_ghost is currently defined as "the resulting BeaconState object from processing the chain up to the justified_head".
This is correct in the "happy" case in which no slots were skipped between the justified_head and the epoch boundary that was justified, but in the case that slots were skipped between the head and epoch boundary slot (% epoch_length == 0), the justified head is actually the block from a prior slot but at the state at the epoch boundary slot. For example, if a block at slot 63 (epoch 0) is justified for epoch 1 (epoch boundary @ slot 64) in the case that there was no block for slot 64, then the state associated with this (justified_block, justified_epoch) tuple is actually the justified block from slot 63 transitioned through an additional slot to slot 64.
Define justified_head_state as "the resulting BeaconState object from processing the chain up to the justified_head through the start slot of justified_epoch"
We probably also want to make the fork choice rule spec executable.
That would be great to produce test vectors.
The only existing reference code in Python is unfortunately outdated:
This was addressed in 1198
Most helpful comment
We probably also want to make the fork choice rule spec executable.