beacon

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SlotsPerHistoricalRoot = uint64(8192)

	// Index of the historical summaries in the beacon state
	HistoricalSummaryListIndex = uint64(27)

	// Index of validator list in beacon state
	ValidatorListIndex = uint64(11)

	// Index of the beacon body root inside the beacon body header
	BeaconBlockBodyRootIndex = uint64(4)

	// Index of the execution payload in the BeaconBlockBody container
	ExecutionPayloadIndex = uint64(9)

	// Index of the timestamp inside the execution payload
	TimestampIndex = uint64(9)

	// Index of the withdrawals inside the execution payload
	WithdrawalsIndex = uint64(14)

	// Index of the slot in the beacon block header
	SlotIndex = uint64(0)

	// in the historical summary coontainer, the block root summary is at index 0
	BlockSummaryRootIndex = uint64(0)
)
View Source
const (
	BlockBodyMerkleSubtreeNumLayers = uint64(4)

	// Number of layers for the merkleixation of the Validator List in the Beacon State
	ValidatorListMerkleSubtreeNumLayers = uint64(40)

	// Number of layers for the merkleixation of the Historical Summary List in the Beacon State
	HistoricalSummaryListMerkleSubtreeNumLayers = uint64(24)

	// Number of layers for the merkleization of the Withdrawal List in the Execution Payload
	WithdrawalListMerkleSubtreeNumLayers = uint64(4)

	// Number of layers for the merkleization of the Block Roots in the Beacon State
	BlockRootsMerkleSubtreeNumLayers = uint64(13)
)

Variables

This section is empty.

Functions

func ComputeExecutionPayloadFieldRootsCapella

func ComputeExecutionPayloadFieldRootsCapella(executionPayloadFields *capella.ExecutionPayload) ([]phase0.Root, error)

func ComputeExecutionPayloadFieldRootsDeneb

func ComputeExecutionPayloadFieldRootsDeneb(executionPayloadFields *deneb.ExecutionPayload) ([]phase0.Root, error)

func ComputeValidatorTreeLeaves

func ComputeValidatorTreeLeaves(validators []*phase0.Validator) ([]phase0.Root, error)

func CreateVersionedSignedBlock

func CreateVersionedSignedBlock(block interface{}) (spec.VersionedSignedBeaconBlock, error)

func CreateVersionedState

func CreateVersionedState(state interface{}) (spec.VersionedBeaconState, error)

func GetBalanceRoots

func GetBalanceRoots(balances []phase0.Gwei) ([]phase0.Root, error)

func GetBlockHeaderFieldRoots

func GetBlockHeaderFieldRoots(blockHeader *phase0.BeaconBlockHeader) ([]phase0.Root, error)

func GetBlockRoots

func GetBlockRoots(beaconState spec.VersionedBeaconState) ([]phase0.Root, error)

func GetExecutionPayloadFieldRootsCapella

func GetExecutionPayloadFieldRootsCapella(executionPayloadFields *capella.ExecutionPayload) ([]phase0.Root, error)

func GetGenesisTime

func GetGenesisTime(state *spec.VersionedBeaconState) (uint64, error)

func GetHistoricalSummaries

func GetHistoricalSummaries(state *spec.VersionedBeaconState) ([]*capella.HistoricalSummary, error)

func MarshalSSZVersionedBeaconState

func MarshalSSZVersionedBeaconState(beaconState spec.VersionedBeaconState) ([]byte, error)

func ProveBeaconTopLevelRootAgainstBeaconState

func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *BeaconStateTopLevelRoots, index uint64) (common.Proof, error)

func ProveBlockBodyAgainstBlockHeader

func ProveBlockBodyAgainstBlockHeader(blockHeader *phase0.BeaconBlockHeader) (common.Proof, error)

func ProveBlockRootAgainstBeaconStateViaHistoricalSummaries

func ProveBlockRootAgainstBeaconStateViaHistoricalSummaries(beaconStateTopLevelRoots *BeaconStateTopLevelRoots, historicalSummaries []*capella.HistoricalSummary, historicalBlockRoots []phase0.Root, historicalSummaryIndex uint64, blockRootIndex uint64) ([][32]byte, error)

func ProveBlockRootAgainstBlockRootsList

func ProveBlockRootAgainstBlockRootsList(blockRoots []phase0.Root, blockRootIndex uint64) (common.Proof, error)

func ProveBlockRootListAgainstHistoricalSummary

func ProveBlockRootListAgainstHistoricalSummary(historicalSummary *capella.HistoricalSummary) (common.Proof, error)

func ProveExecutionPayloadAgainstBlockHeaderCapella

func ProveExecutionPayloadAgainstBlockHeaderCapella(
	blockHeader *phase0.BeaconBlockHeader,
	withdrawalBeaconBlockBody *capella.BeaconBlockBody,
) ([][32]byte, [32]byte, error)

func ProveExecutionPayloadAgainstBlockHeaderDeneb

func ProveExecutionPayloadAgainstBlockHeaderDeneb(
	blockHeader *phase0.BeaconBlockHeader,
	withdrawalBeaconBlockBody *deneb.BeaconBlockBody,
) ([][32]byte, [32]byte, error)

func ProveHistoricalSummaryAgainstHistoricalSummariesList

func ProveHistoricalSummaryAgainstHistoricalSummariesList(historicalSummaries []*capella.HistoricalSummary, historicalSummaryIndex uint64) (common.Proof, error)

func ProveSlotAgainstBlockHeader

func ProveSlotAgainstBlockHeader(blockHeader *phase0.BeaconBlockHeader) (common.Proof, error)

func ProveTimestampAgainstExecutionPayload

func ProveTimestampAgainstExecutionPayload(executionPayloadFieldRoots []phase0.Root) (common.Proof, error)

func ProveValidatorBalanceAgainstValidatorBalanceList

func ProveValidatorBalanceAgainstValidatorBalanceList(balances []phase0.Gwei, validatorIndex uint64) (common.Proof, error)

func ProveWithdrawalAgainstExecutionPayload

func ProveWithdrawalAgainstExecutionPayload(
	executionPayloadFieldRoots []phase0.Root,
	withdrawals []*capella.Withdrawal,
	withdrawalIndex uint8,
) ([][32]byte, error)

func ProveWithdrawalAgainstWithdrawalList

func ProveWithdrawalAgainstWithdrawalList(withdrawals []*capella.Withdrawal, withdrawalIndex uint8) (common.Proof, error)

func ProveWithdrawalListAgainstExecutionPayload

func ProveWithdrawalListAgainstExecutionPayload(executionPayloadFieldRoots []phase0.Root) (common.Proof, error)

func UnmarshalSSZVersionedBeaconState

func UnmarshalSSZVersionedBeaconState(data []byte) (*spec.VersionedBeaconState, error)

Types

type BeaconStateTopLevelRoots

type BeaconStateTopLevelRoots struct {
	GenesisTimeRoot                  *phase0.Root
	GenesisValidatorsRoot            *phase0.Root
	SlotRoot                         *phase0.Root
	ForkRoot                         *phase0.Root
	LatestBlockHeaderRoot            *phase0.Root
	BlockRootsRoot                   *phase0.Root
	StateRootsRoot                   *phase0.Root
	HistoricalRootsRoot              *phase0.Root
	ETH1DataRoot                     *phase0.Root
	ETH1DataVotesRoot                *phase0.Root
	ETH1DepositIndexRoot             *phase0.Root
	ValidatorsRoot                   *phase0.Root
	BalancesRoot                     *phase0.Root
	RANDAOMixesRoot                  *phase0.Root
	SlashingsRoot                    *phase0.Root
	PreviousEpochParticipationRoot   *phase0.Root
	CurrentEpochParticipationRoot    *phase0.Root
	JustificationBitsRoot            *phase0.Root
	PreviousJustifiedCheckpointRoot  *phase0.Root
	CurrentJustifiedCheckpointRoot   *phase0.Root
	FinalizedCheckpointRoot          *phase0.Root
	InactivityScoresRoot             *phase0.Root
	CurrentSyncCommitteeRoot         *phase0.Root
	NextSyncCommitteeRoot            *phase0.Root
	LatestExecutionPayloadHeaderRoot *phase0.Root
	NextWithdrawalIndexRoot          *phase0.Root
	NextWithdrawalValidatorIndexRoot *phase0.Root
	HistoricalSummariesRoot          *phase0.Root
}

Jump to

Keyboard shortcuts

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