Documentation ¶
Index ¶
- func BlockHeaderRoot(header *ethpb.BeaconBlockHeader) ([32]byte, error)
- func CheckpointRoot(checkpoint *ethpb.Checkpoint) ([32]byte, error)
- func ComputeFieldRoots(state *pb.BeaconState) ([][]byte, error)
- func EpochAttestationsRoot(atts []*pb.PendingAttestation) ([32]byte, error)
- func Eth1DataVotesRoot(eth1DataVotes []*ethpb.Eth1Data) ([32]byte, error)
- func Eth1Root(eth1Data *ethpb.Eth1Data) ([32]byte, error)
- func ForkRoot(fork *pb.Fork) ([32]byte, error)
- func HashTreeRootState(state *pb.BeaconState) ([32]byte, error)
- func HistoricalRootsRoot(historicalRoots [][]byte) ([32]byte, error)
- func RootsArrayHashTreeRoot(vals [][]byte, length uint64, fieldName string) ([32]byte, error)
- func SlashingsRoot(slashings []uint64) ([32]byte, error)
- func Uint64Root(val uint64) [32]byte
- func ValidatorBalancesRoot(balances []uint64) ([32]byte, error)
- func ValidatorRegistryRoot(vals []*ethpb.Validator) ([32]byte, error)
- type HashFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockHeaderRoot ¶
func BlockHeaderRoot(header *ethpb.BeaconBlockHeader) ([32]byte, error)
BlockHeaderRoot computes the HashTreeRoot Merkleization of a BeaconBlockHeader struct according to the eth2 Simple Serialize specification.
func CheckpointRoot ¶
func CheckpointRoot(checkpoint *ethpb.Checkpoint) ([32]byte, error)
CheckpointRoot computes the HashTreeRoot Merkleization of a Checkpoint struct value according to the eth2 Simple Serialize specification.
func ComputeFieldRoots ¶
func ComputeFieldRoots(state *pb.BeaconState) ([][]byte, error)
ComputeFieldRoots returns the hash tree root computations of every field in the beacon state as a list of 32 byte roots.
func EpochAttestationsRoot ¶
func EpochAttestationsRoot(atts []*pb.PendingAttestation) ([32]byte, error)
EpochAttestationsRoot computes the HashTreeRoot Merkleization of a list of pending attestation values according to the eth2 Simple Serialize specification.
func Eth1DataVotesRoot ¶
Eth1DataVotesRoot computes the HashTreeRoot Merkleization of a list of Eth1Data structs according to the eth2 Simple Serialize specification.
func Eth1Root ¶
Eth1Root computes the HashTreeRoot Merkleization of a BeaconBlockHeader struct according to the eth2 Simple Serialize specification.
func ForkRoot ¶
ForkRoot computes the HashTreeRoot Merkleization of a Fork struct value according to the eth2 Simple Serialize specification.
func HashTreeRootState ¶
func HashTreeRootState(state *pb.BeaconState) ([32]byte, error)
HashTreeRootState provides a fully-customized version of ssz.HashTreeRoot for the BeaconState type of the official Ethereum Serenity specification. The reason for this particular function is to optimize for speed and memory allocation at the expense of complete specificity (that is, this function can only be used on the Prysm BeaconState data structure).
func HistoricalRootsRoot ¶
HistoricalRootsRoot computes the HashTreeRoot Merkleization of a list of [32]byte historical block roots according to the eth2 Simple Serialize specification.
func RootsArrayHashTreeRoot ¶
RootsArrayHashTreeRoot computes the Merkle root of arrays of 32-byte hashes, such as [64][32]byte according to the Simple Serialize specification of eth2.
func SlashingsRoot ¶
SlashingsRoot computes the HashTreeRoot Merkleization of a list of uint64 slashing values according to the eth2 Simple Serialize specification.
func Uint64Root ¶
Uint64Root computes the HashTreeRoot Merkleization of a simple uint64 value according to the eth2 Simple Serialize specification.
func ValidatorBalancesRoot ¶
ValidatorBalancesRoot computes the HashTreeRoot Merkleization of a list of validator uint64 balances according to the eth2 Simple Serialize specification.