Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/bcast/bcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func newDelayFunc(ctx context.Context, eth2Cl eth2wrap.Client) (func(slot uint64
var offset time.Duration

switch duty {
case core.DutyAttester, core.DutyAggregator, core.DutySyncContribution:
case core.DutyAttester, core.DutyAggregator, core.DutySyncContribution, core.DutyPayloadAttestation:
offset = slotOffsetFunc(core.Duty{Slot: slot, Type: duty})
default:
}
Expand Down
3 changes: 3 additions & 0 deletions core/deadline.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ func NewDutyDeadlineFunc(ctx context.Context, eth2Cl eth2wrap.Client) (DeadlineF
duration = time.Duration(slotsPerEpoch) * slotDuration
case DutyPrepareAggregator, DutyPrepareSyncContribution:
duration = 2 * time.Duration(slotsPerEpoch) * slotDuration
case DutyPayloadAttestation:
// Payload attestation messages are only accepted on gossip within their own slot.
duration = slotDuration
default:
duration = slotDuration
}
Expand Down
8 changes: 8 additions & 0 deletions core/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ type ValidatorAPI interface {
// RegisterAwaitAttestation registers a function to query attestation data.
RegisterAwaitAttestation(func(ctx context.Context, slot, commIdx uint64) (*eth2p0.AttestationData, error))

// RegisterAwaitPayloadAttestationData registers a function to query payload attestation data.
RegisterAwaitPayloadAttestationData(func(ctx context.Context, slot uint64) (*gloas.PayloadAttestationData, error))

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

Expand Down Expand Up @@ -279,13 +282,15 @@ type wireFuncs struct {
DutyDBPubKeyByAttestation func(ctx context.Context, slot, commIdx, valIdx uint64) (PubKey, error)
DutyDBAwaitAggAttestation func(ctx context.Context, slot uint64, attestationRoot eth2p0.Root, committeeIndex eth2p0.CommitteeIndex) (*eth2spec.VersionedAttestation, error)
DutyDBAwaitSyncContribution func(ctx context.Context, slot, subcommIdx uint64, beaconBlockRoot eth2p0.Root) (*altair.SyncCommitteeContribution, error)
DutyDBAwaitPayloadAttestation func(ctx context.Context, slot uint64) (*gloas.PayloadAttestationData, error)
VAPIRegisterAwaitAttestation func(func(ctx context.Context, slot, commIdx uint64) (*eth2p0.AttestationData, error))
VAPIRegisterAwaitSyncContribution func(func(ctx context.Context, slot, subcommIdx uint64, beaconBlockRoot eth2p0.Root) (*altair.SyncCommitteeContribution, error))
VAPIRegisterAwaitProposal func(func(ctx context.Context, slot uint64) (*eth2api.VersionedProposal, error))
VAPIRegisterGetDutyDefinition func(func(context.Context, Duty) (DutyDefinitionSet, error))
VAPIRegisterPubKeyByAttestation func(func(ctx context.Context, slot, commIdx, valIdx uint64) (PubKey, error))
VAPIRegisterAwaitAggAttestation func(func(ctx context.Context, slot uint64, attestationRoot eth2p0.Root, committeeIndex eth2p0.CommitteeIndex) (*eth2spec.VersionedAttestation, error))
VAPIRegisterAwaitAggSigDB func(func(context.Context, Duty, PubKey, SubcommitteeIndex) (SignedData, error))
VAPIRegisterAwaitPayloadAttData func(func(ctx context.Context, slot uint64) (*gloas.PayloadAttestationData, error))
VAPISubscribe func(func(context.Context, Duty, ParSignedDataSet) error)
ParSigDBStoreInternal func(context.Context, Duty, ParSignedDataSet) error
ParSigDBStoreExternal func(context.Context, Duty, ParSignedDataSet) error
Expand Down Expand Up @@ -335,13 +340,15 @@ func Wire(sched Scheduler,
DutyDBPubKeyByAttestation: dutyDB.PubKeyByAttestation,
DutyDBAwaitAggAttestation: dutyDB.AwaitAggAttestation,
DutyDBAwaitSyncContribution: dutyDB.AwaitSyncContribution,
DutyDBAwaitPayloadAttestation: dutyDB.AwaitPayloadAttestationData,
VAPIRegisterAwaitProposal: vapi.RegisterAwaitProposal,
VAPIRegisterAwaitAttestation: vapi.RegisterAwaitAttestation,
VAPIRegisterAwaitSyncContribution: vapi.RegisterAwaitSyncContribution,
VAPIRegisterGetDutyDefinition: vapi.RegisterGetDutyDefinition,
VAPIRegisterPubKeyByAttestation: vapi.RegisterPubKeyByAttestation,
VAPIRegisterAwaitAggAttestation: vapi.RegisterAwaitAggAttestation,
VAPIRegisterAwaitAggSigDB: vapi.RegisterAwaitAggSigDB,
VAPIRegisterAwaitPayloadAttData: vapi.RegisterAwaitPayloadAttestationData,
VAPISubscribe: vapi.Subscribe,
ParSigDBStoreInternal: parSigDB.StoreInternal,
ParSigDBStoreExternal: parSigDB.StoreExternal,
Expand Down Expand Up @@ -372,6 +379,7 @@ func Wire(sched Scheduler,
w.VAPIRegisterAwaitProposal(w.DutyDBAwaitProposal)
w.VAPIRegisterAwaitAttestation(w.DutyDBAwaitAttestation)
w.VAPIRegisterAwaitSyncContribution(w.DutyDBAwaitSyncContribution)
w.VAPIRegisterAwaitPayloadAttData(w.DutyDBAwaitPayloadAttestation)
w.VAPIRegisterGetDutyDefinition(w.SchedulerGetDutyDefinition)
w.VAPIRegisterPubKeyByAttestation(w.DutyDBPubKeyByAttestation)
w.VAPIRegisterAwaitAggAttestation(w.DutyDBAwaitAggAttestation)
Expand Down
9 changes: 9 additions & 0 deletions core/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"sync"

eth2api "github.com/attestantio/go-eth2-client/api"
"github.com/attestantio/go-eth2-client/spec/gloas"
"go.opentelemetry.io/otel/codes"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
"go.opentelemetry.io/otel/trace"
Expand Down Expand Up @@ -104,6 +105,14 @@ func WithTracing() WireOption {

return vp, withSpanStatus(span, err)
}
w.DutyDBAwaitPayloadAttestation = func(parent context.Context, slot uint64) (*gloas.PayloadAttestationData, error) {
ctx, span := tracer.Start(parent, "core/dutydb.AwaitPayloadAttestationData")
defer span.End()

data, err := clone.DutyDBAwaitPayloadAttestation(ctx, slot)

return data, withSpanStatus(span, err)
}
w.ParSigDBStoreInternal = func(parent context.Context, duty Duty, set ParSignedDataSet) error {
ctx, span := tracer.Start(parent, "core/parsigdb.StoreInternal")
defer span.End()
Expand Down
192 changes: 121 additions & 71 deletions core/validatorapi/mocks/handler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading