Documentation ¶
Index ¶
- Constants
- Variables
- func SubmissionToKey(submission *types.BuilderSubmitBlockRequest) structs.PayloadKey
- func SubmitBlockRequestToBlockBidAndTrace(signedBuilderBid *types.SignedBuilderBid, ...) structs.BlockBidAndTrace
- func SubmitBlockRequestToSignedBuilderBid(req *types.BuilderSubmitBlockRequest, sk *bls.SecretKey, ...) (*types.SignedBuilderBid, error)
- func VerifySignature(obj types.HashTreeRoot, d types.Domain, pkBytes, sigBytes []byte) (bool, error)
- func VerifySignatureBytes(msg [32]byte, sigBytes, pkBytes []byte) (ok bool, err error)
- type Auctioneer
- type Datastore
- type ProcessManager
- func (rm *ProcessManager) AttachMetrics(m *metrics.Metrics)
- func (pm *ProcessManager) Close(ctx context.Context)
- func (rm *ProcessManager) Get(k string) (value uint64, ok bool)
- func (rm *ProcessManager) GetVerifyChan(stack uint) chan VerifyReq
- func (rm *ProcessManager) LoadAll(m map[string]uint64)
- func (pm *ProcessManager) ParallelStore(datas Datastore, ttl time.Duration)
- func (rm *ProcessManager) RunCleanup(checkinterval uint64, cleanupInterval time.Duration)
- func (rm *ProcessManager) RunStore(store Datastore, ttl time.Duration, num uint)
- func (rm *ProcessManager) RunVerify(num uint)
- func (rm *ProcessManager) SendStore(request StoreReq)
- func (rm *ProcessManager) Set(k string, value uint64)
- func (rm *ProcessManager) VerifyChan() chan VerifyReq
- func (rm *ProcessManager) VerifyParallel()
- type ProcessManagerMetrics
- type RegistrationManager
- type Relay
- func (r *Relay) AttachMetrics(m *metrics.Metrics)
- func (rs *Relay) GetHeader(ctx context.Context, request structs.HeaderRequest) (*types.GetHeaderResponse, error)
- func (rs *Relay) GetPayload(ctx context.Context, payloadRequest *types.SignedBlindedBeaconBlock) (*types.GetPayloadResponse, error)
- func (rs *Relay) GetValidators() structs.BuilderGetValidatorsResponseEntrySlice
- func (rs *Relay) RegisterValidator(ctx context.Context, payload []structs.SignedValidatorRegistration) (err error)
- func (rs *Relay) SubmitBlock(ctx context.Context, submitBlockRequest *types.BuilderSubmitBlockRequest) error
- type RelayConfig
- type RelayMetrics
- type Resp
- type State
- type StoreReq
- type StoreReqItem
- type StoreResp
- type TimestampRegistry
- type VerifyReq
Constants ¶
const ( ResponseQueueSubmit = iota ResponseQueueRegister ResponseQueueOther )
const ( ResponseTypeVerify = iota ResponseTypeOthers ResponseTypeStored )
const BLST_SUCCESS = 0x0
Variables ¶
Functions ¶
func SubmissionToKey ¶
func SubmissionToKey(submission *types.BuilderSubmitBlockRequest) structs.PayloadKey
func SubmitBlockRequestToBlockBidAndTrace ¶
func SubmitBlockRequestToBlockBidAndTrace(signedBuilderBid *types.SignedBuilderBid, submitBlockRequest *types.BuilderSubmitBlockRequest) structs.BlockBidAndTrace
func SubmitBlockRequestToSignedBuilderBid ¶
func SubmitBlockRequestToSignedBuilderBid(req *types.BuilderSubmitBlockRequest, sk *bls.SecretKey, pubkey *types.PublicKey, domain types.Domain) (*types.SignedBuilderBid, error)
***** Relay Domain ***** SubmitBlockRequestToSignedBuilderBid converts a builders block submission to a bid compatible with mev-boost
func VerifySignature ¶
Types ¶
type Auctioneer ¶ added in v0.3.4
type Auctioneer interface { AddBlock(block *structs.CompleteBlockstruct) bool MaxProfitBlock(slot structs.Slot) (*structs.CompleteBlockstruct, bool) }
type Datastore ¶
type Datastore interface { CheckSlotDelivered(context.Context, uint64) (bool, error) PutDelivered(context.Context, structs.Slot, structs.DeliveredTrace, time.Duration) error GetDelivered(context.Context, structs.PayloadQuery) (structs.BidTraceWithTimestamp, error) PutPayload(context.Context, structs.PayloadKey, *structs.BlockBidAndTrace, time.Duration) error GetPayload(context.Context, structs.PayloadKey) (*structs.BlockBidAndTrace, bool, error) PutHeader(ctx context.Context, hd structs.HeaderData, ttl time.Duration) error CacheBlock(ctx context.Context, block *structs.CompleteBlockstruct) error GetMaxProfitHeader(ctx context.Context, slot uint64) (structs.HeaderAndTrace, error) PutRegistrationRaw(context.Context, structs.PubKey, []byte, time.Duration) error GetRegistration(context.Context, structs.PubKey) (types.SignedValidatorRegistration, error) }
type ProcessManager ¶
type ProcessManager struct { LastRegTime map[string]uint64 // [pubkey]timestamp VerifySubmitBlockCh chan VerifyReq VerifyRegisterValidatorCh chan VerifyReq VerifyOtherCh chan VerifyReq StoreCh chan StoreReq // contains filtered or unexported fields }
func NewProcessManager ¶
func NewProcessManager(l log.Logger, verifySize, storeSize uint) *ProcessManager
func (*ProcessManager) AttachMetrics ¶
func (rm *ProcessManager) AttachMetrics(m *metrics.Metrics)
func (*ProcessManager) Close ¶ added in v0.3.3
func (pm *ProcessManager) Close(ctx context.Context)
func (*ProcessManager) GetVerifyChan ¶
func (rm *ProcessManager) GetVerifyChan(stack uint) chan VerifyReq
func (*ProcessManager) LoadAll ¶
func (rm *ProcessManager) LoadAll(m map[string]uint64)
func (*ProcessManager) ParallelStore ¶
func (pm *ProcessManager) ParallelStore(datas Datastore, ttl time.Duration)
func (*ProcessManager) RunCleanup ¶
func (rm *ProcessManager) RunCleanup(checkinterval uint64, cleanupInterval time.Duration)
func (*ProcessManager) RunStore ¶
func (rm *ProcessManager) RunStore(store Datastore, ttl time.Duration, num uint)
func (*ProcessManager) RunVerify ¶
func (rm *ProcessManager) RunVerify(num uint)
func (*ProcessManager) SendStore ¶ added in v0.3.3
func (rm *ProcessManager) SendStore(request StoreReq)
func (*ProcessManager) Set ¶
func (rm *ProcessManager) Set(k string, value uint64)
func (*ProcessManager) VerifyChan ¶
func (rm *ProcessManager) VerifyChan() chan VerifyReq
func (*ProcessManager) VerifyParallel ¶
func (rm *ProcessManager) VerifyParallel()
type ProcessManagerMetrics ¶
type ProcessManagerMetrics struct { VerifyTiming *prometheus.HistogramVec StoreTiming prometheus.Histogram StoreSize prometheus.Histogram MapSize prometheus.Gauge StoreErrorRate prometheus.Counter RunningWorkers *prometheus.GaugeVec }
type RegistrationManager ¶
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
func NewRelay ¶
func NewRelay(l log.Logger, config RelayConfig, beaconState State, d Datastore, regMngr RegistrationManager, a Auctioneer) *Relay
NewRelay relay service
func (*Relay) AttachMetrics ¶
func (*Relay) GetHeader ¶
func (rs *Relay) GetHeader(ctx context.Context, request structs.HeaderRequest) (*types.GetHeaderResponse, error)
GetHeader is called by a block proposer communicating through mev-boost and returns a bid along with an execution payload header
func (*Relay) GetPayload ¶
func (rs *Relay) GetPayload(ctx context.Context, payloadRequest *types.SignedBlindedBeaconBlock) (*types.GetPayloadResponse, error)
GetPayload is called by a block proposer communicating through mev-boost and reveals execution payload of given signed beacon block if stored
func (*Relay) GetValidators ¶
func (rs *Relay) GetValidators() structs.BuilderGetValidatorsResponseEntrySlice
GetValidators returns a list of registered block proposers in current and next epoch
func (*Relay) RegisterValidator ¶
func (rs *Relay) RegisterValidator(ctx context.Context, payload []structs.SignedValidatorRegistration) (err error)
***** Builder Domain ***** RegisterValidator is called is called by validators communicating through mev-boost who would like to receive a block from us when their slot is scheduled
func (*Relay) SubmitBlock ¶
func (rs *Relay) SubmitBlock(ctx context.Context, submitBlockRequest *types.BuilderSubmitBlockRequest) error
SubmitBlock Accepts block from trusted builder and stores
type RelayConfig ¶
type RelayMetrics ¶
type RelayMetrics struct {
Timing *prometheus.HistogramVec
}
type Resp ¶
Resp respone structure - potential candidate for structure pool as it's almost constant size
type State ¶
type State interface {
Beacon() *structs.BeaconState
}
type StoreReq ¶
type StoreReq struct {
Items []StoreReqItem
}
type StoreReqItem ¶ added in v0.3.3
type StoreReqItem struct { RawPayload json.RawMessage Time uint64 Pubkey types.PublicKey }
StoreReqItem is similar to VerifyReq jsut for storing payloads
type StoreResp ¶ added in v0.3.3
type StoreResp struct {
// contains filtered or unexported fields
}
func (*StoreResp) SuccessfullIndexes ¶ added in v0.3.3
type TimestampRegistry ¶
type VerifyReq ¶
type VerifyReq struct { Signature [96]byte Pubkey [48]byte Msg [32]byte // Unique identifier of payload // if needed to be passed back in response ID int Response *StoreResp }
VerifyReq is a request structure used in communication between api calls and fixed set of worker goroutines it's using return channel pattern, meaning that after sent the sender locks on that channel to get the response