spec: update to v0.5.1

This commit is contained in:
Michael Sproul 2019-04-02 14:18:07 +11:00
parent 4f63c89bb6
commit 2914d77cd3
No known key found for this signature in database
GPG Key ID: 77B1309D2E54E914

View File

@ -99,7 +99,7 @@ fn per_block_processing_signature_optional(
/// Processes the block header.
///
/// Spec v0.5.0
/// Spec v0.5.1
pub fn process_block_header(
state: &mut BeaconState,
block: &BeaconBlock,
@ -107,11 +107,8 @@ 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 == *state.get_block_root(state.slot - 1, spec)?,
block.previous_block_root == Hash256::from_slice(&state.latest_block_header.signed_root()),
Invalid::ParentBlockRootMismatch
);