Documentation ¶
Overview ¶
Package detection defines a service that reacts to incoming blocks/attestations by running slashing detection for double proposals, double votes, and surround votes according to the eth2 specification. As soon as slashing objects are found, they are sent over a feed for the beaconclient service to submit to a beacon node via gRPC.
Index ¶
- type Config
- type Service
- func (ds *Service) DetectAttesterSlashings(ctx context.Context, att *ethpb.IndexedAttestation) ([]*ethpb.AttesterSlashing, error)
- func (ds *Service) DetectDoubleProposals(ctx context.Context, incomingBlock *ethpb.SignedBeaconBlockHeader) (*ethpb.ProposerSlashing, error)
- func (ds *Service) Start()
- func (ds *Service) Status() error
- func (ds *Service) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Notifier beaconclient.Notifier SlasherDB db.Database ChainFetcher beaconclient.ChainFetcher BeaconClient *beaconclient.Service AttesterSlashingsFeed *event.Feed ProposerSlashingsFeed *event.Feed }
Config options for the detection service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service struct for the detection service of the slasher.
func NewDetectionService ¶
NewDetectionService instantiation.
func (*Service) DetectAttesterSlashings ¶ added in v0.3.8
func (ds *Service) DetectAttesterSlashings( ctx context.Context, att *ethpb.IndexedAttestation, ) ([]*ethpb.AttesterSlashing, error)
DetectAttesterSlashings detects double, surround and surrounding attestation offences given an attestation.
func (*Service) DetectDoubleProposals ¶ added in v0.3.8
func (ds *Service) DetectDoubleProposals(ctx context.Context, incomingBlock *ethpb.SignedBeaconBlockHeader) (*ethpb.ProposerSlashing, error)
DetectDoubleProposals checks if the given signed beacon block is a slashable offense and returns the slashing.