catalyst

package
v1.10.28 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

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 *eth.Ethereum) error

Register adds the engine API to the full node.

Types

type ConsensusAPI

type ConsensusAPI struct {
	// contains filtered or unexported fields
}

func NewConsensusAPI

func NewConsensusAPI(eth *eth.Ethereum) *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

func (api *ConsensusAPI) ExchangeTransitionConfigurationV1(config beacon.TransitionConfigurationV1) (*beacon.TransitionConfigurationV1, error)

ExchangeTransitionConfigurationV1 checks the given configuration against the configuration of the node.

func (*ConsensusAPI) ForkchoiceUpdatedV1

func (api *ConsensusAPI) ForkchoiceUpdatedV1(update beacon.ForkchoiceStateV1, payloadAttributes *beacon.PayloadAttributesV1) (beacon.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 engine API 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 try to assemble a block with the payloadAttributes and return its payloadID.

func (*ConsensusAPI) GetPayloadV1

func (api *ConsensusAPI) GetPayloadV1(payloadID beacon.PayloadID) (*beacon.ExecutableDataV1, error)

GetPayloadV1 returns a cached payload by id.

func (*ConsensusAPI) NewPayloadV1

func (api *ConsensusAPI) NewPayloadV1(params beacon.ExecutableDataV1) (beacon.PayloadStatusV1, error)

NewPayloadV1 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.

type FullSyncTester

type FullSyncTester struct {
	// contains filtered or unexported fields
}

FullSyncTester is an auxiliary service that allows Geth to perform full sync alone without consensus-layer attached. Users must specify a valid block as the sync target. This tester can be applied to different networks, no matter it's pre-merge or post-merge, but only for full-sync.

func RegisterFullSyncTester

func RegisterFullSyncTester(stack *node.Node, backend *eth.Ethereum, block *types.Block) (*FullSyncTester, error)

RegisterFullSyncTester registers the full-sync tester service into the node stack for launching and stopping the service controlled by node.

func (*FullSyncTester) Start

func (tester *FullSyncTester) Start() error

Start launches the full-sync tester by spinning up a background thread for keeping firing NewPayload-UpdateForkChoice combos with the provided target block, it may or may not trigger the beacon sync depends on if there are protocol peers connected.

func (*FullSyncTester) Stop

func (tester *FullSyncTester) Stop() error

Stop stops the full-sync tester to stop all background activities. This function can only be called for one time.

Jump to

Keyboard shortcuts

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