Documentation
¶
Index ¶
- func BazelDirectoryNonEmpty(filePath string) (bool, error)
- func BazelFileBytes(filePaths ...string) ([]byte, error)
- func BazelListDirectories(filepath string) ([]string, error)
- func BazelListFiles(filepath string) ([]string, error)
- func BlockSignature(bState state.BeaconState, block interface{}, privKeys []bls.SecretKey) (bls.Signature, error)
- func BlockSignatureAltair(bState state.BeaconState, block *ethpb.BeaconBlockAltair, ...) (bls.Signature, error)
- func ConvertToCommittee(inputKeys [][]byte) *ethpb.SyncCommittee
- func DepositTrieFromDeposits(deposits []*ethpb.Deposit) (*trie.SparseMerkleTrie, [][32]byte, error)
- func DepositTrieSubset(sparseTrie *trie.SparseMerkleTrie, size int) (*trie.SparseMerkleTrie, [][32]byte, error)
- func DepositsWithBalance(balances []uint64) ([]*ethpb.Deposit, *trie.SparseMerkleTrie, error)
- func DeterministicDepositTrie(size int) (*trie.SparseMerkleTrie, [][32]byte, error)
- func DeterministicDepositsAndKeys(numDeposits uint64) ([]*ethpb.Deposit, []bls.SecretKey, error)
- func DeterministicDepositsAndKeysSameValidator(numDeposits uint64) ([]*ethpb.Deposit, []bls.SecretKey, error)
- func DeterministicEth1Data(size int) (*ethpb.Eth1Data, error)
- func DeterministicGenesisState(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
- func DeterministicGenesisStateAltair(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
- func DeterministicGenesisStateBellatrix(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
- func DeterministicGenesisStateCapella(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
- func DeterministicGenesisStateDeneb(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
- func DeterministicGenesisStateElectra(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
- func DeterministicGenesisStateWithGenesisBlock(t *testing.T, ctx context.Context, db iface.HeadAccessDatabase, ...) (state.BeaconState, [32]byte, []bls.SecretKey)
- func ExtendBlocksPlusBlobs(t *testing.T, blks []blocks.ROBlock, size int) ([]blocks.ROBlock, []blocks.ROBlob)
- func FillRootsNaturalOpt(state *ethpb.BeaconState) error
- func FillRootsNaturalOptAltair(state *ethpb.BeaconStateAltair) error
- func FillRootsNaturalOptBellatrix(state *ethpb.BeaconStateBellatrix) error
- func FillRootsNaturalOptCapella(state *ethpb.BeaconStateCapella) error
- func FillRootsNaturalOptDeneb(state *ethpb.BeaconStateDeneb) error
- func GenerateAttestations(bState state.BeaconState, privs []bls.SecretKey, numToGen uint64, ...) ([]ethpb.Att, error)
- func GenerateAttesterSlashingForValidator(bState state.BeaconState, priv bls.SecretKey, idx primitives.ValidatorIndex) (ethpb.AttSlashing, error)
- func GenerateBLSToExecutionChange(st state.BeaconState, priv bls.SecretKey, val primitives.ValidatorIndex) (*ethpb.SignedBLSToExecutionChange, error)
- func GenerateFullBlock(bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, ...) (*ethpb.SignedBeaconBlock, error)
- func GenerateFullBlockAltair(bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, ...) (*ethpb.SignedBeaconBlockAltair, error)
- func GenerateFullBlockBellatrix(bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, ...) (*ethpb.SignedBeaconBlockBellatrix, error)
- func GenerateFullBlockCapella(bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, ...) (*ethpb.SignedBeaconBlockCapella, error)
- func GenerateFullBlockElectra(bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, ...) (*ethpb.SignedBeaconBlockElectra, error)
- func GenerateProposerSlashingForValidator(bState state.BeaconState, priv bls.SecretKey, idx primitives.ValidatorIndex) (*ethpb.ProposerSlashing, error)
- func GenerateTestDenebBlobSidecar(t *testing.T, root [32]byte, header *ethpb.SignedBeaconBlockHeader, index int, ...) blocks.ROBlob
- func GenerateTestDenebBlockWithSidecar(t *testing.T, parent [32]byte, slot primitives.Slot, nblobs int, ...) (blocks.ROBlock, []blocks.ROBlob)
- func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot primitives.Slot, nblobs int, ...) (blocks.ROBlock, []blocks.ROBlob)
- func GenerateVoluntaryExits(bState state.BeaconState, k bls.SecretKey, idx primitives.ValidatorIndex) (*ethpb.SignedVoluntaryExit, error)
- func GenesisBeaconState(ctx context.Context, deposits []*ethpb.Deposit, genesisTime uint64, ...) (state.BeaconState, error)
- func GetRandBlob(seed int64) GoKZG.Blob
- func GetRandFieldElement(seed int64) [32]byte
- func HackForksMaxuint(t *testing.T, forksVersion []int) func()
- func HydrateAttestation(a *ethpb.Attestation) *ethpb.Attestation
- func HydrateAttestationData(d *ethpb.AttestationData) *ethpb.AttestationData
- func HydrateAttestationElectra(a *ethpb.AttestationElectra) *ethpb.AttestationElectra
- func HydrateBeaconBlock(b *ethpb.BeaconBlock) *ethpb.BeaconBlock
- func HydrateBeaconBlockAltair(b *ethpb.BeaconBlockAltair) *ethpb.BeaconBlockAltair
- func HydrateBeaconBlockBellatrix(b *ethpb.BeaconBlockBellatrix) *ethpb.BeaconBlockBellatrix
- func HydrateBeaconBlockBody(b *ethpb.BeaconBlockBody) *ethpb.BeaconBlockBody
- func HydrateBeaconBlockBodyAltair(b *ethpb.BeaconBlockBodyAltair) *ethpb.BeaconBlockBodyAltair
- func HydrateBeaconBlockBodyBellatrix(b *ethpb.BeaconBlockBodyBellatrix) *ethpb.BeaconBlockBodyBellatrix
- func HydrateBeaconBlockBodyCapella(b *ethpb.BeaconBlockBodyCapella) *ethpb.BeaconBlockBodyCapella
- func HydrateBeaconBlockBodyDeneb(b *ethpb.BeaconBlockBodyDeneb) *ethpb.BeaconBlockBodyDeneb
- func HydrateBeaconBlockBodyElectra(b *ethpb.BeaconBlockBodyElectra) *ethpb.BeaconBlockBodyElectra
- func HydrateBeaconBlockBodyFulu(b *ethpb.BeaconBlockBodyFulu) *ethpb.BeaconBlockBodyFulu
- func HydrateBeaconBlockCapella(b *ethpb.BeaconBlockCapella) *ethpb.BeaconBlockCapella
- func HydrateBeaconBlockDeneb(b *ethpb.BeaconBlockDeneb) *ethpb.BeaconBlockDeneb
- func HydrateBeaconBlockElectra(b *ethpb.BeaconBlockElectra) *ethpb.BeaconBlockElectra
- func HydrateBeaconBlockFulu(b *ethpb.BeaconBlockFulu) *ethpb.BeaconBlockFulu
- func HydrateBeaconHeader(h *ethpb.BeaconBlockHeader) *ethpb.BeaconBlockHeader
- func HydrateBlindedBeaconBlockBellatrix(b *ethpb.BlindedBeaconBlockBellatrix) *ethpb.BlindedBeaconBlockBellatrix
- func HydrateBlindedBeaconBlockBodyBellatrix(b *ethpb.BlindedBeaconBlockBodyBellatrix) *ethpb.BlindedBeaconBlockBodyBellatrix
- func HydrateBlindedBeaconBlockBodyCapella(b *ethpb.BlindedBeaconBlockBodyCapella) *ethpb.BlindedBeaconBlockBodyCapella
- func HydrateBlindedBeaconBlockBodyDeneb(b *ethpb.BlindedBeaconBlockBodyDeneb) *ethpb.BlindedBeaconBlockBodyDeneb
- func HydrateBlindedBeaconBlockBodyElectra(b *ethpb.BlindedBeaconBlockBodyElectra) *ethpb.BlindedBeaconBlockBodyElectra
- func HydrateBlindedBeaconBlockBodyFulu(b *ethpb.BlindedBeaconBlockBodyFulu) *ethpb.BlindedBeaconBlockBodyFulu
- func HydrateBlindedBeaconBlockCapella(b *ethpb.BlindedBeaconBlockCapella) *ethpb.BlindedBeaconBlockCapella
- func HydrateBlindedBeaconBlockDeneb(b *ethpb.BlindedBeaconBlockDeneb) *ethpb.BlindedBeaconBlockDeneb
- func HydrateBlindedBeaconBlockElectra(b *ethpb.BlindedBeaconBlockElectra) *ethpb.BlindedBeaconBlockElectra
- func HydrateBlindedBeaconBlockFulu(b *ethpb.BlindedBeaconBlockFulu) *ethpb.BlindedBeaconBlockFulu
- func HydrateBlobSidecar(b *ethpb.BlobSidecar) *ethpb.BlobSidecar
- func HydrateCommitmentInclusionProofs() [][]byte
- func HydrateExecutionRequests(e *enginev1.ExecutionRequests) *enginev1.ExecutionRequests
- func HydrateIndexedAttestation(a *ethpb.IndexedAttestation) *ethpb.IndexedAttestation
- func HydrateIndexedAttestationElectra(a *ethpb.IndexedAttestationElectra) *ethpb.IndexedAttestationElectra
- func HydrateSignedBeaconBlock(b *ethpb.SignedBeaconBlock) *ethpb.SignedBeaconBlock
- func HydrateSignedBeaconBlockAltair(b *ethpb.SignedBeaconBlockAltair) *ethpb.SignedBeaconBlockAltair
- func HydrateSignedBeaconBlockBellatrix(b *ethpb.SignedBeaconBlockBellatrix) *ethpb.SignedBeaconBlockBellatrix
- func HydrateSignedBeaconBlockCapella(b *ethpb.SignedBeaconBlockCapella) *ethpb.SignedBeaconBlockCapella
- func HydrateSignedBeaconBlockContentsDeneb(b *ethpb.SignedBeaconBlockContentsDeneb) *ethpb.SignedBeaconBlockContentsDeneb
- func HydrateSignedBeaconBlockContentsElectra(b *ethpb.SignedBeaconBlockContentsElectra) *ethpb.SignedBeaconBlockContentsElectra
- func HydrateSignedBeaconBlockContentsFulu(b *ethpb.SignedBeaconBlockContentsFulu) *ethpb.SignedBeaconBlockContentsFulu
- func HydrateSignedBeaconBlockDeneb(b *ethpb.SignedBeaconBlockDeneb) *ethpb.SignedBeaconBlockDeneb
- func HydrateSignedBeaconBlockElectra(b *ethpb.SignedBeaconBlockElectra) *ethpb.SignedBeaconBlockElectra
- func HydrateSignedBeaconBlockFulu(b *ethpb.SignedBeaconBlockFulu) *ethpb.SignedBeaconBlockFulu
- func HydrateSignedBeaconHeader(h *ethpb.SignedBeaconBlockHeader) *ethpb.SignedBeaconBlockHeader
- func HydrateSignedBlindedBeaconBlockBellatrix(b *ethpb.SignedBlindedBeaconBlockBellatrix) *ethpb.SignedBlindedBeaconBlockBellatrix
- func HydrateSignedBlindedBeaconBlockCapella(b *ethpb.SignedBlindedBeaconBlockCapella) *ethpb.SignedBlindedBeaconBlockCapella
- func HydrateSignedBlindedBeaconBlockDeneb(b *ethpb.SignedBlindedBeaconBlockDeneb) *ethpb.SignedBlindedBeaconBlockDeneb
- func HydrateSignedBlindedBeaconBlockElectra(b *ethpb.SignedBlindedBeaconBlockElectra) *ethpb.SignedBlindedBeaconBlockElectra
- func HydrateSignedBlindedBeaconBlockFulu(b *ethpb.SignedBlindedBeaconBlockFulu) *ethpb.SignedBlindedBeaconBlockFulu
- func HydrateSingleAttestation(a *ethpb.SingleAttestation) *ethpb.SingleAttestation
- func HydrateSyncCommittee(s *ethpb.SyncCommitteeMessage) *ethpb.SyncCommitteeMessage
- func HydrateV1Attestation(a *attv1.Attestation) *attv1.Attestation
- func HydrateV1AttestationData(d *attv1.AttestationData) *attv1.AttestationData
- func HydrateV1BeaconBlock(b *v1.BeaconBlock) *v1.BeaconBlock
- func HydrateV1BeaconBlockBody(b *v1.BeaconBlockBody) *v1.BeaconBlockBody
- func HydrateV1SignedBeaconBlock(b *v1.SignedBeaconBlock) *v1.SignedBeaconBlock
- func NewAttestation() *ethpb.Attestation
- func NewAttestationElectra() *ethpb.AttestationElectra
- func NewBeaconBlock() *ethpb.SignedBeaconBlock
- func NewBeaconBlockAltair() *ethpb.SignedBeaconBlockAltair
- func NewBeaconBlockBellatrix() *ethpb.SignedBeaconBlockBellatrix
- func NewBeaconBlockCapella() *ethpb.SignedBeaconBlockCapella
- func NewBeaconBlockContentsDeneb() *ethpb.SignedBeaconBlockContentsDeneb
- func NewBeaconBlockContentsElectra() *ethpb.SignedBeaconBlockContentsElectra
- func NewBeaconBlockContentsFulu() *ethpb.SignedBeaconBlockContentsFulu
- func NewBeaconBlockDeneb() *ethpb.SignedBeaconBlockDeneb
- func NewBeaconBlockElectra() *ethpb.SignedBeaconBlockElectra
- func NewBeaconBlockFulu() *ethpb.SignedBeaconBlockFulu
- func NewBeaconState(options ...NewBeaconStateOption) (state.BeaconState, error)
- func NewBeaconStateAltair(options ...func(state *ethpb.BeaconStateAltair) error) (state.BeaconState, error)
- func NewBeaconStateBellatrix(options ...func(state *ethpb.BeaconStateBellatrix) error) (state.BeaconState, error)
- func NewBeaconStateCapella(options ...func(state *ethpb.BeaconStateCapella) error) (state.BeaconState, error)
- func NewBeaconStateDeneb(options ...func(state *ethpb.BeaconStateDeneb) error) (state.BeaconState, error)
- func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) error) (state.BeaconState, error)
- func NewBeaconStateFulu(options ...func(state *ethpb.BeaconStateFulu) error) (state.BeaconState, error)
- func NewBlindedBeaconBlockBellatrix() *ethpb.SignedBlindedBeaconBlockBellatrix
- func NewBlindedBeaconBlockCapella() *ethpb.SignedBlindedBeaconBlockCapella
- func NewBlindedBeaconBlockDeneb() *ethpb.SignedBlindedBeaconBlockDeneb
- func NewBlindedBeaconBlockElectra() *ethpb.SignedBlindedBeaconBlockElectra
- func NewBlindedBeaconBlockFulu() *ethpb.SignedBlindedBeaconBlockFulu
- func PrepareRoots(size int) ([][]byte, error)
- func RandaoReveal(beaconState state.ReadOnlyBeaconState, epoch primitives.Epoch, ...) ([]byte, error)
- func Random32Bytes(t *testing.T) []byte
- func RegisterHookWithUndo(logger *logrus.Logger, hook ComparableHook) func()
- func SaveBlock(tb assertions.AssertionTestingTB, ctx context.Context, ...) interfaces.SignedBeaconBlock
- func UnregisterHook(logger *logrus.Logger, unregister ComparableHook)
- func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool
- type BlockGenConfig
- type ChannelEntryWriter
- type ComparableHook
- type DenebBlockGeneratorOption
- type ElectraBlockGeneratorOption
- type NewBeaconStateOption
- type TestLightClient
- func (l *TestLightClient) CheckAttestedHeader(header interfaces.LightClientHeader)
- func (l *TestLightClient) CheckSyncAggregate(sa *ethpb.SyncAggregate)
- func (l *TestLightClient) SetupTestAltair() *TestLightClient
- func (l *TestLightClient) SetupTestBellatrix() *TestLightClient
- func (l *TestLightClient) SetupTestCapella(blinded bool) *TestLightClient
- func (l *TestLightClient) SetupTestCapellaFinalizedBlockAltair(blinded bool) *TestLightClient
- func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient
- func (l *TestLightClient) SetupTestDenebFinalizedBlockCapella(blinded bool) *TestLightClient
- func (l *TestLightClient) SetupTestElectra(blinded bool) *TestLightClient
- func (l *TestLightClient) SetupTestElectraFinalizedBlockDeneb(blinded bool) *TestLightClient
- func (l *TestLightClient) SetupTestFulu(blinded bool) *TestLightClient
- type Waiter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BazelDirectoryNonEmpty ¶
BazelDirectoryNonEmpty returns true if directory exists and is not empty.
func BazelFileBytes ¶
BazelFileBytes returns the byte array of the bazel file path given.
func BazelListDirectories ¶
BazelListDirectories lists all of the directories in the given directory. Excludes regular files. Returns error when no directories exist.
func BazelListFiles ¶
BazelListFiles lists all of the file names in a given directory. Excludes directories. Returns an error when no non-directory files exist.
func BlockSignature ¶
func BlockSignature( bState state.BeaconState, block interface{}, privKeys []bls.SecretKey, ) (bls.Signature, error)
BlockSignature calculates the post-state root of the block and returns the signature.
func BlockSignatureAltair ¶
func BlockSignatureAltair( bState state.BeaconState, block *ethpb.BeaconBlockAltair, privKeys []bls.SecretKey, ) (bls.Signature, error)
BlockSignatureAltair calculates the post-state root of the block and returns the signature.
func ConvertToCommittee ¶
func ConvertToCommittee(inputKeys [][]byte) *ethpb.SyncCommittee
ConvertToCommittee takes a list of pubkeys and returns a SyncCommittee with these keys as members. Some keys may appear repeated
func DepositTrieFromDeposits ¶
DepositTrieFromDeposits takes an array of deposits and returns the deposit trie.
func DepositTrieSubset ¶
func DepositTrieSubset(sparseTrie *trie.SparseMerkleTrie, size int) (*trie.SparseMerkleTrie, [][32]byte, error)
DepositTrieSubset takes in a full tree and the desired size and returns a subset of the deposit trie.
func DepositsWithBalance ¶
DepositsWithBalance generates N amount of deposits with the balances taken from the passed in balances array. If an empty array is passed,
func DeterministicDepositTrie ¶
func DeterministicDepositTrie(size int) (*trie.SparseMerkleTrie, [][32]byte, error)
DeterministicDepositTrie returns a merkle trie of the requested size from the deterministic deposits.
func DeterministicDepositsAndKeys ¶
DeterministicDepositsAndKeys returns the entered amount of deposits and secret keys. The deposits are configured such that for deposit n the validator account is key n and the withdrawal account is key n+1. As such, if all secret keys for n validators are required then numDeposits should be n+1.
func DeterministicDepositsAndKeysSameValidator ¶
func DeterministicDepositsAndKeysSameValidator(numDeposits uint64) ([]*ethpb.Deposit, []bls.SecretKey, error)
DeterministicDepositsAndKeysSameValidator returns the entered amount of deposits and secret keys of the same validator. This is for negative test cases such as same deposits from same validators in a block don't result in duplicated validator indices.
func DeterministicEth1Data ¶
DeterministicEth1Data takes an array of deposits and returns the eth1Data made from the deposit trie.
func DeterministicGenesisState ¶
func DeterministicGenesisState(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
DeterministicGenesisState returns a genesis state made using the deterministic deposits.
func DeterministicGenesisStateAltair ¶
func DeterministicGenesisStateAltair(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
DeterministicGenesisStateAltair returns a genesis state in hard fork 1 format made using the deterministic deposits.
func DeterministicGenesisStateBellatrix ¶
func DeterministicGenesisStateBellatrix(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
DeterministicGenesisStateBellatrix returns a genesis state in Bellatrix format made using the deterministic deposits.
func DeterministicGenesisStateCapella ¶
func DeterministicGenesisStateCapella(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
DeterministicGenesisStateCapella returns a genesis state in Capella format made using the deterministic deposits.
func DeterministicGenesisStateDeneb ¶
func DeterministicGenesisStateDeneb(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
DeterministicGenesisStateDeneb returns a genesis state in Deneb format made using the deterministic deposits.
func DeterministicGenesisStateElectra ¶ added in v5.1.0
func DeterministicGenesisStateElectra(t testing.TB, numValidators uint64) (state.BeaconState, []bls.SecretKey)
DeterministicGenesisStateElectra returns a genesis state in Electra format made using the deterministic deposits.
func DeterministicGenesisStateWithGenesisBlock ¶
func DeterministicGenesisStateWithGenesisBlock( t *testing.T, ctx context.Context, db iface.HeadAccessDatabase, numValidators uint64, ) (state.BeaconState, [32]byte, []bls.SecretKey)
DeterministicGenesisStateWithGenesisBlock creates a genesis state, saves the genesis block, genesis state and head block root. It returns the genesis state, genesis block's root and validator private keys.
func ExtendBlocksPlusBlobs ¶
func FillRootsNaturalOpt ¶
func FillRootsNaturalOpt(state *ethpb.BeaconState) error
FillRootsNaturalOpt is meant to be used as an option when calling NewBeaconState. It fills state and block roots with hex representations of natural numbers starting with 0. Example: 16 becomes 0x00...0f.
func FillRootsNaturalOptAltair ¶
func FillRootsNaturalOptAltair(state *ethpb.BeaconStateAltair) error
FillRootsNaturalOptAltair is meant to be used as an option when calling NewBeaconStateAltair. It fills state and block roots with hex representations of natural numbers starting with 0. Example: 16 becomes 0x00...0f.
func FillRootsNaturalOptBellatrix ¶
func FillRootsNaturalOptBellatrix(state *ethpb.BeaconStateBellatrix) error
FillRootsNaturalOptBellatrix is meant to be used as an option when calling NewBeaconStateBellatrix. It fills state and block roots with hex representations of natural numbers starting with 0. Example: 16 becomes 0x00...0f.
func FillRootsNaturalOptCapella ¶
func FillRootsNaturalOptCapella(state *ethpb.BeaconStateCapella) error
FillRootsNaturalOptCapella is meant to be used as an option when calling NewBeaconStateCapella. It fills state and block roots with hex representations of natural numbers starting with 0. Example: 16 becomes 0x00...0f.
func FillRootsNaturalOptDeneb ¶
func FillRootsNaturalOptDeneb(state *ethpb.BeaconStateDeneb) error
FillRootsNaturalOptDeneb is meant to be used as an option when calling NewBeaconStateDeneb. It fills state and block roots with hex representations of natural numbers starting with 0. Example: 16 becomes 0x00...0f.
func GenerateAttestations ¶
func GenerateAttestations(bState state.BeaconState, privs []bls.SecretKey, numToGen uint64, slot primitives.Slot, randomRoot bool) ([]ethpb.Att, error)
GenerateAttestations creates attestations that are entirely valid, for all the committees of the current state slot. This function expects attestations requested to be cleanly divisible by committees per slot. If there is 1 committee in the slot, and numToGen is set to 4, then it will return 4 attestations for the same data with their aggregation bits split uniformly.
If you request 4 attestations, but there are 8 committees, you will get 4 fully aggregated attestations.
func GenerateAttesterSlashingForValidator ¶
func GenerateAttesterSlashingForValidator( bState state.BeaconState, priv bls.SecretKey, idx primitives.ValidatorIndex, ) (ethpb.AttSlashing, error)
GenerateAttesterSlashingForValidator for a specific validator index.
func GenerateBLSToExecutionChange ¶
func GenerateBLSToExecutionChange(st state.BeaconState, priv bls.SecretKey, val primitives.ValidatorIndex) (*ethpb.SignedBLSToExecutionChange, error)
GenerateBLSToExecutionChange generates a valid bls to exec change for validator `val` and its private key `priv` with the given beacon state `st`.
func GenerateFullBlock ¶
func GenerateFullBlock( bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, slot primitives.Slot, ) (*ethpb.SignedBeaconBlock, error)
GenerateFullBlock generates a fully valid block with the requested parameters. Use BlockGenConfig to declare the conditions you would like the block generated under.
func GenerateFullBlockAltair ¶
func GenerateFullBlockAltair( bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, slot primitives.Slot, ) (*ethpb.SignedBeaconBlockAltair, error)
GenerateFullBlockAltair generates a fully valid Altair block with the requested parameters. Use BlockGenConfig to declare the conditions you would like the block generated under.
func GenerateFullBlockBellatrix ¶
func GenerateFullBlockBellatrix( bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, slot primitives.Slot, ) (*ethpb.SignedBeaconBlockBellatrix, error)
func GenerateFullBlockCapella ¶
func GenerateFullBlockCapella( bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, slot primitives.Slot, ) (*ethpb.SignedBeaconBlockCapella, error)
GenerateFullBlockCapella generates a fully valid Capella block with the requested parameters. Use BlockGenConfig to declare the conditions you would like the block generated under. This function modifies the passed state as follows:
func GenerateFullBlockElectra ¶ added in v5.1.0
func GenerateFullBlockElectra( bState state.BeaconState, privs []bls.SecretKey, conf *BlockGenConfig, slot primitives.Slot, ) (*ethpb.SignedBeaconBlockElectra, error)
GenerateFullBlockElectra generates a fully valid Electra block with the requested parameters. Use BlockGenConfig to declare the conditions you would like the block generated under. This function modifies the passed state as follows:
func GenerateProposerSlashingForValidator ¶
func GenerateProposerSlashingForValidator( bState state.BeaconState, priv bls.SecretKey, idx primitives.ValidatorIndex, ) (*ethpb.ProposerSlashing, error)
GenerateProposerSlashingForValidator for a specific validator index.
func GenerateTestElectraBlockWithSidecar ¶ added in v5.1.0
func GenerateVoluntaryExits ¶
func GenerateVoluntaryExits(bState state.BeaconState, k bls.SecretKey, idx primitives.ValidatorIndex) (*ethpb.SignedVoluntaryExit, error)
func GenesisBeaconState ¶
func GenesisBeaconState(ctx context.Context, deposits []*ethpb.Deposit, genesisTime uint64, eth1Data *ethpb.Eth1Data) (state.BeaconState, error)
GenesisBeaconState returns the genesis beacon state.
func GetRandBlob ¶ added in v5.2.0
Returns a random blob using the passed seed as entropy
func GetRandFieldElement ¶ added in v5.2.0
Returns a serialized random field element in big-endian
func HackForksMaxuint ¶ added in v5.3.0
HackForksMaxuint is helpful for tests that need to set up cases for some future forks. We have unit tests that assert our config matches the upstream config, where some forks epoch are always set to MaxUint64 until they are formally set. This creates an issue for tests that want to work with slots that are defined to be after these forks because converting the max epoch to a slot leads to multiplication overflow. Monkey patching tests with this function is the simplest workaround in these cases.
func HydrateAttestation ¶
func HydrateAttestation(a *ethpb.Attestation) *ethpb.Attestation
HydrateAttestation hydrates an attestation object with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateAttestationData ¶
func HydrateAttestationData(d *ethpb.AttestationData) *ethpb.AttestationData
HydrateAttestationData hydrates an attestation data object with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateAttestationElectra ¶ added in v5.1.0
func HydrateAttestationElectra(a *ethpb.AttestationElectra) *ethpb.AttestationElectra
HydrateAttestationElectra hydrates an attestation object with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlock ¶
func HydrateBeaconBlock(b *ethpb.BeaconBlock) *ethpb.BeaconBlock
HydrateBeaconBlock hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockAltair ¶
func HydrateBeaconBlockAltair(b *ethpb.BeaconBlockAltair) *ethpb.BeaconBlockAltair
HydrateBeaconBlockAltair hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBellatrix ¶
func HydrateBeaconBlockBellatrix(b *ethpb.BeaconBlockBellatrix) *ethpb.BeaconBlockBellatrix
HydrateBeaconBlockBellatrix hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBody ¶
func HydrateBeaconBlockBody(b *ethpb.BeaconBlockBody) *ethpb.BeaconBlockBody
HydrateBeaconBlockBody hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBodyAltair ¶
func HydrateBeaconBlockBodyAltair(b *ethpb.BeaconBlockBodyAltair) *ethpb.BeaconBlockBodyAltair
HydrateBeaconBlockBodyAltair hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBodyBellatrix ¶
func HydrateBeaconBlockBodyBellatrix(b *ethpb.BeaconBlockBodyBellatrix) *ethpb.BeaconBlockBodyBellatrix
HydrateBeaconBlockBodyBellatrix hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBodyCapella ¶
func HydrateBeaconBlockBodyCapella(b *ethpb.BeaconBlockBodyCapella) *ethpb.BeaconBlockBodyCapella
HydrateBeaconBlockBodyCapella hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBodyDeneb ¶
func HydrateBeaconBlockBodyDeneb(b *ethpb.BeaconBlockBodyDeneb) *ethpb.BeaconBlockBodyDeneb
HydrateBeaconBlockBodyDeneb hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBodyElectra ¶ added in v5.1.0
func HydrateBeaconBlockBodyElectra(b *ethpb.BeaconBlockBodyElectra) *ethpb.BeaconBlockBodyElectra
HydrateBeaconBlockBodyElectra hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockBodyFulu ¶ added in v5.3.0
func HydrateBeaconBlockBodyFulu(b *ethpb.BeaconBlockBodyFulu) *ethpb.BeaconBlockBodyFulu
HydrateBeaconBlockBodyFulu hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockCapella ¶
func HydrateBeaconBlockCapella(b *ethpb.BeaconBlockCapella) *ethpb.BeaconBlockCapella
HydrateBeaconBlockCapella hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockDeneb ¶
func HydrateBeaconBlockDeneb(b *ethpb.BeaconBlockDeneb) *ethpb.BeaconBlockDeneb
HydrateBeaconBlockDeneb hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockElectra ¶ added in v5.1.0
func HydrateBeaconBlockElectra(b *ethpb.BeaconBlockElectra) *ethpb.BeaconBlockElectra
HydrateBeaconBlockElectra hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconBlockFulu ¶ added in v5.3.0
func HydrateBeaconBlockFulu(b *ethpb.BeaconBlockFulu) *ethpb.BeaconBlockFulu
HydrateBeaconBlockFulu hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBeaconHeader ¶
func HydrateBeaconHeader(h *ethpb.BeaconBlockHeader) *ethpb.BeaconBlockHeader
HydrateBeaconHeader hydrates a beacon block header with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockBellatrix ¶
func HydrateBlindedBeaconBlockBellatrix(b *ethpb.BlindedBeaconBlockBellatrix) *ethpb.BlindedBeaconBlockBellatrix
HydrateBlindedBeaconBlockBellatrix hydrates a blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockBodyBellatrix ¶
func HydrateBlindedBeaconBlockBodyBellatrix(b *ethpb.BlindedBeaconBlockBodyBellatrix) *ethpb.BlindedBeaconBlockBodyBellatrix
HydrateBlindedBeaconBlockBodyBellatrix hydrates a blinded beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockBodyCapella ¶
func HydrateBlindedBeaconBlockBodyCapella(b *ethpb.BlindedBeaconBlockBodyCapella) *ethpb.BlindedBeaconBlockBodyCapella
HydrateBlindedBeaconBlockBodyCapella hydrates a blinded beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockBodyDeneb ¶
func HydrateBlindedBeaconBlockBodyDeneb(b *ethpb.BlindedBeaconBlockBodyDeneb) *ethpb.BlindedBeaconBlockBodyDeneb
HydrateBlindedBeaconBlockBodyDeneb hydrates a blinded beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockBodyElectra ¶ added in v5.1.0
func HydrateBlindedBeaconBlockBodyElectra(b *ethpb.BlindedBeaconBlockBodyElectra) *ethpb.BlindedBeaconBlockBodyElectra
HydrateBlindedBeaconBlockBodyElectra hydrates a blinded beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockBodyFulu ¶ added in v5.3.0
func HydrateBlindedBeaconBlockBodyFulu(b *ethpb.BlindedBeaconBlockBodyFulu) *ethpb.BlindedBeaconBlockBodyFulu
HydrateBlindedBeaconBlockBodyFulu hydrates a blinded beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockCapella ¶
func HydrateBlindedBeaconBlockCapella(b *ethpb.BlindedBeaconBlockCapella) *ethpb.BlindedBeaconBlockCapella
HydrateBlindedBeaconBlockCapella hydrates a blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockDeneb ¶
func HydrateBlindedBeaconBlockDeneb(b *ethpb.BlindedBeaconBlockDeneb) *ethpb.BlindedBeaconBlockDeneb
HydrateBlindedBeaconBlockDeneb hydrates a blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockElectra ¶ added in v5.1.0
func HydrateBlindedBeaconBlockElectra(b *ethpb.BlindedBeaconBlockElectra) *ethpb.BlindedBeaconBlockElectra
HydrateBlindedBeaconBlockElectra hydrates a blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlindedBeaconBlockFulu ¶ added in v5.3.0
func HydrateBlindedBeaconBlockFulu(b *ethpb.BlindedBeaconBlockFulu) *ethpb.BlindedBeaconBlockFulu
HydrateBlindedBeaconBlockFulu hydrates a blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateBlobSidecar ¶
func HydrateBlobSidecar(b *ethpb.BlobSidecar) *ethpb.BlobSidecar
HydrateBlobSidecar hydrates a blob sidecar with correct field length sizes to comply with SSZ marshalling and unmarshalling rules.
func HydrateCommitmentInclusionProofs ¶
func HydrateCommitmentInclusionProofs() [][]byte
HydrateCommitmentInclusionProofs returns 2d byte slice of Commitment Inclusion Proofs
func HydrateExecutionRequests ¶ added in v5.1.1
func HydrateExecutionRequests(e *enginev1.ExecutionRequests) *enginev1.ExecutionRequests
HydrateExecutionRequests fills the execution requests with the correct field lengths
func HydrateIndexedAttestation ¶
func HydrateIndexedAttestation(a *ethpb.IndexedAttestation) *ethpb.IndexedAttestation
HydrateIndexedAttestation hydrates an indexed attestation with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateIndexedAttestationElectra ¶ added in v5.3.0
func HydrateIndexedAttestationElectra(a *ethpb.IndexedAttestationElectra) *ethpb.IndexedAttestationElectra
HydrateIndexedAttestationElectra hydrates an indexed attestation with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlock ¶
func HydrateSignedBeaconBlock(b *ethpb.SignedBeaconBlock) *ethpb.SignedBeaconBlock
HydrateSignedBeaconBlock hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockAltair ¶
func HydrateSignedBeaconBlockAltair(b *ethpb.SignedBeaconBlockAltair) *ethpb.SignedBeaconBlockAltair
HydrateSignedBeaconBlockAltair hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockBellatrix ¶
func HydrateSignedBeaconBlockBellatrix(b *ethpb.SignedBeaconBlockBellatrix) *ethpb.SignedBeaconBlockBellatrix
HydrateSignedBeaconBlockBellatrix hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockCapella ¶
func HydrateSignedBeaconBlockCapella(b *ethpb.SignedBeaconBlockCapella) *ethpb.SignedBeaconBlockCapella
HydrateSignedBeaconBlockCapella hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockContentsDeneb ¶
func HydrateSignedBeaconBlockContentsDeneb(b *ethpb.SignedBeaconBlockContentsDeneb) *ethpb.SignedBeaconBlockContentsDeneb
HydrateSignedBeaconBlockContentsDeneb hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockContentsElectra ¶ added in v5.1.0
func HydrateSignedBeaconBlockContentsElectra(b *ethpb.SignedBeaconBlockContentsElectra) *ethpb.SignedBeaconBlockContentsElectra
HydrateSignedBeaconBlockContentsElectra hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockContentsFulu ¶ added in v5.3.0
func HydrateSignedBeaconBlockContentsFulu(b *ethpb.SignedBeaconBlockContentsFulu) *ethpb.SignedBeaconBlockContentsFulu
HydrateSignedBeaconBlockContentsFulu hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockDeneb ¶
func HydrateSignedBeaconBlockDeneb(b *ethpb.SignedBeaconBlockDeneb) *ethpb.SignedBeaconBlockDeneb
HydrateSignedBeaconBlockDeneb hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockElectra ¶ added in v5.1.0
func HydrateSignedBeaconBlockElectra(b *ethpb.SignedBeaconBlockElectra) *ethpb.SignedBeaconBlockElectra
HydrateSignedBeaconBlockElectra hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconBlockFulu ¶ added in v5.3.0
func HydrateSignedBeaconBlockFulu(b *ethpb.SignedBeaconBlockFulu) *ethpb.SignedBeaconBlockFulu
HydrateSignedBeaconBlockFulu hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBeaconHeader ¶
func HydrateSignedBeaconHeader(h *ethpb.SignedBeaconBlockHeader) *ethpb.SignedBeaconBlockHeader
HydrateSignedBeaconHeader hydrates a signed beacon block header with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBlindedBeaconBlockBellatrix ¶
func HydrateSignedBlindedBeaconBlockBellatrix(b *ethpb.SignedBlindedBeaconBlockBellatrix) *ethpb.SignedBlindedBeaconBlockBellatrix
HydrateSignedBlindedBeaconBlockBellatrix hydrates a signed blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBlindedBeaconBlockCapella ¶
func HydrateSignedBlindedBeaconBlockCapella(b *ethpb.SignedBlindedBeaconBlockCapella) *ethpb.SignedBlindedBeaconBlockCapella
HydrateSignedBlindedBeaconBlockCapella hydrates a signed blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBlindedBeaconBlockDeneb ¶
func HydrateSignedBlindedBeaconBlockDeneb(b *ethpb.SignedBlindedBeaconBlockDeneb) *ethpb.SignedBlindedBeaconBlockDeneb
HydrateSignedBlindedBeaconBlockDeneb hydrates a signed blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBlindedBeaconBlockElectra ¶ added in v5.1.0
func HydrateSignedBlindedBeaconBlockElectra(b *ethpb.SignedBlindedBeaconBlockElectra) *ethpb.SignedBlindedBeaconBlockElectra
HydrateSignedBlindedBeaconBlockElectra hydrates a signed blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSignedBlindedBeaconBlockFulu ¶ added in v5.3.0
func HydrateSignedBlindedBeaconBlockFulu(b *ethpb.SignedBlindedBeaconBlockFulu) *ethpb.SignedBlindedBeaconBlockFulu
HydrateSignedBlindedBeaconBlockFulu hydrates a signed blinded beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateSingleAttestation ¶ added in v5.3.0
func HydrateSingleAttestation(a *ethpb.SingleAttestation) *ethpb.SingleAttestation
func HydrateSyncCommittee ¶
func HydrateSyncCommittee(s *ethpb.SyncCommitteeMessage) *ethpb.SyncCommitteeMessage
HydrateSyncCommittee hydrates the provided sync committee message.
func HydrateV1Attestation ¶
func HydrateV1Attestation(a *attv1.Attestation) *attv1.Attestation
HydrateV1Attestation hydrates a v1 attestation object with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateV1AttestationData ¶
func HydrateV1AttestationData(d *attv1.AttestationData) *attv1.AttestationData
HydrateV1AttestationData hydrates a v1 attestation data object with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateV1BeaconBlock ¶
func HydrateV1BeaconBlock(b *v1.BeaconBlock) *v1.BeaconBlock
HydrateV1BeaconBlock hydrates a beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateV1BeaconBlockBody ¶
func HydrateV1BeaconBlockBody(b *v1.BeaconBlockBody) *v1.BeaconBlockBody
HydrateV1BeaconBlockBody hydrates a beacon block body with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func HydrateV1SignedBeaconBlock ¶
func HydrateV1SignedBeaconBlock(b *v1.SignedBeaconBlock) *v1.SignedBeaconBlock
HydrateV1SignedBeaconBlock hydrates a signed beacon block with correct field length sizes to comply with fssz marshalling and unmarshalling rules.
func NewAttestation ¶
func NewAttestation() *ethpb.Attestation
NewAttestation creates a block attestation with minimum marshalable fields.
func NewAttestationElectra ¶ added in v5.1.0
func NewAttestationElectra() *ethpb.AttestationElectra
NewAttestationElectra creates a block attestation with minimum marshalable fields.
func NewBeaconBlock ¶
func NewBeaconBlock() *ethpb.SignedBeaconBlock
NewBeaconBlock creates a beacon block with minimum marshalable fields.
func NewBeaconBlockAltair ¶
func NewBeaconBlockAltair() *ethpb.SignedBeaconBlockAltair
NewBeaconBlockAltair creates a beacon block with minimum marshalable fields.
func NewBeaconBlockBellatrix ¶
func NewBeaconBlockBellatrix() *ethpb.SignedBeaconBlockBellatrix
NewBeaconBlockBellatrix creates a beacon block with minimum marshalable fields.
func NewBeaconBlockCapella ¶
func NewBeaconBlockCapella() *ethpb.SignedBeaconBlockCapella
NewBeaconBlockCapella creates a beacon block with minimum marshalable fields.
func NewBeaconBlockContentsDeneb ¶
func NewBeaconBlockContentsDeneb() *ethpb.SignedBeaconBlockContentsDeneb
NewBeaconBlockContentsDeneb creates a beacon block with minimum marshalable fields.
func NewBeaconBlockContentsElectra ¶ added in v5.1.0
func NewBeaconBlockContentsElectra() *ethpb.SignedBeaconBlockContentsElectra
NewBeaconBlockContentsElectra creates a beacon block with minimum marshalable fields.
func NewBeaconBlockContentsFulu ¶ added in v5.3.0
func NewBeaconBlockContentsFulu() *ethpb.SignedBeaconBlockContentsFulu
NewBeaconBlockContentsFulu creates a beacon block with minimum marshalable fields.
func NewBeaconBlockDeneb ¶
func NewBeaconBlockDeneb() *ethpb.SignedBeaconBlockDeneb
NewBeaconBlockDeneb creates a beacon block with minimum marshalable fields.
func NewBeaconBlockElectra ¶ added in v5.1.0
func NewBeaconBlockElectra() *ethpb.SignedBeaconBlockElectra
NewBeaconBlockElectra creates a beacon block with minimum marshalable fields.
func NewBeaconBlockFulu ¶ added in v5.3.0
func NewBeaconBlockFulu() *ethpb.SignedBeaconBlockFulu
NewBeaconBlockFulu creates a beacon block with minimum marshalable fields.
func NewBeaconState ¶
func NewBeaconState(options ...NewBeaconStateOption) (state.BeaconState, error)
NewBeaconState creates a beacon state with minimum marshalable fields.
func NewBeaconStateAltair ¶
func NewBeaconStateAltair(options ...func(state *ethpb.BeaconStateAltair) error) (state.BeaconState, error)
NewBeaconStateAltair creates a beacon state with minimum marshalable fields.
func NewBeaconStateBellatrix ¶
func NewBeaconStateBellatrix(options ...func(state *ethpb.BeaconStateBellatrix) error) (state.BeaconState, error)
NewBeaconStateBellatrix creates a beacon state with minimum marshalable fields.
func NewBeaconStateCapella ¶
func NewBeaconStateCapella(options ...func(state *ethpb.BeaconStateCapella) error) (state.BeaconState, error)
NewBeaconStateCapella creates a beacon state with minimum marshalable fields.
func NewBeaconStateDeneb ¶
func NewBeaconStateDeneb(options ...func(state *ethpb.BeaconStateDeneb) error) (state.BeaconState, error)
NewBeaconStateDeneb creates a beacon state with minimum marshalable fields.
func NewBeaconStateElectra ¶ added in v5.1.0
func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) error) (state.BeaconState, error)
NewBeaconStateElectra creates a beacon state with minimum marshalable fields.
func NewBeaconStateFulu ¶ added in v5.3.0
func NewBeaconStateFulu(options ...func(state *ethpb.BeaconStateFulu) error) (state.BeaconState, error)
NewBeaconStateFulu creates a beacon state with minimum marshalable fields.
func NewBlindedBeaconBlockBellatrix ¶
func NewBlindedBeaconBlockBellatrix() *ethpb.SignedBlindedBeaconBlockBellatrix
NewBlindedBeaconBlockBellatrix creates a blinded beacon block with minimum marshalable fields.
func NewBlindedBeaconBlockCapella ¶
func NewBlindedBeaconBlockCapella() *ethpb.SignedBlindedBeaconBlockCapella
NewBlindedBeaconBlockCapella creates a blinded beacon block with minimum marshalable fields.
func NewBlindedBeaconBlockDeneb ¶
func NewBlindedBeaconBlockDeneb() *ethpb.SignedBlindedBeaconBlockDeneb
NewBlindedBeaconBlockDeneb creates a blinded beacon block with minimum marshalable fields.
func NewBlindedBeaconBlockElectra ¶ added in v5.1.0
func NewBlindedBeaconBlockElectra() *ethpb.SignedBlindedBeaconBlockElectra
NewBlindedBeaconBlockElectra creates a blinded beacon block with minimum marshalable fields.
func NewBlindedBeaconBlockFulu ¶ added in v5.3.0
func NewBlindedBeaconBlockFulu() *ethpb.SignedBlindedBeaconBlockFulu
NewBlindedBeaconBlockFulu creates a blinded beacon block with minimum marshalable fields.
func PrepareRoots ¶
PrepareRoots returns a list of roots with hex representations of natural numbers starting with 0. Example: 16 becomes 0x00...0f.
func RandaoReveal ¶
func RandaoReveal(beaconState state.ReadOnlyBeaconState, epoch primitives.Epoch, privKeys []bls.SecretKey) ([]byte, error)
RandaoReveal returns a signature of the requested epoch using the beacon proposer private key.
func Random32Bytes ¶
Random32Bytes generates a random 32 byte slice.
func RegisterHookWithUndo ¶ added in v5.2.0
func RegisterHookWithUndo(logger *logrus.Logger, hook ComparableHook) func()
RegisterHookWithUndo adds a hook to the logger and returns a function that can be called to remove it. This is intended to be used in tests to ensure that test hooks are removed after the test is complete.
func SaveBlock ¶
func SaveBlock(tb assertions.AssertionTestingTB, ctx context.Context, db iface.NoHeadAccessDatabase, b interface{}) interfaces.SignedBeaconBlock
func UnregisterHook ¶ added in v5.2.0
func UnregisterHook(logger *logrus.Logger, unregister ComparableHook)
UnregisterHook removes a hook that implements the HookIdentifier interface from all levels of the given logger.
Types ¶
type BlockGenConfig ¶
type BlockGenConfig struct { NumProposerSlashings uint64 NumAttesterSlashings uint64 NumAttestations uint64 NumDeposits uint64 NumVoluntaryExits uint64 NumTransactions uint64 // Only for post Bellatrix blocks FullSyncAggregate bool NumBLSChanges uint64 // Only for post Capella blocks NumWithdrawals uint64 NumDepositRequests uint64 // Only for post Electra blocks NumWithdrawalRequests uint64 // Only for post Electra blocks NumConsolidationRequests uint64 // Only for post Electra blocks }
BlockGenConfig is used to define the requested conditions for block generation.
func DefaultBlockGenConfig ¶
func DefaultBlockGenConfig() *BlockGenConfig
DefaultBlockGenConfig returns the block config that utilizes the current params in the beacon config.
type ChannelEntryWriter ¶ added in v5.2.0
ChannelEntryWriter embeds/wraps the test.Hook struct and adds a channel to receive log entries every time the Fire method of the Hook interface is called.
func NewChannelEntryWriter ¶ added in v5.2.0
func NewChannelEntryWriter(c chan *logrus.Entry) *ChannelEntryWriter
NewChannelEntryWriter creates a new ChannelEntryWriter. The channel argument will be sent all log entries. Note that if this is an unbuffered channel, it is the responsibility of the code using it to make sure that it is drained appropriately, or calls to the logger can block.
type ComparableHook ¶ added in v5.2.0
ComparableHook is an interface that allows hooks to be uniquely identified so that tests can safely unregister them as part of cleanup.
type DenebBlockGeneratorOption ¶
type DenebBlockGeneratorOption func(*denebBlockGenerator)
func WithPayloadSetter ¶ added in v5.1.0
func WithPayloadSetter(p *enginev1.ExecutionPayloadDeneb) DenebBlockGeneratorOption
func WithProposerSigning ¶
func WithProposerSigning(idx primitives.ValidatorIndex, sk bls.SecretKey, valRoot []byte) DenebBlockGeneratorOption
type ElectraBlockGeneratorOption ¶ added in v5.1.0
type ElectraBlockGeneratorOption func(*electraBlockGenerator)
func WithElectraPayload ¶ added in v5.1.0
func WithElectraPayload(p *enginev1.ExecutionPayloadDeneb) ElectraBlockGeneratorOption
func WithElectraProposerSigning ¶ added in v5.1.0
func WithElectraProposerSigning(idx primitives.ValidatorIndex, sk bls.SecretKey, valRoot []byte) ElectraBlockGeneratorOption
type NewBeaconStateOption ¶
type NewBeaconStateOption func(state *ethpb.BeaconState) error
type TestLightClient ¶ added in v5.1.1
type TestLightClient struct { T *testing.T Ctx context.Context State state.BeaconState Block interfaces.ReadOnlySignedBeaconBlock AttestedState state.BeaconState AttestedBlock interfaces.ReadOnlySignedBeaconBlock FinalizedBlock interfaces.ReadOnlySignedBeaconBlock }
func NewTestLightClient ¶ added in v5.1.1
func NewTestLightClient(t *testing.T) *TestLightClient
func (*TestLightClient) CheckAttestedHeader ¶ added in v5.1.1
func (l *TestLightClient) CheckAttestedHeader(header interfaces.LightClientHeader)
func (*TestLightClient) CheckSyncAggregate ¶ added in v5.1.1
func (l *TestLightClient) CheckSyncAggregate(sa *ethpb.SyncAggregate)
func (*TestLightClient) SetupTestAltair ¶ added in v5.1.1
func (l *TestLightClient) SetupTestAltair() *TestLightClient
func (*TestLightClient) SetupTestBellatrix ¶ added in v5.2.0
func (l *TestLightClient) SetupTestBellatrix() *TestLightClient
func (*TestLightClient) SetupTestCapella ¶ added in v5.1.1
func (l *TestLightClient) SetupTestCapella(blinded bool) *TestLightClient
func (*TestLightClient) SetupTestCapellaFinalizedBlockAltair ¶ added in v5.1.1
func (l *TestLightClient) SetupTestCapellaFinalizedBlockAltair(blinded bool) *TestLightClient
func (*TestLightClient) SetupTestDeneb ¶ added in v5.1.1
func (l *TestLightClient) SetupTestDeneb(blinded bool) *TestLightClient
func (*TestLightClient) SetupTestDenebFinalizedBlockCapella ¶ added in v5.1.1
func (l *TestLightClient) SetupTestDenebFinalizedBlockCapella(blinded bool) *TestLightClient
func (*TestLightClient) SetupTestElectra ¶ added in v5.1.1
func (l *TestLightClient) SetupTestElectra(blinded bool) *TestLightClient
func (*TestLightClient) SetupTestElectraFinalizedBlockDeneb ¶ added in v5.3.0
func (l *TestLightClient) SetupTestElectraFinalizedBlockDeneb(blinded bool) *TestLightClient
func (*TestLightClient) SetupTestFulu ¶ added in v5.3.0
func (l *TestLightClient) SetupTestFulu(blinded bool) *TestLightClient
type Waiter ¶
type Waiter struct {
// contains filtered or unexported fields
}
Waiter offers an alternate ux for building tests that want to ensure contexts are used in certain ways.
func NewWaiter ¶
func NewWaiter() *Waiter
NewWaiter internally create the chan that Waiter relies on.
func (*Waiter) Done ¶
func (w *Waiter) Done()
Done is used with RequireDoneAfter and RequireDoneBefore to make assertions that certain test code is reached before a timeout or context cancellation.
func (*Waiter) RequireDoneAfter ¶
RequireDoneAfter forces the test to fail if the timeout is reached before Done is called.
Source Files
¶
- altair.go
- attestation.go
- bazel.go
- bellatrix.go
- bellatrix_state.go
- blob.go
- block.go
- capella_block.go
- capella_state.go
- deneb.go
- deneb_state.go
- deposits.go
- electra.go
- electra_block.go
- electra_state.go
- helpers.go
- lightclient.go
- logging.go
- merge.go
- state.go
- sync_aggregate.go
- sync_committee.go
- wait_timeout.go