rpc

package
v1.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2021 License: GPL-3.0 Imports: 29 Imported by: 7

Documentation

Overview

Package rpc defines an implementation of a gRPC slasher service, providing endpoints for determining whether or not a block/attestation is slashable based on slasher's evidence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.3.8

type Config struct {
	Host         string
	Port         string
	CertFlag     string
	KeyFlag      string
	Detector     *detection.Service
	SlasherDB    db.Database
	BeaconClient *beaconclient.Service
}

Config options for the slasher node RPC server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server defines a server implementation of the gRPC Slasher service, providing RPC endpoints for retrieving slashing proofs for malicious validators.

func (*Server) HighestAttestations added in v1.0.0

HighestAttestations returns the highest observed attestation source and epoch for a given validator id.

func (*Server) IsSlashableAttestation

func (s *Server) IsSlashableAttestation(ctx context.Context, req *ethpb.IndexedAttestation) (*slashpb.AttesterSlashingResponse, error)

IsSlashableAttestation returns an attester slashing if the attestation submitted is a slashable vote.

func (*Server) IsSlashableAttestationNoUpdate added in v1.0.0

func (s *Server) IsSlashableAttestationNoUpdate(ctx context.Context, req *ethpb.IndexedAttestation) (*slashpb.Slashable, error)

IsSlashableAttestationNoUpdate returns true if the attestation submitted is a slashable vote (no db update is being done).

func (*Server) IsSlashableBlock

IsSlashableBlock returns an proposer slashing if the block submitted is a double proposal.

func (*Server) IsSlashableBlockNoUpdate added in v1.0.0

func (s *Server) IsSlashableBlockNoUpdate(ctx context.Context, req *ethpb.BeaconBlockHeader) (*slashpb.Slashable, error)

IsSlashableBlockNoUpdate returns true if the block submitted is slashable (no db update is being done).

type Service added in v0.3.8

type Service struct {
	// contains filtered or unexported fields
}

Service defines a server implementation of the gRPC Slasher service, providing RPC endpoints for retrieving slashing proofs for malicious validators.

func NewService added in v0.3.8

func NewService(ctx context.Context, cfg *Config) *Service

NewService instantiates a new RPC service instance that will be registered into a running beacon node.

func (*Service) Start added in v0.3.8

func (s *Service) Start()

Start the gRPC service.

func (*Service) Status added in v0.3.8

func (s *Service) Status() error

Status returns nil if slasher is ready to receive attestations and blocks from clients for slashing detection.

func (*Service) Stop added in v0.3.8

func (s *Service) Stop() error

Stop the service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL