Skip to content

Commit

Permalink
fix(vdb): blocks cl rewards precision
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami authored and sasha-bitfly committed Dec 16, 2024
1 parent e846d8f commit bfaf2e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/pkg/api/data_access/vdb_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (d *DataAccessService) GetValidatorDashboardBlocks(ctx context.Context, das
From(goqu.T("consensus_payloads")).
Select(
goqu.C("slot"),
goqu.L("cl_attestations_reward / 1e9 + cl_sync_aggregate_reward / 1e9 + cl_slashing_inclusion_reward / 1e9 AS cl_reward"),
goqu.L("cl_attestations_reward + cl_sync_aggregate_reward + cl_slashing_inclusion_reward AS cl_reward"),
).Where(goqu.C("slot").In(slots))
clRewardsQuerySql, args, err := clRewardsQuery.Prepared(true).ToSQL()
if err != nil {
Expand Down Expand Up @@ -450,7 +450,7 @@ func (d *DataAccessService) GetValidatorDashboardBlocks(ctx context.Context, das
reward.El = proposal.ElReward.Decimal.Mul(decimal.NewFromInt(1e18))
}
if clReward, ok := clRewards[proposal.Slot]; ok && clReward.Valid {
reward.Cl = clReward.Decimal.Mul(decimal.NewFromInt(1e18))
reward.Cl = clReward.Decimal.Mul(decimal.NewFromInt(1e9))
}
proposals[i].Reward = proposal.ElReward.Decimal.Add(proposal.ClReward.Decimal)
data[i].Reward = &reward
Expand Down

0 comments on commit bfaf2e2

Please sign in to comment.