Documentation
¶
Index ¶
- Constants
- func ComputeValidatorBalancesTreeLeaves(balances []phase0.Gwei) []phase0.Root
- func ComputeValidatorTreeLeaves(validators []*phase0.Validator) ([]phase0.Root, error)
- func CreateVersionedSignedBlock(block interface{}) (spec.VersionedSignedBeaconBlock, error)
- func CreateVersionedState(state interface{}) (spec.VersionedBeaconState, error)
- func GetBalanceRoots(balances []phase0.Gwei) ([]phase0.Root, error)
- func GetBlockHeaderFieldRoots(blockHeader *phase0.BeaconBlockHeader) ([]phase0.Root, error)
- func GetGenesisTime(state *spec.VersionedBeaconState) (uint64, error)
- func GetValidatorBalancesProofDepth(numBalances int) uint64
- func MarshalSSZVersionedBeaconState(beaconState spec.VersionedBeaconState) ([]byte, error)
- func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *BeaconStateTopLevelRoots, index uint64) (common.Proof, error)
- func ProveStateRootAgainstBlockHeader(b *phase0.BeaconBlockHeader) (common.Proof, error)
- func ProveValidatorBalanceAgainstValidatorBalanceList(balances []phase0.Gwei, validatorIndex uint64) (phase0.Root, common.Proof, error)
- func UnmarshalSSZVersionedBeaconState(data []byte) (*spec.VersionedBeaconState, error)
- type BeaconStateTopLevelRoots
Constants ¶
View Source
const ( BEACON_BLOCK_HEADER_NUM_FIELDS = uint64(5) BEACON_BLOCK_HEADER_TREE_HEIGHT = uint64(3) BEACON_STATE_TREE_HEIGHT = uint64(5) BALANCE_TREE_HEIGHT = uint64(38) VALIDATOR_TREE_HEIGHT = uint64(40) STATE_ROOT_INDEX = uint64(3) VALIDATORS_INDEX = uint64(11) BALANCES_INDEX = uint64(12) VALIDATOR_FIELDS_LENGTH = uint64(8) VALIDATOR_PUBKEY_INDEX = uint64(0) VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX = uint64(1) VALIDATOR_BALANCE_INDEX = uint64(2) VALIDATOR_SLASHED_INDEX = uint64(3) VALIDATOR_EXIT_EPOCH_INDEX = uint64(6) SECONDS_PER_SLOT = uint64(12) SLOTS_PER_EPOCH = uint64(32) SECONDS_PER_EPOCH = SECONDS_PER_SLOT * SLOTS_PER_EPOCH FAR_FUTURE_EPOCH = ^uint64(0) UINT64_MASK = 0xffffffffffffffff )
Variables ¶
This section is empty.
Functions ¶
func CreateVersionedSignedBlock ¶
func CreateVersionedSignedBlock(block interface{}) (spec.VersionedSignedBeaconBlock, error)
func CreateVersionedState ¶
func CreateVersionedState(state interface{}) (spec.VersionedBeaconState, error)
func GetBlockHeaderFieldRoots ¶
func GetBlockHeaderFieldRoots(blockHeader *phase0.BeaconBlockHeader) ([]phase0.Root, error)
func GetGenesisTime ¶
func GetGenesisTime(state *spec.VersionedBeaconState) (uint64, error)
func MarshalSSZVersionedBeaconState ¶
func MarshalSSZVersionedBeaconState(beaconState spec.VersionedBeaconState) ([]byte, error)
func ProveBeaconTopLevelRootAgainstBeaconState ¶
func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *BeaconStateTopLevelRoots, index uint64) (common.Proof, error)
func ProveStateRootAgainstBlockHeader ¶
func ProveStateRootAgainstBlockHeader(b *phase0.BeaconBlockHeader) (common.Proof, error)
refer to this: https://github.com/attestantio/go-eth2-client/blob/654ac05b4c534d96562329f988655e49e5743ff5/spec/phase0/beaconblockheader_encoding.go
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 }
func ComputeBeaconStateTopLevelRootsDeneb ¶
func ComputeBeaconStateTopLevelRootsDeneb(b *deneb.BeaconState) (*BeaconStateTopLevelRoots, error)
Click to show internal directories.
Click to hide internal directories.