validatorapi

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 36 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(h Handler, eth2Cl eth2client.Service) (*mux.Router, error)

NewRouter returns a new validator http server router. The http router translates http requests related to the distributed validator to the validatorapi.Handler. All other requests are reserve-proxied to the beacon-node address.

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

func NewComponent

func NewComponent(eth2Svc eth2client.Service, pubShareByKey map[*bls_sig.PublicKey]*bls_sig.PublicKey, shareIdx int) (*Component, error)

NewComponent returns a new instance of the validator API core workflow component.

func NewComponentInsecure

func NewComponentInsecure(eth2Svc eth2client.Service, shareIdx int) (*Component, error)

NewComponentInsecure returns a new instance of the validator API core workflow component that does not perform signature verification.

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) 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 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 block. It 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) 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 (c Component) SubmitBeaconBlock(ctx context.Context, block *spec.VersionedSignedBeaconBlock) error

func (Component) SubmitBlindedBeaconBlock added in v0.9.0

func (c Component) SubmitBlindedBeaconBlock(ctx context.Context, block *eth2api.VersionedSignedBlindedBeaconBlock) error

func (Component) SubmitVoluntaryExit added in v0.6.0

func (c Component) SubmitVoluntaryExit(ctx context.Context, exit *eth2p0.SignedVoluntaryExit) error

SubmitVoluntaryExit receives the partially signed voluntary exit.

func (*Component) Subscribe added in v0.9.0

func (c *Component) Subscribe(fn func(context.Context, core.Duty, core.ParSignedDataSet) error)

Subscribe registers a partial signed data set store function. It supports multiple functions since it is the output of the component.

func (Component) Validators

func (c Component) Validators(ctx context.Context, stateID string, validatorIndices []eth2p0.ValidatorIndex) (map[eth2p0.ValidatorIndex]*eth2v1.Validator, error)

func (Component) ValidatorsByPubKey

func (c Component) ValidatorsByPubKey(ctx context.Context, stateID string, pubshares []eth2p0.BLSPubKey) (map[eth2p0.ValidatorIndex]*eth2v1.Validator, error)

type PubShareFunc

type PubShareFunc func(pubkey core.PubKey, shareIdx int) (*bls_sig.PublicKey, error)

PubShareFunc abstracts the mapping of validator root public key to tbls public share.

Jump to

Keyboard shortcuts

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