go-livepeer icon indicating copy to clipboard operation
go-livepeer copied to clipboard

Bug: nonsensical print of Ticket processing

Open stronk-dev opened this issue 1 year ago • 8 comments

As of PR #2907, logging of received tickets have been changed. It now sums the FV, win percentage and EV and prints only the sum, which make these variables useless: the parameters of a game of chance do not change when doing multiple runs. Specifically, it breaks my panels as without knowing how many tickets were added, I cannot derive any useable FV, win% or EV.

Since summing these values is nonsenical, can we roll back the PR or modify it to print an average?

https://github.com/ad-astra-video/go-livepeer/blob/7fdbde80aa075b963f8210958a69cb93093347c9/core/orchestrator.go#L219

stronk-dev avatar Jan 29 '24 13:01 stronk-dev

Never mind, looks like i mixed up some repos (and i need to update my binaries). I can't find the commit (7fdbde80aa075b963f8210958a69cb93093347c9) of the PR applied to orchestrator.go

stronk-dev avatar Jan 29 '24 13:01 stronk-dev

😄 the best kind of bug report

thomshutt avatar Jan 29 '24 13:01 thomshutt

New checklist before opening a GH issue/PR:

  • [ ] Ingest 1 unit of caffeine
  • [x] Do not verify info
  • [x] Include snarky comment in OP

stronk-dev avatar Jan 29 '24 14:01 stronk-dev

Never mind, it looks the commit is in the master branch after all: https://github.com/livepeer/go-livepeer/commit/ddd7e7e760ff1489aaeb31ef15559dea22fbfc90

I get that summarizing the EV makes sense, but this is already exposed as a prometheus metric to track it. Having a totalFaceValue or totalWinProb doesn't make sense to me, as you can no longer use them to calculate anything without converting it back to a per-ticket basis

stronk-dev avatar Jan 30 '24 13:01 stronk-dev

Since the update to 0.7.2, I am actually encountering the same problem and some of my Grafana dashboards no longer really make sense. :)

FranckUltima avatar Jan 30 '24 14:01 FranckUltima

I can get a PR up for this to change to average and add number of tickets processed to the log line.

I personally do not prefer to get the logs overwhelmed by a log line for each ticket processed with new lower ticketEV.

@stronk-dev, for now, are the panels not able to be adjusted in grafana with the ticketEV known by the O?

ad-astra-video avatar Jan 31 '24 16:01 ad-astra-video

I can get a PR up for this to change to average and add number of tickets processed to the log line. I personally do not prefer to get the logs overwhelmed by a log line for each ticket processed with new lower ticketEV.

Since these ticket params are usually constant (correct me if i am wrong on this assumption), we could prevent calculating the average value. You could print something like: W tickets processed with X face value and Y winProb for a total EV of Z. Any time the face value or winprob changes, start a new print.

@stronk-dev, for now, are the panels not able to be adjusted in grafana with the ticketEV known by the O?

Nope, it's Loki log parsing extracting the face value and win percentage specifically. I'm unable to parse this back into a per-ticket basis at the moment to do calculations with

stronk-dev avatar Jan 31 '24 18:01 stronk-dev

The faceValue and winProb are the same for each ticket.

O provides the faceValue and winProb then the B provides a nonce and signs the ticket with the nonce. The B then sends back a list of signatures over the ticket params and the nonce for each ticket to the O.

I think your solution works and side steps additional calculation since we can just pull the faceValue and the winProb from the first ticket in the batch.

ad-astra-video avatar Jan 31 '24 18:01 ad-astra-video

@stronk-dev, @FranckUltima solved by https://github.com/livepeer/go-livepeer/pull/2968.

rickstaa avatar Jan 20 '25 19:01 rickstaa