-
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
cmd/livepeer: Use price feed watcher for dynamic pricePerPixel #2981
Conversation
Makefile: Use mockgen binary from tool dependencies eth/contracts: Add chainlink interfaces source Makefile: Generate Chainlink contracts ABI tools: Add abigen tool to repo eth/contracts: Generate chainlink bindings Makefile: Fix abigen bindings generation Revert everything abigen Turns out there's already bindings exported from the Chainlink lib. go.mod: Add chainlink library eth/watchers: Add pricefeed watcher eth/watchers: Clean-up event watching code eth/watchers: Improve price tracking Revert "go.mod: Add chainlink library" This reverts commit ac415bd. Revert "Revert everything abigen" This reverts commit b7c40b1. eth/contracts: Gen bindings for proxy iface eth/watchers: Use local bindings for contracts eth/watchers: Simplify event subs logic eth/watchers: Simplify&optimize truncated ticker eth/watchers: Update decimals on fetch eth/watchers: Improve handling of decimals eth/watchers: Fix price rat creation eth/watchers: Make sure we use UTC on truncated timer eth/contracts/chainlink: Generate only V3 contract bindings eth/watchers: Watch PriceFeed only with polling eth/watchers: Add a retry logic on price update eth/watchers: Use clog instead of fmt.Printf
This will make the code more testable.
Gosh that was much harder than I thought
Currently ignoring the currency value.
12060d7
to
644e680
Compare
644e680
to
87907f2
Compare
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 comments. It looks good, but I think it requires some more manual testing. Unfortunately go-livepeer is a beast and we don't have too many automated tests. Therefore, we need to check manually at least the following scenarios:
- Set up local dev (or ask some public O to test it on Mainnet):
- O: Set different prices per Broadcasters read from a file
- O: Set dynamically prices per Broadcasters
- O: Set dynamically default price from wei to USD and back to wei and back to USD
- B: Set max price from commandline
- B: Set max price dynamically
- Check if automated tests work in Catalyst (enough to send a draft PR with the update go-livepeer version to your commit hash)
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 👍
Parse it directlty as a big.Rat from a raw string, like I was doing for pricePerUnit in some places.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2981 +/- ##
===================================================
+ Coverage 57.24231% 57.47690% +0.23459%
===================================================
Files 91 92 +1
Lines 15513 15695 +182
===================================================
+ Hits 8880 9021 +141
- Misses 6040 6078 +38
- Partials 593 596 +3
Continue to review full report in Codecov by Sentry.
|
Found out that's officially supported precision on the discovery logic, so let's reflect that here.
What does this pull request do? Explain your changes. (required)
This uses the Chainlink price feed watcher component created on #2972 to
support dynamic transcode pricing for Broadcasters and Orchestrators. It works
by simply updating the
LivepeerNode.SetBasePrice
orserver.BroadcastCfg.SetMaxPrice
when there are price updates on the price feed.
Specific updates (required)
How did you test each of these updates (required)
go test
Does this pull request close any open issues?
Implements ENG-1726
Checklist:
make
runs successfully./test.sh
pass