skip bad proof of possession deposits

This commit is contained in:
Danny Ryan 2019-02-25 09:36:52 -07:00 committed by GitHub
parent fbb70e91eb
commit b2a3ee4bbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1235,7 +1235,7 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None:
""" """
deposit_input = deposit.deposit_data.deposit_input deposit_input = deposit.deposit_data.deposit_input
assert bls_verify( proof_is_valid = bls_verify(
pubkey=deposit_input.pubkey, pubkey=deposit_input.pubkey,
message_hash=signed_root(deposit_input, "proof_of_possession"), message_hash=signed_root(deposit_input, "proof_of_possession"),
signature=deposit_input.proof_of_possession, signature=deposit_input.proof_of_possession,
@ -1245,6 +1245,9 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None:
DOMAIN_DEPOSIT, DOMAIN_DEPOSIT,
) )
) )
if not proof_is_valid:
return
validator_pubkeys = [v.pubkey for v in state.validator_registry] validator_pubkeys = [v.pubkey for v in state.validator_registry]
pubkey = deposit_input.pubkey pubkey = deposit_input.pubkey