eth2exp

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconCommitteeSubscription

type BeaconCommitteeSubscription struct {
	// ValidatorIdex is the index of the validator making the subscription request.
	ValidatorIndex eth2p0.ValidatorIndex
	// Slot is the slot for which the validator is attesting.
	Slot eth2p0.Slot
	// CommitteeIndex is the index of the committee of which the validator is a member at the given slot.
	CommitteeIndex eth2p0.CommitteeIndex
	// CommitteesAtSlot is the number of committees at the given slot.
	CommitteesAtSlot uint64
	// SlotSignature is the slot signature required to calculate whether the validator is an aggregator.
	SlotSignature eth2p0.BLSSignature
}

BeaconCommitteeSubscription is the data required for a beacon committee subscription.

func (*BeaconCommitteeSubscription) MarshalJSON

func (b *BeaconCommitteeSubscription) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*BeaconCommitteeSubscription) String

func (b *BeaconCommitteeSubscription) String() (string, error)

String returns a string version of the structure.

func (*BeaconCommitteeSubscription) UnmarshalJSON

func (b *BeaconCommitteeSubscription) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BeaconCommitteeSubscriptionResponse

type BeaconCommitteeSubscriptionResponse struct {
	// ValidatorIndex is the index of the validator the made the subscription request.
	ValidatorIndex eth2p0.ValidatorIndex
	// Slot is the slot for which the validator is attesting.
	Slot eth2p0.Slot
	// CommitteeIndex is the index of the committee of which the validator is a member at the given slot.
	CommitteeIndex eth2p0.CommitteeIndex
	// CommitteesAtSlot is the number of committees at the given slot.
	CommitteesAtSlot uint64
	// IsAggregator indicates whether the validator is an attestation aggregator.
	IsAggregator bool
	// SelectionProof is the slot signature proving the validator is an aggregator for this slot and committee.
	SelectionProof eth2p0.BLSSignature
}

BeaconCommitteeSubscriptionResponse is the response from beacon node after submitting BeaconCommitteeSubscription.

func CalculateCommitteeSubscriptionResponse

func CalculateCommitteeSubscriptionResponse(ctx context.Context, eth2Cl eth2Provider, sub *BeaconCommitteeSubscription) (*BeaconCommitteeSubscriptionResponse, error)

CalculateCommitteeSubscriptionResponse returns a BeaconCommitteeSubscriptionResponse with isAggregator field set to true if the validator is an aggregator.

type BeaconCommitteeSubscriptionsSubmitterV2

type BeaconCommitteeSubscriptionsSubmitterV2 interface {
	// SubmitBeaconCommitteeSubscriptionsV2 subscribes to beacon committees.
	SubmitBeaconCommitteeSubscriptionsV2(ctx context.Context, subscriptions []*BeaconCommitteeSubscription) ([]*BeaconCommitteeSubscriptionResponse, error)
}

BeaconCommitteeSubscriptionsSubmitterV2 is the interface for submitting beacon committee subnet subscription requests. TODO(dhruv): Should be removed once it is supported by go-eth2-client.

Jump to

Keyboard shortcuts

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