validator

package
v5.1.3-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-3.0 Imports: 48 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
	Stater                 lookup.Stater
	OptimisticModeFetcher  blockchain.OptimisticModeFetcher
	SyncCommitteePool      synccommittee.Pool
	V1Alpha1Server         eth.BeaconNodeValidatorServer
	ChainInfoFetcher       blockchain.ChainInfoFetcher
	BeaconDB               db.HeadAccessDatabase
	BlockBuilder           builder.BlockBuilder
	OperationNotifier      operation.Notifier
	CoreService            *core.Service
	BlockRewardFetcher     rewards.BlockRewardsFetcher
	TrackedValidatorsCache *cache.TrackedValidatorsCache
	PayloadIDCache         *cache.PayloadIDCache
}

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

func (*Server) BeaconCommitteeSelections

func (s *Server) BeaconCommitteeSelections(w http.ResponseWriter, _ *http.Request)

BeaconCommitteeSelections responds with appropriate message and status code according the spec: https://ethereum.github.io/beacon-APIs/#/Validator/submitBeaconCommitteeSelections.

func (*Server) GetAggregateAttestation

func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetAttestationData

func (s *Server) GetAttestationData(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetAttesterDuties

func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetLiveness

func (s *Server) GetLiveness(w http.ResponseWriter, r *http.Request)

GetLiveness requests the beacon node to indicate if a validator has been observed to be live in a given epoch. The beacon node might detect liveness by observing messages from the validator on the network, in the beacon chain, from its API or from any other source. A beacon node SHOULD support the current and previous epoch, however it MAY support earlier epoch. It is important to note that the values returned by the beacon node are not canonical; they are best-effort and based upon a subjective view of the network. A beacon node that was recently started or suffered a network partition may indicate that a validator is not live when it actually is.

func (*Server) GetProposerDuties

func (s *Server) GetProposerDuties(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetSyncCommitteeDuties

func (s *Server) GetSyncCommitteeDuties(w http.ResponseWriter, r *http.Request)

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 (s *Server) PrepareBeaconProposer(w http.ResponseWriter, r *http.Request)

PrepareBeaconProposer endpoint saves the fee recipient given a validator index, this is used when proposing a block.

func (*Server) ProduceBlindedBlock

func (s *Server) ProduceBlindedBlock(w http.ResponseWriter, r *http.Request)

DEPRECATED: Please use ProduceBlockV3 instead.

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

func (*Server) ProduceBlockV2

func (s *Server) ProduceBlockV2(w http.ResponseWriter, r *http.Request)

DEPRECATED: Please use ProduceBlockV3 instead.

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

func (*Server) ProduceBlockV3

func (s *Server) ProduceBlockV3(w http.ResponseWriter, r *http.Request)

ProduceBlockV3 requests a beacon node to produce a valid block, which can then be signed by a validator. The returned block may be blinded or unblinded, depending on the current state of the network as decided by the execution and beacon nodes. The beacon node must return an unblinded block if it obtains the execution payload from its paired execution node. It must only return a blinded block if it obtains the execution payload header from an MEV relay. Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress.

func (*Server) ProduceSyncCommitteeContribution

func (s *Server) ProduceSyncCommitteeContribution(w http.ResponseWriter, r *http.Request)

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

func (*Server) RegisterValidator

func (s *Server) RegisterValidator(w http.ResponseWriter, r *http.Request)

RegisterValidator requests that the beacon node stores valid validator registrations and calls the builder apis to update the custom builder

func (*Server) SubmitAggregateAndProofs

func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request)

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

func (*Server) SubmitAggregateAndProofsV2 added in v5.2.0

func (s *Server) SubmitAggregateAndProofsV2(w http.ResponseWriter, r *http.Request)

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

func (*Server) SubmitBeaconCommitteeSubscription

func (s *Server) SubmitBeaconCommitteeSubscription(w http.ResponseWriter, r *http.Request)

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 (s *Server) SubmitContributionAndProofs(w http.ResponseWriter, r *http.Request)

SubmitContributionAndProofs publishes multiple signed sync committee contribution and proofs.

func (*Server) SubmitSyncCommitteeSubscription

func (s *Server) SubmitSyncCommitteeSubscription(w http.ResponseWriter, r *http.Request)

SubmitSyncCommitteeSubscription subscribe to a number of sync committee subnets.

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

func (*Server) SyncCommitteeSelections added in v5.0.2

func (s *Server) SyncCommitteeSelections(w http.ResponseWriter, _ *http.Request)

SyncCommitteeSelections responds with appropriate message and status code according the spec: https://ethereum.github.io/beacon-APIs/#/Validator/submitSyncCommitteeSelections.

Jump to

Keyboard shortcuts

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