Skip to content

Commit

Permalink
remove logger from ExecuteDuties
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Jan 21, 2025
1 parent 4952294 commit 3ee7692
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion operator/duties/attester.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (h *AttesterHandler) processExecution(ctx context.Context, epoch phase0.Epo
}
}

h.dutiesExecutor.ExecuteDuties(ctx, h.logger, toExecute)
h.dutiesExecutor.ExecuteDuties(ctx, toExecute)
}

func (h *AttesterHandler) fetchAndProcessDuties(ctx context.Context, epoch phase0.Epoch) error {
Expand Down
2 changes: 1 addition & 1 deletion operator/duties/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (h *ProposerHandler) processExecution(ctx context.Context, epoch phase0.Epo
toExecute = append(toExecute, h.toSpecDuty(d, spectypes.BNRoleProposer))
}
}
h.dutiesExecutor.ExecuteDuties(ctx, h.logger, toExecute)
h.dutiesExecutor.ExecuteDuties(ctx, toExecute)
}

func (h *ProposerHandler) fetchAndProcessDuties(ctx context.Context, epoch phase0.Epoch) error {
Expand Down
4 changes: 2 additions & 2 deletions operator/duties/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (

// DutiesExecutor is an interface for executing duties.
type DutiesExecutor interface {
ExecuteDuties(ctx context.Context, logger *zap.Logger, duties []*spectypes.ValidatorDuty)
ExecuteDuties(ctx context.Context, duties []*spectypes.ValidatorDuty)
ExecuteCommitteeDuties(ctx context.Context, duties committeeDutiesMap)
}

Expand Down Expand Up @@ -359,7 +359,7 @@ func (s *Scheduler) HandleHeadEvent() func(event *eth2apiv1.Event) {
}

// ExecuteDuties tries to execute the given duties
func (s *Scheduler) ExecuteDuties(ctx context.Context, logger *zap.Logger, duties []*spectypes.ValidatorDuty) {
func (s *Scheduler) ExecuteDuties(ctx context.Context, duties []*spectypes.ValidatorDuty) {
for _, duty := range duties {
duty := duty
logger := s.loggerWithDutyContext(duty)
Expand Down
8 changes: 4 additions & 4 deletions operator/duties/scheduler_mock.go

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

2 changes: 1 addition & 1 deletion operator/duties/sync_committee.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (h *SyncCommitteeHandler) processExecution(ctx context.Context, period uint
}
}

h.dutiesExecutor.ExecuteDuties(ctx, h.logger, toExecute)
h.dutiesExecutor.ExecuteDuties(ctx, toExecute)
}

func (h *SyncCommitteeHandler) fetchAndProcessDuties(ctx context.Context, period uint64, waitForInitial bool) error {
Expand Down
2 changes: 1 addition & 1 deletion operator/duties/validatorregistration.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (h *ValidatorRegistrationHandler) HandleDuties(ctx context.Context) {

pk := phase0.BLSPubKey{}
copy(pk[:], share.ValidatorPubKey[:])
h.dutiesExecutor.ExecuteDuties(ctx, h.logger, []*spectypes.ValidatorDuty{{
h.dutiesExecutor.ExecuteDuties(ctx, []*spectypes.ValidatorDuty{{

Check warning on line 58 in operator/duties/validatorregistration.go

View check run for this annotation

Codecov / codecov/patch

operator/duties/validatorregistration.go#L58

Added line #L58 was not covered by tests
Type: spectypes.BNRoleValidatorRegistration,
ValidatorIndex: share.ValidatorIndex,
PubKey: pk,
Expand Down
2 changes: 1 addition & 1 deletion operator/duties/voluntary_exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (h *VoluntaryExitHandler) processExecution(ctx context.Context, slot phase0
h.duties.RemoveSlot(slot - phase0.Slot(h.network.SlotsPerEpoch()))

if dutyCount := len(dutiesForExecution); dutyCount != 0 {
h.dutiesExecutor.ExecuteDuties(ctx, h.logger, dutiesForExecution)
h.dutiesExecutor.ExecuteDuties(ctx, dutiesForExecution)
h.logger.Debug("executed voluntary exit duties",
fields.Slot(slot),
fields.Count(dutyCount))
Expand Down

0 comments on commit 3ee7692

Please sign in to comment.