-
Notifications
You must be signed in to change notification settings - Fork 308
feat(solana-receiver-cli): Add post-twap-update cmd to CLI, update TWAP data model & validations
#2180
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
feat(solana-receiver-cli): Add post-twap-update cmd to CLI, update TWAP data model & validations
#2180
Conversation
…, added post twap subcommand to CLI
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
post-twap-update cmd to CLI, update TWAP data model & validationspost-twap-update cmd to CLI, update TWAP data model & validations
ali-behjati
left a comment
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 like the refactors. I left some comments which are mostly questions for me to understand your change before approving.
target_chains/solana/pyth_solana_receiver_sdk/src/price_update.rs
Outdated
Show resolved
Hide resolved
ali-behjati
left a comment
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.
Nice!
Purpose
This PR makes changes to the Solana receiver contract, the receiver SDK, and the receiver CLI.
Add
post-twap-updatecommand to the CLI. This is useful for users to test the update procedure, and to see an example of how to verify start & end data from Hermes via Wormhole and post it to the receiver contract.pyth-solana-receiver-cli --wormhole <WORMHOLE> post-twap-update --start-payload <START_PAYLOAD> --end-payload <END_PAYLOAD>Add extra validations to
calculate_twapas brought up in earlier code review.feed_idandexponentUpdate
TwapUpdatedata model to remove theverification_level&posted_slotfields.verification_levelfield is unnecessary because we don't support an "atomic" version of this instruction. It's required to verify VAAs before usingpost_twap_updateand the instruction will error if unverified VAAs are used. Therefore all TwapUpdates produced by the program can be assumed to be fully verified.posted_slotnot very useful since it's primarily used by price pushers to measure recency, which doesn't apply to our use case, unless we want to support some kind of scheduled/constantly pushed TWAP updates.Testing
Updated unit tests for
solana_receiver_sdk. The CLI doesn't have a test suite.