Skip to content

fix(apps/price_pusher) handle price feed removal more gracefully #2730

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

Merged
merged 3 commits into from
Jun 5, 2025

Conversation

ali-bahjati
Copy link
Collaborator

Summary

The price pusher in many networks would throw an error if a feed doesn't exist and the behaviour was there to prevent config errors but it falls short when we remove a feed. This change adds a warning for non existent feeds but lets the pusher keep functioning (for the remaining feeds).

How has this been tested?

  • Manually tested the code: tested missing feeds (another code path errors it) and tested hermes reconnections.

p.s: evm pusher already had the flag to ignore invalid feeds.

when a feed is not found, the code throws an error which is
typically good but often a feed is removed and that results
in the entire push failing. this change adds the flag to ignore
invalid price updates, which allows the push to continue.
@ali-bahjati ali-bahjati requested a review from cctdaniel May 24, 2025 18:43
@ali-bahjati ali-bahjati requested a review from a team as a code owner May 24, 2025 18:43
Copy link

vercel bot commented May 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Skipped (Inspect) May 26, 2025 9:36am
component-library ⬜️ Skipped (Inspect) May 26, 2025 9:36am
developer-hub ⬜️ Skipped (Inspect) May 26, 2025 9:36am
entropy-debugger ⬜️ Skipped (Inspect) May 26, 2025 9:36am
entropy-explorer ⬜️ Skipped (Inspect) May 26, 2025 9:36am
insights ⬜️ Skipped (Inspect) May 26, 2025 9:36am
proposals ⬜️ Skipped (Inspect) May 26, 2025 9:36am
staking ⬜️ Skipped (Inspect) May 26, 2025 9:36am

console.error("Error receiving updates from Hermes:", error);
eventSource.close();
await sleep(5000); // Wait a bit before trying to reconnect
this.startListening(); // Attempt to restart the listener
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please note that we have another loop checking for latest price update that crashes if there's no update within last 30 seconds.

@ali-bahjati ali-bahjati force-pushed the pusher/better-feed-removal-handling branch from 2389662 to 9fb34e9 Compare May 24, 2025 22:14
@vercel vercel bot temporarily deployed to Preview – entropy-explorer May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – api-reference May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-debugger May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – component-library May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – staking May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – insights May 24, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – staking May 26, 2025 09:35 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub May 26, 2025 09:35 Inactive
@vercel vercel bot temporarily deployed to Preview – api-reference May 26, 2025 09:35 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-debugger May 26, 2025 09:35 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals May 26, 2025 09:35 Inactive
@vercel vercel bot temporarily deployed to Preview – component-library May 26, 2025 09:35 Inactive
@vercel vercel bot temporarily deployed to Preview – insights May 26, 2025 09:36 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer May 26, 2025 09:36 Inactive
@ali-bahjati ali-bahjati merged commit d88ab77 into main Jun 5, 2025
11 of 12 checks passed
@ali-bahjati ali-bahjati deleted the pusher/better-feed-removal-handling branch June 5, 2025 09:43
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