Skip to content

Commit

Permalink
Add extra logging about the reward pool to the solana codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Nov 4, 2023
1 parent 2749ce1 commit ffb3665
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions cmd/microservice-solana-worker-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,18 @@ func main() {

sizeOfThePool := new(big.Rat).SetUint64(unscaledPool)

log.Debug(func(k *log.Log) {
k.Message = "Unscaled reward pool size"
k.Payload = unscaledPool
})

sizeOfThePool.Quo(sizeOfThePool, decimalPlacesRat)

log.Debug(func(k *log.Log) {
k.Message = "Scaled reward pool size"
k.Payload = sizeOfThePool.String()
})

for _, userAction := range userActions {
var (
userActionTransactionHash = userAction.Transaction.Signature
Expand Down Expand Up @@ -200,6 +210,8 @@ func main() {
},
}

emission.Payout.RewardPool, _ = sizeOfThePool.Float64()

randomN, randomPayouts, _ := probability.WinningChances(
worker_types.TrfModeNormal,
solanaTransactionFeesNormalised,
Expand Down
2 changes: 0 additions & 2 deletions common/calculation/probability/probability.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ func payout(trfMode worker.TrfMode, atx, g, blockTimeRat, delta *big.Rat, winnin
emission.Payout.B = b
emission.Payout.Delta, _ = delta.Float64()
emission.Payout.Atx, _ = atx.Float64()
//emission.Payout.BlockTime = blockTime
//emission.Payout.RewardPool, _ = rewardPool.Float64()

return aDivP, p
}
Expand Down

0 comments on commit ffb3665

Please sign in to comment.