validator

package
v3.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: GPL-3.0 Imports: 38 Imported by: 1

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
	HeadUpdater           blockchain.HeadUpdater
	TimeFetcher           blockchain.TimeFetcher
	SyncChecker           sync.Checker
	AttestationsPool      attestations.Pool
	PeerManager           p2p.PeerManager
	Broadcaster           p2p.Broadcaster
	StateFetcher          statefetcher.Fetcher
	OptimisticModeFetcher blockchain.OptimisticModeFetcher
	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) PrepareBeaconProposer

func (vs *Server) PrepareBeaconProposer(
	ctx context.Context, request *ethpbv1.PrepareBeaconProposerRequest,
) (*emptypb.Empty, error)

PrepareBeaconProposer caches and updates the fee recipient for the given proposer.

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) ProduceBlindedBlock

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

Pre-Bellatrix, this endpoint will return a regular block.

func (*Server) ProduceBlindedBlockSSZ

func (vs *Server) ProduceBlindedBlockSSZ(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.SSZContainer, error)

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

The produced block is in SSZ form.

Pre-Bellatrix, this endpoint will return a regular block.

func (*Server) ProduceBlockV2

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

func (*Server) ProduceBlockV2SSZ

func (vs *Server) ProduceBlockV2SSZ(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.SSZContainer, error)

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

The produced block is in SSZ form.

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.

func (*Server) SubmitValidatorRegistration

func (vs *Server) SubmitValidatorRegistration(ctx context.Context, reg *ethpbv1.SubmitValidatorRegistrationsRequest) (*empty.Empty, error)

SubmitValidatorRegistration submits validator registrations.

Jump to

Keyboard shortcuts

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