Documentation ¶
Index ¶
- type AggregateAttestationResponse
- type AttesterDuty
- type GetAttestationDataResponse
- type GetAttesterDutiesResponse
- type GetLivenessResponse
- type GetProposerDutiesResponse
- type GetSyncCommitteeDutiesResponse
- type ProduceBlockV3Response
- type ProduceSyncCommitteeContributionResponse
- type ProposerDuty
- type Server
- func (s *Server) GetAggregateAttestation(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetAttestationData(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetAttesterDuties(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetLiveness(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetProposerDuties(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetSyncCommitteeDuties(w http.ResponseWriter, r *http.Request)
- func (s *Server) PrepareBeaconProposer(w http.ResponseWriter, r *http.Request)
- 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 (s *Server) ProduceBlockV3(w http.ResponseWriter, r *http.Request)
- func (s *Server) ProduceSyncCommitteeContribution(w http.ResponseWriter, r *http.Request)
- func (s *Server) RegisterValidator(w http.ResponseWriter, r *http.Request)
- func (s *Server) SubmitAggregateAndProofs(w http.ResponseWriter, r *http.Request)
- func (s *Server) SubmitBeaconCommitteeSubscription(w http.ResponseWriter, r *http.Request)
- func (s *Server) SubmitContributionAndProofs(w http.ResponseWriter, r *http.Request)
- func (s *Server) SubmitSyncCommitteeSubscription(w http.ResponseWriter, r *http.Request)
- type SubmitAggregateAndProofsRequest
- type SubmitBeaconCommitteeSubscriptionsRequest
- type SubmitContributionAndProofsRequest
- type SubmitSyncCommitteeSubscriptionsRequest
- type SyncCommitteeDuty
- type ValidatorLiveness
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateAttestationResponse ¶
type AggregateAttestationResponse struct {
Data *shared.Attestation `json:"data"`
}
type AttesterDuty ¶
type AttesterDuty struct { Pubkey string `json:"pubkey"` ValidatorIndex string `json:"validator_index"` CommitteeIndex string `json:"committee_index"` CommitteeLength string `json:"committee_length"` CommitteesAtSlot string `json:"committees_at_slot"` ValidatorCommitteeIndex string `json:"validator_committee_index"` Slot string `json:"slot"` }
type GetAttestationDataResponse ¶
type GetAttestationDataResponse struct {
Data *shared.AttestationData `json:"data"`
}
type GetAttesterDutiesResponse ¶
type GetAttesterDutiesResponse struct { DependentRoot string `json:"dependent_root"` ExecutionOptimistic bool `json:"execution_optimistic"` Data []*AttesterDuty `json:"data"` }
type GetLivenessResponse ¶
type GetLivenessResponse struct {
Data []*ValidatorLiveness `json:"data"`
}
type GetProposerDutiesResponse ¶
type GetProposerDutiesResponse struct { DependentRoot string `json:"dependent_root"` ExecutionOptimistic bool `json:"execution_optimistic"` Data []*ProposerDuty `json:"data"` }
type GetSyncCommitteeDutiesResponse ¶
type GetSyncCommitteeDutiesResponse struct { ExecutionOptimistic bool `json:"execution_optimistic"` Data []*SyncCommitteeDuty `json:"data"` }
type ProduceBlockV3Response ¶
type ProduceBlockV3Response struct { Version string `json:"version"` ExecutionPayloadBlinded bool `json:"execution_payload_blinded"` ExecutionPayloadValue string `json:"execution_payload_value"` Data json.RawMessage `json:"data"` // represents the block values based on the version }
ProduceBlockV3Response is a wrapper json object for the returned block from the ProduceBlockV3 endpoint
type ProduceSyncCommitteeContributionResponse ¶
type ProduceSyncCommitteeContributionResponse struct {
Data *shared.SyncCommitteeContribution `json:"data"`
}
type ProposerDuty ¶
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 OperationNotifier operation.Notifier CoreService *core.Service }
Server defines a server implementation of the gRPC Validator service, providing RPC endpoints intended for validator clients.
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 (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) 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) 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.
type SubmitAggregateAndProofsRequest ¶
type SubmitAggregateAndProofsRequest struct {
Data []*shared.SignedAggregateAttestationAndProof `json:"data" validate:"required,dive"`
}
type SubmitBeaconCommitteeSubscriptionsRequest ¶
type SubmitBeaconCommitteeSubscriptionsRequest struct {
Data []*shared.BeaconCommitteeSubscription `json:"data" validate:"required,dive"`
}
type SubmitContributionAndProofsRequest ¶
type SubmitContributionAndProofsRequest struct {
Data []*shared.SignedContributionAndProof `json:"data" validate:"required,dive"`
}
type SubmitSyncCommitteeSubscriptionsRequest ¶
type SubmitSyncCommitteeSubscriptionsRequest struct {
Data []*shared.SyncCommitteeSubscription `json:"data" validate:"required,dive"`
}