Documentation
¶
Index ¶
- func ForkchoiceUpdateErr(payloadStatus PayloadStatusV1) error
- func NewPayloadErr(payload *ExecutionPayload, payloadStatus *PayloadStatusV1) error
- func WatchHeadChanges(ctx context.Context, src NewHeadSource, fn HeadSignalFn) (ethereum.Subscription, error)
- type BlockID
- type Bytes256
- type Bytes32
- type BytesMax32
- type Data
- type ErrorCode
- type ExecutePayloadStatus
- type ExecutionPayload
- func (payload *ExecutionPayload) CheckBlockHash() (actual common.Hash, ok bool)
- func (payload *ExecutionPayload) ID() BlockID
- func (payload *ExecutionPayload) MarshalSSZ(w io.Writer) (n int, err error)
- func (payload *ExecutionPayload) ParentID() BlockID
- func (payload *ExecutionPayload) SizeSSZ() (full uint32)
- func (payload *ExecutionPayload) UnmarshalSSZ(scope uint32, r io.Reader) error
- type ForkchoiceState
- type ForkchoiceUpdatedResult
- type HeadSignalFn
- type L1BlockRef
- type L1Info
- type L2BlockRef
- type NewHeadSource
- type PayloadAttributes
- type PayloadID
- type PayloadStatusV1
- type Uint256Quantity
- type Uint64Quantity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForkchoiceUpdateErr ¶
func ForkchoiceUpdateErr(payloadStatus PayloadStatusV1) error
func NewPayloadErr ¶
func NewPayloadErr(payload *ExecutionPayload, payloadStatus *PayloadStatusV1) error
func WatchHeadChanges ¶
func WatchHeadChanges(ctx context.Context, src NewHeadSource, fn HeadSignalFn) (ethereum.Subscription, error)
WatchHeadChanges wraps a new-head subscription from NewHeadSource to feed the given Tracker
Types ¶
type BlockID ¶
func (BlockID) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type Bytes256 ¶
type Bytes256 [256]byte
func (Bytes256) MarshalText ¶
func (Bytes256) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes256) UnmarshalJSON ¶
func (*Bytes256) UnmarshalText ¶
type Bytes32 ¶
type Bytes32 [32]byte
func (Bytes32) MarshalText ¶
func (Bytes32) TerminalString ¶
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
func (*Bytes32) UnmarshalJSON ¶
func (*Bytes32) UnmarshalText ¶
type BytesMax32 ¶
type BytesMax32 []byte
func (BytesMax32) MarshalText ¶
func (b BytesMax32) MarshalText() ([]byte, error)
func (BytesMax32) String ¶
func (b BytesMax32) String() string
func (*BytesMax32) UnmarshalJSON ¶
func (b *BytesMax32) UnmarshalJSON(text []byte) error
func (*BytesMax32) UnmarshalText ¶
func (b *BytesMax32) UnmarshalText(text []byte) error
type ExecutePayloadStatus ¶
type ExecutePayloadStatus string
const ( // given payload is valid ExecutionValid ExecutePayloadStatus = "VALID" // given payload is invalid ExecutionInvalid ExecutePayloadStatus = "INVALID" // sync process is in progress ExecutionSyncing ExecutePayloadStatus = "SYNCING" // returned if the payload is not fully validated, and does not extend the canonical chain, // but will be remembered for later (on reorgs or sync updates and such) ExecutionAccepted ExecutePayloadStatus = "ACCEPTED" // if the block-hash in the payload is not correct ExecutionInvalidBlockHash ExecutePayloadStatus = "INVALID_BLOCK_HASH" // proof-of-stake transition only, not used in rollup ExecutionInvalidTerminalBlock ExecutePayloadStatus = "INVALID_TERMINAL_BLOCK" )
type ExecutionPayload ¶
type ExecutionPayload struct {
ParentHash common.Hash `json:"parentHash"`
FeeRecipient common.Address `json:"feeRecipient"`
StateRoot Bytes32 `json:"stateRoot"`
ReceiptsRoot Bytes32 `json:"receiptsRoot"`
LogsBloom Bytes256 `json:"logsBloom"`
PrevRandao Bytes32 `json:"prevRandao"`
BlockNumber Uint64Quantity `json:"blockNumber"`
GasLimit Uint64Quantity `json:"gasLimit"`
GasUsed Uint64Quantity `json:"gasUsed"`
Timestamp Uint64Quantity `json:"timestamp"`
ExtraData BytesMax32 `json:"extraData"`
BaseFeePerGas Uint256Quantity `json:"baseFeePerGas"`
BlockHash common.Hash `json:"blockHash"`
// Array of transaction objects, each object is a byte list (DATA) representing
// TransactionType || TransactionPayload or LegacyTransaction as defined in EIP-2718
Transactions []Data `json:"transactions"`
}
func BlockAsPayload ¶
func BlockAsPayload(bl *types.Block) (*ExecutionPayload, error)
func (*ExecutionPayload) CheckBlockHash ¶
func (payload *ExecutionPayload) CheckBlockHash() (actual common.Hash, ok bool)
CheckBlockHash recomputes the block hash and returns if the embedded block hash matches.
func (*ExecutionPayload) ID ¶
func (payload *ExecutionPayload) ID() BlockID
func (*ExecutionPayload) MarshalSSZ ¶
func (payload *ExecutionPayload) MarshalSSZ(w io.Writer) (n int, err error)
MarshalSSZ encodes the ExecutionPayload as SSZ type
func (*ExecutionPayload) ParentID ¶
func (payload *ExecutionPayload) ParentID() BlockID
func (*ExecutionPayload) SizeSSZ ¶
func (payload *ExecutionPayload) SizeSSZ() (full uint32)
func (*ExecutionPayload) UnmarshalSSZ ¶
func (payload *ExecutionPayload) UnmarshalSSZ(scope uint32, r io.Reader) error
UnmarshalSSZ decodes the ExecutionPayload as SSZ type
type ForkchoiceState ¶
type ForkchoiceState struct {
// block hash of the head of the canonical chain
HeadBlockHash common.Hash `json:"headBlockHash"`
// safe block hash in the canonical chain
SafeBlockHash common.Hash `json:"safeBlockHash"`
// block hash of the most recent finalized block
FinalizedBlockHash common.Hash `json:"finalizedBlockHash"`
}
type ForkchoiceUpdatedResult ¶
type ForkchoiceUpdatedResult struct {
// the result of the payload execution
PayloadStatus PayloadStatusV1 `json:"payloadStatus"`
// the payload id if requested
PayloadID *PayloadID `json:"payloadId"`
}
type HeadSignalFn ¶
type HeadSignalFn func(ctx context.Context, sig L1BlockRef)
HeadSignalFn is used as callback function to accept head-signals
type L1BlockRef ¶
type L1BlockRef struct {
Hash common.Hash `json:"hash"`
Number uint64 `json:"number"`
ParentHash common.Hash `json:"parentHash"`
Time uint64 `json:"timestamp"`
}
func (L1BlockRef) ID ¶
func (id L1BlockRef) ID() BlockID
func (L1BlockRef) ParentID ¶
func (id L1BlockRef) ParentID() BlockID
func (L1BlockRef) String ¶
func (id L1BlockRef) String() string
func (L1BlockRef) TerminalString ¶
func (id L1BlockRef) TerminalString() string
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type L1Info ¶ added in v0.3.0
type L1Info interface {
Hash() common.Hash
ParentHash() common.Hash
Root() common.Hash // state-root
NumberU64() uint64
Time() uint64
// MixDigest field, reused for randomness after The Merge (Bellatrix hardfork)
MixDigest() common.Hash
BaseFee() *big.Int
ID() BlockID
BlockRef() L1BlockRef
ReceiptHash() common.Hash
}
type L2BlockRef ¶
type L2BlockRef struct {
Hash common.Hash `json:"hash"`
Number uint64 `json:"number"`
ParentHash common.Hash `json:"parentHash"`
Time uint64 `json:"timestamp"`
L1Origin BlockID `json:"l1origin"`
SequenceNumber uint64 `json:"sequenceNumber"` // distance to first block of epoch
}
func (L2BlockRef) ID ¶
func (id L2BlockRef) ID() BlockID
func (L2BlockRef) ParentID ¶
func (id L2BlockRef) ParentID() BlockID
func (L2BlockRef) String ¶
func (id L2BlockRef) String() string
func (L2BlockRef) TerminalString ¶
func (id L2BlockRef) TerminalString() string
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type NewHeadSource ¶
type PayloadAttributes ¶
type PayloadAttributes struct {
// value for the timestamp field of the new payload
Timestamp Uint64Quantity `json:"timestamp"`
// value for the random field of the new payload
PrevRandao Bytes32 `json:"prevRandao"`
// suggested value for the coinbase field of the new payload
SuggestedFeeRecipient common.Address `json:"suggestedFeeRecipient"`
// Transactions to force into the block (always at the start of the transactions list).
Transactions []Data `json:"transactions,omitempty"`
// NoTxPool to disable adding any transactions from the transaction-pool.
NoTxPool bool `json:"noTxPool,omitempty"`
}
type PayloadStatusV1 ¶
type PayloadStatusV1 struct {
// the result of the payload execution
Status ExecutePayloadStatus `json:"status"`
// the hash of the most recent valid block in the branch defined by payload and its ancestors (optional field)
LatestValidHash *common.Hash `json:"latestValidHash,omitempty"`
// additional details on the result (optional field)
ValidationError *string `json:"validationError,omitempty"`
}