Consensus updates for v0.12 (#1228)

* Update state processing for v0.12

* Fix EF test runners for v0.12

* Fix some tests

* Fix broken attestation verification test

* More test fixes

* Fix typo found in review
This commit is contained in:
Michael Sproul
2020-06-03 13:34:01 +10:00
parent 197adeff0b
commit fe03ff0f21
29 changed files with 359 additions and 323 deletions

View File

@@ -157,6 +157,15 @@ pub fn process_block_header<T: EthSpec>(
// Verify that the slots match
verify!(block.slot == state.slot, HeaderInvalid::StateSlotMismatch);
// Verify that the block is newer than the latest block header
verify!(
block.slot > state.latest_block_header.slot,
HeaderInvalid::OlderThanLatestBlockHeader {
block_slot: block.slot,
latest_block_header_slot: state.latest_block_header.slot,
}
);
// Verify that proposer index is the correct index
let proposer_index = block.proposer_index as usize;
let state_proposer_index = state.get_beacon_proposer_index(block.slot, spec)?;