Documentation ¶
Index ¶
- func DutyToProto(duty Duty) *pbv1.Duty
- func NewDutyDeadlineFunc(ctx context.Context, eth2Cl eth2wrap.Client) (func(Duty) (time.Time, bool), error)
- func ParSignedDataSetToProto(set ParSignedDataSet) (*pbv1.ParSignedDataSet, error)
- func ParSignedDataToProto(data ParSignedData) (*pbv1.ParSignedData, error)
- func StartDutyTrace(ctx context.Context, duty Duty, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)
- func UnsignedDataSetToProto(set UnsignedDataSet) (*pbv1.UnsignedDataSet, error)
- func VerifyEth2SignedData(ctx context.Context, eth2Cl eth2wrap.Client, data Eth2SignedData, ...) error
- func Wire(sched Scheduler, fetch Fetcher, cons Consensus, dutyDB DutyDB, ...)
- type AggSigDB
- type AggregatedAttestation
- type Attestation
- func (a Attestation) Clone() (SignedData, error)
- func (Attestation) DomainName() signing.DomainName
- func (a Attestation) Epoch(_ context.Context, _ eth2wrap.Client) (eth2p0.Epoch, error)
- func (a Attestation) MarshalJSON() ([]byte, error)
- func (a Attestation) MessageRoot() ([32]byte, error)
- func (a Attestation) SetSignature(sig Signature) (SignedData, error)
- func (a Attestation) Signature() Signature
- func (a *Attestation) UnmarshalJSON(b []byte) error
- type AttestationData
- type AttesterDefinition
- type BeaconCommitteeSelection
- func (s BeaconCommitteeSelection) Clone() (SignedData, error)
- func (BeaconCommitteeSelection) DomainName() signing.DomainName
- func (s BeaconCommitteeSelection) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (s BeaconCommitteeSelection) MarshalJSON() ([]byte, error)
- func (s BeaconCommitteeSelection) MessageRoot() ([32]byte, error)
- func (s BeaconCommitteeSelection) SetSignature(sig Signature) (SignedData, error)
- func (s BeaconCommitteeSelection) Signature() Signature
- func (s *BeaconCommitteeSelection) UnmarshalJSON(input []byte) error
- type Broadcaster
- type Consensus
- type Deadliner
- type Duty
- func DutyFromProto(duty *pbv1.Duty) Duty
- func NewAggregatorDuty(slot int64) Duty
- func NewAttesterDuty(slot int64) Duty
- func NewBuilderProposerDuty(slot int64) Duty
- func NewBuilderRegistrationDuty(slot int64) Duty
- func NewInfoSyncDuty(slot int64) Duty
- func NewPrepareAggregatorDuty(slot int64) Duty
- func NewPrepareSyncContributionDuty(slot int64) Duty
- func NewProposerDuty(slot int64) Duty
- func NewRandaoDuty(slot int64) Duty
- func NewSignatureDuty(slot int64) Duty
- func NewSyncContributionDuty(slot int64) Duty
- func NewSyncMessageDuty(slot int64) Duty
- func NewVoluntaryExit(slot int64) Duty
- type DutyDB
- type DutyDefinition
- type DutyDefinitionSet
- type DutyType
- type Eth2SignedData
- type Fetcher
- type ParSigDB
- type ParSigEx
- type ParSignedData
- func NewPartialAttestation(att *eth2p0.Attestation, shareIdx int) ParSignedData
- func NewPartialSignature(sig Signature, shareIdx int) ParSignedData
- func NewPartialSignedAggregateAndProof(data *eth2p0.SignedAggregateAndProof, shareIdx int) ParSignedData
- func NewPartialSignedBeaconCommitteeSelection(selection *eth2exp.BeaconCommitteeSelection, shareIdx int) ParSignedData
- func NewPartialSignedRandao(epoch eth2p0.Epoch, randao eth2p0.BLSSignature, shareIdx int) ParSignedData
- func NewPartialSignedSyncCommitteeSelection(selection *eth2exp.SyncCommitteeSelection, shareIdx int) ParSignedData
- func NewPartialSignedSyncContributionAndProof(proof *altair.SignedContributionAndProof, shareIdx int) ParSignedData
- func NewPartialSignedSyncMessage(data *altair.SyncCommitteeMessage, shareIdx int) ParSignedData
- func NewPartialSignedVoluntaryExit(exit *eth2p0.SignedVoluntaryExit, shareIdx int) ParSignedData
- func NewPartialSyncContributionAndProof(proof *altair.ContributionAndProof, shareIdx int) ParSignedData
- func NewPartialVersionedSignedBeaconBlock(block *spec.VersionedSignedBeaconBlock, shareIdx int) (ParSignedData, error)
- func NewPartialVersionedSignedBlindedBeaconBlock(block *eth2api.VersionedSignedBlindedBeaconBlock, shareIdx int) (ParSignedData, error)
- func NewPartialVersionedSignedValidatorRegistration(registration *eth2api.VersionedSignedValidatorRegistration, shareIdx int) (ParSignedData, error)
- func ParSignedDataFromProto(typ DutyType, data *pbv1.ParSignedData) (ParSignedData, error)
- type ParSignedDataSet
- type ProposerDefinition
- type PubKey
- type Scheduler
- type SigAgg
- type Signature
- func (s Signature) Clone() (SignedData, error)
- func (s Signature) MarshalJSON() ([]byte, error)
- func (Signature) MessageRoot() ([32]byte, error)
- func (Signature) SetSignature(sig Signature) (SignedData, error)
- func (s Signature) Signature() Signature
- func (s Signature) ToETH2() eth2p0.BLSSignature
- func (s *Signature) UnmarshalJSON(b []byte) error
- type SignedAggregateAndProof
- func (s SignedAggregateAndProof) Clone() (SignedData, error)
- func (SignedAggregateAndProof) DomainName() signing.DomainName
- func (s SignedAggregateAndProof) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (s SignedAggregateAndProof) MarshalJSON() ([]byte, error)
- func (s SignedAggregateAndProof) MessageRoot() ([32]byte, error)
- func (s SignedAggregateAndProof) SetSignature(sig Signature) (SignedData, error)
- func (s SignedAggregateAndProof) Signature() Signature
- func (s *SignedAggregateAndProof) UnmarshalJSON(input []byte) error
- type SignedData
- type SignedRandao
- func (s SignedRandao) Clone() (SignedData, error)
- func (SignedRandao) DomainName() signing.DomainName
- func (s SignedRandao) Epoch(_ context.Context, _ eth2wrap.Client) (eth2p0.Epoch, error)
- func (s SignedRandao) MarshalJSON() ([]byte, error)
- func (s SignedRandao) MessageRoot() ([32]byte, error)
- func (s SignedRandao) SetSignature(sig Signature) (SignedData, error)
- func (s SignedRandao) Signature() Signature
- func (s *SignedRandao) UnmarshalJSON(input []byte) error
- type SignedSyncContributionAndProof
- func (s SignedSyncContributionAndProof) Clone() (SignedData, error)
- func (SignedSyncContributionAndProof) DomainName() signing.DomainName
- func (s SignedSyncContributionAndProof) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (s SignedSyncContributionAndProof) MarshalJSON() ([]byte, error)
- func (s SignedSyncContributionAndProof) MessageRoot() ([32]byte, error)
- func (s SignedSyncContributionAndProof) SetSignature(sig Signature) (SignedData, error)
- func (s SignedSyncContributionAndProof) Signature() Signature
- func (s *SignedSyncContributionAndProof) UnmarshalJSON(input []byte) error
- type SignedSyncMessage
- func (s SignedSyncMessage) Clone() (SignedData, error)
- func (SignedSyncMessage) DomainName() signing.DomainName
- func (s SignedSyncMessage) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (s SignedSyncMessage) MarshalJSON() ([]byte, error)
- func (s SignedSyncMessage) MessageRoot() ([32]byte, error)
- func (s SignedSyncMessage) SetSignature(sig Signature) (SignedData, error)
- func (s SignedSyncMessage) Signature() Signature
- func (s *SignedSyncMessage) UnmarshalJSON(input []byte) error
- type SignedVoluntaryExit
- func (e SignedVoluntaryExit) Clone() (SignedData, error)
- func (SignedVoluntaryExit) DomainName() signing.DomainName
- func (e SignedVoluntaryExit) Epoch(_ context.Context, _ eth2wrap.Client) (eth2p0.Epoch, error)
- func (e SignedVoluntaryExit) MarshalJSON() ([]byte, error)
- func (e SignedVoluntaryExit) MessageRoot() ([32]byte, error)
- func (e SignedVoluntaryExit) SetSignature(sig Signature) (SignedData, error)
- func (e SignedVoluntaryExit) Signature() Signature
- func (e *SignedVoluntaryExit) UnmarshalJSON(b []byte) error
- type Slot
- type SyncCommitteeDefinition
- type SyncCommitteeSelection
- func (s SyncCommitteeSelection) Clone() (SignedData, error)
- func (SyncCommitteeSelection) DomainName() signing.DomainName
- func (s SyncCommitteeSelection) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (s SyncCommitteeSelection) MarshalJSON() ([]byte, error)
- func (s SyncCommitteeSelection) MessageRoot() ([32]byte, error)
- func (s SyncCommitteeSelection) SetSignature(sig Signature) (SignedData, error)
- func (s SyncCommitteeSelection) Signature() Signature
- func (s *SyncCommitteeSelection) UnmarshalJSON(input []byte) error
- type SyncContribution
- type SyncContributionAndProof
- func (s SyncContributionAndProof) Clone() (SignedData, error)
- func (SyncContributionAndProof) DomainName() signing.DomainName
- func (s SyncContributionAndProof) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (s SyncContributionAndProof) MarshalJSON() ([]byte, error)
- func (s SyncContributionAndProof) MessageRoot() ([32]byte, error)
- func (s SyncContributionAndProof) SetSignature(sig Signature) (SignedData, error)
- func (s SyncContributionAndProof) Signature() Signature
- func (s *SyncContributionAndProof) UnmarshalJSON(input []byte) error
- type UnsignedData
- type UnsignedDataSet
- type ValidatorAPI
- type VersionedBeaconBlock
- type VersionedBlindedBeaconBlock
- type VersionedSignedBeaconBlock
- func (b VersionedSignedBeaconBlock) Clone() (SignedData, error)
- func (VersionedSignedBeaconBlock) DomainName() signing.DomainName
- func (b VersionedSignedBeaconBlock) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (b VersionedSignedBeaconBlock) MarshalJSON() ([]byte, error)
- func (b VersionedSignedBeaconBlock) MessageRoot() ([32]byte, error)
- func (b VersionedSignedBeaconBlock) SetSignature(sig Signature) (SignedData, error)
- func (b VersionedSignedBeaconBlock) Signature() Signature
- func (b *VersionedSignedBeaconBlock) UnmarshalJSON(input []byte) error
- type VersionedSignedBlindedBeaconBlock
- func (b VersionedSignedBlindedBeaconBlock) Clone() (SignedData, error)
- func (VersionedSignedBlindedBeaconBlock) DomainName() signing.DomainName
- func (b VersionedSignedBlindedBeaconBlock) Epoch(ctx context.Context, eth2Cl eth2wrap.Client) (eth2p0.Epoch, error)
- func (b VersionedSignedBlindedBeaconBlock) MarshalJSON() ([]byte, error)
- func (b VersionedSignedBlindedBeaconBlock) MessageRoot() ([32]byte, error)
- func (b VersionedSignedBlindedBeaconBlock) SetSignature(sig Signature) (SignedData, error)
- func (b VersionedSignedBlindedBeaconBlock) Signature() Signature
- func (b *VersionedSignedBlindedBeaconBlock) UnmarshalJSON(input []byte) error
- type VersionedSignedValidatorRegistration
- func (r VersionedSignedValidatorRegistration) Clone() (SignedData, error)
- func (VersionedSignedValidatorRegistration) DomainName() signing.DomainName
- func (VersionedSignedValidatorRegistration) Epoch(context.Context, eth2wrap.Client) (eth2p0.Epoch, error)
- func (r VersionedSignedValidatorRegistration) MarshalJSON() ([]byte, error)
- func (r VersionedSignedValidatorRegistration) MessageRoot() ([32]byte, error)
- func (r VersionedSignedValidatorRegistration) SetSignature(sig Signature) (SignedData, error)
- func (r VersionedSignedValidatorRegistration) Signature() Signature
- func (r *VersionedSignedValidatorRegistration) UnmarshalJSON(input []byte) error
- type WireOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DutyToProto ¶ added in v0.3.0
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 (a AggregatedAttestation) Clone() (UnsignedData, error)
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) 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 (d AttesterDefinition) Clone() (DutyDefinition, error)
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 (s BeaconCommitteeSelection) Clone() (SignedData, error)
func (BeaconCommitteeSelection) DomainName ¶ added in v0.12.0
func (BeaconCommitteeSelection) DomainName() signing.DomainName
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 ¶
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.
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
DutyFromProto returns the duty from a protobuf.
func NewAggregatorDuty ¶ added in v0.10.1
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 ¶
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
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
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
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
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
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
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
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
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
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
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
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)
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
func (s DutyDefinitionSet) Clone() (DutyDefinitionSet, error)
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.
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 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
func (s ParSignedDataSet) Clone() (ParSignedDataSet, error)
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 (d ProposerDefinition) Clone() (DutyDefinition, error)
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
PubKeyFrom48Bytes returns a new public key from raw bytes.
func PubKeyFromBytes ¶
PubKeyFromBytes returns a new public key from raw bytes.
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 (Signature) MessageRoot ¶ added in v0.12.0
func (Signature) SetSignature ¶ added in v0.7.0
func (Signature) SetSignature(sig Signature) (SignedData, error)
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
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 (s SignedAggregateAndProof) Clone() (SignedData, error)
func (SignedAggregateAndProof) DomainName ¶ added in v0.12.0
func (SignedAggregateAndProof) DomainName() signing.DomainName
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) 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 (s SignedSyncContributionAndProof) Clone() (SignedData, error)
func (SignedSyncContributionAndProof) DomainName ¶ added in v0.12.0
func (SignedSyncContributionAndProof) DomainName() signing.DomainName
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 (s SignedSyncContributionAndProof) SetSignature(sig Signature) (SignedData, error)
func (SignedSyncContributionAndProof) Signature ¶ added in v0.11.0
func (s SignedSyncContributionAndProof) Signature() Signature
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) 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) 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
Slot is a beacon chain slot including chain metadata to infer epoch and next slot.
func (Slot) FirstInEpoch ¶ added in v0.10.0
FirstInEpoch returns true if this is the first slot in the epoch.
func (Slot) LastInEpoch ¶ added in v0.10.0
LastInEpoch returns true if this is the last slot in the epoch.
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 (s SyncCommitteeDefinition) Clone() (DutyDefinition, error)
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 (s SyncCommitteeSelection) Clone() (SignedData, error)
func (SyncCommitteeSelection) DomainName ¶ added in v0.12.0
func (SyncCommitteeSelection) DomainName() signing.DomainName
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 (s SyncContributionAndProof) Clone() (SignedData, error)
func (SyncContributionAndProof) DomainName ¶ added in v0.12.0
func (SyncContributionAndProof) DomainName() signing.DomainName
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 (b VersionedBeaconBlock) Clone() (UnsignedData, error)
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 (b VersionedBlindedBeaconBlock) Clone() (UnsignedData, error)
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 (b VersionedSignedBeaconBlock) Clone() (SignedData, error)
func (VersionedSignedBeaconBlock) DomainName ¶ added in v0.12.0
func (VersionedSignedBeaconBlock) DomainName() signing.DomainName
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 (b VersionedSignedBlindedBeaconBlock) Clone() (SignedData, error)
func (VersionedSignedBlindedBeaconBlock) DomainName ¶ added in v0.12.0
func (VersionedSignedBlindedBeaconBlock) DomainName() signing.DomainName
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 (b VersionedSignedBlindedBeaconBlock) SetSignature(sig Signature) (SignedData, error)
func (VersionedSignedBlindedBeaconBlock) Signature ¶ added in v0.9.0
func (b VersionedSignedBlindedBeaconBlock) Signature() Signature
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 (r VersionedSignedValidatorRegistration) Clone() (SignedData, error)
func (VersionedSignedValidatorRegistration) DomainName ¶ added in v0.12.0
func (VersionedSignedValidatorRegistration) DomainName() signing.DomainName
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 (r VersionedSignedValidatorRegistration) SetSignature(sig Signature) (SignedData, error)
func (VersionedSignedValidatorRegistration) Signature ¶ added in v0.10.0
func (r VersionedSignedValidatorRegistration) Signature() Signature
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.
Source Files ¶
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
|
|
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. |