validator

package
v4.0.0-...-ae7b6de Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: GPL-3.0 Imports: 49 Imported by: 0

Documentation

Index

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 []*Liveness `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 Liveness

type Liveness struct {
	Index  string `json:"index"`
	IsLive bool   `json:"is_live"`
}

type ProduceBlockV3Response

type ProduceBlockV3Response struct {
	Version                 string          `json:"version"`
	ExecutionPayloadBlinded bool            `json:"execution_payload_blinded"`
	ExecutionPayloadValue   string          `json:"execution_payload_value"`
	ConsensusBlockValue     string          `json:"consensus_block_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 ProposerDuty struct {
	Pubkey         string `json:"pubkey"`
	ValidatorIndex string `json:"validator_index"`
	Slot           string `json:"slot"`
}

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
	BlockRewardFetcher     rewards.BlockRewardsFetcher
}

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 (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) 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"`
}

type SubmitBeaconCommitteeSubscriptionsRequest

type SubmitBeaconCommitteeSubscriptionsRequest struct {
	Data []*shared.BeaconCommitteeSubscription `json:"data"`
}

type SubmitContributionAndProofsRequest

type SubmitContributionAndProofsRequest struct {
	Data []*shared.SignedContributionAndProof `json:"data"`
}

type SubmitSyncCommitteeSubscriptionsRequest

type SubmitSyncCommitteeSubscriptionsRequest struct {
	Data []*shared.SyncCommitteeSubscription `json:"data"`
}

type SyncCommitteeDuty

type SyncCommitteeDuty struct {
	Pubkey                        string   `json:"pubkey"`
	ValidatorIndex                string   `json:"validator_index"`
	ValidatorSyncCommitteeIndices []string `json:"validator_sync_committee_indices"`
}

Jump to

Keyboard shortcuts

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