Documentation ¶
Overview ¶
Package validator defines a gRPC validator service implementation, providing critical endpoints for validator clients to submit blocks/attestations to the beacon node, receive assignments, and more.
Index ¶
- func BuildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgProofs [][]byte) ([]*ethpb.BlobSidecar, error)
- type Server
- func (vs *Server) AggregatedSigAndAggregationBits(ctx context.Context, req *ethpb.AggregatedSigAndAggregationBitsRequest) (*ethpb.AggregatedSigAndAggregationBitsResponse, error)
- func (vs *Server) AssignValidatorToSubnet(_ context.Context, req *ethpb.AssignValidatorToSubnetRequest) (*emptypb.Empty, error)
- func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.SignedBeaconBlock, head state.BeaconState, ...) error
- func (vs *Server) CheckDoppelGanger(ctx context.Context, req *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error)
- func (vs *Server) DomainData(ctx context.Context, request *ethpb.DomainRequest) (*ethpb.DomainResponse, error)
- func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error)
- func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error)
- func (vs *Server) GetDuties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error)
- func (vs *Server) GetFeeRecipientByPubKey(ctx context.Context, request *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error)
- func (vs *Server) GetSyncCommitteeContribution(ctx context.Context, req *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error)
- func (vs *Server) GetSyncMessageBlockRoot(ctx context.Context, _ *emptypb.Empty) (*ethpb.SyncMessageBlockRootResponse, error)
- func (vs *Server) GetSyncSubcommitteeIndex(ctx context.Context, req *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error)
- func (vs *Server) MultipleValidatorStatus(ctx context.Context, req *ethpb.MultipleValidatorStatusRequest) (*ethpb.MultipleValidatorStatusResponse, error)
- func (vs *Server) PrepareBeaconProposer(_ context.Context, request *ethpb.PrepareBeaconProposerRequest) (*emptypb.Empty, error)
- func (vs *Server) ProposeAttestation(ctx context.Context, att *ethpb.Attestation) (*ethpb.AttestResponse, error)
- func (vs *Server) ProposeBeaconBlock(ctx context.Context, req *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error)
- func (vs *Server) ProposeExit(ctx context.Context, req *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error)
- func (vs *Server) PruneBlobsBundleCacheRoutine()
- func (vs *Server) StreamBlocksAltair(req *ethpb.StreamBlocksRequest, ...) error
- func (vs *Server) StreamSlots(req *ethpb.StreamSlotsRequest, ...) error
- func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb.AggregateSelectionRequest) (*ethpb.AggregateSelectionResponse, error)
- func (vs *Server) SubmitSignedAggregateSelectionProof(ctx context.Context, req *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error)
- func (vs *Server) SubmitSignedContributionAndProof(ctx context.Context, s *ethpb.SignedContributionAndProof) (*emptypb.Empty, error)
- func (vs *Server) SubmitSyncMessage(ctx context.Context, msg *ethpb.SyncCommitteeMessage) (*emptypb.Empty, error)
- func (vs *Server) SubmitValidatorRegistrations(ctx context.Context, reg *ethpb.SignedValidatorRegistrationsV1) (*emptypb.Empty, error)
- func (vs *Server) SubscribeCommitteeSubnets(ctx context.Context, req *ethpb.CommitteeSubnetsSubscribeRequest) (*emptypb.Empty, error)
- func (vs *Server) ValidatorIndex(ctx context.Context, req *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error)
- func (vs *Server) ValidatorStatus(ctx context.Context, req *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error)
- func (vs *Server) WaitForActivation(req *ethpb.ValidatorActivationRequest, ...) error
- func (vs *Server) WaitForChainStart(_ *emptypb.Empty, stream ethpb.BeaconNodeValidator_WaitForChainStartServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBlobSidecars ¶
func BuildBlobSidecars(blk interfaces.SignedBeaconBlock, blobs [][]byte, kzgProofs [][]byte) ([]*ethpb.BlobSidecar, error)
BuildBlobSidecars given a block, builds the blob sidecars for the block.
Types ¶
type Server ¶
type Server struct { Ctx context.Context PayloadIDCache *cache.PayloadIDCache TrackedValidatorsCache *cache.TrackedValidatorsCache HeadFetcher blockchain.HeadFetcher ForkFetcher blockchain.ForkFetcher ForkchoiceFetcher blockchain.ForkchoiceFetcher GenesisFetcher blockchain.GenesisFetcher FinalizationFetcher blockchain.FinalizationFetcher TimeFetcher blockchain.TimeFetcher BlockFetcher execution.POWBlockFetcher DepositFetcher cache.DepositFetcher ChainStartFetcher execution.ChainStartFetcher Eth1InfoFetcher execution.ChainInfoFetcher OptimisticModeFetcher blockchain.OptimisticModeFetcher SyncChecker sync.Checker StateNotifier statefeed.Notifier BlockNotifier blockfeed.Notifier P2P p2p.Broadcaster AttPool attestations.Pool SlashingsPool slashings.PoolManager ExitPool voluntaryexits.PoolManager SyncCommitteePool synccommittee.Pool BlockReceiver blockchain.BlockReceiver BlobReceiver blockchain.BlobReceiver MockEth1Votes bool Eth1BlockFetcher execution.POWBlockFetcher PendingDepositsFetcher depositsnapshot.PendingDepositsFetcher OperationNotifier opfeed.Notifier StateGen stategen.StateManager ReplayerBuilder stategen.ReplayerBuilder BeaconDB db.HeadAccessDatabase ExecutionEngineCaller execution.EngineCaller BlockBuilder builder.BlockBuilder BLSChangesPool blstoexec.PoolManager ClockWaiter startup.ClockWaiter CoreService *core.Service }
Server defines a server implementation of the gRPC Validator service, providing RPC endpoints for obtaining validator assignments per epoch, the slots and committees in which particular validators need to perform their responsibilities, and more.
func (*Server) AggregatedSigAndAggregationBits ¶
func (vs *Server) AggregatedSigAndAggregationBits( ctx context.Context, req *ethpb.AggregatedSigAndAggregationBitsRequest, ) (*ethpb.AggregatedSigAndAggregationBitsResponse, error)
AggregatedSigAndAggregationBits returns the aggregated signature and aggregation bits associated with a particular set of sync committee messages.
func (*Server) AssignValidatorToSubnet ¶
func (vs *Server) AssignValidatorToSubnet(_ context.Context, req *ethpb.AssignValidatorToSubnetRequest) (*emptypb.Empty, error)
AssignValidatorToSubnet checks the status and pubkey of a particular validator to discern whether persistent subnets need to be registered for them.
func (*Server) BuildBlockParallel ¶
func (vs *Server) BuildBlockParallel(ctx context.Context, sBlk interfaces.SignedBeaconBlock, head state.BeaconState, skipMevBoost bool, builderBoostFactor uint64) error
func (*Server) CheckDoppelGanger ¶
func (vs *Server) CheckDoppelGanger(ctx context.Context, req *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error)
CheckDoppelGanger checks if the provided keys are currently active in the network.
func (*Server) DomainData ¶
func (vs *Server) DomainData(ctx context.Context, request *ethpb.DomainRequest) (*ethpb.DomainResponse, error)
DomainData fetches the current domain version information from the beacon state.
func (*Server) GetAttestationData ¶
func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error)
GetAttestationData requests that the beacon node produce an attestation data object, which the validator acting as an attester will then sign.
func (*Server) GetBeaconBlock ¶
func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error)
GetBeaconBlock is called by a proposer during its assigned slot to request a block to sign by passing in the slot and the signed randao reveal of the slot.
func (*Server) GetDuties ¶
func (vs *Server) GetDuties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error)
GetDuties returns the duties assigned to a list of validators specified in the request object.
func (*Server) GetFeeRecipientByPubKey ¶
func (vs *Server) GetFeeRecipientByPubKey(ctx context.Context, request *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error)
GetFeeRecipientByPubKey returns a fee recipient from the beacon node's settings or db based on a given public key
func (*Server) GetSyncCommitteeContribution ¶
func (vs *Server) GetSyncCommitteeContribution( ctx context.Context, req *ethpb.SyncCommitteeContributionRequest, ) (*ethpb.SyncCommitteeContribution, error)
GetSyncCommitteeContribution is called by a sync committee aggregator to retrieve sync committee contribution object.
func (*Server) GetSyncMessageBlockRoot ¶
func (vs *Server) GetSyncMessageBlockRoot( ctx context.Context, _ *emptypb.Empty, ) (*ethpb.SyncMessageBlockRootResponse, error)
GetSyncMessageBlockRoot retrieves the sync committee block root of the beacon chain.
func (*Server) GetSyncSubcommitteeIndex ¶
func (vs *Server) GetSyncSubcommitteeIndex( ctx context.Context, req *ethpb.SyncSubcommitteeIndexRequest, ) (*ethpb.SyncSubcommitteeIndexResponse, error)
GetSyncSubcommitteeIndex is called by a sync committee participant to get its subcommittee index for sync message aggregation duty.
func (*Server) MultipleValidatorStatus ¶
func (vs *Server) MultipleValidatorStatus( ctx context.Context, req *ethpb.MultipleValidatorStatusRequest, ) (*ethpb.MultipleValidatorStatusResponse, error)
MultipleValidatorStatus is the same as ValidatorStatus. Supports retrieval of multiple validator statuses. Takes a list of public keys or a list of validator indices.
func (*Server) PrepareBeaconProposer ¶
func (vs *Server) PrepareBeaconProposer( _ context.Context, request *ethpb.PrepareBeaconProposerRequest, ) (*emptypb.Empty, error)
PrepareBeaconProposer caches and updates the fee recipient for the given proposer.
func (*Server) ProposeAttestation ¶
func (vs *Server) ProposeAttestation(ctx context.Context, att *ethpb.Attestation) (*ethpb.AttestResponse, error)
ProposeAttestation is a function called by an attester to vote on a block via an attestation object as defined in the Ethereum Serenity specification.
func (*Server) ProposeBeaconBlock ¶
func (vs *Server) ProposeBeaconBlock(ctx context.Context, req *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error)
ProposeBeaconBlock handles the proposal of beacon blocks.
func (*Server) ProposeExit ¶
func (vs *Server) ProposeExit(ctx context.Context, req *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error)
ProposeExit proposes an exit for a validator.
func (*Server) PruneBlobsBundleCacheRoutine ¶
func (vs *Server) PruneBlobsBundleCacheRoutine()
PruneBlobsBundleCacheRoutine prunes the blobs bundle cache at 6s mark of the slot.
func (*Server) StreamBlocksAltair ¶
func (vs *Server) StreamBlocksAltair(req *ethpb.StreamBlocksRequest, stream ethpb.BeaconNodeValidator_StreamBlocksAltairServer) error
StreamBlocksAltair to clients every single time a block is received by the beacon node.
func (*Server) StreamSlots ¶
func (vs *Server) StreamSlots(req *ethpb.StreamSlotsRequest, stream ethpb.BeaconNodeValidator_StreamSlotsServer) error
StreamSlots sends a block's slot to clients every single time a block is received by the beacon node.
func (*Server) SubmitAggregateSelectionProof ¶
func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb.AggregateSelectionRequest) (*ethpb.AggregateSelectionResponse, error)
SubmitAggregateSelectionProof is called by a validator when its assigned to be an aggregator. The aggregator submits the selection proof to obtain the aggregated attestation object to sign over.
func (*Server) SubmitSignedAggregateSelectionProof ¶
func (vs *Server) SubmitSignedAggregateSelectionProof( ctx context.Context, req *ethpb.SignedAggregateSubmitRequest, ) (*ethpb.SignedAggregateSubmitResponse, error)
SubmitSignedAggregateSelectionProof is called by a validator to broadcast a signed aggregated and proof object.
func (*Server) SubmitSignedContributionAndProof ¶
func (vs *Server) SubmitSignedContributionAndProof( ctx context.Context, s *ethpb.SignedContributionAndProof, ) (*emptypb.Empty, error)
SubmitSignedContributionAndProof is called by a sync committee aggregator to submit signed contribution and proof object.
func (*Server) SubmitSyncMessage ¶
func (vs *Server) SubmitSyncMessage(ctx context.Context, msg *ethpb.SyncCommitteeMessage) (*emptypb.Empty, error)
SubmitSyncMessage submits the sync committee message to the network. It also saves the sync committee message into the pending pool for block inclusion.
func (*Server) SubmitValidatorRegistrations ¶
func (vs *Server) SubmitValidatorRegistrations(ctx context.Context, reg *ethpb.SignedValidatorRegistrationsV1) (*emptypb.Empty, error)
SubmitValidatorRegistrations submits validator registrations.
func (*Server) SubscribeCommitteeSubnets ¶
func (vs *Server) SubscribeCommitteeSubnets(ctx context.Context, req *ethpb.CommitteeSubnetsSubscribeRequest) (*emptypb.Empty, error)
SubscribeCommitteeSubnets subscribes to the committee ID subnet given subscribe request.
func (*Server) ValidatorIndex ¶
func (vs *Server) ValidatorIndex(ctx context.Context, req *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error)
ValidatorIndex is called by a validator to get its index location in the beacon state.
func (*Server) ValidatorStatus ¶
func (vs *Server) ValidatorStatus( ctx context.Context, req *ethpb.ValidatorStatusRequest, ) (*ethpb.ValidatorStatusResponse, error)
ValidatorStatus returns the validator status of the current epoch. The status response can be one of the following:
DEPOSITED - validator's deposit has been recognized by Ethereum 1, not yet recognized by Ethereum. PENDING - validator is in Ethereum's activation queue. ACTIVE - validator is active. EXITING - validator has initiated an exit request, or has dropped below the ejection balance and is being kicked out. EXITED - validator is no longer validating. SLASHING - validator has been kicked out due to meeting a slashing condition. UNKNOWN_STATUS - validator does not have a known status in the network.
func (*Server) WaitForActivation ¶
func (vs *Server) WaitForActivation(req *ethpb.ValidatorActivationRequest, stream ethpb.BeaconNodeValidator_WaitForActivationServer) error
WaitForActivation checks if a validator public key exists in the active validator registry of the current beacon state, if not, then it creates a stream which listens for canonical states which contain the validator with the public key as an active validator record.
func (*Server) WaitForChainStart ¶
func (vs *Server) WaitForChainStart(_ *emptypb.Empty, stream ethpb.BeaconNodeValidator_WaitForChainStartServer) error
WaitForChainStart queries the logs of the Deposit Contract in order to verify the beacon chain has started its runtime and validators begin their responsibilities. If it has not, it then subscribes to an event stream triggered by the powchain service whenever the ChainStart log does occur in the Deposit Contract on ETH 1.0.
Source Files ¶
- aggregator.go
- attester.go
- blocks.go
- construct_generic_block.go
- duties.go
- exit.go
- log.go
- proposer.go
- proposer_altair.go
- proposer_attestations.go
- proposer_bellatrix.go
- proposer_builder.go
- proposer_capella.go
- proposer_deneb.go
- proposer_deposits.go
- proposer_empty_block.go
- proposer_eth1data.go
- proposer_execution_payload.go
- proposer_exits.go
- proposer_slashings.go
- proposer_sync_aggregate.go
- server.go
- status.go
- sync_committee.go
- unblinder.go