validator

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	HeadFetcher       blockchain.HeadFetcher
	TimeFetcher       blockchain.TimeFetcher
	SyncChecker       sync.Checker
	AttestationsPool  attestations.Pool
	PeerManager       p2p.PeerManager
	Broadcaster       p2p.Broadcaster
	StateFetcher      statefetcher.Fetcher
	SyncCommitteePool synccommittee.Pool
	V1Alpha1Server    *v1alpha1validator.Server
}

Server defines a server implementation of the gRPC Validator service, providing RPC endpoints intended for validator clients.

func (*Server) GetAggregateAttestation

GetAggregateAttestation aggregates all attestations matching the given attestation data root and slot, returning the aggregated result.

func (*Server) GetAttesterDuties

GetAttesterDuties requests the beacon node to provide a set of attestation duties, which should be performed by validators, for a particular epoch.

func (*Server) GetProposerDuties

GetProposerDuties requests beacon node to provide all validators that are scheduled to propose a block in the given epoch.

func (*Server) GetSyncCommitteeDuties

GetSyncCommitteeDuties provides a set of sync committee duties for a particular epoch.

The logic for calculating epoch validity comes from https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/getSyncCommitteeDuties where `epoch` is described as `epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1`.

Algorithm:

  • Get the last valid epoch. This is the last epoch of the next sync committee period.
  • Get the state for the requested epoch. If it's a future epoch from the current sync committee period or an epoch from the next sync committee period, then get the current state.
  • Get the state's current sync committee. If it's an epoch from the next sync committee period, then get the next sync committee.
  • Get duties.

func (*Server) ProduceAttestationData

ProduceAttestationData requests that the beacon node produces attestation data for the requested committee index and slot based on the nodes current head.

func (*Server) ProduceBlock

ProduceBlock requests the beacon node to produce a valid unsigned beacon block, which can then be signed by a proposer and submitted.

func (*Server) ProduceBlockV2

func (*Server) ProduceSyncCommitteeContribution

ProduceSyncCommitteeContribution requests that the beacon node produce a sync committee contribution.

func (*Server) SubmitAggregateAndProofs

func (vs *Server) SubmitAggregateAndProofs(ctx context.Context, req *ethpbv1.SubmitAggregateAndProofsRequest) (*empty.Empty, error)

SubmitAggregateAndProofs verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.

func (*Server) SubmitBeaconCommitteeSubscription

func (vs *Server) SubmitBeaconCommitteeSubscription(ctx context.Context, req *ethpbv1.SubmitBeaconCommitteeSubscriptionsRequest) (*emptypb.Empty, error)

SubmitBeaconCommitteeSubscription searches using discv5 for peers related to the provided subnet information and replaces current peers with those ones if necessary.

func (*Server) SubmitContributionAndProofs

func (vs *Server) SubmitContributionAndProofs(ctx context.Context, req *ethpbv2.SubmitContributionAndProofsRequest) (*empty.Empty, error)

SubmitContributionAndProofs publishes multiple signed sync committee contribution and proofs.

func (*Server) SubmitSyncCommitteeSubscription

func (vs *Server) SubmitSyncCommitteeSubscription(ctx context.Context, req *ethpbv2.SubmitSyncCommitteeSubscriptionsRequest) (*empty.Empty, error)

SubmitSyncCommitteeSubscription subscribe to a number of sync committee subnets.

Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee.

Jump to

Keyboard shortcuts

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