Documentation ¶
Overview ¶
Package catalyst implements the temporary eth1/eth2 RPC integration.
Index ¶
- func Register(stack *node.Node, backend *les.LightEthereum) error
- type ConsensusAPI
- func (api *ConsensusAPI) ExchangeTransitionConfigurationV1(config engine.TransitionConfigurationV1) (*engine.TransitionConfigurationV1, error)
- func (api *ConsensusAPI) ExecutePayloadV1(params engine.ExecutableData) (engine.PayloadStatusV1, error)
- func (api *ConsensusAPI) ForkchoiceUpdatedV1(heads engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error)
- func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.ExecutableData, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsensusAPI ¶
type ConsensusAPI struct {
// contains filtered or unexported fields
}
func NewConsensusAPI ¶
func NewConsensusAPI(les *les.LightEthereum) *ConsensusAPI
NewConsensusAPI creates a new consensus api for the given backend. The underlying blockchain needs to have a valid terminal total difficulty set.
func (*ConsensusAPI) ExchangeTransitionConfigurationV1 ¶ added in v1.11.0
func (api *ConsensusAPI) ExchangeTransitionConfigurationV1(config engine.TransitionConfigurationV1) (*engine.TransitionConfigurationV1, error)
ExchangeTransitionConfigurationV1 checks the given configuration against the configuration of the node.
func (*ConsensusAPI) ExecutePayloadV1 ¶
func (api *ConsensusAPI) ExecutePayloadV1(params engine.ExecutableData) (engine.PayloadStatusV1, error)
ExecutePayloadV1 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
func (*ConsensusAPI) ForkchoiceUpdatedV1 ¶
func (api *ConsensusAPI) ForkchoiceUpdatedV1(heads engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error)
ForkchoiceUpdatedV1 has several responsibilities:
We try to set our blockchain to the headBlock.
If the method is called with an empty head block: we return success, which can be used to check if the catalyst mode is enabled.
If the total difficulty was not reached: we return INVALID.
If the finalizedBlockHash is set: we check if we have the finalizedBlockHash in our db, if not we start a sync.
If there are payloadAttributes: we return an error since block creation is not supported in les mode.
func (*ConsensusAPI) GetPayloadV1 ¶
func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.ExecutableData, error)
GetPayloadV1 returns a cached payload by id. It's not supported in les mode.