mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
3858068201
* integrate at runtime and revamp tests * historical att * Update validator/db/iface/interface.go * deepsource * import * log the slashing kind * gaz * create a slashutils * integrate new slashutil * imports
17 lines
522 B
Go
17 lines
522 B
Go
package slashutil
|
|
|
|
import ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
|
|
|
// IsSurround checks if an attestation, a, is surrounding
|
|
// another one, b, based on the eth2 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
|
|
}
|