Documentation ¶
Index ¶
Constants ¶
View Source
const ( // proposer endpoints PathStatus = "/eth/v1/builder/status" PathRegisterValidator = "/eth/v1/builder/validators" PathGetHeader = "/eth/v1/builder/header/{slot:[0-9]+}/{parent_hash:0x[a-fA-F0-9]+}/{pubkey:0x[a-fA-F0-9]+}" PathGetPayload = "/eth/v1/builder/blinded_blocks" // builder endpoints PathGetValidators = "/relay/v1/builder/validators" PathSubmitBlock = "/relay/v1/builder/blocks" // data api PathBuilderBlocksReceived = "/relay/v1/data/bidtraces/builder_blocks_received" PathProposerPayloadsDelivered = "/relay/v1/data/bidtraces/proposer_payload_delivered" PathSpecificRegistration = "/relay/v1/data/validator_registration" )
Router paths
Variables ¶
View Source
var (
ErrParamNotFound = errors.New("not found")
)
View Source
var ErrTooManyCalls = errors.New("too many calls")
Functions ¶
func ParseHeaderRequest ¶
func ParseHeaderRequest(r *http.Request) structs.HeaderRequest
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewApi ¶
func NewApi(l log.Logger, enabled *EnabledEndpoints, r Relay, reg Registrations, st State, lim RateLimitter, dataLimit int, errorsOnDisable bool) (a *API)
func (*API) AttachMetrics ¶
func (*API) AttachToHandler ¶
type APIMetrics ¶
type APIMetrics struct { ApiReqCounter *prometheus.CounterVec ApiReqTiming *prometheus.HistogramVec ApiReqElCount *prometheus.HistogramVec RelayTiming *prometheus.HistogramVec }
type EnabledEndpoints ¶ added in v0.4.13
type Limitter ¶
type Limitter struct { AllowedBuilders map[[48]byte]struct{} RateLimit rate.Limit Burst int LimitterCacheSize int // contains filtered or unexported fields }
func (*Limitter) OnConfigChange ¶ added in v0.6.0
func (*Limitter) ParseInitialConfig ¶ added in v0.6.0
type RateLimitter ¶
type Registrations ¶
type Registrations interface { // Proposer APIs (builder spec https://github.com/ethereum/builder-specs) RegisterValidator(context.Context, *structs.MetricGroup, []types.SignedValidatorRegistration) error // Data APIs Registration(context.Context, types.PublicKey) (types.SignedValidatorRegistration, error) // Builder APIs (relay spec https://flashbots.notion.site/Relay-API-Spec-5fb0819366954962bc02e81cb33840f5) GetValidators(*structs.MetricGroup) structs.BuilderGetValidatorsResponseEntrySlice }
type Relay ¶
type Relay interface { // Proposer APIs (builder spec https://github.com/ethereum/builder-specs) GetHeader(context.Context, *structs.MetricGroup, structs.UserContent, structs.HeaderRequest) (structs.GetHeaderResponse, error) GetPayload(context.Context, *structs.MetricGroup, structs.UserContent, structs.SignedBlindedBeaconBlock) (structs.GetPayloadResponse, error) // Builder APIs (relay spec https://flashbots.notion.site/Relay-API-Spec-5fb0819366954962bc02e81cb33840f5) SubmitBlock(context.Context, *structs.MetricGroup, structs.UserContent, structs.SubmitBlockRequest) error // Data APIs GetPayloadDelivered(context.Context, io.Writer, structs.PayloadTraceQuery) error GetBlockReceived(ctx context.Context, w io.Writer, query structs.SubmissionTraceQuery) error }
Click to show internal directories.
Click to hide internal directories.