Fix bug with per-block processing

This commit is contained in:
Paul Hauner
2019-03-18 18:09:31 +11:00
parent 71d95ee9db
commit 7503f31ddc
2 changed files with 4 additions and 4 deletions

View File

@@ -100,8 +100,11 @@ pub fn process_block_header(
) -> Result<(), Error> {
verify!(block.slot == state.slot, Invalid::StateSlotMismatch);
// NOTE: this is not to spec. I think spec is broken. See:
//
// https://github.com/ethereum/eth2.0-specs/issues/797
verify!(
block.previous_block_root.as_bytes() == &state.latest_block_header.hash_tree_root()[..],
block.previous_block_root == *state.get_block_root(state.slot - 1, spec)?,
Invalid::ParentBlockRootMismatch
);