light_client

package
v5.2.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeTransactionsRoot

func ComputeTransactionsRoot(payload interfaces.ExecutionData) ([]byte, error)

func ComputeWithdrawalsRoot

func ComputeWithdrawalsRoot(payload interfaces.ExecutionData) ([]byte, error)

func CreateDefaultLightClientUpdate added in v5.2.0

func CreateDefaultLightClientUpdate(currentSlot primitives.Slot, attestedState state.BeaconState) (interfaces.LightClientUpdate, error)

func HasFinality added in v5.2.0

func HasFinality(update interfaces.LightClientUpdate) (bool, error)

func HasRelevantSyncCommittee added in v5.2.0

func HasRelevantSyncCommittee(update interfaces.LightClientUpdate) (bool, error)

func IsBetterUpdate added in v5.2.0

func IsBetterUpdate(newUpdate, oldUpdate interfaces.LightClientUpdate) (bool, error)

func NewLightClientBootstrapFromBeaconState added in v5.2.0

func NewLightClientBootstrapFromBeaconState(
	ctx context.Context,
	currentSlot primitives.Slot,
	state state.BeaconState,
	block interfaces.ReadOnlySignedBeaconBlock,
) (interfaces.LightClientBootstrap, error)

func NewLightClientUpdateFromBeaconState

func NewLightClientUpdateFromBeaconState(
	ctx context.Context,
	currentSlot primitives.Slot,
	state state.BeaconState,
	block interfaces.ReadOnlySignedBeaconBlock,
	attestedState state.BeaconState,
	attestedBlock interfaces.ReadOnlySignedBeaconBlock,
	finalizedBlock interfaces.ReadOnlySignedBeaconBlock) (interfaces.LightClientUpdate, error)

To form a LightClientUpdate, the following historical states and blocks are needed:

  • state: the post state of any block with a post-Altair parent block
  • block: the corresponding block
  • attested_state: the post state of attested_block
  • attested_block: the block referred to by block.parent_root
  • finalized_block: the block referred to by attested_state.finalized_checkpoint.root, if locally available (may be unavailable, e.g., when using checkpoint sync, or if it was pruned locally)

Types

This section is empty.

Jump to

Keyboard shortcuts

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