catalyst

package
v1.13.14 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: GPL-3.0 Imports: 23 Imported by: 106

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.

func RegisterSimulatedBeaconAPIs added in v1.12.1

func RegisterSimulatedBeaconAPIs(stack *node.Node, sim *SimulatedBeacon)

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) *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) ExchangeCapabilities added in v1.11.0

func (api *ConsensusAPI) ExchangeCapabilities([]string) []string

ExchangeCapabilities returns the current methods provided by this node.

func (*ConsensusAPI) ExchangeTransitionConfigurationV1 added in v1.10.17

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

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

func (*ConsensusAPI) ForkchoiceUpdatedV1 added in v1.10.14

func (api *ConsensusAPI) ForkchoiceUpdatedV1(update 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 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) ForkchoiceUpdatedV2 added in v1.11.0

func (api *ConsensusAPI) ForkchoiceUpdatedV2(update engine.ForkchoiceStateV1, params *engine.PayloadAttributes) (engine.ForkChoiceResponse, error)

ForkchoiceUpdatedV2 is equivalent to V1 with the addition of withdrawals in the payload attributes. It supports both PayloadAttributesV1 and PayloadAttributesV2.

func (*ConsensusAPI) ForkchoiceUpdatedV3 added in v1.13.0

func (api *ConsensusAPI) ForkchoiceUpdatedV3(update engine.ForkchoiceStateV1, params *engine.PayloadAttributes) (engine.ForkChoiceResponse, error)

ForkchoiceUpdatedV3 is equivalent to V2 with the addition of parent beacon block root in the payload attributes. It supports only PayloadAttributesV3.

func (*ConsensusAPI) GetClientVersionV1 added in v1.13.13

func (api *ConsensusAPI) GetClientVersionV1(info engine.ClientVersionV1) []engine.ClientVersionV1

GetClientVersionV1 exchanges client version data of this node.

func (*ConsensusAPI) GetPayloadBodiesByHashV1 added in v1.11.0

func (api *ConsensusAPI) GetPayloadBodiesByHashV1(hashes []common.Hash) []*engine.ExecutionPayloadBodyV1

GetPayloadBodiesByHashV1 implements engine_getPayloadBodiesByHashV1 which allows for retrieval of a list of block bodies by the engine api.

func (*ConsensusAPI) GetPayloadBodiesByRangeV1 added in v1.11.0

func (api *ConsensusAPI) GetPayloadBodiesByRangeV1(start, count hexutil.Uint64) ([]*engine.ExecutionPayloadBodyV1, error)

GetPayloadBodiesByRangeV1 implements engine_getPayloadBodiesByRangeV1 which allows for retrieval of a range of block bodies by the engine api.

func (*ConsensusAPI) GetPayloadV1 added in v1.10.14

func (api *ConsensusAPI) GetPayloadV1(payloadID engine.PayloadID) (*engine.ExecutableData, error)

GetPayloadV1 returns a cached payload by id.

func (*ConsensusAPI) GetPayloadV2 added in v1.11.0

func (api *ConsensusAPI) GetPayloadV2(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error)

GetPayloadV2 returns a cached payload by id.

func (*ConsensusAPI) GetPayloadV3 added in v1.12.1

func (api *ConsensusAPI) GetPayloadV3(payloadID engine.PayloadID) (*engine.ExecutionPayloadEnvelope, error)

GetPayloadV3 returns a cached payload by id.

func (*ConsensusAPI) NewPayloadV1 added in v1.10.17

func (api *ConsensusAPI) NewPayloadV1(params engine.ExecutableData) (engine.PayloadStatusV1, error)

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

func (*ConsensusAPI) NewPayloadV2 added in v1.11.0

func (api *ConsensusAPI) NewPayloadV2(params engine.ExecutableData) (engine.PayloadStatusV1, error)

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

func (*ConsensusAPI) NewPayloadV3 added in v1.12.1

func (api *ConsensusAPI) NewPayloadV3(params engine.ExecutableData, versionedHashes []common.Hash, beaconRoot *common.Hash) (engine.PayloadStatusV1, error)

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

type FullSyncTester added in v1.11.0

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 hash 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 added in v1.11.0

func RegisterFullSyncTester(stack *node.Node, backend *eth.Ethereum, target common.Hash) (*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 added in v1.11.0

func (tester *FullSyncTester) Start() error

Start launches the beacon sync with provided sync target.

func (*FullSyncTester) Stop added in v1.11.0

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.

type SimulatedBeacon added in v1.12.1

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

func NewSimulatedBeacon added in v1.12.1

func NewSimulatedBeacon(period uint64, eth *eth.Ethereum) (*SimulatedBeacon, error)

NewSimulatedBeacon constructs a new simulated beacon chain. Period sets the period in which blocks should be produced.

  • If period is set to 0, a block is produced on every transaction. via Commit, Fork and AdjustTime.

func (*SimulatedBeacon) AdjustTime added in v1.13.10

func (c *SimulatedBeacon) AdjustTime(adjustment time.Duration) error

AdjustTime creates a new block with an adjusted timestamp.

func (*SimulatedBeacon) Commit added in v1.13.10

func (c *SimulatedBeacon) Commit() common.Hash

Commit seals a block on demand.

func (*SimulatedBeacon) Fork added in v1.13.10

func (c *SimulatedBeacon) Fork(parentHash common.Hash) error

Fork sets the head to the provided hash.

func (*SimulatedBeacon) Rollback added in v1.13.10

func (c *SimulatedBeacon) Rollback()

Rollback un-sends previously added transactions.

func (*SimulatedBeacon) Start added in v1.12.1

func (c *SimulatedBeacon) Start() error

Start invokes the SimulatedBeacon life-cycle function in a goroutine.

func (*SimulatedBeacon) Stop added in v1.12.1

func (c *SimulatedBeacon) Stop() error

Stop halts the SimulatedBeacon service.

Jump to

Keyboard shortcuts

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