-
Notifications
You must be signed in to change notification settings - Fork 226
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
chore(price-puhser) Use Hermes Client #2312
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
This is a very good change. Thank you. Can you double check whether pusher keeps working or crashes upon network failures on Hermes? (look at my comment about it). A good way to test is to run it, turn off internet and wait a little while and turn it on again. A good behaviour is that it either crashes when you turn it off, or it doesn't crash but keeps working after you turn the internet on. anything else is a silent dead state.
// Better to filter out invalid price items before creating the pyth listener | ||
const { existingPriceItems, invalidPriceItems } = | ||
await filterInvalidPriceItems(hermesClient, priceItems); | ||
|
||
if (invalidPriceItems.length > 0) { | ||
logger.error( | ||
`Invalid price id submitted for: ${invalidPriceItems | ||
.map(({ alias }) => alias) | ||
.join(", ")}` | ||
); | ||
} | ||
|
||
const priceItems = priceConfigs.map(({ id, alias }) => ({ id, alias })); | ||
priceItems = existingPriceItems; |
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.
I recommend you to do it in the PythPriceListener to avoid replicating the logic on each network
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.
Either we filter pricefeeds at src/index.ts
or at every chain level since we pass price ids to both chain listener and price listener.
@@ -67,16 +67,6 @@ export const logLevel = { | |||
} as Options, | |||
}; | |||
|
|||
export const priceServiceConnectionLogLevel = { | |||
"price-service-connection-log-level": { |
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.
let's remove it from readme as well
eventSource.onerror = (error: Event) => { | ||
console.error("Error receiving updates from Hermes:", error); | ||
eventSource.close(); | ||
}; |
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.
i think here you should either crash the service, or try to reconnect. doing otherwise will result in one dead component while the rest are working.
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.
It's better it crashes when the connection goes down. Just tested it.
455bbf6
to
84793f1
Compare
No description provided.