validators

package
v0.5.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSignature = errors.New("invalid signature")
	ErrUnknownValidator = errors.New("unknown validator")
	ErrInvalidTimestamp = errors.New("invalid timestamp")
)

Functions

This section is empty.

Types

type MultiSlotState added in v0.4.2

type MultiSlotState interface {
	Get(uint64) State
}

type Register

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

func NewRegister

func NewRegister(l log.Logger, builderSigningDomain types.Domain, beaconState *beacon.MultiSlotState, ver Verifier, regMngr RegistrationManager) *Register

func (*Register) AttachMetrics

func (r *Register) AttachMetrics(m *metrics.Metrics)

func (*Register) GetValidators

GetValidators returns a list of registered block proposers in current and next epoch

func (*Register) RegisterValidator

func (rs *Register) RegisterValidator(ctx context.Context, m *structs.MetricGroup, payload []types.SignedValidatorRegistration) (err error)

***** Builder Domain ***** RegisterValidator is called is called by validators communicating through mev-boost who would like to receive a block from us when their slot is scheduled

func (*Register) Registration

type RegisterMetrics

type RegisterMetrics struct {
	RegistrationsCacheHits *prometheus.CounterVec
}

type RegistrationManager

type RegistrationManager interface {
	SendStore(sReq StoreReq)
	GetRegistration(ctx context.Context, pk types.PublicKey) (types.SignedValidatorRegistration, error)
	Check(rvg *types.RegisterValidatorRequestMessage) bool
}

type State

type State interface {
	Duties() structs.DutiesState
	KnownValidators() structs.ValidatorsState
}

type StoreManager

type StoreManager struct {
	RegistrationCache ValidatorCache

	StoreCh chan StoreReq
	// contains filtered or unexported fields
}

func NewStoreManager

func NewStoreManager(l log.Logger, cache ValidatorCache, store ValidatorStore, writeTTL time.Duration, storeSize uint) *StoreManager

func (*StoreManager) AttachMetrics

func (rm *StoreManager) AttachMetrics(m *metrics.Metrics)

func (*StoreManager) Check

func (*StoreManager) Close

func (pm *StoreManager) Close(ctx context.Context)

func (*StoreManager) GetRegistration

func (*StoreManager) ParallelStore

func (pm *StoreManager) ParallelStore(datas ValidatorStore)

func (*StoreManager) RunStore

func (rm *StoreManager) RunStore(num uint)

func (*StoreManager) SendStore

func (rm *StoreManager) SendStore(request StoreReq)

type StoreManagerMetrics

type StoreManagerMetrics struct {
	StoreTiming    prometheus.Histogram
	StoreSize      prometheus.Histogram
	StoreErrorRate prometheus.Counter
	RunningWorkers *prometheus.GaugeVec
}

type StoreReq

type StoreReq struct {
	Items []StoreReqItem
}

type StoreReqItem

type StoreReqItem struct {
	Payload types.SignedValidatorRegistration
	Time    uint64
}

StoreReqItem is a payload requested to be stored

type ValidatorCache

type ValidatorCache interface {
	Add(types.PublicKey, structs.ValidatorCacheEntry) (evicted bool)
	Get(types.PublicKey) (structs.ValidatorCacheEntry, bool)
}

type ValidatorStore

type ValidatorStore interface {
	GetRegistration(context.Context, types.PublicKey) (types.SignedValidatorRegistration, error)
	PutNewerRegistration(ctx context.Context, pk types.PublicKey, registration types.SignedValidatorRegistration) error
}

type Verifier

type Verifier interface {
	GetVerifyChan(stack uint) chan verify.Request
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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