Skip to content
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

Never report stale prices #43

Merged
merged 7 commits into from
Dec 20, 2024
Merged

Never report stale prices #43

merged 7 commits into from
Dec 20, 2024

Conversation

SupernaviX
Copy link
Collaborator

The oracle uses many APIs to get price data for the various tokens it reports on. If one of those APIs is down (or not pushing us updates for whatever reason), there's two things we can do about it:

  1. keep using the most recent prices reported by that API
  2. stop reporting prices from that API

The node was doing 1, to avoid our own downtime by using stale prices. This PR switches it to do 2, so that prolonged outages don't cause us to report extremely old prices.

The changes:

  • Before, nodes would always have some price for every token; now, if a node can't get updates for that token, it won't produce any price feeds which depend on it.
  • We no longer use "default" prices the first time an oracle starts up
  • We won't ever reference prices saved to disk (though we still save them to disk in case we want to start doing that again someday)

@Quantumplation
Copy link
Collaborator

Do we have a metric for stale prices, or are we just relying on "we haven't reported prices for 2 minutes"?

Might make reporting easier if we had the former

@SupernaviX SupernaviX merged commit cef513b into main Dec 20, 2024
7 checks passed
@SupernaviX SupernaviX deleted the no-stale-prices branch December 20, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants