Documentation ¶
Overview ¶
Package duties is a generated GoMock package.
Index ¶
- type AttesterHandler
- type BeaconNode
- type EventFeed
- type ExecuteDutiesFunc
- type ExecuteDutyFunc
- type ExecutionClient
- type ExitDescriptor
- type MockdutyHandler
- func (m *MockdutyHandler) EXPECT() *MockdutyHandlerMockRecorder
- func (m *MockdutyHandler) HandleDuties(arg0 context.Context)
- func (m *MockdutyHandler) HandleInitialDuties(arg0 context.Context)
- func (m *MockdutyHandler) Name() string
- func (m *MockdutyHandler) Setup(arg0 string, arg1 *zap.Logger, arg2 BeaconNode, arg3 ExecutionClient, ...)
- type MockdutyHandlerMockRecorder
- func (mr *MockdutyHandlerMockRecorder) HandleDuties(arg0 interface{}) *gomock.Call
- func (mr *MockdutyHandlerMockRecorder) HandleInitialDuties(arg0 interface{}) *gomock.Call
- func (mr *MockdutyHandlerMockRecorder) Name() *gomock.Call
- func (mr *MockdutyHandlerMockRecorder) Setup(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 interface{}) *gomock.Call
- type ProposerHandler
- type ReorgEvent
- type Scheduler
- func (s *Scheduler) ExecuteDuties(logger *zap.Logger, duties []*spectypes.Duty)
- func (s *Scheduler) HandleHeadEvent(logger *zap.Logger) func(event *eth2apiv1.Event)
- func (s *Scheduler) SlotTicker(ctx context.Context)
- func (s *Scheduler) Start(ctx context.Context, logger *zap.Logger) error
- func (s *Scheduler) Wait() error
- type SchedulerOptions
- type SlotTicker
- type SyncCommitteeHandler
- type ValidatorController
- type ValidatorRegistrationHandler
- func (h *ValidatorRegistrationHandler) HandleDuties(ctx context.Context)
- func (b *ValidatorRegistrationHandler) HandleInitialDuties(context.Context)
- func (h *ValidatorRegistrationHandler) Name() string
- func (h *ValidatorRegistrationHandler) Setup(name string, logger *zap.Logger, beaconNode BeaconNode, ...)
- type VoluntaryExitHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttesterHandler ¶ added in v1.1.0
type AttesterHandler struct {
// contains filtered or unexported fields
}
func NewAttesterHandler ¶ added in v1.1.0
func NewAttesterHandler(duties *dutystore.Duties[eth2apiv1.AttesterDuty]) *AttesterHandler
func (*AttesterHandler) HandleDuties ¶ added in v1.1.0
func (h *AttesterHandler) HandleDuties(ctx context.Context)
HandleDuties manages the duty lifecycle, handling different cases:
On First Run:
- Fetch duties for the current epoch.
- If necessary, fetch duties for the next epoch.
- Execute duties.
On Re-org:
If the previous dependent root changed: 1. Fetch duties for the current epoch. 2. Execute duties. If the current dependent root changed: 1. Execute duties. 2. If necessary, fetch duties for the next epoch.
On Indices Change:
- Execute duties.
- ResetEpoch duties for the current epoch.
- Fetch duties for the current epoch.
- If necessary, fetch duties for the next epoch.
On Ticker event:
- Execute duties.
- If necessary, fetch duties for the next epoch.
func (*AttesterHandler) HandleInitialDuties ¶ added in v1.2.0
func (*AttesterHandler) Name ¶ added in v1.1.0
func (h *AttesterHandler) Name() string
func (*AttesterHandler) Setup ¶ added in v1.1.0
func (h *AttesterHandler) Setup(name string, logger *zap.Logger, beaconNode BeaconNode, executionClient ExecutionClient, network networkconfig.NetworkConfig, validatorController ValidatorController, executeDuties ExecuteDutiesFunc, slotTickerProvider slotticker.Provider, reorgEvents chan ReorgEvent, indicesChange chan struct{})
type BeaconNode ¶ added in v1.1.0
type BeaconNode interface { AttesterDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*eth2apiv1.AttesterDuty, error) ProposerDuties(ctx context.Context, epoch phase0.Epoch, validatorIndices []phase0.ValidatorIndex) ([]*eth2apiv1.ProposerDuty, error) SyncCommitteeDuties(ctx context.Context, epoch phase0.Epoch, indices []phase0.ValidatorIndex) ([]*eth2apiv1.SyncCommitteeDuty, error) Events(ctx context.Context, topics []string, handler eth2client.EventHandlerFunc) error SubmitBeaconCommitteeSubscriptions(ctx context.Context, subscription []*eth2apiv1.BeaconCommitteeSubscription) error SubmitSyncCommitteeSubscriptions(ctx context.Context, subscription []*eth2apiv1.SyncCommitteeSubscription) error }
type EventFeed ¶ added in v1.1.0
type EventFeed[T any] struct { // contains filtered or unexported fields }
func NewEventFeed ¶ added in v1.1.0
func (*EventFeed[T]) Subscribe ¶ added in v1.1.0
func (f *EventFeed[T]) Subscribe(ch chan<- T) event.Subscription
type ExecuteDutiesFunc ¶ added in v1.1.0
ExecuteDutiesFunc is a non-blocking functions which executes the given duties.
type ExecuteDutyFunc ¶ added in v1.1.0
type ExecutionClient ¶ added in v1.2.2
type ExitDescriptor ¶ added in v1.2.2
type ExitDescriptor struct { PubKey phase0.BLSPubKey ValidatorIndex phase0.ValidatorIndex BlockNumber uint64 }
type MockdutyHandler ¶ added in v1.1.0
type MockdutyHandler struct {
// contains filtered or unexported fields
}
MockdutyHandler is a mock of dutyHandler interface.
func NewMockdutyHandler ¶ added in v1.1.0
func NewMockdutyHandler(ctrl *gomock.Controller) *MockdutyHandler
NewMockdutyHandler creates a new mock instance.
func (*MockdutyHandler) EXPECT ¶ added in v1.1.0
func (m *MockdutyHandler) EXPECT() *MockdutyHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockdutyHandler) HandleDuties ¶ added in v1.1.0
func (m *MockdutyHandler) HandleDuties(arg0 context.Context)
HandleDuties mocks base method.
func (*MockdutyHandler) HandleInitialDuties ¶ added in v1.2.0
func (m *MockdutyHandler) HandleInitialDuties(arg0 context.Context)
HandleInitialDuties mocks base method.
func (*MockdutyHandler) Name ¶ added in v1.1.0
func (m *MockdutyHandler) Name() string
Name mocks base method.
func (*MockdutyHandler) Setup ¶ added in v1.1.0
func (m *MockdutyHandler) Setup(arg0 string, arg1 *zap.Logger, arg2 BeaconNode, arg3 ExecutionClient, arg4 networkconfig.NetworkConfig, arg5 ValidatorController, arg6 ExecuteDutiesFunc, arg7 slotticker.Provider, arg8 chan ReorgEvent, arg9 chan struct{})
Setup mocks base method.
type MockdutyHandlerMockRecorder ¶ added in v1.1.0
type MockdutyHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockdutyHandlerMockRecorder is the mock recorder for MockdutyHandler.
func (*MockdutyHandlerMockRecorder) HandleDuties ¶ added in v1.1.0
func (mr *MockdutyHandlerMockRecorder) HandleDuties(arg0 interface{}) *gomock.Call
HandleDuties indicates an expected call of HandleDuties.
func (*MockdutyHandlerMockRecorder) HandleInitialDuties ¶ added in v1.2.0
func (mr *MockdutyHandlerMockRecorder) HandleInitialDuties(arg0 interface{}) *gomock.Call
HandleInitialDuties indicates an expected call of HandleInitialDuties.
func (*MockdutyHandlerMockRecorder) Name ¶ added in v1.1.0
func (mr *MockdutyHandlerMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name.
func (*MockdutyHandlerMockRecorder) Setup ¶ added in v1.1.0
func (mr *MockdutyHandlerMockRecorder) Setup(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 interface{}) *gomock.Call
Setup indicates an expected call of Setup.
type ProposerHandler ¶ added in v1.1.0
type ProposerHandler struct {
// contains filtered or unexported fields
}
func NewProposerHandler ¶ added in v1.1.0
func NewProposerHandler(duties *dutystore.Duties[eth2apiv1.ProposerDuty]) *ProposerHandler
func (*ProposerHandler) HandleDuties ¶ added in v1.1.0
func (h *ProposerHandler) HandleDuties(ctx context.Context)
HandleDuties manages the duty lifecycle, handling different cases:
On First Run:
- Fetch duties for the current epoch.
- Execute duties.
On Re-org (current dependent root changed):
- Fetch duties for the current epoch.
- Execute duties.
On Indices Change:
- Execute duties.
- ResetEpoch duties for the current epoch.
- Fetch duties for the current epoch.
On Ticker event:
- Execute duties.
- If necessary, fetch duties for the current epoch.
func (*ProposerHandler) HandleInitialDuties ¶ added in v1.2.0
func (h *ProposerHandler) HandleInitialDuties(ctx context.Context)
func (*ProposerHandler) Name ¶ added in v1.1.0
func (h *ProposerHandler) Name() string
func (*ProposerHandler) Setup ¶ added in v1.1.0
func (h *ProposerHandler) Setup(name string, logger *zap.Logger, beaconNode BeaconNode, executionClient ExecutionClient, network networkconfig.NetworkConfig, validatorController ValidatorController, executeDuties ExecuteDutiesFunc, slotTickerProvider slotticker.Provider, reorgEvents chan ReorgEvent, indicesChange chan struct{})
type ReorgEvent ¶ added in v1.1.0
type Scheduler ¶ added in v1.1.0
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶ added in v1.1.0
func NewScheduler(opts *SchedulerOptions) *Scheduler
func (*Scheduler) ExecuteDuties ¶ added in v1.1.0
ExecuteDuties tries to execute the given duties
func (*Scheduler) HandleHeadEvent ¶ added in v1.1.0
HandleHeadEvent handles the "head" events from the beacon node.
func (*Scheduler) SlotTicker ¶ added in v1.1.0
SlotTicker handles the "head" events from the beacon node.
type SchedulerOptions ¶ added in v1.1.0
type SchedulerOptions struct { Ctx context.Context BeaconNode BeaconNode ExecutionClient ExecutionClient Network networkconfig.NetworkConfig ValidatorController ValidatorController ExecuteDuty ExecuteDutyFunc IndicesChg chan struct{} ValidatorExitCh <-chan ExitDescriptor SlotTickerProvider slotticker.Provider BuilderProposals bool DutyStore *dutystore.Store }
type SlotTicker ¶ added in v1.1.0
type SyncCommitteeHandler ¶ added in v1.1.0
type SyncCommitteeHandler struct {
// contains filtered or unexported fields
}
func NewSyncCommitteeHandler ¶ added in v1.1.0
func NewSyncCommitteeHandler(duties *dutystore.SyncCommitteeDuties) *SyncCommitteeHandler
func (*SyncCommitteeHandler) HandleDuties ¶ added in v1.1.0
func (h *SyncCommitteeHandler) HandleDuties(ctx context.Context)
HandleDuties manages the duty lifecycle, handling different cases:
On First Run:
- Fetch duties for the current period.
- If necessary, fetch duties for the next period.
- Execute duties.
On Re-org:
- Execute duties.
- If necessary, fetch duties for the next period.
On Indices Change:
- Execute duties.
- ResetEpoch duties for the current period.
- Fetch duties for the current period.
- If necessary, fetch duties for the next period.
On Ticker event:
- Execute duties.
- If necessary, fetch duties for the next period.
func (*SyncCommitteeHandler) HandleInitialDuties ¶ added in v1.2.0
func (h *SyncCommitteeHandler) HandleInitialDuties(ctx context.Context)
func (*SyncCommitteeHandler) Name ¶ added in v1.1.0
func (h *SyncCommitteeHandler) Name() string
func (*SyncCommitteeHandler) Setup ¶ added in v1.1.0
func (h *SyncCommitteeHandler) Setup(name string, logger *zap.Logger, beaconNode BeaconNode, executionClient ExecutionClient, network networkconfig.NetworkConfig, validatorController ValidatorController, executeDuties ExecuteDutiesFunc, slotTickerProvider slotticker.Provider, reorgEvents chan ReorgEvent, indicesChange chan struct{})
type ValidatorController ¶ added in v1.1.0
type ValidatorController interface { CommitteeActiveIndices(epoch phase0.Epoch) []phase0.ValidatorIndex AllActiveIndices(epoch phase0.Epoch, afterInit bool) []phase0.ValidatorIndex }
ValidatorController represents the component that controls validators via the scheduler
type ValidatorRegistrationHandler ¶ added in v1.1.0
type ValidatorRegistrationHandler struct {
// contains filtered or unexported fields
}
func NewValidatorRegistrationHandler ¶ added in v1.1.0
func NewValidatorRegistrationHandler() *ValidatorRegistrationHandler
func (*ValidatorRegistrationHandler) HandleDuties ¶ added in v1.1.0
func (h *ValidatorRegistrationHandler) HandleDuties(ctx context.Context)
func (*ValidatorRegistrationHandler) HandleInitialDuties ¶ added in v1.2.0
func (*ValidatorRegistrationHandler) Name ¶ added in v1.1.0
func (h *ValidatorRegistrationHandler) Name() string
func (*ValidatorRegistrationHandler) Setup ¶ added in v1.1.0
func (h *ValidatorRegistrationHandler) Setup(name string, logger *zap.Logger, beaconNode BeaconNode, executionClient ExecutionClient, network networkconfig.NetworkConfig, validatorController ValidatorController, executeDuties ExecuteDutiesFunc, slotTickerProvider slotticker.Provider, reorgEvents chan ReorgEvent, indicesChange chan struct{})
type VoluntaryExitHandler ¶ added in v1.2.2
type VoluntaryExitHandler struct {
// contains filtered or unexported fields
}
func NewVoluntaryExitHandler ¶ added in v1.2.2
func NewVoluntaryExitHandler(validatorExitCh <-chan ExitDescriptor) *VoluntaryExitHandler
func (*VoluntaryExitHandler) HandleDuties ¶ added in v1.2.2
func (h *VoluntaryExitHandler) HandleDuties(ctx context.Context)
func (*VoluntaryExitHandler) HandleInitialDuties ¶ added in v1.2.2
func (*VoluntaryExitHandler) Name ¶ added in v1.2.2
func (h *VoluntaryExitHandler) Name() string
func (*VoluntaryExitHandler) Setup ¶ added in v1.2.2
func (h *VoluntaryExitHandler) Setup(name string, logger *zap.Logger, beaconNode BeaconNode, executionClient ExecutionClient, network networkconfig.NetworkConfig, validatorController ValidatorController, executeDuties ExecuteDutiesFunc, slotTickerProvider slotticker.Provider, reorgEvents chan ReorgEvent, indicesChange chan struct{})