lightclient_utils

package
v1.9.7-0...-c81b736 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockToLightClientHeader

func BlockToLightClientHeader(block *cltypes.SignedBeaconBlock) (*cltypes.LightClientHeader, error)

def block_to_light_client_header(block: SignedBeaconBlock) -> LightClientHeader:

return LightClientHeader(
    beacon=BeaconBlockHeader(
        slot=block.message.slot,
        proposer_index=block.message.proposer_index,
        parent_root=block.message.parent_root,
        state_root=block.message.state_root,
        body_root=hash_tree_root(block.message.body),
    ),
)

func CreateLightClientBootstrap

func CreateLightClientBootstrap(state *state.CachingBeaconState, block *cltypes.SignedBeaconBlock) (*cltypes.LightClientBootstrap, error)

return LightClientBootstrap(

header=block_to_light_client_header(block),
current_sync_committee=state.current_sync_committee,
current_sync_committee_branch=CurrentSyncCommitteeBranch(
compute_merkle_proof(state, CURRENT_SYNC_COMMITTEE_GINDEX)),

)

func CreateLightClientUpdate

func CreateLightClientUpdate(cfg *clparams.BeaconChainConfig, block *cltypes.SignedBeaconBlock, finalizedBlock *cltypes.SignedBeaconBlock,
	attestedBlock *cltypes.SignedBeaconBlock, attestedSlot uint64,
	attestedNextSyncCommittee *solid.SyncCommittee, attestedFinalizedCheckpoint solid.Checkpoint,
	attestedNextSyncCommitteeBranch, attestedFinalityBranch solid.HashVectorSSZ) (*cltypes.LightClientUpdate, error)

return update CreateLightClientUpdate implements the specs to initialize the light client update

Types

This section is empty.

Jump to

Keyboard shortcuts

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