Check proposer is not slashed

This commit is contained in:
Justin 2019-03-11 22:07:34 +00:00 committed by GitHub
parent 8ca303efc5
commit 3459ea0838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -2247,8 +2247,10 @@ def process_block_header(state: BeaconState, block: BeaconBlock) -> None:
assert block.previous_block_root == hash_tree_root(state.latest_block_header) assert block.previous_block_root == hash_tree_root(state.latest_block_header)
# Save current block as the new latest block # Save current block as the new latest block
state.latest_block_header = get_temporary_block_header(block) state.latest_block_header = get_temporary_block_header(block)
# Verify proposer signature # Verify proposer
proposer = state.validator_registry[get_beacon_proposer_index(state, state.slot)] proposer = state.validator_registry[get_beacon_proposer_index(state, state.slot)]
assert not proposer.slashed
# Verify proposer signature
assert bls_verify( assert bls_verify(
pubkey=proposer.pubkey, pubkey=proposer.pubkey,
message_hash=signed_root(block), message_hash=signed_root(block),