Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeJSON(r io.Reader, dst any) error
- func GetURI(url *url.URL, path string) string
- func HexToPubkey(s string) (ret phase0.BLSPubKey, err error)
- func ParseConfigFLags(r *RelayService, moduleFlags commonType.ModuleFlags) error
- func RelayEntriesToStrings(relays []RelayEntry) []string
- func SendHTTPRequest(ctx context.Context, client http.Client, method, url string, payload, dst any) (code int, err error)
- func SendHTTPRequestWithRetries(ctx context.Context, client http.Client, method, url string, payload, dst any, ...) (code int, err error)
- func VerifySignature(sig *Signature, pk *PublicKey, msg []byte) (bool, error)
- func VerifySignatureBytes(msg, sigBytes, pkBytes []byte) (bool, error)
- type PublicKey
- type RelayEntry
- type RelayService
- func (r *RelayService) CliCommand() *cli.Command
- func (r *RelayService) Configure(moduleFlags commonType.ModuleFlags) error
- func (r *RelayService) ConnectCore(coreClient *coreCommon.Client, pingId string) error
- func (r *RelayService) GetHeader(slot uint64, parentHash, pubkey string) (res []spec.VersionedSignedBuilderBid, err error)
- func (r *RelayService) GetPayload(...) (...)
- func (r *RelayService) Name() string
- func (r *RelayService) RegisterValidator(payload []apiv1.SignedValidatorRegistration) error
- func (r *RelayService) Start() error
- func (r *RelayService) Status() error
- func (r *RelayService) Stop() error
- type SecretKey
- type Signature
Constants ¶
const ( HeaderKeySlotUID = "X-MEVPLUS-SlotID" HeaderKeyVersion = "X-MEVPLUS-Version" )
const ( PublicKeyLength = bls12381.SizeOfG1AffineCompressed SecretKeyLength = fr.Bytes SignatureLength = bls12381.SizeOfG2AffineCompressed )
Variables ¶
var ( ErrMissingRelayPubkey = fmt.Errorf("missing relay public key") ErrHTTPErrorResponse = errors.New("HTTP error response") ErrNoBidReceived = errors.New("No bid received") ErrInvalidInput = errors.New("Invalid input") ErrIncompletePayload = errors.New("Missing parts of the request payload from the beacon-node") ErrNoPayloadReceived = errors.New("No payload received from relay") ErrMaxRetriesExceeded = errors.New("max retries exceeded") ErrInvalidTransaction = errors.New("invalid transaction") ErrPointAtInfinityPubkey = fmt.Errorf("relay public key cannot be the point-at-infinity") ErrLength = errors.New("invalid length") ErrNoRelays = errors.New("no relays") ErrInvalidSlot = errors.New("invalid slot") ErrInvalidHash = errors.New("invalid hash") ErrInvalidPubkey = errors.New("invalid pubkey") ErrNoSuccessfulRelayResponse = errors.New("no successful relay response") ErrUseLastResponse = errors.New("net/http: use last response") )
Functions ¶
func DecodeJSON ¶
DecodeJSON reads JSON from io.Reader and decodes it into a struct
func HexToPubkey ¶
HexToPubkey takes a hex string and returns a PublicKey
func ParseConfigFLags ¶
func ParseConfigFLags(r *RelayService, moduleFlags commonType.ModuleFlags) error
func RelayEntriesToStrings ¶
func RelayEntriesToStrings(relays []RelayEntry) []string
RelayEntriesToStrings returns the string representation of a list of relay entries
func SendHTTPRequest ¶
func SendHTTPRequest(ctx context.Context, client http.Client, method, url 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 ¶
func SendHTTPRequestWithRetries(ctx context.Context, client http.Client, method, url 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
func VerifySignature ¶
func VerifySignatureBytes ¶
Types ¶
type PublicKey ¶
func PublicKeyFromBytes ¶
type RelayEntry ¶
RelayEntry represents a relay that mev-plus connects to.
func NewRelayEntry ¶
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 ¶
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 ¶
func (r *RelayEntry) String() string
type RelayService ¶
type RelayService struct {
// contains filtered or unexported fields
}
func NewRelayService ¶
func NewRelayService() *RelayService
func (*RelayService) CliCommand ¶ added in v1.0.0
func (r *RelayService) CliCommand() *cli.Command
func (*RelayService) Configure ¶
func (r *RelayService) Configure(moduleFlags commonType.ModuleFlags) error
func (*RelayService) ConnectCore ¶
func (r *RelayService) ConnectCore(coreClient *coreCommon.Client, pingId string) error
func (*RelayService) GetHeader ¶
func (r *RelayService) GetHeader(slot uint64, parentHash, pubkey string) (res []spec.VersionedSignedBuilderBid, err error)
func (*RelayService) GetPayload ¶
func (r *RelayService) GetPayload(VersionedSignedBlindedBeaconBlock *commonTypes.VersionedSignedBlindedBeaconBlock) (versionedExecutionPayload []commonTypes.VersionedExecutionPayloadV2WithVersionName, err error)
func (*RelayService) Name ¶
func (r *RelayService) Name() string
func (*RelayService) RegisterValidator ¶
func (r *RelayService) RegisterValidator(payload []apiv1.SignedValidatorRegistration) error
func (*RelayService) Start ¶
func (r *RelayService) Start() error
func (*RelayService) Status ¶
func (r *RelayService) Status() error
func (*RelayService) Stop ¶
func (r *RelayService) Stop() error