mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 05:17:22 +00:00
f3d6dbcc1e
* config params into pkg * gaz Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
17 lines
697 B
Go
17 lines
697 B
Go
package slashings
|
|
|
|
import "github.com/prysmaticlabs/prysm/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
|
|
}
|