prysm-pulse/proto/prysm/v1alpha1/slashings/surround_votes.go
Raul Jordan eebcd52ee6
Miscellaneous Packages from Shared Into Proper Folders (#9638)
* slashutil

* builds

* interop

* viz

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-21 18:11:16 +00:00

17 lines
527 B
Go

package slashings
import ethpb "github.com/prysmaticlabs/prysm/proto/prysm/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
}