duties

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToUint

func BytesToUint(data []byte) uint64

func ComputeShuffledIndex

func ComputeShuffledIndex(spec *consensus.ChainSpec, index uint64, indexCount uint64, seed [32]byte, shuffle bool) (uint64, error)

func GetAttesterDuties

func GetAttesterDuties(spec *consensus.ChainSpec, state *BeaconState, epoch phase0.Epoch) ([][][]ActiveIndiceIndex, error)

func GetRandaoMix

func GetRandaoMix(spec *consensus.ChainSpec, state *BeaconState, epoch phase0.Epoch) phase0.Hash32

func GetSeed

func GetSeed(spec *consensus.ChainSpec, state *BeaconState, epoch phase0.Epoch, domainType phase0.DomainType) phase0.Hash32

func Hash

func Hash(data []byte) phase0.Hash32

func SlotCommitteeCount

func SlotCommitteeCount(spec *consensus.ChainSpec, activeValidatorCount uint64) uint64

func SplitOffset

func SplitOffset(listSize, chunks, index uint64) uint64

func UintToBytes

func UintToBytes(data any) []byte

Types

type ActiveIndiceIndex

type ActiveIndiceIndex uint32

func GetProposerIndex

func GetProposerIndex(spec *consensus.ChainSpec, state *BeaconState, slot phase0.Slot) (ActiveIndiceIndex, error)

func ShuffleList

func ShuffleList(spec *consensus.ChainSpec, input []ActiveIndiceIndex, seed [32]byte) ([]ActiveIndiceIndex, error)

func UnshuffleList

func UnshuffleList(spec *consensus.ChainSpec, input []ActiveIndiceIndex, seed [32]byte) ([]ActiveIndiceIndex, error)

UnshuffleList un-shuffles the list by running backwards through the round count.

type BeaconState

type BeaconState struct {
	RandaoMix           *phase0.Hash32
	NextRandaoMix       *phase0.Hash32
	GetRandaoMixes      func() []phase0.Root
	GetActiveCount      func() uint64
	GetEffectiveBalance func(index ActiveIndiceIndex) phase0.Gwei
}

Jump to

Keyboard shortcuts

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