Documentation ¶
Index ¶
- Constants
- Variables
- func SubmissionToKey(submission *types.BuilderSubmitBlockRequest) structs.PayloadKey
- type Auctioneer
- type Beacon
- type BlockValidationClient
- type DataAPIStore
- type Datastore
- type Relay
- func (r *Relay) AttachMetrics(m *metrics.Metrics)
- func (rs *Relay) Close(ctx context.Context)
- func (r *Relay) GetBlockReceived(ctx context.Context, query structs.SubmissionTraceQuery) ([]structs.BidTraceWithTimestamp, error)
- func (rs *Relay) GetHeader(ctx context.Context, m *structs.MetricGroup, request structs.HeaderRequest) (structs.GetHeaderResponse, error)
- func (rs *Relay) GetPayload(ctx context.Context, m *structs.MetricGroup, ...) (structs.GetPayloadResponse, error)
- func (r *Relay) GetPayloadDelivered(ctx context.Context, query structs.PayloadTraceQuery) ([]structs.BidTraceExtended, error)
- func (rs *Relay) SubmitBlock(ctx context.Context, m *structs.MetricGroup, sbr structs.SubmitBlockRequest) error
- type RelayConfig
- type RelayMetrics
- type State
- type TimeoutWaitGroup
- type ValidatorCache
- type ValidatorStore
- type Verifier
Constants ¶
View Source
const (
StateRecheckDelay = time.Second
)
Variables ¶
View Source
var ( ErrUnknownValue = errors.New("value is unknown") ErrPayloadAlreadyDelivered = errors.New("slot payload already delivered") ErrNoPayloadFound = errors.New("no payload found") ErrMissingRequest = errors.New("req is nil") ErrMissingSecretKey = errors.New("secret key is nil") ErrNoBuilderBid = errors.New("no builder bid") ErrTraceMismatch = errors.New("trace and payload mismatch") ErrZeroBid = errors.New("zero valued builder bid") ErrOldSlot = errors.New("requested slot is old") ErrBadHeader = errors.New("invalid block header from datastore") ErrInvalidSignature = errors.New("invalid signature") ErrStore = errors.New("failed to store") ErrMarshal = errors.New("failed to marshal") ErrInternal = errors.New("internal server error") ErrUnknownValidator = errors.New("unknown validator") ErrVerification = errors.New("failed to verify") ErrInvalidTimestamp = errors.New("invalid timestamp") ErrInvalidSlot = errors.New("invalid slot") ErrEmptyBlock = errors.New("block is empty") ErrWrongPayload = errors.New("wrong publish payload") ErrFailedToPublish = errors.New("failed to publish block") )
Functions ¶
func SubmissionToKey ¶
func SubmissionToKey(submission *types.BuilderSubmitBlockRequest) structs.PayloadKey
Types ¶
type Auctioneer ¶
type Auctioneer interface { AddBlock(block *structs.CompleteBlockstruct) bool MaxProfitBlock(slot structs.Slot) (*structs.CompleteBlockstruct, bool) }
type Beacon ¶
type Beacon interface {
PublishBlock(ctx context.Context, block structs.SignedBeaconBlock) error
}
type BlockValidationClient ¶
type DataAPIStore ¶
type DataAPIStore interface { PutDelivered(context.Context, structs.Slot, structs.DeliveredTrace, time.Duration) error GetDeliveredPayloads(ctx context.Context, headSlot uint64, queryArgs structs.PayloadTraceQuery) (bts []structs.BidTraceExtended, err error) PutBuilderBlockSubmission(ctx context.Context, bid structs.BidTraceWithTimestamp, isMostProfitable bool) (err error) GetBuilderBlockSubmissions(ctx context.Context, headSlot uint64, payload structs.SubmissionTraceQuery) ([]structs.BidTraceWithTimestamp, error) }
type Datastore ¶
type Datastore interface { CacheBlock(ctx context.Context, key structs.PayloadKey, block *structs.CompleteBlockstruct) error PutPayload(context.Context, structs.PayloadKey, structs.BlockBidAndTrace, time.Duration) error GetPayload(context.Context, structs.ForkVersion, structs.PayloadKey) (structs.BlockBidAndTrace, bool, error) }
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
func NewRelay ¶
func NewRelay(l log.Logger, config RelayConfig, beacon Beacon, cache ValidatorCache, vstore ValidatorStore, ver Verifier, beaconState State, d Datastore, das DataAPIStore, a Auctioneer, bvc BlockValidationClient) *Relay
NewRelay relay service
func (*Relay) AttachMetrics ¶
func (*Relay) GetBlockReceived ¶
func (r *Relay) GetBlockReceived(ctx context.Context, query structs.SubmissionTraceQuery) ([]structs.BidTraceWithTimestamp, error)
func (*Relay) GetHeader ¶
func (rs *Relay) GetHeader(ctx context.Context, m *structs.MetricGroup, request structs.HeaderRequest) (structs.GetHeaderResponse, error)
GetHeader is called by a block proposer communicating through mev-boost and returns a bid along with an execution payload header
func (*Relay) GetPayload ¶
func (rs *Relay) GetPayload(ctx context.Context, m *structs.MetricGroup, payloadRequest structs.SignedBlindedBeaconBlock) (structs.GetPayloadResponse, error)
GetPayload is called by a block proposer communicating through mev-boost and reveals execution payload of given signed beacon block if stored
func (*Relay) GetPayloadDelivered ¶
func (r *Relay) GetPayloadDelivered(ctx context.Context, query structs.PayloadTraceQuery) ([]structs.BidTraceExtended, error)
func (*Relay) SubmitBlock ¶
func (rs *Relay) SubmitBlock(ctx context.Context, m *structs.MetricGroup, sbr structs.SubmitBlockRequest) error
SubmitBlock Accepts block from trusted builder and stores
type RelayConfig ¶
type RelayConfig struct { BuilderSigningDomain types.Domain ProposerSigningDomain map[structs.ForkVersion]types.Domain PubKey types.PublicKey SecretKey *bls.SecretKey MaxBlockPublishDelay time.Duration AllowedListedBuilders map[[48]byte]struct{} PublishBlock bool TTL time.Duration RegistrationCacheTTL time.Duration }
type RelayMetrics ¶
type RelayMetrics struct {
MissHeaderCount *prometheus.CounterVec
}
type State ¶
type State interface { KnownValidators() structs.ValidatorsState HeadSlot() structs.Slot Genesis() structs.GenesisInfo Withdrawals(uint64) structs.WithdrawalsState Randao(uint64) structs.RandaoState ForkVersion(slot structs.Slot) structs.ForkVersion }
type TimeoutWaitGroup ¶ added in v0.4.4
type TimeoutWaitGroup struct {
// contains filtered or unexported fields
}
func NewTimeoutWaitGroup ¶ added in v0.4.4
func NewTimeoutWaitGroup() *TimeoutWaitGroup
func (*TimeoutWaitGroup) Add ¶ added in v0.4.4
func (wg *TimeoutWaitGroup) Add(i int64)
func (*TimeoutWaitGroup) C ¶ added in v0.4.4
func (wg *TimeoutWaitGroup) C() <-chan struct{}
func (*TimeoutWaitGroup) Done ¶ added in v0.4.4
func (wg *TimeoutWaitGroup) Done()
type ValidatorCache ¶
type ValidatorStore ¶
Click to show internal directories.
Click to hide internal directories.