-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEDS 1065/apps christmas miracle #1239
base: staging
Are you sure you want to change the base?
Conversation
Deploying beaconchain with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the changes here don't fit the intended usage for this file please lmk
- adds efficiency, balances and rewards fields See: BEDS-1065
See: BEDS-1065
See: BEDS-1065
See: BEDS-1065
See: BEDS-1065
df5ec40
to
53bc77d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, left a few comments. ptal
func (d *DataAccessService) internal_getElClAPR(ctx context.Context, dashboardId t.VDBId, groupId int64, hours int) (elIncome decimal.Decimal, elAPR float64, clIncome decimal.Decimal, clAPR float64, err error) { | ||
func (d *DataAccessService) getElClAPR(ctx context.Context, dashboardId t.VDBId, groupId int64, hours int) (elIncome decimal.Decimal, elAPR float64, clIncome decimal.Decimal, clAPR float64, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That function could probably also be moved to vdb_helpers.go
, it's used a few times in different locations 🙏
if totalIdealAttestationRewards > 0 { | ||
attestationEfficiency.Float64 = decimal.NewFromInt(totalAttestationRewards).Div(decimal.NewFromInt(totalIdealAttestationRewards)).InexactFloat64() | ||
attestationEfficiency.Valid = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was calculated above already, see ret.AttestationEfficiency
rpOperatorInfo, err := d.getValidatorDashboardRpOperatorInfo(ctx, dashboardId) | ||
if err != nil { | ||
return nil, err | ||
} | ||
validatorMapping, err := d.services.GetCurrentValidatorMapping() | ||
if err != nil { | ||
return nil, err | ||
} | ||
balances, err := d.calculateValidatorDashboardBalance(ctx, rpOperatorInfo, validators, validatorMapping, protocolModes) | ||
if err != nil { | ||
return nil, err | ||
} | ||
ret.Balances = balances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check: This would factor in the protocolModes
for the new balances field, but the rest of the function does not yet use the parameter. I'm not 100% certain which other fields would also be affected, but apr might be a candidate.
- If there are any, I would prefer to not return "mixed" data as that could be confusing. Rather either apply the calculation to all relevant fields, or (temporarily) apply it to none (hardcoding
protocolModes.RocketPool
tofalse
) - If there are none (which might actually be the case, could be that the parameter is just a leftover from when we were briefly planning to add RP stats to the group summaries or something), the comment about it at the top of the method should be removed / clarified.
Adds efficiency, balances and rewards field to validator dashboard group summary.
Rule-of-thumb performance estimates: