Documentation
¶
Index ¶
- Constants
- Variables
- type BeaconState
- func (s *BeaconState) HeadSlot() Slot
- func (s *BeaconState) IsKnownValidator(pk types.PubkeyHex) (bool, error)
- func (s *BeaconState) KnownValidatorByIndex(index uint64) (types.PubkeyHex, error)
- func (s *BeaconState) KnownValidators() map[types.PubkeyHex]struct{}
- func (s *BeaconState) ValidatorsMap() BuilderGetValidatorsResponseEntrySlice
- type BidTraceExtended
- type BidTraceWithTimestamp
- type BlockBidAndTrace
- type BuilderBid
- type BuilderGetValidatorsResponseEntrySlice
- type CompleteBlockstruct
- type DeliveredTrace
- type DutiesState
- type Epoch
- type ExecutionPayload
- type ExecutionPayloadHeader
- type ForkState
- type ForkVersion
- type GenesisInfo
- type GetHeaderResponse
- type GetPayloadResponse
- type HashWithdrawals
- type HeaderAndTrace
- type HeaderData
- type HeaderRequest
- type HeaderTraceQuery
- type MetricGroup
- type PayloadKey
- type PayloadQuery
- type PayloadTraceQuery
- type PrometheusObserver
- type PubKey
- type RandaoState
- type SignedBeaconBlock
- type SignedBlindedBeaconBlock
- type SignedBuilderBid
- type Slot
- type SubmissionTraceQuery
- type SubmitBlockRequest
- type ValidatorCacheEntry
- type ValidatorsState
- type Withdrawal
- type Withdrawals
- type WithdrawalsState
Constants ¶
const ( SlotsPerEpoch Slot = 32 DurationPerSlot = time.Second * 12 DurationPerEpoch = DurationPerSlot * time.Duration(SlotsPerEpoch) )
Variables ¶
var ErrUnknownValue = errors.New("value is unknown")
Functions ¶
This section is empty.
Types ¶
type BeaconState ¶
type BeaconState struct {
DutiesState
ValidatorsState
GenesisInfo
}
func (*BeaconState) HeadSlot ¶
func (s *BeaconState) HeadSlot() Slot
func (*BeaconState) IsKnownValidator ¶
func (s *BeaconState) IsKnownValidator(pk types.PubkeyHex) (bool, error)
func (*BeaconState) KnownValidatorByIndex ¶
func (s *BeaconState) KnownValidatorByIndex(index uint64) (types.PubkeyHex, error)
func (*BeaconState) KnownValidators ¶
func (s *BeaconState) KnownValidators() map[types.PubkeyHex]struct{}
func (*BeaconState) ValidatorsMap ¶
func (s *BeaconState) ValidatorsMap() BuilderGetValidatorsResponseEntrySlice
type BidTraceExtended ¶
type BidTraceWithTimestamp ¶
type BidTraceWithTimestamp struct {
BidTraceExtended
Timestamp uint64 `json:"timestamp,string"`
TimestampMs uint64 `json:"timestamp_ms,string"`
}
type BlockBidAndTrace ¶
type BuilderBid ¶
type BuilderGetValidatorsResponseEntrySlice ¶
type BuilderGetValidatorsResponseEntrySlice []types.BuilderGetValidatorsResponseEntry
func (BuilderGetValidatorsResponseEntrySlice) Loggable ¶
func (b BuilderGetValidatorsResponseEntrySlice) Loggable() map[string]any
type CompleteBlockstruct ¶
type CompleteBlockstruct struct {
Header HeaderAndTrace
Payload BlockBidAndTrace
}
/ That's to be improved in future
type DeliveredTrace ¶
type DeliveredTrace struct {
Trace BidTraceWithTimestamp
BlockNumber uint64
}
type DutiesState ¶
type DutiesState struct {
CurrentSlot Slot
ProposerDutiesResponse BuilderGetValidatorsResponseEntrySlice
}
type ExecutionPayload ¶
type ExecutionPayload interface {
ParentHash() types.Hash
FeeRecipient() types.Address
StateRoot() types.Root
ReceiptsRoot() types.Root
LogsBloom() types.Bloom
Random() types.Hash
BlockNumber() uint64
GasLimit() uint64
GasUsed() uint64
Timestamp() uint64
ExtraData() types.ExtraData
BaseFeePerGas() types.U256Str
BlockHash() types.Hash
Transactions() []hexutil.Bytes
}
type ExecutionPayloadHeader ¶
type ForkState ¶
func (ForkState) IsBellatrix ¶
func (ForkState) Version ¶
func (fs ForkState) Version(slot Slot) ForkVersion
type ForkVersion ¶
type ForkVersion uint8
const ( ForkUnknown ForkVersion = iota ForkAltair ForkBellatrix ForkCapella )
func (ForkVersion) String ¶
func (v ForkVersion) String() string
type GenesisInfo ¶
type GetHeaderResponse ¶
type GetHeaderResponse interface {
Version() types.VersionString
Data() SignedBuilderBid
}
type GetPayloadResponse ¶
type GetPayloadResponse interface {
Data() ExecutionPayload
}
type HashWithdrawals ¶
type HashWithdrawals struct {
Withdrawals Withdrawals `ssz-max:"16"`
}
Withdrawal provides information about a withdrawal.
func (*HashWithdrawals) GetTree ¶
func (w *HashWithdrawals) GetTree() (*ssz.Node, error)
GetTree ssz hashes the Withdrawals object
func (*HashWithdrawals) HashTreeRoot ¶
func (w *HashWithdrawals) HashTreeRoot() ([32]byte, error)
HashTreeRoot ssz hashes the Withdrawals object
func (*HashWithdrawals) HashTreeRootWith ¶
func (w *HashWithdrawals) HashTreeRootWith(hh ssz.HashWalker) (err error)
HashTreeRootWith ssz hashes the Withdrawals object with a hasher
func (*HashWithdrawals) SizeSSZ ¶
func (w *HashWithdrawals) SizeSSZ() (size int)
SizeSSZ returns the ssz encoded size in bytes for the Withdrawals object
type HeaderAndTrace ¶
type HeaderAndTrace struct {
Header ExecutionPayloadHeader
Trace BidTraceWithTimestamp
}
type HeaderData ¶
type HeaderData struct {
HeaderAndTrace
Slot Slot
Marshaled []byte `json:"-"`
}
/ extra
func (*HeaderData) UnmarshalJSON ¶
func (hd *HeaderData) UnmarshalJSON(b []byte) error
type HeaderRequest ¶
func (HeaderRequest) ParentHash ¶
func (hr HeaderRequest) ParentHash() (types.Hash, error)
func (HeaderRequest) Pubkey ¶
func (hr HeaderRequest) Pubkey() (PubKey, error)
func (HeaderRequest) Slot ¶
func (hr HeaderRequest) Slot() (Slot, error)
type HeaderTraceQuery ¶
HeaderTraceQuery structure used to query header structure
func (HeaderTraceQuery) HasBlockHash ¶
func (q HeaderTraceQuery) HasBlockHash() bool
func (HeaderTraceQuery) HasBlockNum ¶
func (q HeaderTraceQuery) HasBlockNum() bool
func (HeaderTraceQuery) HasLimit ¶
func (q HeaderTraceQuery) HasLimit() bool
func (HeaderTraceQuery) HasSlot ¶
func (q HeaderTraceQuery) HasSlot() bool
type MetricGroup ¶
type MetricGroup struct {
// contains filtered or unexported fields
}
func NewMetricGroup ¶
func NewMetricGroup(num int) *MetricGroup
func (*MetricGroup) AppendSince ¶
func (mg *MetricGroup) AppendSince(t time.Time, labels ...string)
func (*MetricGroup) Observe ¶
func (mg *MetricGroup) Observe(t PrometheusObserver)
func (*MetricGroup) ObserveWithError ¶
func (mg *MetricGroup) ObserveWithError(t PrometheusObserver, err error)
type PayloadKey ¶
func (PayloadKey) Loggable ¶
func (k PayloadKey) Loggable() map[string]any
type PayloadQuery ¶
type PayloadTraceQuery ¶
type PayloadTraceQuery struct {
Slot Slot
BlockHash types.Hash
BlockNum uint64
Pubkey types.PublicKey
Cursor, Limit uint64
}
PayloadTraceQuery structure used to query payloads only
func (PayloadTraceQuery) HasBlockHash ¶
func (q PayloadTraceQuery) HasBlockHash() bool
func (PayloadTraceQuery) HasBlockNum ¶
func (q PayloadTraceQuery) HasBlockNum() bool
func (PayloadTraceQuery) HasCursor ¶
func (q PayloadTraceQuery) HasCursor() bool
func (PayloadTraceQuery) HasLimit ¶
func (q PayloadTraceQuery) HasLimit() bool
func (PayloadTraceQuery) HasPubkey ¶
func (q PayloadTraceQuery) HasPubkey() bool
func (PayloadTraceQuery) HasSlot ¶
func (q PayloadTraceQuery) HasSlot() bool
type PrometheusObserver ¶
type PrometheusObserver interface {
WithLabelValues(lvs ...string) prometheus.Observer
}
type RandaoState ¶ added in v0.4.2
type SignedBeaconBlock ¶
type SignedBlindedBeaconBlock ¶
type SignedBlindedBeaconBlock interface {
Slot() uint64
BlockHash() types.Hash
BlockNumber() uint64
ProposerIndex() uint64
Signature() types.Signature
ComputeSigningRoot(d types.Domain) ([32]byte, error)
ToBeaconBlock(executionPayload ExecutionPayload) (SignedBeaconBlock, error)
ToPayloadKey(pk types.PublicKey) (PayloadKey, error)
ExecutionHeaderHash() (types.Hash, error)
}
type SignedBuilderBid ¶
SignedBuilderBid https://github.com/ethereum/builder-specs/pull/2/files#diff-b37cbf48e8754483e30e7caaadc5defc8c3c6e1aaf3273ee188d787b7c75d993
type SubmissionTraceQuery ¶
SubmissionTraceQuery structure used to query header structure
func (SubmissionTraceQuery) HasBlockHash ¶
func (q SubmissionTraceQuery) HasBlockHash() bool
func (SubmissionTraceQuery) HasBlockNum ¶
func (q SubmissionTraceQuery) HasBlockNum() bool
func (SubmissionTraceQuery) HasLimit ¶
func (q SubmissionTraceQuery) HasLimit() bool
func (SubmissionTraceQuery) HasSlot ¶
func (q SubmissionTraceQuery) HasSlot() bool
type SubmitBlockRequest ¶
type SubmitBlockRequest interface {
Slot() uint64
BlockHash() types.Hash
ParentHash() types.Hash
TraceBlockHash() types.Hash
TraceParentHash() types.Hash
BuilderPubkey() types.PublicKey
ProposerPubkey() types.PublicKey
ProposerFeeRecipient() types.Address
Value() types.U256Str
Signature() types.Signature
Timestamp() uint64
Random() types.Hash
Withdrawals() Withdrawals
NumTx() uint64
ComputeSigningRoot(d types.Domain) ([32]byte, error)
ToPayloadKey() PayloadKey
PreparePayloadContents(sk *bls.SecretKey, pubkey *types.PublicKey, domain types.Domain) (cbs CompleteBlockstruct, err error)
}
type ValidatorCacheEntry ¶
type ValidatorCacheEntry struct {
Time time.Time
Entry types.SignedValidatorRegistration
}
type ValidatorsState ¶
type Withdrawal ¶
type Withdrawal struct {
Index uint64 `json:"index,string"`
ValidatorIndex uint64 `json:"validator_index,string"`
Address types.Address `json:"address" ssz-size:"20"`
Amount uint64 `json:"amount,string"`
}
Withdrawal provides information about a withdrawal.
func (*Withdrawal) GetTree ¶
func (w *Withdrawal) GetTree() (*ssz.Node, error)
GetTree ssz hashes the Withdrawal object
func (*Withdrawal) HashTreeRoot ¶
func (w *Withdrawal) HashTreeRoot() ([32]byte, error)
HashTreeRoot ssz hashes the Withdrawal object
func (*Withdrawal) HashTreeRootWith ¶
func (w *Withdrawal) HashTreeRootWith(hh ssz.HashWalker) (err error)
HashTreeRootWith ssz hashes the Withdrawal object with a hasher
type Withdrawals ¶
type Withdrawals []*Withdrawal
Withdrawal provides information about a withdrawal.