From 1d8b207d7c8b1c9be36228a7f4b3bf8aa365a196 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Thu, 9 Apr 2020 17:19:13 -0700 Subject: [PATCH] Fix incorrect proposer slashing domain calculation (#5369) * StartSlot != SlotToEpoch * Merge refs/heads/master into fix-proposer-slashing --- beacon-chain/core/blocks/block_operations.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon-chain/core/blocks/block_operations.go b/beacon-chain/core/blocks/block_operations.go index db2ee2602976..be7b8e3e0601 100644 --- a/beacon-chain/core/blocks/block_operations.go +++ b/beacon-chain/core/blocks/block_operations.go @@ -450,7 +450,7 @@ func ProcessProposerSlashings( return beaconState, nil } -// VerifyProposerSlashing verifies that the data provided fro slashing is valid. +// VerifyProposerSlashing verifies that the data provided from slashing is valid. func VerifyProposerSlashing( beaconState *stateTrie.BeaconState, slashing *ethpb.ProposerSlashing, @@ -472,7 +472,7 @@ func VerifyProposerSlashing( return fmt.Errorf("validator with key %#x is not slashable", proposer.PublicKey) } // Using headerEpoch1 here because both of the headers should have the same epoch. - domain, err := helpers.Domain(beaconState.Fork(), helpers.StartSlot(slashing.Header_1.Header.Slot), params.BeaconConfig().DomainBeaconProposer) + domain, err := helpers.Domain(beaconState.Fork(), helpers.SlotToEpoch(slashing.Header_1.Header.Slot), params.BeaconConfig().DomainBeaconProposer) if err != nil { return err }