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) GetLiveness(ctx context.Context, req *ethpbv2.GetLivenessRequest) (*ethpbv2.GetLivenessResponse, 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) PrepareBeaconProposer(ctx context.Context, request *ethpbv1.PrepareBeaconProposerRequest) (*emptypb.Empty, error)
- func (vs *Server) ProduceAttestationData(ctx context.Context, req *ethpbv1.ProduceAttestationDataRequest) (*ethpbv1.ProduceAttestationDataResponse, error)
- func (vs *Server) ProduceBlindedBlock(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.ProduceBlindedBlockResponse, error)
- func (vs *Server) ProduceBlindedBlockSSZ(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.SSZContainer, error)
- func (vs *Server) ProduceBlockV2(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.ProduceBlockResponseV2, error)
- func (vs *Server) ProduceBlockV2SSZ(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.SSZContainer, 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)
- func (vs *Server) SubmitValidatorRegistration(ctx context.Context, reg *ethpbv1.SubmitValidatorRegistrationsRequest) (*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 Stater lookup.Stater OptimisticModeFetcher blockchain.OptimisticModeFetcher SyncCommitteePool synccommittee.Pool V1Alpha1Server eth.BeaconNodeValidatorServer ProposerSlotIndexCache *cache.ProposerPayloadIDsCache ChainInfoFetcher blockchain.ChainInfoFetcher BeaconDB db.HeadAccessDatabase BlockBuilder builder.BlockBuilder }
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) GetLiveness ¶
func (vs *Server) GetLiveness(ctx context.Context, req *ethpbv2.GetLivenessRequest) (*ethpbv2.GetLivenessResponse, error)
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 (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) 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 ¶
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) ProduceBlindedBlock ¶
func (vs *Server) ProduceBlindedBlock(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.ProduceBlindedBlockResponse, error)
ProduceBlindedBlock requests the beacon node to produce a valid unsigned blinded beacon block, which can then be signed by a proposer and submitted.
Under the following conditions, this endpoint will return an error. - The node is syncing or optimistic mode (after bellatrix). - The builder is not figured (after bellatrix). - The relayer circuit breaker is activated (after bellatrix). - The relayer responded with an error (after bellatrix).
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 ¶
func (vs *Server) ProduceBlockV2(ctx context.Context, req *ethpbv1.ProduceBlockRequest) (*ethpbv2.ProduceBlockResponseV2, error)
ProduceBlockV2 requests the beacon node to produce a valid unsigned beacon block, which can then be signed by a proposer and submitted. By definition `/eth/v2/validator/blocks/{slot}`, does not produce block using mev-boost and relayer network. The following endpoint states that the returned object is a BeaconBlock, not a BlindedBeaconBlock. As such, the block must return a full ExecutionPayload: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceBlockV2
To use mev-boost and relayer network. It's recommended to use the following endpoint: https://github.com/ethereum/beacon-APIs/blob/master/apis/validator/blinded_block.yaml
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. By definition `/eth/v2/validator/blocks/{slot}/ssz`, does not produce block using mev-boost and relayer network: The following endpoint states that the returned object is a BeaconBlock, not a BlindedBeaconBlock. As such, the block must return a full ExecutionPayload: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceBlockV2
To use mev-boost and relayer network. It's recommended to use the following endpoint: https://github.com/ethereum/beacon-APIs/blob/master/apis/validator/blinded_block.yaml
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.
func (*Server) SubmitValidatorRegistration ¶
func (vs *Server) SubmitValidatorRegistration(ctx context.Context, reg *ethpbv1.SubmitValidatorRegistrationsRequest) (*empty.Empty, error)
SubmitValidatorRegistration submits validator registrations.