mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 19:21:19 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
16 lines
524 B
Go
16 lines
524 B
Go
package slashings
|
|
|
|
import ethpb "github.com/prysmaticlabs/prysm/v5/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
|
|
}
|