interop

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: GPL-3.0 Imports: 18 Imported by: 24

Documentation

Overview

Package interop contains deterministic utilities for generating genesis states and keys.

Package interop contains deterministic utilities for generating genesis states and keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DepositDataFromKeys

func DepositDataFromKeys(privKeys []bls.SecretKey, pubKeys []bls.PublicKey) ([]*ethpb.Deposit_Data, [][]byte, error)

DepositDataFromKeys generates a list of deposit data items from a set of BLS validator keys.

func DepositDataFromKeysWithExecCreds

func DepositDataFromKeysWithExecCreds(privKeys []bls.SecretKey, pubKeys []bls.PublicKey, numOfCreds uint64) ([]*ethpb.Deposit_Data, [][]byte, error)

DepositDataFromKeysWithExecCreds generates a list of deposit data items from a set of BLS validator keys.

func DeterministicallyGenerateKeys

func DeterministicallyGenerateKeys(startIndex, numKeys uint64) ([]bls.SecretKey, []bls.PublicKey, error)

DeterministicallyGenerateKeys creates BLS private keys using a fixed curve order according to the algorithm specified in the Ethereum beacon chain specification interop mock start section found here: https://github.com/ethereum/eth2.0-pm/blob/a085c9870f3956d6228ed2a40cd37f0c6580ecd7/interop/mocked_start/README.md

func GenerateDepositsFromData

func GenerateDepositsFromData(depositDataItems []*ethpb.Deposit_Data, trie *trie.SparseMerkleTrie) ([]*ethpb.Deposit, error)

GenerateDepositsFromData a list of deposit items by creating proofs for each of them from a sparse Merkle trie.

func GenerateGenesisState

func GenerateGenesisState(ctx context.Context, genesisTime, numValidators uint64) (*ethpb.BeaconState, []*ethpb.Deposit, error)

GenerateGenesisState deterministically given a genesis time and number of validators. If a genesis time of 0 is supplied it is set to the current time.

func GenerateGenesisStateBellatrix

func GenerateGenesisStateBellatrix(ctx context.Context, genesisTime, numValidators uint64, ep *enginev1.ExecutionPayload, ed *ethpb.Eth1Data) (*ethpb.BeaconStateBellatrix, []*ethpb.Deposit, error)

GenerateGenesisStateBellatrix deterministically given a genesis time and number of validators. If a genesis time of 0 is supplied it is set to the current time.

func GenerateGenesisStateBellatrixFromDepositData

func GenerateGenesisStateBellatrixFromDepositData(
	ctx context.Context, genesisTime uint64, depositData []*ethpb.Deposit_Data, depositDataRoots [][]byte, ep *enginev1.ExecutionPayload, e1d *ethpb.Eth1Data,
) (*ethpb.BeaconStateBellatrix, []*ethpb.Deposit, error)

GenerateGenesisStateBellatrixFromDepositData creates a genesis state given a list of deposit data items and their corresponding roots.

func GenerateGenesisStateFromDepositData

func GenerateGenesisStateFromDepositData(
	ctx context.Context, genesisTime uint64, depositData []*ethpb.Deposit_Data, depositDataRoots [][]byte,
) (*ethpb.BeaconState, []*ethpb.Deposit, error)

GenerateGenesisStateFromDepositData creates a genesis state given a list of deposit data items and their corresponding roots.

func GeneratePreminedGenesisState

func GeneratePreminedGenesisState(ctx context.Context, genesisTime, numValidators uint64, e1d *ethpb.Eth1Data) (*ethpb.BeaconState, []*ethpb.Deposit, error)

GeneratePreminedGenesisState deterministically given a genesis time and number of validators. If a genesis time of 0 is supplied it is set to the current time.

func GeneratePreminedGenesisStateFromDepositData

func GeneratePreminedGenesisStateFromDepositData(
	ctx context.Context, genesisTime uint64, depositData []*ethpb.Deposit_Data, depositDataRoots [][]byte, e1d *ethpb.Eth1Data,
) (*ethpb.BeaconState, []*ethpb.Deposit, error)

GeneratePreminedGenesisStateFromDepositData creates a genesis state given a list of deposit data items and their corresponding roots.

Types

This section is empty.

Jump to

Keyboard shortcuts

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