Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeBlockHash(payload *capella.ExecutionPayload) (phase0.Hash32, error)
- func ComputeDomain(domainType boostTypes.DomainType, ...) (domain boostTypes.Domain, err error)
- func DecodeJSON(r io.Reader, dst any) error
- func GetURI(url *url.URL, path string) string
- func RelayEntriesToStrings(relays []RelayEntry) []string
- func SendHTTPRequest(ctx context.Context, client http.Client, method, url string, ...) (code int, err error)
- func SendHTTPRequestWithRetries(ctx context.Context, client http.Client, method, url string, ...) (code int, err error)
- type AuctionTranscript
- type BlockHashHex
- type BoostService
- type BoostServiceOpts
- type GetHeaderResponse
- func (r *GetHeaderResponse) BlockHash() string
- func (r *GetHeaderResponse) BlockNumber() uint64
- func (r *GetHeaderResponse) BuilderBid() *SignedBuilderBid
- func (r *GetHeaderResponse) IsEmpty() bool
- func (r *GetHeaderResponse) IsInvalid() bool
- func (r *GetHeaderResponse) MarshalJSON() ([]byte, error)
- func (r *GetHeaderResponse) Message() types.HashTreeRoot
- func (r *GetHeaderResponse) ParentHash() string
- func (r *GetHeaderResponse) Pubkey() string
- func (r *GetHeaderResponse) Signature() []byte
- func (r *GetHeaderResponse) TransactionsRoot() string
- func (r *GetHeaderResponse) UnmarshalJSON(data []byte) error
- func (r *GetHeaderResponse) Value() *big.Int
- type RelayEntry
- type SignedBuilderBid
- type UserAgent
Constants ¶
const ( HeaderKeySlotUID = "X-MEVBoost-SlotID" HeaderKeyVersion = "X-MEVBoost-Version" HeaderKeyForkVersion = "X-MEVBoost-ForkVersion" )
Variables ¶
var ErrMissingRelayPubkey = fmt.Errorf("missing relay public key")
ErrMissingRelayPubkey is returned if a new RelayEntry URL has no public key.
var ErrPointAtInfinityPubkey = fmt.Errorf("relay public key cannot be the point-at-infinity")
ErrPointAtInfinityPubkey is returned if a new RelayEntry URL has an all-zero public key.
Functions ¶
func ComputeBlockHash ¶ added in v1.5.0
func ComputeBlockHash(payload *capella.ExecutionPayload) (phase0.Hash32, error)
func ComputeDomain ¶ added in v0.5.0
func ComputeDomain(domainType boostTypes.DomainType, forkVersionHex, genesisValidatorsRootHex string) (domain boostTypes.Domain, err error)
ComputeDomain computes the signing domain
func DecodeJSON ¶ added in v0.7.5
DecodeJSON reads JSON from io.Reader and decodes it into a struct
func RelayEntriesToStrings ¶ added in v1.3.2
func RelayEntriesToStrings(relays []RelayEntry) []string
RelayEntriesToStrings returns the string representation of a list of relay entries
func SendHTTPRequest ¶ added in v0.5.0
func SendHTTPRequest(ctx context.Context, client http.Client, method, url string, userAgent UserAgent, headers map[string]string, payload, dst any) (code int, err error)
SendHTTPRequest - prepare and send HTTP request, marshaling the payload if any, and decoding the response if dst is set
func SendHTTPRequestWithRetries ¶ added in v1.5.0
func SendHTTPRequestWithRetries(ctx context.Context, client http.Client, method, url string, userAgent UserAgent, headers map[string]string, payload, dst any, maxRetries int, log *logrus.Entry) (code int, err error)
SendHTTPRequestWithRetries - prepare and send HTTP request, retrying the request if within the client timeout
Types ¶
type AuctionTranscript ¶ added in v1.4.0
type AuctionTranscript struct {
Bid *SignedBuilderBid `json:"bid"`
Acceptance *types.SignedBlindedBeaconBlock `json:"acceptance"`
}
AuctionTranscript is the bid and blinded block received from the relay send to the relay monitor
type BlockHashHex ¶ added in v1.3.2
type BlockHashHex string
BlockHashHex is a hex-string representation of a block hash
type BoostService ¶
type BoostService struct {
// contains filtered or unexported fields
}
BoostService - the mev-boost service
func NewBoostService ¶
func NewBoostService(opts BoostServiceOpts) (*BoostService, error)
NewBoostService created a new BoostService
func (*BoostService) CheckRelays ¶ added in v0.5.0
func (m *BoostService) CheckRelays() int
CheckRelays sends a request to each one of the relays previously registered to get their status
func (*BoostService) StartHTTPServer ¶ added in v0.4.0
func (m *BoostService) StartHTTPServer() error
StartHTTPServer starts the HTTP server for this boost service instance
type BoostServiceOpts ¶ added in v0.7.1
type BoostServiceOpts struct {
Log *logrus.Entry
ListenAddr string
Relays []RelayEntry
RelayMonitors []*url.URL
GenesisForkVersionHex string
RelayCheck bool
RelayMinBid types.U256Str
RequestTimeoutGetHeader time.Duration
RequestTimeoutGetPayload time.Duration
RequestTimeoutRegVal time.Duration
RequestMaxRetries int
}
BoostServiceOpts provides all available options for use with NewBoostService
type GetHeaderResponse ¶ added in v1.5.0
type GetHeaderResponse struct {
Bellatrix *types.GetHeaderResponse
Capella *spec.VersionedSignedBuilderBid
}
func (*GetHeaderResponse) BlockHash ¶ added in v1.5.0
func (r *GetHeaderResponse) BlockHash() string
func (*GetHeaderResponse) BlockNumber ¶ added in v1.5.0
func (r *GetHeaderResponse) BlockNumber() uint64
func (*GetHeaderResponse) BuilderBid ¶ added in v1.5.0
func (r *GetHeaderResponse) BuilderBid() *SignedBuilderBid
func (*GetHeaderResponse) IsEmpty ¶ added in v1.5.0
func (r *GetHeaderResponse) IsEmpty() bool
func (*GetHeaderResponse) IsInvalid ¶ added in v1.5.0
func (r *GetHeaderResponse) IsInvalid() bool
func (*GetHeaderResponse) MarshalJSON ¶ added in v1.5.0
func (r *GetHeaderResponse) MarshalJSON() ([]byte, error)
func (*GetHeaderResponse) Message ¶ added in v1.5.0
func (r *GetHeaderResponse) Message() types.HashTreeRoot
func (*GetHeaderResponse) ParentHash ¶ added in v1.5.0
func (r *GetHeaderResponse) ParentHash() string
func (*GetHeaderResponse) Pubkey ¶ added in v1.5.0
func (r *GetHeaderResponse) Pubkey() string
func (*GetHeaderResponse) Signature ¶ added in v1.5.0
func (r *GetHeaderResponse) Signature() []byte
func (*GetHeaderResponse) TransactionsRoot ¶ added in v1.5.0
func (r *GetHeaderResponse) TransactionsRoot() string
func (*GetHeaderResponse) UnmarshalJSON ¶ added in v1.5.0
func (r *GetHeaderResponse) UnmarshalJSON(data []byte) error
func (*GetHeaderResponse) Value ¶ added in v1.5.0
func (r *GetHeaderResponse) Value() *big.Int
type RelayEntry ¶ added in v0.4.2
RelayEntry represents a relay that mev-boost connects to.
func NewRelayEntry ¶ added in v0.4.5
func NewRelayEntry(relayURL string) (entry RelayEntry, err error)
NewRelayEntry creates a new instance based on an input string relayURL can be IP@PORT, PUBKEY@IP:PORT, https://IP, etc.
func (*RelayEntry) GetURI ¶ added in v0.7.4
func (r *RelayEntry) GetURI(path string) string
GetURI returns the full request URI with scheme, host, path and args for the relay.
func (*RelayEntry) String ¶ added in v0.4.5
func (r *RelayEntry) String() string
type SignedBuilderBid ¶ added in v1.5.0
type SignedBuilderBid struct {
Bellatrix *types.SignedBuilderBid
Capella *capella.SignedBuilderBid
}
func (*SignedBuilderBid) MarshalJSON ¶ added in v1.5.0
func (r *SignedBuilderBid) MarshalJSON() ([]byte, error)
func (*SignedBuilderBid) UnmarshalJSON ¶ added in v1.5.0
func (r *SignedBuilderBid) UnmarshalJSON(data []byte) error