mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
a860648960
* remove all mentions * more changes * folder by folder Co-authored-by: terence tsao <terence@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
17 lines
525 B
Go
17 lines
525 B
Go
package slashutil
|
|
|
|
import ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
|
|
|
// IsSurround checks if an attestation, a, is surrounding
|
|
// another one, b, based on the Ethereum slashing conditions specified
|
|
// by @protolambda https://github.com/protolambda/eth2-surround#definition.
|
|
//
|
|
// s: source
|
|
// t: target
|
|
//
|
|
// a surrounds b if: s_a < s_b and t_b < t_a
|
|
//
|
|
func IsSurround(a, b *ethpb.IndexedAttestation) bool {
|
|
return a.Data.Source.Epoch < b.Data.Source.Epoch && b.Data.Target.Epoch < a.Data.Target.Epoch
|
|
}
|