Documentation ¶
Overview ¶
Package common provides things used by various other components
Index ¶
- Variables
- func ComputeDomain(domainType types.DomainType, forkVersionHex, genesisValidatorsRootHex string) (domain types.Domain, err error)
- func GetEnv(key, defaultValue string) string
- func GetIPXForwardedFor(r *http.Request) string
- func GetMevBoostVersionFromUserAgent(ua string) string
- func GetSliceEnv(key string, defaultValue []string) []string
- func LogSetup(json bool, logLevel string) *logrus.Entry
- type BidTraceV2
- type BidTraceV2JSON
- type BidTraceV2WithTimestampJSON
- type BuilderEntry
- type EthNetworkDetails
- type HTTPServerTimeouts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServerAlreadyRunning = errors.New("server already running") SlotsPerEpoch = 32 DurationPerSlot = time.Second * 12 DurationPerEpoch = DurationPerSlot * time.Duration(SlotsPerEpoch) )
View Source
var ( ErrInvalidSlot = errors.New("invalid slot") ErrInvalidHash = errors.New("invalid hash") ErrInvalidPubkey = errors.New("invalid pubkey") ErrInvalidSignature = errors.New("invalid signature") )
View Source
var ( EthNetworkKiln = "kiln" EthNetworkRopsten = "ropsten" EthNetworkSepolia = "sepolia" EthNetworkGoerli = "goerli" EthNetworkMainnet = "mainnet" )
View Source
var ( ErrInvalidForkVersion = errors.New("invalid fork version") ErrHTTPErrorResponse = errors.New("got an HTTP error response") )
View Source
var ErrUnknownNetwork = errors.New("unknown network")
View Source
var TestLog = logrus.WithField("testing", true)
TestLog is used to log information in the test methods
View Source
var ValidPayloadRegisterValidator = types.SignedValidatorRegistration{ Message: &types.RegisterValidatorRequestMessage{ FeeRecipient: _HexToAddress("0xdb65fEd33dc262Fe09D9a2Ba8F80b329BA25f941"), Timestamp: 1234356, GasLimit: 278234191203, Pubkey: _HexToPubkey( "0x8a1d7b8dd64e0aafe7ea7b6c95065c9364cf99d38470c12ee807d55f7de1529ad29ce2c422e0b65e3d5a05c02caca249"), }, Signature: _HexToSignature( "0x8209b5391cd69f392b1f02dbc03bab61f574bb6bb54bf87b59e2a85bdc0756f7db6a71ce1b41b727a1f46ccc77b213bf0df1426177b5b29926b39956114421eaa36ec4602969f6f6370a44de44a6bce6dae2136e5fb594cce2a476354264d1ea"), }
Functions ¶
func ComputeDomain ¶
func ComputeDomain(domainType types.DomainType, forkVersionHex, genesisValidatorsRootHex string) (domain types.Domain, err error)
ComputeDomain computes the signing domain
func GetIPXForwardedFor ¶
func GetMevBoostVersionFromUserAgent ¶ added in v0.8.1
GetMevBoostVersionFromUserAgent returns the mev-boost version from an user agent string Example ua: "mev-boost/1.0.1 go-http-client" -> returns "1.0.1". If no version is found, returns "-"
func GetSliceEnv ¶
Types ¶
type BidTraceV2 ¶ added in v0.10.0
type BidTraceV2JSON ¶ added in v0.10.0
type BidTraceV2JSON struct { Slot uint64 `json:"slot,string"` ParentHash string `json:"parent_hash"` BlockHash string `json:"block_hash"` BuilderPubkey string `json:"builder_pubkey"` ProposerPubkey string `json:"proposer_pubkey"` ProposerFeeRecipient string `json:"proposer_fee_recipient"` GasLimit uint64 `json:"gas_limit,string"` GasUsed uint64 `json:"gas_used,string"` Value string `json:"value"` NumTx uint64 `json:"num_tx,string"` BlockNumber uint64 `json:"block_number,string"` }
func (*BidTraceV2JSON) CSVHeader ¶ added in v0.10.0
func (b *BidTraceV2JSON) CSVHeader() []string
func (*BidTraceV2JSON) ToCSVRecord ¶ added in v0.10.0
func (b *BidTraceV2JSON) ToCSVRecord() []string
type BidTraceV2WithTimestampJSON ¶ added in v0.10.0
type BidTraceV2WithTimestampJSON struct { BidTraceV2JSON Timestamp int64 `json:"timestamp,string,omitempty"` TimestampMs int64 `json:"timestamp_ms,string,omitempty"` }
type BuilderEntry ¶
BuilderEntry represents a builder that is allowed to send blocks Address will be schema://hostname:port
func NewBuilderEntry ¶
func NewBuilderEntry(builderURL string) (entry *BuilderEntry, err error)
NewBuilderEntry creates a new instance based on an input string builderURL can be IP@PORT, PUBKEY@IP:PORT, https://IP, etc.
type EthNetworkDetails ¶
type EthNetworkDetails struct { Name string GenesisForkVersionHex string GenesisValidatorsRootHex string BellatrixForkVersionHex string DomainBuilder types.Domain DomainBeaconProposer types.Domain }
func NewEthNetworkDetails ¶
func NewEthNetworkDetails(networkName string) (ret *EthNetworkDetails, err error)
type HTTPServerTimeouts ¶
type HTTPServerTimeouts struct { Read time.Duration // Timeout for body reads. None if 0. ReadHeader time.Duration // Timeout for header reads. None if 0. Write time.Duration // Timeout for writes. None if 0. Idle time.Duration // Timeout to disconnect idle client connections. None if 0. }
HTTPServerTimeouts are various timeouts for requests to the mev-boost HTTP server
Click to show internal directories.
Click to hide internal directories.