Documentation ¶
Index ¶
- type Server
- func (vs *Server) GetAggregateAttestation(ctx context.Context, req *ethpbv1.AggregateAttestationRequest) (*ethpbv1.AggregateAttestationResponse, error)
- func (vs *Server) GetAttesterDuties(ctx context.Context, req *ethpbv1.AttesterDutiesRequest) (*ethpbv1.AttesterDutiesResponse, error)
- func (vs *Server) GetProposerDuties(ctx context.Context, req *ethpbv1.ProposerDutiesRequest) (*ethpbv1.ProposerDutiesResponse, error)
- func (vs *Server) GetSyncCommitteeDuties(ctx context.Context, req *ethpbv2.SyncCommitteeDutiesRequest) (*ethpbv2.SyncCommitteeDutiesResponse, error)
- func (vs *Server) ProduceAttestationData(ctx context.Context, req *ethpbv1.ProduceAttestationDataRequest) (*ethpbv1.ProduceAttestationDataResponse, error)
- func (vs *Server) ProduceBlock(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv1.ProduceBlockResponse, error)
- func (vs *Server) ProduceBlockV2(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.ProduceBlockResponseV2, error)
- func (vs *Server) ProduceSyncCommitteeContribution(ctx context.Context, req *ethpbv2.ProduceSyncCommitteeContributionRequest) (*ethpbv2.ProduceSyncCommitteeContributionResponse, error)
- func (vs *Server) SubmitAggregateAndProofs(ctx context.Context, req *ethpbv1.SubmitAggregateAndProofsRequest) (*empty.Empty, error)
- func (vs *Server) SubmitBeaconCommitteeSubscription(ctx context.Context, req *ethpbv1.SubmitBeaconCommitteeSubscriptionsRequest) (*emptypb.Empty, error)
- func (vs *Server) SubmitContributionAndProofs(ctx context.Context, req *ethpbv2.SubmitContributionAndProofsRequest) (*empty.Empty, error)
- func (vs *Server) SubmitSyncCommitteeSubscription(ctx context.Context, req *ethpbv2.SubmitSyncCommitteeSubscriptionsRequest) (*empty.Empty, error)
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 ¶
func (vs *Server) GetAggregateAttestation(ctx context.Context, req *ethpbv1.AggregateAttestationRequest) (*ethpbv1.AggregateAttestationResponse, error)
GetAggregateAttestation aggregates all attestations matching the given attestation data root and slot, returning the aggregated result.
func (*Server) GetAttesterDuties ¶
func (vs *Server) GetAttesterDuties(ctx context.Context, req *ethpbv1.AttesterDutiesRequest) (*ethpbv1.AttesterDutiesResponse, error)
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 ¶
func (vs *Server) GetProposerDuties(ctx context.Context, req *ethpbv1.ProposerDutiesRequest) (*ethpbv1.ProposerDutiesResponse, error)
GetProposerDuties requests beacon node to provide all validators that are scheduled to propose a block in the given epoch.
func (*Server) GetSyncCommitteeDuties ¶
func (vs *Server) GetSyncCommitteeDuties(ctx context.Context, req *ethpbv2.SyncCommitteeDutiesRequest) (*ethpbv2.SyncCommitteeDutiesResponse, error)
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 ¶
func (vs *Server) ProduceAttestationData(ctx context.Context, req *ethpbv1.ProduceAttestationDataRequest) (*ethpbv1.ProduceAttestationDataResponse, error)
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 ¶
func (vs *Server) ProduceBlock(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv1.ProduceBlockResponse, error)
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 (vs *Server) ProduceBlockV2(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.ProduceBlockResponseV2, error)
func (*Server) ProduceSyncCommitteeContribution ¶
func (vs *Server) ProduceSyncCommitteeContribution( ctx context.Context, req *ethpbv2.ProduceSyncCommitteeContributionRequest, ) (*ethpbv2.ProduceSyncCommitteeContributionResponse, error)
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.