Skip to content

Conversation

@tompntn
Copy link
Contributor

@tompntn tompntn commented Jan 24, 2022

This PR changes the semantics of the update_price pythd JRPC call. Previously, updates were immediately sent to Solana (or pyth_tx) using a new transaction for each update. Instead, we buffer all received updates inside pythd, and send all buffered updates in bulk whenever a new slot is available. This uses less transactions at a cost of slightly increased latency.

I have tried to follow existing code styles and conventions as much as possible.

A follow-up PR will modify the on-chain program, adding a batch update endpoint which will only fail the transaction if all the individual price updates in that batch fail. This will ensure publishing failures on one product won't block updates for unaffected products.

Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. My C++ is terrible though, so would be good to let david look as well.

Main question is what's our testing strategy?

@pyth-network pyth-network deleted a comment from jhunsaker Jan 31, 2022
@tompntn tompntn force-pushed the batching branch 4 times, most recently from dec0217 to 1a5f77e Compare January 31, 2022 23:01
@tompntn tompntn marked this pull request as ready for review February 1, 2022 09:30
jayantk
jayantk previously approved these changes Feb 1, 2022
Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

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

LGTM!

Reisen
Reisen previously approved these changes Feb 2, 2022
@tompntn tompntn merged commit 8be5247 into pyth-network:main Feb 4, 2022
@tompntn tompntn deleted the batching branch February 4, 2022 13:06
guibescos pushed a commit that referenced this pull request Aug 2, 2022
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.

4 participants