core

package
v0.12.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DutyToProto added in v0.3.0

func DutyToProto(duty Duty) *pbv1.Duty

DutyToProto returns the duty as a protobuf.

func NewDutyDeadlineFunc added in v0.6.0

func NewDutyDeadlineFunc(ctx context.Context, eth2Cl eth2wrap.Client) (func(Duty) (time.Time, bool), error)

NewDutyDeadlineFunc returns the function that provides duty deadlines or false if the duty never deadlines.

func ParSignedDataSetToProto added in v0.3.0

func ParSignedDataSetToProto(set ParSignedDataSet) (*pbv1.ParSignedDataSet, error)

ParSignedDataSetToProto returns the set as a protobuf.

func ParSignedDataToProto added in v0.3.0

func ParSignedDataToProto(data ParSignedData) (*pbv1.ParSignedData, error)

ParSignedDataToProto returns the data as a protobuf.

func StartDutyTrace

func StartDutyTrace(ctx context.Context, duty Duty, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

StartDutyTrace returns a context and span rooted to the duty traceID and wrapped in a duty span. This creates a new trace root and should generally only be called when a new duty is scheduled or when a duty is received from the VC or peer.

func UnsignedDataSetToProto added in v0.4.0

func UnsignedDataSetToProto(set UnsignedDataSet) (*pbv1.UnsignedDataSet, error)

UnsignedDataSetToProto returns the set as a protobuf.

func VerifyEth2SignedData added in v0.12.0

func VerifyEth2SignedData(ctx context.Context, eth2Cl eth2wrap.Client, data Eth2SignedData, pubkey *bls_sig.PublicKey) error

VerifyEth2SignedData verifies signature associated with given Eth2SignedData.

func Wire

func Wire(sched Scheduler,
	fetch Fetcher,
	cons Consensus,
	dutyDB DutyDB,
	vapi ValidatorAPI,
	parSigDB ParSigDB,
	parSigEx ParSigEx,
	sigAgg SigAgg,
	aggSigDB AggSigDB,
	bcast Broadcaster,
	opts ...WireOption,
)

Wire wires the workflow components together.

Types

type AggSigDB

type AggSigDB interface {
	// Store stores aggregated signed duty data.
	Store(context.Context, Duty, PubKey, SignedData) error

	// Await blocks and returns the aggregated signed duty data when available.
	Await(context.Context, Duty, PubKey) (SignedData, error)
}

AggSigDB persists aggregated signed duty data.

type AggregatedAttestation added in v0.10.1

type AggregatedAttestation struct {
	eth2p0.Attestation
}

AggregatedAttestation wraps un unsigned aggregated attestation and implements the UnsignedData interface.

func NewAggregatedAttestation added in v0.10.1

func NewAggregatedAttestation(att *eth2p0.Attestation) AggregatedAttestation

NewAggregatedAttestation returns a new aggregated attestation.

func (AggregatedAttestation) Clone added in v0.10.1

func (AggregatedAttestation) MarshalJSON added in v0.10.1

func (a AggregatedAttestation) MarshalJSON() ([]byte, error)

func (*AggregatedAttestation) UnmarshalJSON added in v0.10.1

func (a *AggregatedAttestation) UnmarshalJSON(input []byte) error

type Attestation added in v0.7.0

type Attestation struct {
	eth2p0.Attestation
}

Attestation is a signed attestation and implements SignedData.

func NewAttestation added in v0.7.0

func NewAttestation(att *eth2p0.Attestation) Attestation

NewAttestation is a convenience function that returns a new wrapped attestation.

func (Attestation) Clone added in v0.7.0

func (a Attestation) Clone() (SignedData, error)

func (Attestation) DomainName added in v0.12.0

func (Attestation) DomainName() signing.DomainName

func (Attestation) Epoch added in v0.12.0

func (Attestation) MarshalJSON added in v0.7.0

func (a Attestation) MarshalJSON() ([]byte, error)

func (Attestation) MessageRoot added in v0.12.0

func (a Attestation) MessageRoot() ([32]byte, error)

func (Attestation) SetSignature added in v0.7.0

func (a Attestation) SetSignature(sig Signature) (SignedData, error)

func (Attestation) Signature added in v0.7.0

func (a Attestation) Signature() Signature

func (*Attestation) UnmarshalJSON added in v0.7.0

func (a *Attestation) UnmarshalJSON(b []byte) error

type AttestationData

type AttestationData struct {
	Data eth2p0.AttestationData
	Duty eth2v1.AttesterDuty
}

AttestationData wraps the eth2 attestation data and adds the original duty. The original duty allows mapping the partial signed response from the VC back to the validator pubkey via the aggregation bits field.

func (AttestationData) Clone added in v0.7.0

func (a AttestationData) Clone() (UnsignedData, error)

func (AttestationData) MarshalJSON added in v0.7.0

func (a AttestationData) MarshalJSON() ([]byte, error)

func (*AttestationData) UnmarshalJSON added in v0.7.0

func (a *AttestationData) UnmarshalJSON(data []byte) error

type AttesterDefinition added in v0.7.0

type AttesterDefinition struct {
	eth2v1.AttesterDuty
}

AttesterDefinition defines an attester duty. It implements DutyDefinition. Note the slight rename from Duty to Definition to avoid overloading the term Duty.

func NewAttesterDefinition added in v0.7.0

func NewAttesterDefinition(duty *eth2v1.AttesterDuty) AttesterDefinition

NewAttesterDefinition is a convenience function that returns a new attester definition.

func (AttesterDefinition) Clone added in v0.7.0

func (AttesterDefinition) MarshalJSON added in v0.7.0

func (d AttesterDefinition) MarshalJSON() ([]byte, error)

type BeaconCommitteeSelection added in v0.11.0

type BeaconCommitteeSelection struct {
	eth2exp.BeaconCommitteeSelection
}

BeaconCommitteeSelection wraps a BeaconCommitteeSelection which implements SignedData.

func NewBeaconCommitteeSelection added in v0.11.0

func NewBeaconCommitteeSelection(selection *eth2exp.BeaconCommitteeSelection) BeaconCommitteeSelection

NewBeaconCommitteeSelection is a convenience function which returns new signed BeaconCommitteeSelection.

func (BeaconCommitteeSelection) Clone added in v0.11.0

func (BeaconCommitteeSelection) DomainName added in v0.12.0

func (BeaconCommitteeSelection) Epoch added in v0.12.0

func (BeaconCommitteeSelection) MarshalJSON added in v0.11.0

func (s BeaconCommitteeSelection) MarshalJSON() ([]byte, error)

func (BeaconCommitteeSelection) MessageRoot added in v0.12.0

func (s BeaconCommitteeSelection) MessageRoot() ([32]byte, error)

func (BeaconCommitteeSelection) SetSignature added in v0.11.0

func (s BeaconCommitteeSelection) SetSignature(sig Signature) (SignedData, error)

func (BeaconCommitteeSelection) Signature added in v0.11.0

func (s BeaconCommitteeSelection) Signature() Signature

func (*BeaconCommitteeSelection) UnmarshalJSON added in v0.11.0

func (s *BeaconCommitteeSelection) UnmarshalJSON(input []byte) error

type Broadcaster

type Broadcaster interface {
	Broadcast(context.Context, Duty, PubKey, SignedData) error
}

Broadcaster broadcasts aggregated signed duty data to the beacon node.

type Consensus

type Consensus interface {
	// Propose triggers consensus game of the proposed duty unsigned data set.
	Propose(context.Context, Duty, UnsignedDataSet) error

	// Subscribe registers a callback for resolved (reached consensus) duty unsigned data set.
	Subscribe(func(context.Context, Duty, UnsignedDataSet) error)
}

Consensus comes to consensus on proposed duty data.

type Deadliner added in v0.9.0

type Deadliner interface {
	// Add returns true if the duty was added for future deadline scheduling. It is idempotent
	// and returns true if the duty was previously added and still awaits deadline scheduling. It
	// returns false if the duty has already expired and cannot therefore be added for scheduling.
	Add(duty Duty) bool

	// C returns the same read channel every time and contains deadlined duties.
	// It should only be called by a single goroutine.
	C() <-chan Duty
}

Deadliner provides duty Deadline functionality. The C method isn’t thread safe and may only be used by a single goroutine. So, multiple instances are required for different components and use cases.

func NewDeadliner added in v0.9.0

func NewDeadliner(ctx context.Context, label string, deadlineFunc func(Duty) (time.Time, bool)) Deadliner

NewDeadliner returns a new instance of Deadline.

It also starts a goroutine which is responsible for reading and storing duties, and sending the deadlined duty to receiver's deadlineChan until the context is closed.

func NewDeadlinerForT added in v0.10.0

func NewDeadlinerForT(ctx context.Context, t *testing.T, deadlineFunc func(Duty) (time.Time, bool), clock clockwork.Clock) Deadliner

NewDeadlinerForT returns a Deadline for use in tests.

type Duty

type Duty struct {
	// Slot is the Ethereum consensus layer slot.
	Slot int64
	// Type is the duty type performed in the slot.
	Type DutyType
}

Duty is the unit of work of the core workflow.

func DutyFromProto added in v0.3.0

func DutyFromProto(duty *pbv1.Duty) Duty

DutyFromProto returns the duty from a protobuf.

func NewAggregatorDuty added in v0.10.1

func NewAggregatorDuty(slot int64) Duty

NewAggregatorDuty returns a new aggregator duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyAggregator}
vs
core.NewAggregatorDuty(slot)

