Skip to content

Commit

Permalink
fix: applied scaling to notification content
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Oct 29, 2024
1 parent d078cab commit 1fc7159
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/pkg/notification/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,11 @@ func collectGroupEfficiencyNotifications(notificationsByUserID types.Notificatio
syncEfficiency.Valid = true
}

efficiency := utils.CalculateTotalEfficiency(attestationEfficiency, proposerEfficiency, syncEfficiency)
efficiency := utils.CalculateTotalEfficiency(attestationEfficiency, proposerEfficiency, syncEfficiency) / 100

log.Infof("efficiency: %v, threshold: %v", efficiency, groupDetails.Subscription.EventThreshold*100)
log.Infof("efficiency: %v, threshold: %v", efficiency*100, groupDetails.Subscription.EventThreshold*100)

if efficiency < groupDetails.Subscription.EventThreshold*100 {
if efficiency < groupDetails.Subscription.EventThreshold {
log.Infof("creating group efficiency notification for user %v, dashboard %v, group %v in epoch %v", userId, dashboardId, groupId, epoch)
n := &ValidatorGroupEfficiencyNotification{
NotificationBaseImpl: types.NotificationBaseImpl{
Expand Down
2 changes: 1 addition & 1 deletion backend/pkg/notification/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (n *ValidatorGroupEfficiencyNotification) GetEntitiyId() string {
func (n *ValidatorGroupEfficiencyNotification) GetInfo(format types.NotificationFormat) string {
dashboardAndGroupInfo := formatPureDashboardAndGroupLink(format, n)
epoch := formatEpochLink(format, n.Epoch)
return fmt.Sprintf(`%s efficiency of %.2f%% was below the threshold of %.2f%% in epoch %s.`, dashboardAndGroupInfo, n.Efficiency, n.Threshold, epoch)
return fmt.Sprintf(`%s efficiency of %.2f%% was below the threshold of %.2f%% in epoch %s.`, dashboardAndGroupInfo, n.Efficiency*100, n.Threshold*100, epoch)
}

func (n *ValidatorGroupEfficiencyNotification) GetTitle() string {
Expand Down

0 comments on commit 1fc7159

Please sign in to comment.