interop

package
v3.2.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: GPL-3.0 Imports: 18 Imported by: 8

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 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 added in v3.2.1

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 added in v3.2.1

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 added in v3.2.1

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 added in v3.2.1

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