-
Notifications
You must be signed in to change notification settings - Fork 167
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
Enable Orchestrator to set pricing by broadcaster ETH address #2592
Conversation
Thank you for the PR! We'll review it in the next 1-2 weeks. |
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.
Thank you for the PR. Added a few comments.
Co-authored-by: Rafał Leszko <[email protected]>
…to priceperbroadcaster
…ForBroadcaster, updated log for setOrchestratorPriceInfo to reflect broadcasterEthAddr
…epeer into priceperbroadcaster
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.
Added some super minor comments. Other than that, could you address the following 2 points?
-
The following GH Action is failing, could you check?
-
I've played a little bit with your change and set the price per broadcaster, but then I don't see it in the status when checked from
livepeer_cli
. Also when I do the following curl call, I don't see the broadcaster prices. Could you check?
$ curl localhost:1936/status
{"Manifests":{},"InternalManifests":{},"StreamInfo":{},"OrchestratorPool":[],"OrchestratorPoolInfos":null,"Version":"0.5.34-129325e0","GolangRuntimeVersion":"go1.18.2","GOArch":"arm64","GOOS":"darwin","RegisteredTranscodersNumber":0,"RegisteredTranscoders":[],"LocalTranscoding":true,"BroadcasterPrices":{}}
…ForBroadcaster, updated log for setOrchestratorPriceInfo to reflect broadcasterEthAddr
…epeer into priceperbroadcaster
Codecov Report
@@ Coverage Diff @@
## master #2592 +/- ##
===================================================
- Coverage 56.44931% 56.32685% -0.12246%
===================================================
Files 88 88
Lines 18909 19030 +121
===================================================
+ Hits 10674 10719 +45
- Misses 7656 7728 +72
- Partials 579 583 +4
Continue to review full report at Codecov.
|
@eliteprox Please re-request review or just comment here when you think that your PR is ready for review. |
btw. I've seen the GH Action started to pass 🎉 |
@leszko We are adding some tests so the CodeCov reports pass. We had some tests when submitting but it wants a few more. |
Tests are passing and this now works:
|
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.
Revert unrelated change
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.
Add new line at the end of starter_test.go
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.
LGTM 👍
Thanks a lot for this PR @eliteprox |
What does this pull request do? Explain your changes. (required)
Enables orchestrator to set specific pricePerPixel and pricePerUnit by the broadcaster's ETH address.
Specific updates (required)
-pricePerBroadcaster
to livepeer.go/setPriceForBroadcaster
to handlers.go and webserver.goHow did you test each of these updates (required)
All tests were ran on testnet with linux using multiple broadcasters and an orchestrator node compiled with the changes.
Ran livepeer as orchestrator with
-pricePerUnit 5
,-pixelsPerUnit 1
and -pricePerBroadcaster set to{"broadcasters":[{"ethaddress":"0x6E98a769926f55A65e34066E67198f6B68e4B166","priceperunit":0,"pixelsperunit":1},{"ethaddress":"0xF115A3dfd39778A6719Ace6AA77A2aD228e90329","priceperunit":1200,"pixelsperunit":1}]}
Ran livepeer as orchestrator with
-pricePerUnit 0
,-pixelsPerUnit 1
and-pricePerBroadcaster {"broadcasters":[{"ethaddress":"0x6E98a769926f55A65e34066E67198f6B68e4B166","priceperunit":1200,"pixelsperunit":1}]}
Tested the same using a json file
-pricePerBroadcaster broadcasterprices.json
.Set prices using
curl -X POST -d "pixelsPerUnit=1&pricePerUnit=9&broadcasterEthAddr=0xEB62188121725A605f76a97791a1C69B4BdB435D" http://127.0.0.1:7920/setPriceForBroadcaster
Confirmed correct price sent to broadcaster by verifying payment ticket logs.
Confirmed no deposit required for broadcaster when broadcaster uses
-maxPricePerUnit 0
and orchestrator sets broadcaster's ETH address to a pricePerUnit of 0.Confirmed orchestrator's
-pricePerUnit
and-pricePerPixel
continue to function as the default price when a broadcaster is not assigned a specific price via-pricePerBroadcaster
,-freeStream
or/setPricePerBroadcaster
.Does this pull request close any open issues?
Checklist:
make
runs successfully./test.sh
pass