-
Notifications
You must be signed in to change notification settings - Fork 212
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
PriceUpdateV2 LEN #1871
Comments
Yes, same question, is it correct to launch on mainnet (or TestNet)? |
hey guys, thank you for the question @aditya520 @guibescos could you take a look please? |
I'm pretty confused about this. The size of the struct is 134, we even have a test to check this https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_sdk/src/price_update.rs#L238. The reason why AnchorDeserialize::try_from_slice(data) fails is because it expects the PriceUpdateV2 to start at the beginning of the bytes but instead there's the Anchor 8 bytes discriminator. |
Issue
Deserializing an
PriceUpdateV2
account info usingAnchorDeserialize::try_from_slice(data)
fails.Note: Using
PriceUpdateV2::try_deserialize(&mut data)
works.Cause
The
PriceUpdateV2
structure have a size of 136 bytes, whileLEN
is 134 and onchain accounts are 134 bytes.Onchain Account Example
https://explorer.solana.com/address/7UVimffxr9ow1uXYxsr4LHAcV58mLzhmwaeKvJ1pjLiE?cluster=devnet
PriceUpdateV2 struct in the code
The text was updated successfully, but these errors were encountered: