registrations

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Enabled is the flag to enable the validator registration monitor
	Enabled *bool `yaml:"enabled" default:"false"`
	// NumShards is the number of shards to split the validator set into
	NumShards int `yaml:"numShards" default:"1"`
	// Shard is the shard to use for the validator set
	Shard int `yaml:"shard" default:"0"`
	// ActiveValidatorsFetchInterval is the interval at which to fetch active validators
	ActiveValidatorsFetchInterval human.Duration `yaml:"activeValidatorsFetchInterval" default:"24h"`
	// TargetSweepDuration is the duration at which we want to sweep all validators in this shard of
	// the validator set.
	// If this is set too low for the size of the validator set, the relays may ban you.
	// Defaults to 14 days. This means that we will sweep all validators in this shard
	// over the course of 14 days.
	TargetSweepDuration human.Duration `yaml:"targetSweepDuration" default:"336h"`
	// Workers is the number of workers to use for fetching active validators per relay
	Workers int `yaml:"workers" default:"10"`
}

func (*Config) Validate

func (c *Config) Validate() error

type RelayValidatorRegistrationScraper

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

func NewRelayValidatorRegistrationScraper

func NewRelayValidatorRegistrationScraper(
	log logrus.FieldLogger,
	workers int,
	r *relay.Client,
	cb func(ctx context.Context, validator *apiv1.Validator, relay *relay.Client, registration *mevrelay.ValidatorRegistration),
) *RelayValidatorRegistrationScraper

NewRelayValidatorRegistrationScraper creates a new validator registration scraper

func (*RelayValidatorRegistrationScraper) Add

func (*RelayValidatorRegistrationScraper) Start

func (*RelayValidatorRegistrationScraper) Stop

type ValidatorMonitor

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

func NewValidatorMonitor

func NewValidatorMonitor(
	log logrus.FieldLogger,
	config *Config,
	relays []*relay.Client,
	beaconNode *ethereum.BeaconNode,
	eventsCh chan *ValidatorRegistrationEvent,
) *ValidatorMonitor

func (*ValidatorMonitor) Start

func (r *ValidatorMonitor) Start(ctx context.Context) error

type ValidatorRegistrationEvent

type ValidatorRegistrationEvent struct {
	Validator    *apiv1.Validator
	Relay        *relay.Client
	Registration *mevrelay.ValidatorRegistration
}

type ValidatorSetWalker

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

ValidatorSetWalker is a struct that walks through the validator set and returns the next validator index to register

func NewValidatorSetWalker

func NewValidatorSetWalker(shard, numShards int) *ValidatorSetWalker

NewValidatorSetWalker creates a new ValidatorSetWalker

func (*ValidatorSetWalker) GetValidator

func (v *ValidatorSetWalker) GetValidator(index *phase0.ValidatorIndex) (*apiv1.Validator, error)

func (*ValidatorSetWalker) Marker

func (*ValidatorSetWalker) Max

func (*ValidatorSetWalker) Min

func (*ValidatorSetWalker) Next

func (*ValidatorSetWalker) NumShards

func (v *ValidatorSetWalker) NumShards() int

func (*ValidatorSetWalker) NumValidatorsInShard

func (v *ValidatorSetWalker) NumValidatorsInShard() uint64

func (*ValidatorSetWalker) Shard

func (v *ValidatorSetWalker) Shard() int

func (*ValidatorSetWalker) Update

func (v *ValidatorSetWalker) Update(validators map[phase0.ValidatorIndex]*apiv1.Validator)

func (*ValidatorSetWalker) ValidatorMap

func (v *ValidatorSetWalker) ValidatorMap() map[phase0.ValidatorIndex]*apiv1.Validator

func (*ValidatorSetWalker) Validators

func (v *ValidatorSetWalker) Validators() []phase0.ValidatorIndex

Jump to

Keyboard shortcuts

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