Documentation ¶
Index ¶
- type Server
- func (ss *Server) DetectAndUpdateMaxEpochSpan(ctx context.Context, source uint64, target uint64, validatorIdx uint64) (uint64, error)
- func (ss *Server) DetectAndUpdateMinEpochSpan(ctx context.Context, source uint64, target uint64, validatorIdx uint64) (uint64, error)
- func (ss *Server) DetectSurroundVotes(ctx context.Context, source uint64, target uint64, validatorIdx uint64) ([]*ethpb.IndexedAttestation, error)
- func (ss *Server) IsSlashableAttestation(ctx context.Context, req *ethpb.IndexedAttestation) (*ethpb.AttesterSlashingResponse, error)
- func (ss *Server) IsSlashableBlock(ctx context.Context, psr *ethpb.ProposerSlashingRequest) (*ethpb.ProposerSlashingResponse, error)
- func (ss *Server) SlashableAttestations(req *types.Empty, server ethpb.Slasher_SlashableAttestationsServer) error
- func (ss *Server) SlashableProposals(req *types.Empty, server ethpb.Slasher_SlashableProposalsServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server defines a server implementation of the gRPC Slasher service, providing RPC endpoints for retrieving slashing proofs for malicious validators.
func (*Server) DetectAndUpdateMaxEpochSpan ¶ added in v0.2.4
func (ss *Server) DetectAndUpdateMaxEpochSpan(ctx context.Context, source uint64, target uint64, validatorIdx uint64) (uint64, error)
DetectAndUpdateMaxEpochSpan is used to detect and update the max span of an incoming attestation. This is used for detecting surrounding votes. The max span is the span between the current attestation's source epoch and the furthest attestation's target epoch that has a lower (earlier) source epoch. Logic for this detection method was designed by https://github.com/protolambda Detailed here: https://github.com/protolambda/eth2-surround/blob/master/README.md#min-max-surround
func (*Server) DetectAndUpdateMinEpochSpan ¶ added in v0.2.4
func (ss *Server) DetectAndUpdateMinEpochSpan(ctx context.Context, source uint64, target uint64, validatorIdx uint64) (uint64, error)
DetectAndUpdateMinEpochSpan is used to detect surrounded votes and update the min epoch span of an incoming attestation. The min span is the span between the current attestations target epoch and the closest attestation's target distance.
Logic is following the detection method designed by https://github.com/protolambda Detailed here: https://github.com/protolambda/eth2-surround/blob/master/README.md#min-max-surround
func (*Server) DetectSurroundVotes ¶ added in v0.2.6
func (ss *Server) DetectSurroundVotes(ctx context.Context, source uint64, target uint64, validatorIdx uint64) ([]*ethpb.IndexedAttestation, error)
DetectSurroundVotes is a method used to return the attestation that were detected by min max surround detection method.
func (*Server) IsSlashableAttestation ¶
func (ss *Server) IsSlashableAttestation(ctx context.Context, req *ethpb.IndexedAttestation) (*ethpb.AttesterSlashingResponse, error)
IsSlashableAttestation returns an attester slashing if the attestation submitted is a slashable vote.
func (*Server) IsSlashableBlock ¶
func (ss *Server) IsSlashableBlock(ctx context.Context, psr *ethpb.ProposerSlashingRequest) (*ethpb.ProposerSlashingResponse, error)
IsSlashableBlock returns a proposer slashing if the block header submitted is a slashable proposal.
func (*Server) SlashableAttestations ¶
func (ss *Server) SlashableAttestations(req *types.Empty, server ethpb.Slasher_SlashableAttestationsServer) error
SlashableAttestations is a subscription to receive all slashable attester slashing events found by the watchtower.
func (*Server) SlashableProposals ¶
func (ss *Server) SlashableProposals(req *types.Empty, server ethpb.Slasher_SlashableProposalsServer) error
SlashableProposals is a subscription to receive all slashable proposer slashing events found by the watchtower.