Documentation ¶
Index ¶
- Variables
- func SubmissionToKey(submission *types.BuilderSubmitBlockRequest) structs.PayloadKey
- func SubmitBlockRequestToBlockBidAndTrace(signedBuilderBid *types.SignedBuilderBid, ...) structs.BlockBidAndTrace
- func SubmitBlockRequestToSignedBuilderBid(req *types.BuilderSubmitBlockRequest, sk *bls.SecretKey, ...) (*types.SignedBuilderBid, error)
- type Auctioneer
- type Beacon
- type Datastore
- type Relay
- func (r *Relay) AttachMetrics(m *metrics.Metrics)
- func (r *Relay) GetBlockReceived(ctx context.Context, query structs.HeaderTraceQuery) ([]structs.BidTraceWithTimestamp, error)
- func (rs *Relay) GetHeader(ctx context.Context, m *structs.MetricGroup, request structs.HeaderRequest) (*types.GetHeaderResponse, error)
- func (rs *Relay) GetPayload(ctx context.Context, m *structs.MetricGroup, ...) (*types.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, ...) error
- type RelayConfig
- type RelayMetrics
- type State
- type Verifier
Constants ¶
This section is empty.
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") 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") )
View Source
var (
DurationPerSlot = time.Second * 12
)
Functions ¶
func SubmissionToKey ¶
func SubmissionToKey(submission *types.BuilderSubmitBlockRequest) structs.PayloadKey
func SubmitBlockRequestToBlockBidAndTrace ¶
func SubmitBlockRequestToBlockBidAndTrace(signedBuilderBid *types.SignedBuilderBid, submitBlockRequest *types.BuilderSubmitBlockRequest) structs.BlockBidAndTrace
func SubmitBlockRequestToSignedBuilderBid ¶
func SubmitBlockRequestToSignedBuilderBid(req *types.BuilderSubmitBlockRequest, sk *bls.SecretKey, pubkey *types.PublicKey, domain types.Domain) (*types.SignedBuilderBid, error)
***** Relay Domain ***** SubmitBlockRequestToSignedBuilderBid converts a builders block submission to a bid compatible with mev-boost
Types ¶
type Auctioneer ¶ added in v0.3.4
type Auctioneer interface { AddBlock(block *structs.CompleteBlockstruct) bool MaxProfitBlock(slot structs.Slot) (*structs.CompleteBlockstruct, bool) }
type Beacon ¶ added in v0.3.9
type Beacon interface {
PublishBlock(block *types.SignedBeaconBlock) error
}
type Datastore ¶
type Datastore interface { CheckSlotDelivered(context.Context, uint64) (bool, error) PutDelivered(context.Context, structs.Slot, structs.DeliveredTrace, time.Duration) error GetDelivered(context.Context, structs.PayloadQuery) (structs.BidTraceWithTimestamp, error) PutPayload(context.Context, structs.PayloadKey, *structs.BlockBidAndTrace, time.Duration) error GetPayload(context.Context, structs.PayloadKey) (*structs.BlockBidAndTrace, bool, error) PutHeader(ctx context.Context, hd structs.HeaderData, ttl time.Duration) error CacheBlock(ctx context.Context, block *structs.CompleteBlockstruct) error GetMaxProfitHeader(ctx context.Context, slot uint64) (structs.HeaderAndTrace, error) // to be changed GetHeadersBySlot(ctx context.Context, slot uint64) ([]structs.HeaderAndTrace, error) GetHeadersByBlockHash(ctx context.Context, hash types.Hash) ([]structs.HeaderAndTrace, error) GetHeadersByBlockNum(ctx context.Context, num uint64) ([]structs.HeaderAndTrace, error) GetLatestHeaders(ctx context.Context, limit uint64, stopLag uint64) ([]structs.HeaderAndTrace, error) GetDeliveredBatch(context.Context, []structs.PayloadQuery) ([]structs.BidTraceWithTimestamp, error) }
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
func NewRelay ¶
func NewRelay(l log.Logger, config RelayConfig, beacon Beacon, ver Verifier, beaconState State, d Datastore, a Auctioneer) *Relay
NewRelay relay service
func (*Relay) AttachMetrics ¶
func (*Relay) GetBlockReceived ¶ added in v0.3.9
func (r *Relay) GetBlockReceived(ctx context.Context, query structs.HeaderTraceQuery) ([]structs.BidTraceWithTimestamp, error)
func (*Relay) GetHeader ¶
func (rs *Relay) GetHeader(ctx context.Context, m *structs.MetricGroup, request structs.HeaderRequest) (*types.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 *types.SignedBlindedBeaconBlock) (*types.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 ¶ added in v0.3.9
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, submitBlockRequest *types.BuilderSubmitBlockRequest) error
SubmitBlock Accepts block from trusted builder and stores
type RelayConfig ¶
type RelayMetrics ¶
type RelayMetrics struct { MissHeaderCount *prometheus.CounterVec RegistrationsCacheHits *prometheus.CounterVec }
type State ¶
type State interface {
Beacon() *structs.BeaconState
}
Click to show internal directories.
Click to hide internal directories.