Documentation ¶
Overview ¶
Package validatorapi defines validator facing API that serves the subset of endpoints related to distributed validation and reverse-proxies the rest to the upstream beacon client.
Index ¶
- func NewRouter(h Handler, eth2Cl eth2wrap.Client) (*mux.Router, error)
- type Component
- func (c Component) AggregateAttestation(ctx context.Context, slot eth2p0.Slot, attestationDataRoot eth2p0.Root) (*eth2p0.Attestation, error)
- func (c Component) AggregateBeaconCommitteeSelections(ctx context.Context, selections []*eth2exp.BeaconCommitteeSelection) ([]*eth2exp.BeaconCommitteeSelection, error)
- func (c Component) AggregateSyncCommitteeSelections(ctx context.Context, partialSelections []*eth2exp.SyncCommitteeSelection) ([]*eth2exp.SyncCommitteeSelection, error)
- func (c Component) AttestationData(parent context.Context, slot eth2p0.Slot, committeeIndex eth2p0.CommitteeIndex) (*eth2p0.AttestationData, error)
- func (c Component) AttesterDuties(ctx context.Context, epoch eth2p0.Epoch, ...) ([]*eth2v1.AttesterDuty, error)
- func (c Component) BeaconBlockProposal(ctx context.Context, slot eth2p0.Slot, randao eth2p0.BLSSignature, _ []byte) (*spec.VersionedBeaconBlock, error)
- func (c Component) BlindedBeaconBlockProposal(ctx context.Context, slot eth2p0.Slot, randao eth2p0.BLSSignature, _ []byte) (*eth2api.VersionedBlindedBeaconBlock, error)
- func (c Component) ProposerDuties(ctx context.Context, epoch eth2p0.Epoch, ...) ([]*eth2v1.ProposerDuty, error)
- func (c *Component) RegisterAwaitAggAttestation(...)
- func (c *Component) RegisterAwaitAggSigDB(fn func(context.Context, core.Duty, core.PubKey) (core.SignedData, error))
- func (c *Component) RegisterAwaitAttestation(...)
- func (c *Component) RegisterAwaitBeaconBlock(fn func(ctx context.Context, slot int64) (*spec.VersionedBeaconBlock, error))
- func (c *Component) RegisterAwaitBlindedBeaconBlock(...)
- func (c *Component) RegisterAwaitSyncContribution(...)
- func (c *Component) RegisterGetDutyDefinition(fn func(ctx context.Context, duty core.Duty) (core.DutyDefinitionSet, error))
- func (c *Component) RegisterPubKeyByAttestation(...)
- func (c Component) SubmitAggregateAttestations(ctx context.Context, aggregateAndProofs []*eth2p0.SignedAggregateAndProof) error
- func (c Component) SubmitAttestations(ctx context.Context, attestations []*eth2p0.Attestation) error
- func (c Component) SubmitBeaconBlock(ctx context.Context, block *spec.VersionedSignedBeaconBlock) error
- func (c Component) SubmitBlindedBeaconBlock(ctx context.Context, block *eth2api.VersionedSignedBlindedBeaconBlock) error
- func (c Component) SubmitSyncCommitteeContributions(ctx context.Context, ...) error
- func (c Component) SubmitSyncCommitteeMessages(ctx context.Context, messages []*altair.SyncCommitteeMessage) error
- func (c Component) SubmitValidatorRegistrations(ctx context.Context, ...) error
- func (c Component) SubmitVoluntaryExit(ctx context.Context, exit *eth2p0.SignedVoluntaryExit) error
- func (c *Component) Subscribe(fn func(context.Context, core.Duty, core.ParSignedDataSet) error)
- func (c Component) SyncCommitteeContribution(ctx context.Context, slot eth2p0.Slot, subcommitteeIndex uint64, ...) (*altair.SyncCommitteeContribution, error)
- func (c Component) SyncCommitteeDuties(ctx context.Context, epoch eth2p0.Epoch, ...) ([]*eth2v1.SyncCommitteeDuty, error)
- func (c Component) TekuProposerConfig(ctx context.Context) (TekuProposerConfigResponse, error)
- func (c Component) Validators(ctx context.Context, stateID string, validatorIndices []eth2p0.ValidatorIndex) (map[eth2p0.ValidatorIndex]*eth2v1.Validator, error)
- func (c Component) ValidatorsByPubKey(ctx context.Context, stateID string, pubshares []eth2p0.BLSPubKey) (map[eth2p0.ValidatorIndex]*eth2v1.Validator, error)
- type Handler
- type PubShareFunc
- type TekuBuilder
- type TekuProposerConfig
- type TekuProposerConfigProvider
- type TekuProposerConfigResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
func NewComponent ¶
func NewComponent(eth2Cl eth2wrap.Client, allPubSharesByKey map[core.PubKey]map[int]*bls_sig.PublicKey, shareIdx int, feeRecipientAddress string, builderAPI bool, seenPubkeys func(core.PubKey), ) (*Component, error)
NewComponent returns a new instance of the validator API core workflow component.
func NewComponentInsecure ¶
NewComponentInsecure returns a new instance of the validator API core workflow component that does not perform signature verification.
func (Component) AggregateAttestation ¶ added in v0.10.1
func (c Component) AggregateAttestation(ctx context.Context, slot eth2p0.Slot, attestationDataRoot eth2p0.Root) (*eth2p0.Attestation, error)
AggregateAttestation returns the aggregate attestation for the given attestation root. It does a blocking query to DutyAggregator unsigned data from dutyDB.
func (Component) AggregateBeaconCommitteeSelections ¶ added in v0.11.0
func (c Component) AggregateBeaconCommitteeSelections(ctx context.Context, selections []*eth2exp.BeaconCommitteeSelection) ([]*eth2exp.BeaconCommitteeSelection, error)
AggregateBeaconCommitteeSelections returns aggregate beacon committee selection proofs.
func (Component) AggregateSyncCommitteeSelections ¶ added in v0.12.0
func (c Component) AggregateSyncCommitteeSelections(ctx context.Context, partialSelections []*eth2exp.SyncCommitteeSelection) ([]*eth2exp.SyncCommitteeSelection, error)
AggregateSyncCommitteeSelections returns aggregate sync committee selection proofs.
func (Component) AttestationData ¶
func (c Component) AttestationData(parent context.Context, slot eth2p0.Slot, committeeIndex eth2p0.CommitteeIndex) (*eth2p0.AttestationData, error)
AttestationData implements the eth2client.AttesterDutiesProvider for the router.
func (Component) AttesterDuties ¶
func (c Component) AttesterDuties(ctx context.Context, epoch eth2p0.Epoch, validatorIndices []eth2p0.ValidatorIndex) ([]*eth2v1.AttesterDuty, error)
func (Component) BeaconBlockProposal ¶ added in v0.3.0
func (c Component) BeaconBlockProposal(ctx context.Context, slot eth2p0.Slot, randao eth2p0.BLSSignature, _ []byte) (*spec.VersionedBeaconBlock, error)
BeaconBlockProposal submits the randao for aggregation and inclusion in DutyProposer and then queries the dutyDB for an unsigned beacon block.
func (Component) BlindedBeaconBlockProposal ¶ added in v0.9.0
func (c Component) BlindedBeaconBlockProposal(ctx context.Context, slot eth2p0.Slot, randao eth2p0.BLSSignature, _ []byte) (*eth2api.VersionedBlindedBeaconBlock, error)
BlindedBeaconBlockProposal submits the randao for aggregation and inclusion in DutyBuilderProposer and then queries the dutyDB for an unsigned blinded beacon block.
func (Component) ProposerDuties ¶
func (c Component) ProposerDuties(ctx context.Context, epoch eth2p0.Epoch, validatorIndices []eth2p0.ValidatorIndex) ([]*eth2v1.ProposerDuty, error)
func (*Component) RegisterAwaitAggAttestation ¶ added in v0.10.1
func (c *Component) RegisterAwaitAggAttestation(fn func(ctx context.Context, slot int64, attestationRoot eth2p0.Root) (*eth2p0.Attestation, error))
RegisterAwaitAggAttestation registers a function to query an aggregated attestation. It supports a single function, since it is an input of the component.
func (*Component) RegisterAwaitAggSigDB ¶ added in v0.10.1
func (c *Component) RegisterAwaitAggSigDB(fn func(context.Context, core.Duty, core.PubKey) (core.SignedData, error))
RegisterAwaitAggSigDB registers a function to query aggregated signed data from aggSigDB.
func (*Component) RegisterAwaitAttestation ¶
func (c *Component) RegisterAwaitAttestation(fn func(ctx context.Context, slot, commIdx int64) (*eth2p0.AttestationData, error))
RegisterAwaitAttestation registers a function to query attestation data. It only supports a single function, since it is an input of the component.
func (*Component) RegisterAwaitBeaconBlock ¶ added in v0.3.0
func (c *Component) RegisterAwaitBeaconBlock(fn func(ctx context.Context, slot int64) (*spec.VersionedBeaconBlock, error))
RegisterAwaitBeaconBlock registers a function to query unsigned beacon block. It supports a single function, since it is an input of the component.
func (*Component) RegisterAwaitBlindedBeaconBlock ¶ added in v0.9.0
func (c *Component) RegisterAwaitBlindedBeaconBlock(fn func(ctx context.Context, slot int64) (*eth2api.VersionedBlindedBeaconBlock, error))
RegisterAwaitBlindedBeaconBlock registers a function to query unsigned blinded beacon block. It supports a single function, since it is an input of the component.
func (*Component) RegisterAwaitSyncContribution ¶ added in v0.12.0
func (c *Component) RegisterAwaitSyncContribution(fn func(ctx context.Context, slot, subcommIdx int64, beaconBlockRoot eth2p0.Root) (*altair.SyncCommitteeContribution, error))
RegisterAwaitSyncContribution registers a function to query sync contribution data. It only supports a single function, since it is an input of the component.
func (*Component) RegisterGetDutyDefinition ¶ added in v0.7.0
func (c *Component) RegisterGetDutyDefinition(fn func(ctx context.Context, duty core.Duty) (core.DutyDefinitionSet, error))
RegisterGetDutyDefinition registers a function to query duty definitions. It supports a single function, since it is an input of the component.
func (*Component) RegisterPubKeyByAttestation ¶
func (c *Component) RegisterPubKeyByAttestation(fn func(ctx context.Context, slot, commIdx, valCommIdx int64) (core.PubKey, error))
RegisterPubKeyByAttestation registers a function to query pubkeys by attestation. It only supports a single function, since it is an input of the component.
func (Component) SubmitAggregateAttestations ¶ added in v0.10.1
func (c Component) SubmitAggregateAttestations(ctx context.Context, aggregateAndProofs []*eth2p0.SignedAggregateAndProof) error
SubmitAggregateAttestations receives partially signed aggregateAndProofs. - It verifies partial signature on AggregateAndProof. - It then calls all the subscribers for further steps on partially signed aggregate and proof.
func (Component) SubmitAttestations ¶
func (c Component) SubmitAttestations(ctx context.Context, attestations []*eth2p0.Attestation) error
SubmitAttestations implements the eth2client.AttestationsSubmitter for the router.
func (Component) SubmitBeaconBlock ¶ added in v0.3.0
func (Component) SubmitBlindedBeaconBlock ¶ added in v0.9.0
func (Component) SubmitSyncCommitteeContributions ¶ added in v0.12.0
func (c Component) SubmitSyncCommitteeContributions(ctx context.Context, contributionAndProofs []*altair.SignedContributionAndProof) error
SubmitSyncCommitteeContributions receives partially signed altair.SignedContributionAndProof. - It verifies partial signature on ContributionAndProof. - It then calls all the subscribers for further steps on partially signed contribution and proof.
func (Component) SubmitSyncCommitteeMessages ¶ added in v0.11.0
func (c Component) SubmitSyncCommitteeMessages(ctx context.Context, messages []*altair.SyncCommitteeMessage) error
SubmitSyncCommitteeMessages receives the partially signed altair.SyncCommitteeMessage.
func (Component) SubmitValidatorRegistrations ¶ added in v0.10.0
func (c Component) SubmitValidatorRegistrations(ctx context.Context, registrations []*eth2api.VersionedSignedValidatorRegistration) error
SubmitValidatorRegistrations receives the partially signed validator (builder) registration.
func (Component) SubmitVoluntaryExit ¶ added in v0.6.0
SubmitVoluntaryExit receives the partially signed voluntary exit.
func (*Component) Subscribe ¶ added in v0.9.0
Subscribe registers a partial signed data set store function. It supports multiple functions since it is the output of the component.
func (Component) SyncCommitteeContribution ¶ added in v0.12.0
func (c Component) SyncCommitteeContribution(ctx context.Context, slot eth2p0.Slot, subcommitteeIndex uint64, beaconBlockRoot eth2p0.Root) (*altair.SyncCommitteeContribution, error)
SyncCommitteeContribution returns sync committee contribution data for the given subcommittee and beacon block root.
func (Component) SyncCommitteeDuties ¶ added in v0.11.0
func (c Component) SyncCommitteeDuties(ctx context.Context, epoch eth2p0.Epoch, validatorIndices []eth2p0.ValidatorIndex) ([]*eth2v1.SyncCommitteeDuty, error)
func (Component) TekuProposerConfig ¶ added in v0.10.0
func (c Component) TekuProposerConfig(ctx context.Context) (TekuProposerConfigResponse, error)
func (Component) Validators ¶
type Handler ¶
type Handler interface { eth2client.AggregateAttestationProvider eth2client.AggregateAttestationsSubmitter eth2client.AttestationDataProvider eth2client.AttestationsSubmitter eth2client.AttesterDutiesProvider eth2client.BeaconBlockProposalProvider eth2client.BeaconBlockSubmitter eth2exp.BeaconCommitteeSelectionAggregator eth2client.BlindedBeaconBlockProposalProvider eth2client.BlindedBeaconBlockSubmitter eth2client.ProposerDutiesProvider eth2client.SyncCommitteeContributionProvider eth2client.SyncCommitteeContributionsSubmitter eth2client.SyncCommitteeDutiesProvider eth2client.SyncCommitteeMessagesSubmitter eth2exp.SyncCommitteeSelectionAggregator eth2client.ValidatorsProvider eth2client.ValidatorRegistrationsSubmitter eth2client.VoluntaryExitSubmitter TekuProposerConfigProvider }
Handler defines the request handler providing the business logic for the validator API router.
type PubShareFunc ¶
PubShareFunc abstracts the mapping of validator root public key to tbls public share.
type TekuBuilder ¶ added in v0.10.0
type TekuProposerConfig ¶ added in v0.10.0
type TekuProposerConfig struct { FeeRecipient string `json:"fee_recipient"` Builder TekuBuilder `json:"builder"` }
type TekuProposerConfigProvider ¶ added in v0.10.0
type TekuProposerConfigProvider interface {
TekuProposerConfig(ctx context.Context) (TekuProposerConfigResponse, error)
}
type TekuProposerConfigResponse ¶ added in v0.10.0
type TekuProposerConfigResponse struct { Proposers map[string]TekuProposerConfig `json:"proposer_config"` Default TekuProposerConfig `json:"default_config"` }