-
Notifications
You must be signed in to change notification settings - Fork 192
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
[solana push oracle] Idempotent updates #1452
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
None, | ||
) | ||
.await | ||
.unwrap(); |
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.
note that the account state is checked to be feed_1_recent directly below this already. I changed the update message ^ to feed_1_old to validate that the on-chain state is unchanged.
|
||
require!( | ||
price_feed_account.price_message.feed_id == feed_id, | ||
PushOracleError::PriceFeedMessageMismatch |
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.
Seems inefficient to deserialize PriceUpdateV2
... though I agree it feels better to have this check here
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 me check how many CUs we spend doing this
Let's merge since the logic is good and we'll think later about the CU optimizations if needed |
If someone tries to update a feed with a stale price, ignore the update instead of throwing an error.