Skip to content

Conversation

@cctdaniel
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Oct 17, 2024

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

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 5:55am
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 5:55am
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 5:55am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 5:55am


// Process PriceUpdate events
let mut stream = sub.into_stream();
while let Some(log) = stream.next().await {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably have a reconnect on the error and a liveness check in case the streams gets stuck without producing new data.


// Subscribe to PriceUpdate events
let filter = PriceUpdate::filter().address(config.contract_address);
let sub = provider.subscribe_logs(&filter).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it only fetch new events? How do you plan to deal with events that were missed while the service was not running? I was thinking that maybe we should query old events (up to a certain age) and try to process them as well.


#[derive(Debug, Serialize)]
pub struct PriceUpdateResults {
pub results: HashMap<String, PriceUpdateResult>,
Copy link
Contributor

Choose a reason for hiding this comment

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

"Result" name can be misleading in Rust context. I'd prefer something like PriceFeedValue or PriceFeedInfo.

@cctdaniel cctdaniel closed this Nov 28, 2024
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