validatormock

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package validatormock provides mock validator client functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProposeBlindedBlock added in v0.9.0

func ProposeBlindedBlock(ctx context.Context, eth2Cl eth2wrap.Client, signFunc SignFunc,
	slot eth2p0.Slot, pubkeys ...eth2p0.BLSPubKey,
) error

ProposeBlindedBlock proposes blinded block for the given slot.

func ProposeBlock added in v0.4.0

func ProposeBlock(ctx context.Context, eth2Cl eth2wrap.Client, signFunc SignFunc,
	slot eth2p0.Slot, pubkeys ...eth2p0.BLSPubKey,
) error

ProposeBlock proposes block for the given slot.

func Register added in v0.10.0

func Register(ctx context.Context, eth2Cl eth2wrap.Client, signFunc SignFunc,
	registration *eth2api.VersionedValidatorRegistration, pubshare eth2p0.BLSPubKey,
) error

Register signs and submits the validator builder registration to the validator API.

Types

type SignFunc

type SignFunc func(pubshare eth2p0.BLSPubKey, data []byte) (eth2p0.BLSSignature, error)

SignFunc abstract signing done by the validator client.

func NewSigner

func NewSigner(secrets ...*bls_sig.SecretKey) SignFunc

NewSigner returns a signing function supporting the provided private keys.

type SlotAttester added in v0.10.1

type SlotAttester struct {
	// contains filtered or unexported fields
}

SlotAttester is a stateful structure providing a slot attestation and aggregation API excluding scheduling.

func NewSlotAttester added in v0.10.1

func NewSlotAttester(eth2Cl eth2wrap.Client, slot eth2p0.Slot, signFunc SignFunc, pubkeys []eth2p0.BLSPubKey) *SlotAttester

NewSlotAttester returns a new SlotAttester.

func (*SlotAttester) Aggregate added in v0.10.1

func (a *SlotAttester) Aggregate(ctx context.Context) (bool, error)

Aggregate should be called at latest 2/3 into the slot, it does slot attestation aggregations.

func (*SlotAttester) Attest added in v0.10.1

func (a *SlotAttester) Attest(ctx context.Context) error

Attest should be called at latest 1/3 into the slot, it does slot attestations.

func (*SlotAttester) Prepare added in v0.10.1

func (a *SlotAttester) Prepare(ctx context.Context) error

Prepare should be called at the start of slot, it does the following: - Filters active validators for the slot (this could be cached at start of epoch) - Fetches attester attDuties for the slot (this could be cached at start of epoch). - Prepares aggregation attDuties for slot attesters. It panics if called more than once. TODO(xenowits): Figure out why is this called twice sometimes (https://github.com/ObolNetwork/charon/issues/1389)).

func (*SlotAttester) Slot added in v0.10.1

func (a *SlotAttester) Slot() eth2p0.Slot

Slot returns the attester slot.

type SyncCommMember added in v0.11.0

type SyncCommMember struct {
	// contains filtered or unexported fields
}

SyncCommMember is a stateful structure providing sync committee message and contribution APIs.

func NewSyncCommMember added in v0.11.0

func NewSyncCommMember(eth2Cl eth2wrap.Client, epoch eth2p0.Epoch, signFunc SignFunc, pubkeys []eth2p0.BLSPubKey) *SyncCommMember

func (*SyncCommMember) Aggregate added in v0.11.0

func (s *SyncCommMember) Aggregate(ctx context.Context, slot eth2p0.Slot) (bool, error)

Aggregate submits SignedContributionAndProof at 2/3rd into the slot. It does sync committee aggregations. It blocks until sync committee selections are ready for this slot.

func (*SyncCommMember) Epoch added in v0.11.0

func (s *SyncCommMember) Epoch() eth2p0.Epoch

func (*SyncCommMember) Message added in v0.11.0

func (s *SyncCommMember) Message(ctx context.Context, slot eth2p0.Slot) error

Message submits sync committee messages at 1/3rd into the slot. It also sets the beacon block root for the slot.

func (*SyncCommMember) PrepareEpoch added in v0.11.0

func (s *SyncCommMember) PrepareEpoch(ctx context.Context) error

PrepareEpoch stores sync committee duties and submits sync committee subscriptions at the start of an epoch.

func (*SyncCommMember) PrepareSlot added in v0.11.0

func (s *SyncCommMember) PrepareSlot(ctx context.Context, slot eth2p0.Slot) error

PrepareSlot prepares selection proofs at the start of a slot.

Jump to

Keyboard shortcuts

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