Skip to content

Commit

Permalink
Merge pull request #2399 from fluidity-money/develop-add-extra-loggin…
Browse files Browse the repository at this point in the history
…g-about-reward-pool

Add extra logging about the reward pool to the solana codebase
  • Loading branch information
af-afk authored Nov 4, 2023
2 parents 2749ce1 + ffb3665 commit 9fde2b8
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 9fde2b8

Please sign in to comment.