-
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
eth,eth/watcher: Create Chainlink price feed watcher #2972
Conversation
@victorges would it maybe be possible to use Chainlink library instead of creating go bindings on our own? |
a8f62e5
to
9e35aef
Compare
67be5cb
to
67286d8
Compare
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.
6d36858
to
ae07a11
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2972 +/- ##
===================================================
- Coverage 57.37567% 57.24231% -0.13336%
===================================================
Files 89 91 +2
Lines 15402 15513 +111
===================================================
+ Hits 8837 8880 +43
- Misses 5973 6040 +67
- Partials 592 593 +1
Continue to review full report in Codecov by Sentry.
|
Gosh that was much harder than I thought
fbe50b7
to
4db8153
Compare
efc2aca
to
59450bf
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.
Thanks for the PR @victorges . Added some comments. Other than that it looks good.
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 one more comment. Other than that LGTM.
What does this pull request do? Explain your changes. (required)
This creates a new client in the eth package to fetch and watch a Chainlink PriceFeed.
This will be used by go-livepeer to be able to peg the transcoding price in an alternate currency,
mostly the American dollar, for a more predictable cost and revenue for node operators.
The logic for using this pricefeed info into tuning the price dynamically will be done in a separate PR.
Specific updates (required)
eth
pkg, for basic fetching of price from a price feedeth/watchers
pkg, to keep up to date on pricing changesHow did you test each of these updates (required)
go test
Does this pull request close any open issues?
Implements ENG-1725
Checklist:
make
runs successfully./test.sh
pass