Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeDomain(domainType types.DomainType, forkVersionHex string, ...) (domain types.Domain, err error)
- func Max[T constraints.Ordered](args ...T) T
- func NewBeaconClient(endpoint string, config Config) (*beaconClient, error)
- type AllValidatorsResponse
- type AtomicState
- type BeaconClient
- type Config
- type Datastore
- type ErrBadProposer
- type GenesisResponse
- type GetValidatorRelayResponse
- type HeadEvent
- type MultiBeaconClient
- func (b *MultiBeaconClient) Endpoint() string
- func (b *MultiBeaconClient) Genesis() (genesisInfo structs.GenesisInfo, err error)
- func (b *MultiBeaconClient) GetProposerDuties(epoch structs.Epoch) (*RegisteredProposersResponse, error)
- func (b *MultiBeaconClient) KnownValidators(headSlot structs.Slot) (AllValidatorsResponse, error)
- func (b *MultiBeaconClient) SubscribeToHeadEvents(ctx context.Context, slotC chan HeadEvent)
- func (b *MultiBeaconClient) SyncStatus() (*SyncStatusPayloadData, error)
- type Network
- type RegisteredProposersResponse
- type RegisteredProposersResponseData
- type Relay
- type Service
- func (ds *Service) AttachMetrics(m *metrics.Metrics)
- func (s *Service) GetBlockReceived(ctx context.Context, query structs.HeaderTraceQuery) ([]structs.BidTraceWithTimestamp, error)
- func (s *Service) GetHeader(ctx context.Context, request structs.HeaderRequest) (*types.GetHeaderResponse, error)
- func (s *Service) GetPayload(ctx context.Context, payloadRequest *types.SignedBlindedBeaconBlock) (*types.GetPayloadResponse, error)
- func (s *Service) GetPayloadDelivered(ctx context.Context, query structs.PayloadTraceQuery) ([]structs.BidTraceExtended, error)
- func (s *Service) GetValidators() structs.BuilderGetValidatorsResponseEntrySlice
- func (s *Service) Ready() <-chan struct{}
- func (s *Service) RegisterValidator(ctx context.Context, payload []structs.SignedValidatorRegistration) error
- func (s *Service) RegisterValidatorSingular(ctx context.Context, payload structs.SignedValidatorRegistration) error
- func (s *Service) Registration(ctx context.Context, pk types.PublicKey) (types.SignedValidatorRegistration, error)
- func (s *Service) RunBeacon(ctx context.Context) (err error)
- func (s *Service) SubmitBlock(ctx context.Context, submitBlockRequest *types.BuilderSubmitBlockRequest) error
- type ServiceMetrics
- type SyncStatusPayload
- type SyncStatusPayloadData
- type UserAgent
- type ValidatorResponseEntry
- type ValidatorResponseValidatorData
Constants ¶
View Source
const ( GenesisForkVersionMainnet = "0x00000000" GenesisForkVersionKiln = "0x70000069" // https://github.com/eth-clients/merge-testnets/blob/main/kiln/config.yaml#L10 GenesisForkVersionRopsten = "0x80000069" GenesisForkVersionSepolia = "0x90000069" GenesisForkVersionGoerli = "0x00001020" // https://github.com/eth-clients/merge-testnets/blob/main/goerli-shadow-fork-5/config.yaml#L11 GenesisValidatorsRootMainnet = "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95" GenesisValidatorsRootKiln = "0x99b09fcd43e5905236c370f184056bec6e6638cfc31a323b304fc4aa789cb4ad" GenesisValidatorsRootRopsten = "0x44f1e56283ca88b35c789f7f449e52339bc1fefe3a45913a43a6d16edcd33cf1" GenesisValidatorsRootSepolia = "0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078" GenesisValidatorsRootGoerli = "0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb" BellatrixForkVersionMainnet = "0x02000000" BellatrixForkVersionKiln = "0x70000071" BellatrixForkVersionRopsten = "0x80000071" BellatrixForkVersionSepolia = "0x90000071" BellatrixForkVersionGoerli = "0x02001020" )
View Source
const (
Version = "0.2.8"
)
Variables ¶
View Source
var ( DurationPerSlot = time.Second * 12 DurationPerEpoch = DurationPerSlot * time.Duration(structs.SlotsPerEpoch) ErrHTTPErrorResponse = errors.New("got an HTTP error response") )
View Source
var (
ErrBeaconNodeSyncing = errors.New("beacon node is syncing")
)
Functions ¶
func ComputeDomain ¶
func ComputeDomain(domainType types.DomainType, forkVersionHex string, genesisValidatorsRootHex string) (domain types.Domain, err error)
ComputeDomain computes the signing domain
func Max ¶ added in v0.1.5
func Max[T constraints.Ordered](args ...T) T
func NewBeaconClient ¶
Types ¶
type AllValidatorsResponse ¶
type AllValidatorsResponse struct {
Data []ValidatorResponseEntry
}
AllValidatorsResponse is the response for querying active validators
type AtomicState ¶ added in v0.3.0
type AtomicState struct {
// contains filtered or unexported fields
}
func (*AtomicState) Beacon ¶ added in v0.3.0
func (as *AtomicState) Beacon() *structs.BeaconState
type BeaconClient ¶
type BeaconClient interface {
SubscribeToHeadEvents(ctx context.Context, slotC chan HeadEvent)
GetProposerDuties(structs.Epoch) (*RegisteredProposersResponse, error)
SyncStatus() (*SyncStatusPayloadData, error)
KnownValidators(structs.Slot) (AllValidatorsResponse, error)
Genesis() (structs.GenesisInfo, error)
Endpoint() string
}
func NewMultiBeaconClient ¶ added in v0.1.2
func NewMultiBeaconClient(l log.Logger, clients []BeaconClient) BeaconClient
type Config ¶
type Config struct {
Log log.Logger
BuilderURLs []string
Network string
RelayRequestTimeout time.Duration
BuilderCheck bool
BeaconEndpoints []string
PubKey types.PublicKey
SecretKey *bls.SecretKey
Datadir string
TTL time.Duration
RelayQueueProcessingSize uint64
RelayHeaderMemorySlotLag uint64
RelayHeaderMemorySlotTimeLag time.Duration
RelayHeaderMemoryPurgeInterval time.Duration
GenesisForkVersion string
GenesisValidatorsRoot string
BellatrixForkVersion string
// contains filtered or unexported fields
}
Config provides all available options for the default BeaconClient and Relay
type Datastore ¶
type Datastore interface {
GetHeadersBySlot(ctx context.Context, slot uint64) ([]structs.HeaderAndTrace, error)
GetHeadersByBlockHash(ctx context.Context, hash types.Hash) ([]structs.HeaderAndTrace, error)
GetHeadersByBlockNum(ctx context.Context, num uint64) ([]structs.HeaderAndTrace, error)
GetLatestHeaders(ctx context.Context, limit uint64, stopLag uint64) ([]structs.HeaderAndTrace, error)
PutDelivered(context.Context, structs.Slot, structs.DeliveredTrace, time.Duration) error
GetDelivered(context.Context, structs.PayloadQuery) (structs.BidTraceWithTimestamp, error)
GetDeliveredBatch(context.Context, []structs.PayloadQuery) ([]structs.BidTraceWithTimestamp, error)
PutPayload(context.Context, structs.PayloadKey, *structs.BlockBidAndTrace, time.Duration) error
GetPayload(context.Context, structs.PayloadKey) (*structs.BlockBidAndTrace, error)
PutRegistrationRaw(context.Context, structs.PubKey, []byte, time.Duration) error
GetRegistration(context.Context, structs.PubKey) (types.SignedValidatorRegistration, error)
}
type ErrBadProposer ¶
func (ErrBadProposer) Error ¶
func (ErrBadProposer) Error() string
type GenesisResponse ¶ added in v0.2.7
type GenesisResponse struct {
Data structs.GenesisInfo
}
type GetValidatorRelayResponse ¶
type GetValidatorRelayResponse []struct {
Slot uint64 `json:"slot,string"`
Entry struct {
Message struct {
FeeRecipient string `json:"fee_recipient"`
GasLimit uint64 `json:"gas_limit,string"`
Timestamp uint64 `json:"timestamp,string"`
PubKey string `json:"pubkey"`
} `json:"message"`
Signature string `json:"signature"`
} `json:"entry"`
}
type HeadEvent ¶
type HeadEvent struct {
Slot uint64 `json:"slot,string"`
Block string `json:"block"`
State string `json:"state"`
}
HeadEvent is emitted when subscribing to head events
type MultiBeaconClient ¶ added in v0.1.2
type MultiBeaconClient struct {
Log log.Logger
Clients []BeaconClient
// contains filtered or unexported fields
}
func (*MultiBeaconClient) Endpoint ¶ added in v0.1.2
func (b *MultiBeaconClient) Endpoint() string
func (*MultiBeaconClient) Genesis ¶ added in v0.2.7
func (b *MultiBeaconClient) Genesis() (genesisInfo structs.GenesisInfo, err error)
func (*MultiBeaconClient) GetProposerDuties ¶ added in v0.1.2
func (b *MultiBeaconClient) GetProposerDuties(epoch structs.Epoch) (*RegisteredProposersResponse, error)
func (*MultiBeaconClient) KnownValidators ¶ added in v0.1.2
func (b *MultiBeaconClient) KnownValidators(headSlot structs.Slot) (AllValidatorsResponse, error)
func (*MultiBeaconClient) SubscribeToHeadEvents ¶ added in v0.1.2
func (b *MultiBeaconClient) SubscribeToHeadEvents(ctx context.Context, slotC chan HeadEvent)
func (*MultiBeaconClient) SyncStatus ¶ added in v0.1.2
func (b *MultiBeaconClient) SyncStatus() (*SyncStatusPayloadData, error)
type RegisteredProposersResponse ¶
type RegisteredProposersResponse struct {
Data []RegisteredProposersResponseData
}
RegisteredProposersResponse is the response for querying proposer duties
type Relay ¶
type Relay interface {
// Proposer APIs
RegisterValidatorSingular(context.Context, structs.SignedValidatorRegistration) error
RegisterValidator(context.Context, []structs.SignedValidatorRegistration) error
GetHeader(context.Context, structs.HeaderRequest) (*types.GetHeaderResponse, error)
GetPayload(context.Context, *types.SignedBlindedBeaconBlock) (*types.GetPayloadResponse, error)
// Builder APIs
SubmitBlock(context.Context, *types.BuilderSubmitBlockRequest) error
GetValidators() structs.BuilderGetValidatorsResponseEntrySlice
AttachMetrics(m *metrics.Metrics)
}
type Service ¶ added in v0.3.0
type Service struct {
Log log.Logger
Config Config
Relay Relay
Datastore Datastore
NewBeaconClient func() (BeaconClient, error)
// contains filtered or unexported fields
}
func NewService ¶ added in v0.3.0
func (*Service) AttachMetrics ¶ added in v0.3.0
func (*Service) GetBlockReceived ¶ added in v0.3.0
func (s *Service) GetBlockReceived(ctx context.Context, query structs.HeaderTraceQuery) ([]structs.BidTraceWithTimestamp, error)
func (*Service) GetHeader ¶ added in v0.3.0
func (s *Service) GetHeader(ctx context.Context, request structs.HeaderRequest) (*types.GetHeaderResponse, error)
func (*Service) GetPayload ¶ added in v0.3.0
func (s *Service) GetPayload(ctx context.Context, payloadRequest *types.SignedBlindedBeaconBlock) (*types.GetPayloadResponse, error)
func (*Service) GetPayloadDelivered ¶ added in v0.3.0
func (s *Service) GetPayloadDelivered(ctx context.Context, query structs.PayloadTraceQuery) ([]structs.BidTraceExtended, error)
func (*Service) GetValidators ¶ added in v0.3.0
func (s *Service) GetValidators() structs.BuilderGetValidatorsResponseEntrySlice
func (*Service) RegisterValidator ¶ added in v0.3.0
func (*Service) RegisterValidatorSingular ¶ added in v0.3.0
func (*Service) Registration ¶ added in v0.3.0
func (*Service) RunBeacon ¶ added in v0.3.0
Run creates a relay, datastore and starts the beacon client event loop
func (*Service) SubmitBlock ¶ added in v0.3.0
type ServiceMetrics ¶ added in v0.3.0
type ServiceMetrics struct {
}
type SyncStatusPayload ¶
type SyncStatusPayload struct {
Data SyncStatusPayloadData
}
SyncStatusPayload is the response payload for /eth/v1/node/syncing
type SyncStatusPayloadData ¶
type ValidatorResponseEntry ¶
type ValidatorResponseEntry struct {
Index uint64 `json:"index,string"` // Index of validator in validator registry.
Balance string `json:"balance"` // Current validator balance in gwei.
Status string `json:"status"`
Validator ValidatorResponseValidatorData `json:"validator"`
}
type ValidatorResponseValidatorData ¶
type ValidatorResponseValidatorData struct {
Pubkey string `json:"pubkey"`
}
Directories
¶
| Path | Synopsis |
|---|---|
|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.