validators

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 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 CacheEntry

type CacheEntry struct {
	Time  time.Time
	Entry types.RegisterValidatorRequestMessage
}

type Register

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

func NewRegister

func NewRegister(l log.Logger, builderSigningDomain types.Domain, beaconState State, ver Verifier, regMngr RegistrationManager, d RegistrationStore) *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 {
	Timing                 *prometheus.HistogramVec
	RegistrationsCacheHits *prometheus.CounterVec
}

type RegistrationManager

type RegistrationManager interface {
	SendStore(sReq StoreReq)
	Check(rvg *types.RegisterValidatorRequestMessage) bool
	//Get(k string) (value uint64, ok bool)
	Get(pubkey string) (timestamp uint64, ok bool)
}

type State

type State interface {
	Beacon() *structs.BeaconState
}

type StoreManager

type StoreManager struct {
	RegistrationCache *lru.Cache[types.PublicKey, CacheEntry]

	LastRegTime map[string]uint64 // [pubkey]timestamp

	StoreCh chan StoreReq
	// contains filtered or unexported fields
}

func NewStoreManager

func NewStoreManager(l log.Logger, storeTTLHalftimeSeconds int, storeSize uint, registrationCacheSize int) (*StoreManager, error)

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) Get

func (rm *StoreManager) Get(k string) (value uint64, ok bool)

func (*StoreManager) LoadAll

func (rm *StoreManager) LoadAll(m map[string]uint64)

func (*StoreManager) ParallelStore

func (pm *StoreManager) ParallelStore(datas RegistrationStore, ttl time.Duration)

func (*StoreManager) RunCleanup

func (rm *StoreManager) RunCleanup(checkinterval uint64, cleanupInterval time.Duration)

func (*StoreManager) RunStore

func (rm *StoreManager) RunStore(store RegistrationStore, ttl time.Duration, num uint)

func (*StoreManager) SendStore

func (rm *StoreManager) SendStore(request StoreReq)

func (*StoreManager) Set

func (rm *StoreManager) Set(k string, value uint64)

type StoreManagerMetrics

type StoreManagerMetrics struct {
	StoreTiming prometheus.Histogram
	StoreSize   prometheus.Histogram

	MapSize prometheus.Gauge

	StoreErrorRate prometheus.Counter

	RunningWorkers *prometheus.GaugeVec
}

type StoreReq

type StoreReq struct {
	Items []StoreReqItem
}

type StoreReqItem

type StoreReqItem struct {
	Payload types.SignedValidatorRegistration
	Time    uint64
	Pubkey  types.PublicKey

	// additional params
	FeeRecipient types.Address
	GasLimit     uint64
}

StoreReqItem is a payload requested to be stored

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