func NewAttesterDuty

func NewAttesterDuty(slot int64) Duty

NewAttesterDuty returns a new attester duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyAttester}
vs
core.NewAttesterDuty(slot)

func NewBuilderProposerDuty added in v0.9.0

func NewBuilderProposerDuty(slot int64) Duty

NewBuilderProposerDuty returns a new builder proposer duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyBuilderProposer}
vs
core.NewBuilderProposerDuty(slot)

func NewBuilderRegistrationDuty added in v0.10.0

func NewBuilderRegistrationDuty(slot int64) Duty

NewBuilderRegistrationDuty returns a new builder registration duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyBuilderRegistration}
vs
core.NewBuilderRegistrationDuty(slot)

func NewInfoSyncDuty added in v0.12.0

func NewInfoSyncDuty(slot int64) Duty

NewInfoSyncDuty returns a new info sync duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent.

func NewPrepareAggregatorDuty added in v0.10.1

func NewPrepareAggregatorDuty(slot int64) Duty

NewPrepareAggregatorDuty returns a new prepare aggregator duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyPrepareAggregator}
vs
core.NewPrepareAggregatorDuty(slot)

func NewPrepareSyncContributionDuty added in v0.11.0

func NewPrepareSyncContributionDuty(slot int64) Duty

NewPrepareSyncContributionDuty returns a new prepare sync contribution duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyPrepareSyncContribution}
vs
core.NewPrepareSyncContributionDuty(slot)

func NewProposerDuty added in v0.3.0

func NewProposerDuty(slot int64) Duty

NewProposerDuty returns a new proposer duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyProposer}
vs
core.NewProposerDuty(slot)

func NewRandaoDuty added in v0.3.0

func NewRandaoDuty(slot int64) Duty

NewRandaoDuty returns a new randao duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyRandao}
vs
core.NewRandaoDuty(slot)

func NewSignatureDuty added in v0.10.0

func NewSignatureDuty(slot int64) Duty

NewSignatureDuty returns a new Signature duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutySignature}
vs
core.NewSignatureDuty(slot)

func NewSyncContributionDuty added in v0.11.0

func NewSyncContributionDuty(slot int64) Duty

NewSyncContributionDuty returns a new sync contribution duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutySyncContribution}
vs
core.NewSyncContributionDuty(slot)

func NewSyncMessageDuty added in v0.11.0

func NewSyncMessageDuty(slot int64) Duty

NewSyncMessageDuty returns a new sync message duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutySyncMessage}
vs
core.NewSyncMessageDuty(slot)

func NewVoluntaryExit added in v0.9.0

func NewVoluntaryExit(slot int64) Duty

NewVoluntaryExit returns a new voluntary exit duty. It is a convenience function that is slightly more readable and concise than the struct literal equivalent:

core.Duty{Slot: slot, Type: core.DutyExit}
vs
core.NewVoluntaryExit(slot)

func (Duty) String

func (d Duty) String() string

type DutyDB

type DutyDB interface {
	// Store stores the unsigned duty data set.
	Store(context.Context, Duty, UnsignedDataSet) error

	// AwaitBeaconBlock blocks and returns the proposed beacon block
	// for the slot when available.
	AwaitBeaconBlock(ctx context.Context, slot int64) (*spec.VersionedBeaconBlock, error)

	// AwaitBlindedBeaconBlock blocks and returns the proposed blinded beacon block
	// for the slot when available.
	AwaitBlindedBeaconBlock(ctx context.Context, slot int64) (*eth2api.VersionedBlindedBeaconBlock, error)

	// AwaitAttestation blocks and returns the attestation data
	// for the slot and committee index when available.
	AwaitAttestation(ctx context.Context, slot, commIdx int64) (*eth2p0.AttestationData, error)

	// PubKeyByAttestation returns the validator PubKey for the provided attestation data
	// slot, committee index and validator committee index. This allows mapping of attestation
	// data response to validator.
	PubKeyByAttestation(ctx context.Context, slot, commIdx, valCommIdx int64) (PubKey, error)

	// AwaitAggAttestation blocks and returns the aggregated attestation for the slot
	// and attestation when available.
	AwaitAggAttestation(ctx context.Context, slot int64, attestationRoot eth2p0.Root) (*eth2p0.Attestation, error)

	// AwaitSyncContribution blocks and returns the sync committee contribution data for the slot and
	// the subcommittee and the beacon block root when available.
	AwaitSyncContribution(ctx context.Context, slot, subcommIdx int64, beaconBlockRoot eth2p0.Root) (*altair.SyncCommitteeContribution, error)
}

DutyDB persists unsigned duty data sets and makes it available for querying. It also acts as slashing database.

type DutyDefinition added in v0.7.0

type DutyDefinition interface {
	// Clone returns a cloned copy of the DutyDefinition.
	Clone() (DutyDefinition, error)
	// Marshaler returns the json serialised duty definition.
	json.Marshaler
}

DutyDefinition defines the duty including parameters required to fetch the duty data, it is the result of resolving duties at the start of an epoch.

func NewSyncCommitteeDefinition added in v0.12.0

func NewSyncCommitteeDefinition(duty *eth2v1.SyncCommitteeDuty) DutyDefinition

NewSyncCommitteeDefinition is a convenience function that returns a new SyncCommitteeDefinition.

type DutyDefinitionSet added in v0.7.0

type DutyDefinitionSet map[PubKey]DutyDefinition

DutyDefinitionSet is a set of duty definitions, one per validator.

func (DutyDefinitionSet) Clone added in v0.7.0

Clone returns a cloned copy of the DutyDefinitionSet. For an immutable core workflow architecture, remember to clone data when it leaves the current scope (sharing, storing, returning, etc).

type DutyType

type DutyType int

DutyType enumerates the different types of duties.

const (
	DutyUnknown                 DutyType = 0
	DutyProposer                DutyType = 1
	DutyAttester                DutyType = 2
	DutySignature               DutyType = 3
	DutyExit                    DutyType = 4
	DutyBuilderProposer         DutyType = 5
	DutyBuilderRegistration     DutyType = 6
	DutyRandao                  DutyType = 7
	DutyPrepareAggregator       DutyType = 8
	DutyAggregator              DutyType = 9
	DutySyncMessage             DutyType = 10
	DutyPrepareSyncContribution DutyType = 11
	DutySyncContribution        DutyType = 12
	DutyInfoSync                DutyType = 13
)

func AllDutyTypes

func AllDutyTypes() []DutyType

AllDutyTypes returns a list of all valid duty types.

func (DutyType) String

func (d DutyType) String() string

func (DutyType) Valid

func (d DutyType) Valid() bool

type Eth2SignedData added in v0.12.0

type Eth2SignedData interface {
	SignedData
	// DomainName returns domain associated with underlying signed data.
	DomainName() signing.DomainName
	// Epoch returns eth2p0.Epoch associated with underlying type.
	Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
}

Eth2SignedData wraps SignedData and adds eth2 BLS signature specific methods.

type Fetcher

type Fetcher interface {
	// Fetch triggers fetching of a proposed duty data set.
	Fetch(context.Context, Duty, DutyDefinitionSet) error

	// Subscribe registers a callback for proposed unsigned duty data sets.
	Subscribe(func(context.Context, Duty, UnsignedDataSet) error)

	// RegisterAggSigDB registers a function to get resolved aggregated
	// signed data from the AggSigDB (e.g., randao reveals).
	RegisterAggSigDB(func(context.Context, Duty, PubKey) (SignedData, error))

	// RegisterAwaitAttData registers a function to get attestation data from DutyDB.
	RegisterAwaitAttData(func(ctx context.Context, slot int64, commIdx int64) (*eth2p0.AttestationData, error))
}

Fetcher fetches proposed unsigned duty data.

type ParSigDB

type ParSigDB interface {
	// StoreInternal stores an internally received partially signed duty data set.
	StoreInternal(context.Context, Duty, ParSignedDataSet) error

	// StoreExternal stores an externally received partially signed duty data set.
	StoreExternal(context.Context, Duty, ParSignedDataSet) error

	// SubscribeInternal registers a callback when an internal
	// partially signed duty set is stored.
	SubscribeInternal(func(context.Context, Duty, ParSignedDataSet) error)

	// SubscribeThreshold registers a callback when *threshold*
	// partially signed duty is reached for a DV.
	SubscribeThreshold(func(context.Context, Duty, PubKey, []ParSignedData) error)
}

ParSigDB persists partial signatures and sends them to the partial signature exchange and aggregation.

type ParSigEx

type ParSigEx interface {
	// Broadcast broadcasts the partially signed duty data set to all peers.
	Broadcast(context.Context, Duty, ParSignedDataSet) error

	// Subscribe registers a callback when a partially signed duty set
	// is received from a peer.
	Subscribe(func(context.Context, Duty, ParSignedDataSet) error)
}

ParSigEx exchanges partially signed duty data sets.

type ParSignedData

type ParSignedData struct {
	// SignedData is a partially signed duty data.
	SignedData
	// ShareIdx returns the threshold BLS share index.
	ShareIdx int
}

ParSignedData is a partially signed duty data only signed by a single threshold BLS share.

func NewPartialAttestation added in v0.7.0

func NewPartialAttestation(att *eth2p0.Attestation, shareIdx int) ParSignedData

NewPartialAttestation is a convenience function that returns a new partially signed attestation.

func NewPartialSignature added in v0.7.0

func NewPartialSignature(sig Signature, shareIdx int) ParSignedData

NewPartialSignature is a convenience function that returns a new partially signature.

func NewPartialSignedAggregateAndProof added in v0.10.1

func NewPartialSignedAggregateAndProof(data *eth2p0.SignedAggregateAndProof, shareIdx int) ParSignedData

NewPartialSignedAggregateAndProof is a convenience function which returns a new partially signed SignedAggregateAndProof.

func NewPartialSignedBeaconCommitteeSelection added in v0.11.0

