catalyst

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2022 License: GPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package catalyst implements the temporary eth1/eth2 RPC integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(stack *node.Node, backend *les.LightEthereum) error

Register adds catalyst APIs to the light client.

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) ExecutePayloadV1

func (api *ConsensusAPI) ExecutePayloadV1(params beacon.ExecutableDataV1) (beacon.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 beacon.ForkchoiceStateV1, payloadAttributes *beacon.PayloadAttributesV1) (beacon.ForkChoiceResponse, error)

ForkchoiceUpdatedV1 has several responsibilities: 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

We try to set our blockchain to the headBlock 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 beacon.PayloadID) (*beacon.ExecutableDataV1, error)

GetPayloadV1 returns a cached payload by id. It's not supported in les mode.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL