mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 19:21:19 +00:00
d17996f8b0
* Update V3 from V4 * Fix build v3 -> v4 * Update ssz * Update beacon_chain.pb.go * Fix formatter import * Update update-mockgen.sh comment to v4 * Fix conflicts. Pass build and tests * Fix test
17 lines
700 B
Go
17 lines
700 B
Go
package slashings
|
|
|
|
import "github.com/prysmaticlabs/prysm/v4/config/params"
|
|
|
|
// SigningRootsDiffer verifies that an incoming vs. existing attestation has a different signing root.
|
|
// If the existing signing root is empty, then we consider an attestation as different always.
|
|
func SigningRootsDiffer(existingSigningRoot, incomingSigningRoot [32]byte) bool {
|
|
zeroHash := params.BeaconConfig().ZeroHash
|
|
// If the existing signing root is empty, we always consider the incoming
|
|
// attestation as a double vote to be safe.
|
|
if existingSigningRoot == zeroHash {
|
|
return true
|
|
}
|
|
// Otherwise, we consider any sort of inequality to be a double vote.
|
|
return existingSigningRoot != incomingSigningRoot
|
|
}
|