builder

package
v0.0.0-...-3bf8caa Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0, MIT, GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoBuilder = errors.New("builder endpoint not configured")

ErrNoBuilder is used when builder endpoint is not configured.

Functions

This section is empty.

Types

type BlockBuilder

type BlockBuilder interface {
	SubmitBlindedBlock(ctx context.Context, block interfaces.ReadOnlySignedBeaconBlock) (interfaces.ExecutionData, error)
	GetHeader(ctx context.Context, slot primitives.Slot, parentHash [32]byte, pubKey [48]byte) (builder.SignedBid, error)
	RegisterValidator(ctx context.Context, reg []*ethpb.SignedValidatorRegistrationV1) error
	RegistrationByValidatorID(ctx context.Context, id primitives.ValidatorIndex) (*ethpb.ValidatorRegistrationV1, error)
	Configured() bool
}

BlockBuilder defines the interface for interacting with the block builder

type Option

type Option func(s *Service) error

func FlagOptions

func FlagOptions(c *cli.Context) ([]Option, error)

FlagOptions for builder service flag configurations.

func WithBuilderClient

func WithBuilderClient(client builder.BuilderClient) Option

WithBuilderClient sets the builder client for the beacon chain builder service.

func WithDatabase

func WithDatabase(beaconDB db.HeadAccessDatabase) Option

WithDatabase for head access.

func WithHeadFetcher

func WithHeadFetcher(svc blockchain.HeadFetcher) Option

WithHeadFetcher gets the head info from chain service.

func WithRegistrationCache

func WithRegistrationCache() Option

WithRegistrationCache uses a cache for the validator registrations instead of a persistent db.

type Service

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

Service defines a service that provides a client for interacting with the beacon chain and MEV relay network.

func NewService

func NewService(ctx context.Context, opts ...Option) (*Service, error)

NewService instantiates a new service.

func (*Service) Configured

func (s *Service) Configured() bool

Configured returns true if the user has configured a builder client.

func (*Service) GetHeader

func (s *Service) GetHeader(ctx context.Context, slot primitives.Slot, parentHash [32]byte, pubKey [48]byte) (builder.SignedBid, error)

GetHeader retrieves the header for a given slot and parent hash from the builder relay network.

func (*Service) RegisterValidator

func (s *Service) RegisterValidator(ctx context.Context, reg []*ethpb.SignedValidatorRegistrationV1) error

RegisterValidator registers a validator with the builder relay network. It also saves the registration object to the DB.

func (*Service) RegistrationByValidatorID

func (s *Service) RegistrationByValidatorID(ctx context.Context, id primitives.ValidatorIndex) (*ethpb.ValidatorRegistrationV1, error)

RegistrationByValidatorID returns either the values from the cache or db.

func (*Service) Start

func (s *Service) Start()

Start initializes the service.

func (*Service) Status

func (s *Service) Status() error

Status retrieves the status of the builder relay network.

func (*Service) Stop

func (s *Service) Stop() error

Stop halts the service.

func (*Service) SubmitBlindedBlock

SubmitBlindedBlock submits a blinded block to the builder relay network.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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