malefactor_key -> malefactor_secret

This commit is contained in:
Danny Ryan 2020-01-03 07:29:23 -07:00
parent 595d2f69a3
commit 0a3cc8a84a
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A

View File

@ -96,7 +96,7 @@ class CustodySlashing(Container):
# (Attestation.data.shard_transition_root as ShardTransition).shard_data_roots[data_index] is the root of the data. # (Attestation.data.shard_transition_root as ShardTransition).shard_data_roots[data_index] is the root of the data.
data_index: uint64 data_index: uint64
malefactor_index: ValidatorIndex malefactor_index: ValidatorIndex
malefactor_key: BLSSignature malefactor_secret: BLSSignature
whistleblower_index: ValidatorIndex whistleblower_index: ValidatorIndex
shard_transition: ShardTransition shard_transition: ShardTransition
attestation: Attestation attestation: Attestation
@ -393,7 +393,7 @@ def process_custody_slashing(state: BeaconState, signed_custody_slashing: Signed
custody_slashing.malefactor_index, custody_slashing.malefactor_index,
) )
domain = get_domain(state, DOMAIN_RANDAO, epoch_to_sign) domain = get_domain(state, DOMAIN_RANDAO, epoch_to_sign)
assert bls_verify(malefactor.pubkey, hash_tree_root(epoch_to_sign), custody_slashing.malefactor_key, domain) assert bls_verify(malefactor.pubkey, hash_tree_root(epoch_to_sign), custody_slashing.malefactor_secret, domain)
# Get the custody bit # Get the custody bit
custody_bits = attestation.custody_bits[custody_slashing.data_index] custody_bits = attestation.custody_bits[custody_slashing.data_index]
@ -401,7 +401,7 @@ def process_custody_slashing(state: BeaconState, signed_custody_slashing: Signed
claimed_custody_bit = custody_bits[committee.index(custody_slashing.malefactor_index)] claimed_custody_bit = custody_bits[committee.index(custody_slashing.malefactor_index)]
# Compute the custody bit # Compute the custody bit
computed_custody_bit = compute_custody_bit(custody_slashing.malefactor_key, custody_slashing.data) computed_custody_bit = compute_custody_bit(custody_slashing.malefactor_secret, custody_slashing.data)
# Verify the claim # Verify the claim
if claimed_custody_bit != computed_custody_bit: if claimed_custody_bit != computed_custody_bit: