Documentation
¶
Overview ¶
Package api contains the API webserver for the proposer and block-builder APIs
Index ¶
- Variables
- func BuildGetHeaderResponse(payload *common.BuilderSubmitBlockRequest, sk *bls.SecretKey, ...) (*common.GetHeaderResponse, error)
- func BuildGetPayloadResponse(payload *common.BuilderSubmitBlockRequest) (*common.GetPayloadResponse, error)
- func BuilderSubmitBlockRequestToSignedBuilderBid(req *boostTypes.BuilderSubmitBlockRequest, sk *bls.SecretKey, ...) (*boostTypes.SignedBuilderBid, error)
- func CapellaBuilderSubmitBlockRequestToSignedBuilderBid(req *capella.SubmitBlockRequest, sk *bls.SecretKey, pubkey *phase0.BLSPubKey, ...) (*capella.SignedBuilderBid, error)
- func CapellaPayloadToPayloadHeader(p *consensuscapella.ExecutionPayload) (*consensuscapella.ExecutionPayloadHeader, error)
- func ComputeWithdrawalsRoot(w []*capella.Withdrawal) (phase0.Root, error)
- func SanityCheckBuilderBlockSubmission(payload *common.BuilderSubmitBlockRequest) error
- func SendJSONRPCRequest(client *http.Client, req jsonrpc.JSONRPCRequest, url string, isHighPrio bool) (res *jsonrpc.JSONRPCResponse, err error)
- func SignedBlindedBeaconBlockToBeaconBlock(signedBlindedBeaconBlock *common.SignedBlindedBeaconBlock, ...) *common.SignedBeaconBlock
- type BlockSimulationRateLimiter
- type BuilderBlockValidationRequest
- type HTTPErrorResp
- type RelayAPI
- type RelayAPIOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequestClosed = errors.New("request context closed") ErrSimulationFailed = errors.New("simulation failed") )
View Source
var ( ErrMissingLogOpt = errors.New("log parameter is nil") ErrMissingBeaconClientOpt = errors.New("beacon-client is nil") ErrMissingDatastoreOpt = errors.New("proposer datastore is nil") ErrRelayPubkeyMismatch = errors.New("relay pubkey does not match existing one") ErrServerAlreadyStarted = errors.New("server was already started") ErrBuilderAPIWithoutSecretKey = errors.New("cannot start builder API without secret key") ErrMismatchedForkVersions = errors.New("can not find matching fork versions as retrieved from beacon node") ErrMissingForkVersions = errors.New("invalid bellatrix/capella fork version from beacon node") )
View Source
var ( ErrMissingRequest = errors.New("req is nil") ErrMissingSecretKey = errors.New("secret key is nil") ErrEmptyPayload = errors.New("nil payload") ErrInvalidTransaction = errors.New("invalid transaction") )
View Source
var ( ErrBlockHashMismatch = errors.New("blockHash mismatch") ErrParentHashMismatch = errors.New("parentHash mismatch") )
View Source
var NilResponse = struct{}{}
View Source
var VersionBellatrix boostTypes.VersionString = "bellatrix"
View Source
var ZeroU256 = boostTypes.IntToU256(0)
Functions ¶
func BuildGetHeaderResponse ¶
func BuildGetHeaderResponse(payload *common.BuilderSubmitBlockRequest, sk *bls.SecretKey, pubkey *boostTypes.PublicKey, domain boostTypes.Domain) (*common.GetHeaderResponse, error)
func BuildGetPayloadResponse ¶
func BuildGetPayloadResponse(payload *common.BuilderSubmitBlockRequest) (*common.GetPayloadResponse, error)
func BuilderSubmitBlockRequestToSignedBuilderBid ¶
func BuilderSubmitBlockRequestToSignedBuilderBid(req *boostTypes.BuilderSubmitBlockRequest, sk *bls.SecretKey, pubkey *boostTypes.PublicKey, domain boostTypes.Domain) (*boostTypes.SignedBuilderBid, error)
func CapellaBuilderSubmitBlockRequestToSignedBuilderBid ¶
func CapellaBuilderSubmitBlockRequestToSignedBuilderBid(req *capella.SubmitBlockRequest, sk *bls.SecretKey, pubkey *phase0.BLSPubKey, domain boostTypes.Domain) (*capella.SignedBuilderBid, error)
func CapellaPayloadToPayloadHeader ¶
func CapellaPayloadToPayloadHeader(p *consensuscapella.ExecutionPayload) (*consensuscapella.ExecutionPayloadHeader, error)
func ComputeWithdrawalsRoot ¶ added in v0.20.0
func ComputeWithdrawalsRoot(w []*capella.Withdrawal) (phase0.Root, error)
func SanityCheckBuilderBlockSubmission ¶ added in v0.14.0
func SanityCheckBuilderBlockSubmission(payload *common.BuilderSubmitBlockRequest) error
func SendJSONRPCRequest ¶ added in v0.7.0
func SendJSONRPCRequest(client *http.Client, req jsonrpc.JSONRPCRequest, url string, isHighPrio bool) (res *jsonrpc.JSONRPCResponse, err error)
SendJSONRPCRequest sends the request to URL and returns the general JsonRpcResponse, or an error (note: not the JSONRPCError)
func SignedBlindedBeaconBlockToBeaconBlock ¶ added in v0.6.0
func SignedBlindedBeaconBlockToBeaconBlock(signedBlindedBeaconBlock *common.SignedBlindedBeaconBlock, executionPayload *common.VersionedExecutionPayload) *common.SignedBeaconBlock
Types ¶
type BlockSimulationRateLimiter ¶
type BlockSimulationRateLimiter struct {
// contains filtered or unexported fields
}
func NewBlockSimulationRateLimiter ¶
func NewBlockSimulationRateLimiter(blockSimURL string) *BlockSimulationRateLimiter
type BuilderBlockValidationRequest ¶ added in v0.14.0
type BuilderBlockValidationRequest struct { common.BuilderSubmitBlockRequest RegisteredGasLimit uint64 `json:"registered_gas_limit,string"` }
func (*BuilderBlockValidationRequest) MarshalJSON ¶
func (r *BuilderBlockValidationRequest) MarshalJSON() ([]byte, error)
type HTTPErrorResp ¶
type RelayAPI ¶
type RelayAPI struct {
// contains filtered or unexported fields
}
RelayAPI represents a single Relay instance
func NewRelayAPI ¶
func NewRelayAPI(opts RelayAPIOpts) (api *RelayAPI, err error)
NewRelayAPI creates a new service. if builders is nil, allow any builder
func (*RelayAPI) RespondError ¶
func (api *RelayAPI) RespondError(w http.ResponseWriter, code int, message string)
func (*RelayAPI) StartServer ¶
StartServer starts the HTTP server for this instance
func (*RelayAPI) StopServer ¶ added in v0.9.1
StopServer disables sending any bids on getHeader calls, waits a few seconds to catch any remaining getPayload call, and then shuts down the webserver
type RelayAPIOpts ¶
type RelayAPIOpts struct { Log *logrus.Entry ListenAddr string BlockSimURL string BeaconClient beaconclient.IMultiBeaconClient Datastore *datastore.Datastore Redis *datastore.RedisCache Memcached *datastore.Memcached DB database.IDatabaseService SecretKey *bls.SecretKey // used to sign bids (getHeader responses) // Network specific variables EthNetDetails common.EthNetworkDetails // APIs to enable ProposerAPI bool BlockBuilderAPI bool DataAPI bool PprofAPI bool InternalAPI bool }
RelayAPIOpts contains the options for a relay
Click to show internal directories.
Click to hide internal directories.