func NewPartialSignedBeaconCommitteeSelection(selection *eth2exp.BeaconCommitteeSelection, shareIdx int) ParSignedData

NewPartialSignedBeaconCommitteeSelection is a convenience function which returns new partially signed BeaconCommitteeSelection.

func NewPartialSignedRandao added in v0.10.0

func NewPartialSignedRandao(epoch eth2p0.Epoch, randao eth2p0.BLSSignature, shareIdx int) ParSignedData

NewPartialSignedRandao is a convenience function that returns a new partially signed Randao Reveal.

func NewPartialSignedSyncCommitteeSelection added in v0.12.0

func NewPartialSignedSyncCommitteeSelection(selection *eth2exp.SyncCommitteeSelection, shareIdx int) ParSignedData

NewPartialSignedSyncCommitteeSelection is a convenience function which returns new partially signed SyncCommitteeSelection.

func NewPartialSignedSyncContributionAndProof added in v0.12.0

func NewPartialSignedSyncContributionAndProof(proof *altair.SignedContributionAndProof, shareIdx int) ParSignedData

NewPartialSignedSyncContributionAndProof is a convenience function that returns a new partially signed altair.SignedContributionAndProof.

func NewPartialSignedSyncMessage added in v0.11.0

func NewPartialSignedSyncMessage(data *altair.SyncCommitteeMessage, shareIdx int) ParSignedData

NewPartialSignedSyncMessage is a convenience function which returns a new partially signed SignedSyncMessage.

func NewPartialSignedVoluntaryExit added in v0.7.0

func NewPartialSignedVoluntaryExit(exit *eth2p0.SignedVoluntaryExit, shareIdx int) ParSignedData

NewPartialSignedVoluntaryExit is a convenience function that returns a new partially signed voluntary exit.

func NewPartialSyncContributionAndProof added in v0.12.0

func NewPartialSyncContributionAndProof(proof *altair.ContributionAndProof, shareIdx int) ParSignedData

NewPartialSyncContributionAndProof is a convenience function that returns a new partially signed altair.ContributionAndProof.

func NewPartialVersionedSignedBeaconBlock added in v0.7.0

func NewPartialVersionedSignedBeaconBlock(block *spec.VersionedSignedBeaconBlock, shareIdx int) (ParSignedData, error)

NewPartialVersionedSignedBeaconBlock is a convenience function that returns a new partial signed block.

func NewPartialVersionedSignedBlindedBeaconBlock added in v0.9.0

func NewPartialVersionedSignedBlindedBeaconBlock(block *eth2api.VersionedSignedBlindedBeaconBlock, shareIdx int) (ParSignedData, error)

NewPartialVersionedSignedBlindedBeaconBlock is a convenience function that returns a new partial signed block.

func NewPartialVersionedSignedValidatorRegistration added in v0.10.0

func NewPartialVersionedSignedValidatorRegistration(registration *eth2api.VersionedSignedValidatorRegistration, shareIdx int) (ParSignedData, error)

NewPartialVersionedSignedValidatorRegistration is a convenience function that returns a new partially signed validator (builder) registration.

func ParSignedDataFromProto added in v0.3.0

func ParSignedDataFromProto(typ DutyType, data *pbv1.ParSignedData) (ParSignedData, error)

ParSignedDataFromProto returns the data from a protobuf.

func (ParSignedData) Clone added in v0.7.0

func (d ParSignedData) Clone() (ParSignedData, error)

Clone returns a cloned copy of the ParSignedData. For an immutable core workflow architecture, remember to clone data when it leaves the current scope (sharing, storing, returning, etc).

type ParSignedDataSet

type ParSignedDataSet map[PubKey]ParSignedData

ParSignedDataSet is a set of partially signed duty data objects, one per validator.

func ParSignedDataSetFromProto added in v0.3.0

func ParSignedDataSetFromProto(typ DutyType, set *pbv1.ParSignedDataSet) (ParSignedDataSet, error)

ParSignedDataSetFromProto returns the set from a protobuf.

func (ParSignedDataSet) Clone added in v0.7.0

Clone returns a cloned copy of the ParSignedDataSet. For an immutable core workflow architecture, remember to clone data when it leaves the current scope (sharing, storing, returning, etc).

type ProposerDefinition added in v0.7.0

type ProposerDefinition struct {
	eth2v1.ProposerDuty
}

ProposerDefinition defines a block proposer duty. It implements DutyDefinition. Note the slight rename from Duty to Definition to avoid overloading the term Duty.

func NewProposerDefinition added in v0.7.0

func NewProposerDefinition(duty *eth2v1.ProposerDuty) ProposerDefinition

NewProposerDefinition is a convenience function that returns a new proposer definition.

func (ProposerDefinition) Clone added in v0.7.0

func (ProposerDefinition) MarshalJSON added in v0.7.0

func (d ProposerDefinition) MarshalJSON() ([]byte, error)

type PubKey

type PubKey string

PubKey is the DV root public key, the identifier of a validator in the core workflow. It is a hex formatted string, e.g. "0xb82bc680e...".

func PubKeyFrom48Bytes added in v0.11.0

func PubKeyFrom48Bytes(bytes [48]byte) PubKey

PubKeyFrom48Bytes returns a new public key from raw bytes.

func PubKeyFromBytes

func PubKeyFromBytes(bytes []byte) (PubKey, error)

PubKeyFromBytes returns a new public key from raw bytes.

func (PubKey) Bytes

func (k PubKey) Bytes() ([]byte, error)

Bytes returns the public key as raw bytes.

func (PubKey) String

func (k PubKey) String() string

String returns a concise logging friendly version of the public key, e.g. "b82_97f".

func (PubKey) ToETH2

func (k PubKey) ToETH2() (eth2p0.BLSPubKey, error)

ToETH2 returns the public key as an eth2 phase0 public key.

type Scheduler

type Scheduler interface {
	// SubscribeDuties subscribes a callback function for triggered duties.
	SubscribeDuties(func(context.Context, Duty, DutyDefinitionSet) error)

	// SubscribeSlots subscribes a callback function for triggered slots.
	SubscribeSlots(func(context.Context, Slot) error)

	// GetDutyDefinition returns the definition set for a duty if already resolved.
	GetDutyDefinition(context.Context, Duty) (DutyDefinitionSet, error)
}

Scheduler triggers the start of a duty workflow.

type SigAgg

