best

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package best is a strategy that obtains beacon block proposals from multiple nodes and selects the best one based on its attestation load.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter interface {
	// contains filtered or unexported methods
}

Parameter is the interface for service parameters.

func WithBlockRootToSlotCache added in v1.5.0

func WithBlockRootToSlotCache(cache cache.BlockRootToSlotProvider) Parameter

WithBlockRootToSlotCache sets the block root to slot cache.

func WithChainTimeService added in v1.4.0

func WithChainTimeService(chainTime chaintime.Service) Parameter

WithChainTimeService sets the chain time service.

func WithClientMonitor

func WithClientMonitor(monitor metrics.ClientMonitor) Parameter

WithClientMonitor sets the client monitor for the service.

func WithEventsProvider added in v1.4.0

func WithEventsProvider(provider eth2client.EventsProvider) Parameter

WithEventsProvider sets the events provider.

func WithExecutionPayloadFactor added in v1.7.4

func WithExecutionPayloadFactor(factor float64) Parameter

WithExecutionPayloadFactor sets the relative weight of execution payload gas to block score.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithProcessConcurrency

func WithProcessConcurrency(concurrency int64) Parameter

WithProcessConcurrency sets the concurrency for the service.

func WithProposalProviders added in v1.8.0

func WithProposalProviders(providers map[string]eth2client.ProposalProvider) Parameter

WithProposalProviders sets the proposal providers.

func WithSignedBeaconBlockProvider added in v0.9.0

func WithSignedBeaconBlockProvider(provider eth2client.SignedBeaconBlockProvider) Parameter

WithSignedBeaconBlockProvider sets the signed beacon block provider.

func WithSpecProvider added in v1.4.0

func WithSpecProvider(provider eth2client.SpecProvider) Parameter

WithSpecProvider sets the beacon spec provider.

func WithTimeout

func WithTimeout(timeout time.Duration) Parameter

WithTimeout sets the timeout for requests.

type Service

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

Service is the provider for beacon block proposals.

func New

func New(ctx context.Context, params ...Parameter) (*Service, error)

New creates a new beacon block proposal strategy.

func (*Service) HandleHeadEvent added in v1.4.0

func (s *Service) HandleHeadEvent(event *apiv1.Event)

HandleHeadEvent handles the "head" events from the beacon node.

func (*Service) Proposal added in v1.8.0

func (s *Service) Proposal(ctx context.Context,
	opts *api.ProposalOpts,
) (
	*api.Response[*api.VersionedProposal],
	error,
)

Proposal provides the best beacon block proposal from a number of beacon nodes.

Jump to

Keyboard shortcuts

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