Documentation
¶
Overview ¶
Package catalyst implements the temporary eth1/eth2 RPC integration.
Index ¶
- Variables
- func ExecutableDataToBlock(params ExecutableDataV1) (*types.Block, error)
- func Register(stack *node.Node, backend *eth.Ethereum) error
- func RegisterLight(stack *node.Node, backend *les.LightEthereum) error
- type ConsensusAPI
- func (api *ConsensusAPI) ExecutePayloadV1(params ExecutableDataV1) (ExecutePayloadResponse, error)
- func (api *ConsensusAPI) ForkchoiceUpdatedV1(heads ForkchoiceStateV1, PayloadAttributes *PayloadAttributesV1) (ForkChoiceResponse, error)
- func (api *ConsensusAPI) GetPayloadV1(payloadID hexutil.Bytes) (*ExecutableDataV1, error)
- type ConsensusValidatedParams
- type ExecutableDataV1
- type ExecutePayloadResponse
- type ForkChoiceResponse
- type ForkchoiceStateV1
- type GenericResponse
- type GenericStringResponse
- type NewBlockResponse
- type PayloadAttributesV1
- type PayloadResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( VALID = GenericStringResponse{"VALID"} SUCCESS = GenericStringResponse{"SUCCESS"} INVALID = ForkChoiceResponse{Status: "INVALID", PayloadID: nil} SYNCING = ForkChoiceResponse{Status: "SYNCING", PayloadID: nil} GenericServerError = rpc.CustomError{Code: -32000, ValidationError: "Server error"} UnknownPayload = rpc.CustomError{Code: -32001, ValidationError: "Unknown payload"} InvalidTB = rpc.CustomError{Code: -32002, ValidationError: "Invalid terminal block"} InvalidPayloadID = rpc.CustomError{Code: 1, ValidationError: "invalid payload id"} )
Functions ¶
func ExecutableDataToBlock ¶ added in v1.10.14
func ExecutableDataToBlock(params ExecutableDataV1) (*types.Block, error)
func RegisterLight ¶ added in v1.10.14
func RegisterLight(stack *node.Node, backend *les.LightEthereum) error
RegisterLight adds catalyst APIs to the light client.
Types ¶
type ConsensusAPI ¶ added in v1.10.14
type ConsensusAPI struct {
// contains filtered or unexported fields
}
func NewConsensusAPI ¶ added in v1.10.14
func NewConsensusAPI(eth *eth.Ethereum, les *les.LightEthereum) *ConsensusAPI
func (*ConsensusAPI) ExecutePayloadV1 ¶ added in v1.10.14
func (api *ConsensusAPI) ExecutePayloadV1(params ExecutableDataV1) (ExecutePayloadResponse, error)
ExecutePayload creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
func (*ConsensusAPI) ForkchoiceUpdatedV1 ¶ added in v1.10.14
func (api *ConsensusAPI) ForkchoiceUpdatedV1(heads ForkchoiceStateV1, PayloadAttributes *PayloadAttributesV1) (ForkChoiceResponse, error)
func (*ConsensusAPI) GetPayloadV1 ¶ added in v1.10.14
func (api *ConsensusAPI) GetPayloadV1(payloadID hexutil.Bytes) (*ExecutableDataV1, error)
type ConsensusValidatedParams ¶ added in v1.10.14
type ExecutableDataV1 ¶ added in v1.10.14
type ExecutableDataV1 struct { ParentHash common.Hash `json:"parentHash" gencodec:"required"` FeeRecipient common.Address `json:"feeRecipient" gencodec:"required"` StateRoot common.Hash `json:"stateRoot" gencodec:"required"` ReceiptsRoot common.Hash `json:"receiptsRoot" gencodec:"required"` LogsBloom []byte `json:"logsBloom" gencodec:"required"` Random common.Hash `json:"random" gencodec:"required"` Number uint64 `json:"blockNumber" gencodec:"required"` GasLimit uint64 `json:"gasLimit" gencodec:"required"` GasUsed uint64 `json:"gasUsed" gencodec:"required"` Timestamp uint64 `json:"timestamp" gencodec:"required"` ExtraData []byte `json:"extraData" gencodec:"required"` BaseFeePerGas *big.Int `json:"baseFeePerGas" gencodec:"required"` BlockHash common.Hash `json:"blockHash" gencodec:"required"` Transactions [][]byte `json:"transactions" gencodec:"required"` }
Structure described at https://github.com/ethereum/execution-apis/src/engine/specification.md
func BlockToExecutableData ¶ added in v1.10.14
func BlockToExecutableData(block *types.Block, random common.Hash) *ExecutableDataV1
func (ExecutableDataV1) MarshalJSON ¶ added in v1.10.14
func (e ExecutableDataV1) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*ExecutableDataV1) UnmarshalJSON ¶ added in v1.10.14
func (e *ExecutableDataV1) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type ExecutePayloadResponse ¶ added in v1.10.14
type ForkChoiceResponse ¶ added in v1.10.14
type ForkchoiceStateV1 ¶ added in v1.10.14
type GenericResponse ¶ added in v1.10.14
type GenericResponse struct {
Success bool `json:"success"`
}
type GenericStringResponse ¶ added in v1.10.14
type GenericStringResponse struct {
Status string `json:"status"`
}
type NewBlockResponse ¶ added in v1.10.14
type NewBlockResponse struct {
Valid bool `json:"valid"`
}
type PayloadAttributesV1 ¶ added in v1.10.14
type PayloadAttributesV1 struct { Timestamp uint64 `json:"timestamp" gencodec:"required"` Random common.Hash `json:"random" gencodec:"required"` SuggestedFeeRecipient common.Address `json:"suggestedFeeRecipient" gencodec:"required"` }
Structure described at https://github.com/ethereum/execution-apis/pull/74
func (PayloadAttributesV1) MarshalJSON ¶ added in v1.10.14
func (p PayloadAttributesV1) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*PayloadAttributesV1) UnmarshalJSON ¶ added in v1.10.14
func (p *PayloadAttributesV1) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type PayloadResponse ¶ added in v1.10.14
type PayloadResponse struct {
PayloadID uint64 `json:"payloadId"`
}
func (PayloadResponse) MarshalJSON ¶ added in v1.10.14
func (p PayloadResponse) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*PayloadResponse) UnmarshalJSON ¶ added in v1.10.14
func (p *PayloadResponse) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
Click to show internal directories.
Click to hide internal directories.