type SigAgg interface {
	// Aggregate aggregates the partially signed duty data for the DV.
	Aggregate(context.Context, Duty, PubKey, []ParSignedData) error

	// Subscribe registers a callback for aggregated signed duty data.
	Subscribe(func(context.Context, Duty, PubKey, SignedData) error)
}

SigAgg aggregates threshold partial signatures.

type Signature

type Signature []byte

Signature is a BLS12-381 Signature. It implements SignedData.

func SigFromETH2

func SigFromETH2(sig eth2p0.BLSSignature) Signature

SigFromETH2 returns a new signature from eth2 phase0 BLSSignature.

func (Signature) Clone added in v0.7.0

func (s Signature) Clone() (SignedData, error)

func (Signature) MarshalJSON added in v0.7.0

func (s Signature) MarshalJSON() ([]byte, error)

func (Signature) MessageRoot added in v0.12.0

func (Signature) MessageRoot() ([32]byte, error)

func (Signature) SetSignature added in v0.7.0

func (Signature) SetSignature(sig Signature) (SignedData, error)

func (Signature) Signature added in v0.7.0

func (s Signature) Signature() Signature

func (Signature) ToETH2

func (s Signature) ToETH2() eth2p0.BLSSignature

ToETH2 returns the signature as an eth2 phase0 BLSSignature.

func (*Signature) UnmarshalJSON added in v0.7.0

func (s *Signature) UnmarshalJSON(b []byte) error

type SignedAggregateAndProof added in v0.10.1

type SignedAggregateAndProof struct {
	eth2p0.SignedAggregateAndProof
}

SignedAggregateAndProof wraps eth2p0.SignedAggregateAndProof and implements SignedData.

func NewSignedAggregateAndProof added in v0.10.1

func NewSignedAggregateAndProof(data *eth2p0.SignedAggregateAndProof) SignedAggregateAndProof

NewSignedAggregateAndProof is a convenience function which returns a new signed SignedAggregateAndProof.

func (SignedAggregateAndProof) Clone added in v0.10.1

func (SignedAggregateAndProof) DomainName added in v0.12.0

func (SignedAggregateAndProof) Epoch added in v0.12.0

func (SignedAggregateAndProof) MarshalJSON added in v0.10.1

func (s SignedAggregateAndProof) MarshalJSON() ([]byte, error)

func (SignedAggregateAndProof) MessageRoot added in v0.12.0

func (s SignedAggregateAndProof) MessageRoot() ([32]byte, error)

func (SignedAggregateAndProof) SetSignature added in v0.10.1

func (s SignedAggregateAndProof) SetSignature(sig Signature) (SignedData, error)

func (SignedAggregateAndProof) Signature added in v0.10.1

func (s SignedAggregateAndProof) Signature() Signature

func (*SignedAggregateAndProof) UnmarshalJSON added in v0.10.1

func (s *SignedAggregateAndProof) UnmarshalJSON(input []byte) error

type SignedData added in v0.7.0

type SignedData interface {
	// Signature returns the signed duty data's signature.
	Signature() Signature
	// SetSignature returns a copy of signed duty data with the signature replaced.
	SetSignature(Signature) (SignedData, error)
	// MessageRoot returns the unsigned data message root.
	MessageRoot() ([32]byte, error)
	// Clone returns a cloned copy of the SignedData. For an immutable core workflow architecture,
	// remember to clone data when it leaves the current scope (sharing, storing, returning, etc).
	Clone() (SignedData, error)
	// Marshaler returns the json serialised signed duty data (including the signature).
	json.Marshaler
}

SignedData is a signed duty data.

type SignedRandao added in v0.10.0

type SignedRandao struct {
	eth2util.SignedEpoch
}

SignedRandao is a signed Randao Reveal which implements SignedData.

func (SignedRandao) Clone added in v0.10.0

func (s SignedRandao) Clone() (SignedData, error)

func (SignedRandao) DomainName added in v0.12.0

func (SignedRandao) DomainName() signing.DomainName

func (SignedRandao) Epoch added in v0.12.0

func (SignedRandao) MarshalJSON added in v0.10.0

func (s SignedRandao) MarshalJSON() ([]byte, error)

func (SignedRandao) MessageRoot added in v0.12.0

func (s SignedRandao) MessageRoot() ([32]byte, error)

func (SignedRandao) SetSignature added in v0.10.0

func (s SignedRandao) SetSignature(sig Signature) (SignedData, error)

func (SignedRandao) Signature added in v0.10.0

func (s SignedRandao) Signature() Signature

func (*SignedRandao) UnmarshalJSON added in v0.10.0

func (s *SignedRandao) UnmarshalJSON(input []byte) error

type SignedSyncContributionAndProof added in v0.11.0

type SignedSyncContributionAndProof struct {
	altair.SignedContributionAndProof
}

SignedSyncContributionAndProof wraps altair.SignedContributionAndProof and implements SignedData.

func NewSignedSyncContributionAndProof added in v0.12.0

func NewSignedSyncContributionAndProof(proof *altair.SignedContributionAndProof) SignedSyncContributionAndProof

NewSignedSyncContributionAndProof is a convenience function that returns a new signed altair.SignedContributionAndProof.

func (SignedSyncContributionAndProof) Clone added in v0.11.0

func (SignedSyncContributionAndProof) DomainName added in v0.12.0

func (SignedSyncContributionAndProof) Epoch added in v0.12.0

func (SignedSyncContributionAndProof) MarshalJSON added in v0.11.0

func (s SignedSyncContributionAndProof) MarshalJSON() ([]byte, error)

func (SignedSyncContributionAndProof) MessageRoot added in v0.12.0

func (s SignedSyncContributionAndProof) MessageRoot() ([32]byte, error)

MessageRoot returns the signing root for the provided SignedSyncContributionAndProof. Refer get_contribution_and_proof_signature from https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/validator.md#broadcast-sync-committee-contribution.

func (SignedSyncContributionAndProof) SetSignature added in v0.11.0

func (SignedSyncContributionAndProof) Signature added in v0.11.0

func (*SignedSyncContributionAndProof) UnmarshalJSON added in v0.11.0

func (s *SignedSyncContributionAndProof) UnmarshalJSON(input []byte) error

type SignedSyncMessage added in v0.10.1

type SignedSyncMessage struct {
	altair.SyncCommitteeMessage
}

SignedSyncMessage wraps altair.SyncCommitteeMessage and implements SignedData.

func NewSignedSyncMessage added in v0.11.0

func NewSignedSyncMessage(data *altair.SyncCommitteeMessage) SignedSyncMessage

