From fb9a5f0bc5e2358fbb2a57f3324b83ca2f82ed07 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Thu, 20 Jun 2019 14:57:53 -0600 Subject: [PATCH] one more rootslot fix --- specs/core/0_fork-choice.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specs/core/0_fork-choice.md b/specs/core/0_fork-choice.md index 3bcb6b889..668b20714 100644 --- a/specs/core/0_fork-choice.md +++ b/specs/core/0_fork-choice.md @@ -157,7 +157,8 @@ def on_block(store: Store, block: BeaconBlock) -> None: # Check that block is later than the finalized epoch slot assert blocks.slot > get_epoch_start_slot(store.finalized_epoch) # Check block slot against Unix time - pre_state = deepcopy(store.states[block.parent_root]) + parent_block = store.blocks[block.parent_root] + pre_state = deepcopy(store.states[RootSlot(signing_root(parent_block), parent_block.slot)]) assert store.time >= pre_state.genesis_time + block.slot * SECONDS_PER_SLOT # Check the block is valid and compute the post-state state = state_transition(pre_state, block)