NewSignedSyncMessage is a convenience function which returns new signed SignedSyncMessage.

func (SignedSyncMessage) Clone added in v0.10.1

func (s SignedSyncMessage) Clone() (SignedData, error)

func (SignedSyncMessage) DomainName added in v0.12.0

func (SignedSyncMessage) DomainName() signing.DomainName

func (SignedSyncMessage) Epoch added in v0.12.0

func (SignedSyncMessage) MarshalJSON added in v0.10.1

func (s SignedSyncMessage) MarshalJSON() ([]byte, error)

func (SignedSyncMessage) MessageRoot added in v0.12.0

func (s SignedSyncMessage) MessageRoot() ([32]byte, error)

func (SignedSyncMessage) SetSignature added in v0.10.1

func (s SignedSyncMessage) SetSignature(sig Signature) (SignedData, error)

func (SignedSyncMessage) Signature added in v0.10.1

func (s SignedSyncMessage) Signature() Signature

func (*SignedSyncMessage) UnmarshalJSON added in v0.10.1

func (s *SignedSyncMessage) UnmarshalJSON(input []byte) error

type SignedVoluntaryExit added in v0.7.0

type SignedVoluntaryExit struct {
	eth2p0.SignedVoluntaryExit
}

func NewSignedVoluntaryExit added in v0.7.0

func NewSignedVoluntaryExit(exit *eth2p0.SignedVoluntaryExit) SignedVoluntaryExit

NewSignedVoluntaryExit is a convenience function that returns a new signed voluntary exit.

func (SignedVoluntaryExit) Clone added in v0.7.0

func (e SignedVoluntaryExit) Clone() (SignedData, error)

func (SignedVoluntaryExit) DomainName added in v0.12.0

func (SignedVoluntaryExit) DomainName() signing.DomainName

func (SignedVoluntaryExit) Epoch added in v0.12.0

func (SignedVoluntaryExit) MarshalJSON added in v0.7.0

func (e SignedVoluntaryExit) MarshalJSON() ([]byte, error)

func (SignedVoluntaryExit) MessageRoot added in v0.12.0

func (e SignedVoluntaryExit) MessageRoot() ([32]byte, error)

func (SignedVoluntaryExit) SetSignature added in v0.7.0

func (e SignedVoluntaryExit) SetSignature(sig Signature) (SignedData, error)

func (SignedVoluntaryExit) Signature added in v0.7.0

func (e SignedVoluntaryExit) Signature() Signature

func (*SignedVoluntaryExit) UnmarshalJSON added in v0.7.0

func (e *SignedVoluntaryExit) UnmarshalJSON(b []byte) error

type Slot added in v0.10.0

type Slot struct {
	Slot          int64
	Time          time.Time
	SlotDuration  time.Duration
	SlotsPerEpoch int64
}

Slot is a beacon chain slot including chain metadata to infer epoch and next slot.

func (Slot) Epoch added in v0.10.0

func (s Slot) Epoch() int64

Epoch returns the epoch of the slot.

func (Slot) FirstInEpoch added in v0.10.0

func (s Slot) FirstInEpoch() bool

FirstInEpoch returns true if this is the first slot in the epoch.

func (Slot) LastInEpoch added in v0.10.0

func (s Slot) LastInEpoch() bool

LastInEpoch returns true if this is the last slot in the epoch.

func (Slot) Next added in v0.10.0

func (s Slot) Next() Slot

Next returns the next slot.

type SyncCommitteeDefinition added in v0.10.1

type SyncCommitteeDefinition struct {
	eth2v1.SyncCommitteeDuty
}

SyncCommitteeDefinition defines a sync committee duty. It implements DutyDefinition. Note the slight rename from Duty to Definition to avoid overloading the term Duty.

func (SyncCommitteeDefinition) Clone added in v0.10.1

func (SyncCommitteeDefinition) MarshalJSON added in v0.10.1

func (s SyncCommitteeDefinition) MarshalJSON() ([]byte, error)

type SyncCommitteeSelection added in v0.12.0

type SyncCommitteeSelection struct {
	eth2exp.SyncCommitteeSelection
}

SyncCommitteeSelection wraps an eth2exp.SyncCommitteeSelection and implements SignedData.

func NewSyncCommitteeSelection added in v0.12.0

func NewSyncCommitteeSelection(selection *eth2exp.SyncCommitteeSelection) SyncCommitteeSelection

NewSyncCommitteeSelection is a convenience function which returns new signed SyncCommitteeSelection.

func (SyncCommitteeSelection) Clone added in v0.12.0

func (SyncCommitteeSelection) DomainName added in v0.12.0

func (SyncCommitteeSelection) Epoch added in v0.12.0

func (SyncCommitteeSelection) MarshalJSON added in v0.12.0

func (s SyncCommitteeSelection) MarshalJSON() ([]byte, error)

func (SyncCommitteeSelection) MessageRoot added in v0.12.0

func (s SyncCommitteeSelection) MessageRoot() ([32]byte, error)

MessageRoot returns the signing root for the provided SyncCommitteeSelection. Refer https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/validator.md#syncaggregatorselectiondata

func (SyncCommitteeSelection) SetSignature added in v0.12.0

func (s SyncCommitteeSelection) SetSignature(sig Signature) (SignedData, error)

func (SyncCommitteeSelection) Signature added in v0.12.0

func (s SyncCommitteeSelection) Signature() Signature

func (*SyncCommitteeSelection) UnmarshalJSON added in v0.12.0

func (s *SyncCommitteeSelection) UnmarshalJSON(input []byte) error

type SyncContribution added in v0.10.1

type SyncContribution struct {
	altair.SyncCommitteeContribution
}

func NewSyncContribution added in v0.12.0

func NewSyncContribution(c *altair.SyncCommitteeContribution) SyncContribution

NewSyncContribution returns a new SyncContribution.

func (SyncContribution) Clone added in v0.10.1

func (s SyncContribution) Clone() (UnsignedData, error)

func (SyncContribution) MarshalJSON added in v0.10.1

func (s SyncContribution) MarshalJSON() ([]byte, error)

func (*SyncContribution) UnmarshalJSON added in v0.10.1

func (s *SyncContribution) UnmarshalJSON(input []byte) error

type SyncContributionAndProof added in v0.12.0

type SyncContributionAndProof struct {
	altair.ContributionAndProof
}

SyncContributionAndProof wraps altair.ContributionAndProof and implements SignedData.

func NewSyncContributionAndProof added in v0.12.0

func NewSyncContributionAndProof(proof *altair.ContributionAndProof) SyncContributionAndProof

NewSyncContributionAndProof is a convenience function that returns a new signed altair.ContributionAndProof.

func (SyncContributionAndProof) Clone added in v0.12.0

func (SyncContributionAndProof) DomainName added in v0.12.0

func (SyncContributionAndProof) Epoch added in v0.12.0

func (SyncContributionAndProof) MarshalJSON added in v0.12.0

func (s SyncContributionAndProof) MarshalJSON() ([]byte, error)

func (SyncContributionAndProof) MessageRoot added in v0.12.0

func (s SyncContributionAndProof) MessageRoot() ([32]byte, error)

MessageRoot returns the signing root for the provided SyncContributionAndProof. Refer: https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/validator.md#aggregation-selection.

func (SyncContributionAndProof) SetSignature added in v0.12.0

func (s SyncContributionAndProof) SetSignature(sig Signature) (SignedData, error)

func (SyncContributionAndProof) Signature added in v0.12.0

func (s SyncContributionAndProof) Signature() Signature

func (*SyncContributionAndProof) UnmarshalJSON added in v0.12.0

func (s *SyncContributionAndProof) UnmarshalJSON(input []byte) error

type UnsignedData

type UnsignedData interface {
	// Clone returns a cloned copy of the UnsignedData. For an immutable core workflow architecture,
	// remember to clone data when it leaves the current scope (sharing, storing, returning, etc).
	Clone() (UnsignedData, error)
	// Marshaler returns the json serialised unsigned duty data.
	json.Marshaler
}

UnsignedData represents an unsigned duty data object.

func UnmarshalUnsignedData added in v0.7.0

func UnmarshalUnsignedData(typ DutyType, data []byte) (UnsignedData, error)

UnmarshalUnsignedData returns an instantiated unsigned data based on the duty type. TODO(corver): Unexport once leadercast is removed or uses protobufs.

type UnsignedDataSet

type UnsignedDataSet map[PubKey]UnsignedData

UnsignedDataSet is a set of unsigned duty data objects, one per validator.

func UnsignedDataSetFromProto added in v0.4.0

func UnsignedDataSetFromProto(typ DutyType, set *pbv1.UnsignedDataSet) (UnsignedDataSet, error)

UnsignedDataSetFromProto returns the set from a protobuf.

func (UnsignedDataSet) Clone added in v0.7.0

func (s UnsignedDataSet) Clone() (UnsignedDataSet, error)

Clone returns a cloned copy of the UnsignedDataSet. For an immutable core workflow architecture, remember to clone data when it leaves the current scope (sharing, storing, returning, etc).

type ValidatorAPI

type ValidatorAPI interface {
	// RegisterAwaitBeaconBlock registers a function to query unsigned beacon block by slot.
	RegisterAwaitBeaconBlock(func(ctx context.Context, slot int64) (*spec.VersionedBeaconBlock, error))

	// RegisterAwaitBlindedBeaconBlock registers a function to query unsigned blinded beacon block by slot.
	RegisterAwaitBlindedBeaconBlock(func(ctx context.Context, slot int64) (*eth2api.VersionedBlindedBeaconBlock, error))

	// RegisterAwaitAttestation registers a function to query attestation data.
	RegisterAwaitAttestation(func(ctx context.Context, slot, commIdx int64) (*eth2p0.AttestationData, error))

	// RegisterAwaitSyncContribution registers a function to query sync contribution data.
	RegisterAwaitSyncContribution(func(ctx context.Context, slot, subcommIdx int64, beaconBlockRoot eth2p0.Root) (*altair.SyncCommitteeContribution, error))

	// RegisterPubKeyByAttestation registers a function to query validator by attestation.
	RegisterPubKeyByAttestation(func(ctx context.Context, slot, commIdx, valCommIdx int64) (PubKey, error))

	// RegisterGetDutyDefinition registers a function to query duty definitions.
	RegisterGetDutyDefinition(func(context.Context, Duty) (DutyDefinitionSet, error))

	// RegisterAwaitAggAttestation registers a function to query aggregated attestation.
	RegisterAwaitAggAttestation(fn func(ctx context.Context, slot int64, attestationDataRoot eth2p0.Root) (*eth2p0.Attestation, error))

	// RegisterAggSigDB registers a function to query aggregated signed data from aggSigDB.
	RegisterAwaitAggSigDB(func(context.Context, Duty, PubKey) (SignedData, error))

	// Subscribe registers a function to store partially signed data sets.
	Subscribe(func(context.Context, Duty, ParSignedDataSet) error)
}

ValidatorAPI provides a beacon node API to validator clients. It serves duty data from the DutyDB and stores partial signed data in the ParSigDB.

type VersionedBeaconBlock added in v0.7.0

type VersionedBeaconBlock struct {
	spec.VersionedBeaconBlock
}

func NewVersionedBeaconBlock added in v0.7.0

func NewVersionedBeaconBlock(block *spec.VersionedBeaconBlock) (VersionedBeaconBlock, error)

NewVersionedBeaconBlock validates and returns a new wrapped VersionedBeaconBlock.

func (VersionedBeaconBlock) Clone added in v0.7.0

func (VersionedBeaconBlock) MarshalJSON added in v0.7.0

func (b VersionedBeaconBlock) MarshalJSON() ([]byte, error)

func (*VersionedBeaconBlock) UnmarshalJSON added in v0.7.0

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

type VersionedBlindedBeaconBlock added in v0.9.0

type VersionedBlindedBeaconBlock struct {
	eth2api.VersionedBlindedBeaconBlock
}

func NewVersionedBlindedBeaconBlock added in v0.9.0

func NewVersionedBlindedBeaconBlock(block *eth2api.VersionedBlindedBeaconBlock) (VersionedBlindedBeaconBlock, error)

NewVersionedBlindedBeaconBlock validates and returns a new wrapped VersionedBlindedBeaconBlock.

func (VersionedBlindedBeaconBlock) Clone added in v0.9.0

func (VersionedBlindedBeaconBlock) MarshalJSON added in v0.9.0

func (b VersionedBlindedBeaconBlock) MarshalJSON() ([]byte, error)

func (*VersionedBlindedBeaconBlock) UnmarshalJSON added in v0.9.0

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

type VersionedSignedBeaconBlock added in v0.7.0

type VersionedSignedBeaconBlock struct {
	spec.VersionedSignedBeaconBlock // Could subtype instead of embed, but aligning with Attestation that cannot subtype.
}

VersionedSignedBeaconBlock is a signed versioned beacon block and implements SignedData.

func NewVersionedSignedBeaconBlock added in v0.7.0

func NewVersionedSignedBeaconBlock(block *spec.VersionedSignedBeaconBlock) (VersionedSignedBeaconBlock, error)

NewVersionedSignedBeaconBlock validates and returns a new wrapped VersionedSignedBeaconBlock.

func (VersionedSignedBeaconBlock) Clone added in v0.7.0

func (VersionedSignedBeaconBlock) DomainName added in v0.12.0

func (VersionedSignedBeaconBlock) Epoch added in v0.12.0

func (VersionedSignedBeaconBlock) MarshalJSON added in v0.7.0

func (b VersionedSignedBeaconBlock) MarshalJSON() ([]byte, error)

func (VersionedSignedBeaconBlock) MessageRoot added in v0.12.0

func (b VersionedSignedBeaconBlock) MessageRoot() ([32]byte, error)

func (VersionedSignedBeaconBlock) SetSignature added in v0.7.0

func (b VersionedSignedBeaconBlock) SetSignature(sig Signature) (SignedData, error)

func (VersionedSignedBeaconBlock) Signature added in v0.7.0

func (b VersionedSignedBeaconBlock) Signature() Signature

func (*VersionedSignedBeaconBlock) UnmarshalJSON added in v0.7.0

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

type VersionedSignedBlindedBeaconBlock added in v0.9.0

type VersionedSignedBlindedBeaconBlock struct {
	eth2api.VersionedSignedBlindedBeaconBlock // Could subtype instead of embed, but aligning with Attestation that cannot subtype.
}

VersionedSignedBlindedBeaconBlock is a signed versioned blinded beacon block and implements SignedData.

func NewVersionedSignedBlindedBeaconBlock added in v0.9.0

func NewVersionedSignedBlindedBeaconBlock(block *eth2api.VersionedSignedBlindedBeaconBlock) (VersionedSignedBlindedBeaconBlock, error)

NewVersionedSignedBlindedBeaconBlock validates and returns a new wrapped VersionedSignedBlindedBeaconBlock.

func (VersionedSignedBlindedBeaconBlock) Clone added in v0.9.0

func (VersionedSignedBlindedBeaconBlock) DomainName added in v0.12.0

func (VersionedSignedBlindedBeaconBlock) Epoch added in v0.12.0

func (VersionedSignedBlindedBeaconBlock) MarshalJSON added in v0.9.0

func (b VersionedSignedBlindedBeaconBlock) MarshalJSON() ([]byte, error)

func (VersionedSignedBlindedBeaconBlock) MessageRoot added in v0.12.0

func (b VersionedSignedBlindedBeaconBlock) MessageRoot() ([32]byte, error)

func (VersionedSignedBlindedBeaconBlock) SetSignature added in v0.9.0

func (VersionedSignedBlindedBeaconBlock) Signature added in v0.9.0

func (*VersionedSignedBlindedBeaconBlock) UnmarshalJSON added in v0.9.0

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

type VersionedSignedValidatorRegistration added in v0.10.0

type VersionedSignedValidatorRegistration struct {
	eth2api.VersionedSignedValidatorRegistration
}

VersionedSignedValidatorRegistration is a signed versioned validator (builder) registration and implements SignedData.

func NewVersionedSignedValidatorRegistration added in v0.10.0

func NewVersionedSignedValidatorRegistration(registration *eth2api.VersionedSignedValidatorRegistration) (VersionedSignedValidatorRegistration, error)

NewVersionedSignedValidatorRegistration is a convenience function that returns a new signed validator (builder) registration.

func (VersionedSignedValidatorRegistration) Clone added in v0.10.0

func (VersionedSignedValidatorRegistration) DomainName added in v0.12.0

func (VersionedSignedValidatorRegistration) Epoch added in v0.12.0

func (VersionedSignedValidatorRegistration) MarshalJSON added in v0.10.0

func (r VersionedSignedValidatorRegistration) MarshalJSON() ([]byte, error)

func (VersionedSignedValidatorRegistration) MessageRoot added in v0.12.0

func (r VersionedSignedValidatorRegistration) MessageRoot() ([32]byte, error)

func (VersionedSignedValidatorRegistration) SetSignature added in v0.10.0

func (VersionedSignedValidatorRegistration) Signature added in v0.10.0

func (*VersionedSignedValidatorRegistration) UnmarshalJSON added in v0.10.0

func (r *VersionedSignedValidatorRegistration) UnmarshalJSON(input []byte) error

type WireOption

type WireOption func(*wireFuncs)

WireOption defines a functional option to configure wiring.

func WithAsyncRetry added in v0.3.0

func WithAsyncRetry(retryer *retry.Retryer[Duty]) WireOption

WithAsyncRetry wraps component input functions with the async Retryer adding robustness to network issues.

func WithTracing

func WithTracing() WireOption

WithTracing wraps component input functions with tracing spans.

Directories

Path Synopsis
Package bcast provides the core workflow's broadcaster component that broadcasts/submits aggregated signed duty data to the beacon node.
Package bcast provides the core workflow's broadcaster component that broadcasts/submits aggregated signed duty data to the beacon node.
corepb
v1
Package infosync provides a simple use-case of the priority protocol that prioritises cluster supported versions.
Package infosync provides a simple use-case of the priority protocol that prioritises cluster supported versions.
Package priority implements the priority protocol that resolves arbitrary cluster wide priorities.
Package priority implements the priority protocol that resolves arbitrary cluster wide priorities.
Package qbft is an implementation of the https://arxiv.org/pdf/2002.03613.pdf paper referenced by the QBFT spec https://github.com/ConsenSys/qbft-formal-spec-and-verification.
Package qbft is an implementation of the https://arxiv.org/pdf/2002.03613.pdf paper referenced by the QBFT spec https://github.com/ConsenSys/qbft-formal-spec-and-verification.
Package sigagg provides the sigagg core workflow component that aggregates *threshold* partial signed duty data objects into an aggregated signed duty data object ready to be broadcasted to the beacon chain.
Package sigagg provides the sigagg core workflow component that aggregates *threshold* partial signed duty data objects into an aggregated signed duty data object ready to be broadcasted to the beacon chain.
Package validatorapi defines validator facing API that serves the subset of endpoints related to distributed validation and reverse-proxies the rest to the upstream beacon client.
Package validatorapi defines validator facing API that serves the subset of endpoints related to distributed validation and reverse-proxies the rest to the upstream beacon client.

Jump to

Keyboard shortcuts

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