You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Post a price update using a VAA and a MerklePriceUpdate.
109
114
/// This function allows you to post a price update in a single transaction.
110
-
/// Compared to post_update, it is less secure since you won't be able to verify all guardian signatures if you use this function because of transaction size limitations.
111
-
/// Typically, you can fit 5 guardian signatures in a transaction that uses this.
115
+
/// Compared to `post_update`, it only checks whatever signatures are present in the provided VAA and doesn't fail if the number of signatures is lower than the Wormhole quorum of two thirds of the guardians.
116
+
/// The number of signatures that were in the VAA is stored in the `VerificationLevel` of the `PriceUpdateV1` account.
117
+
///
118
+
/// We recommend using `post_update_atomic` with 5 signatures. This is close to the maximum signatures you can verify in one transaction without exceeding the transaction size limit.
119
+
///
120
+
/// # Warning
121
+
///
122
+
/// Using partially verified price updates is dangerous, as it lowers the threshold of guardians that need to collude to produce a malicious price update.
112
123
pubfnpost_update_atomic(
113
124
ctx:Context<PostUpdateAtomic>,
114
125
params:PostUpdateAtomicParams,
@@ -195,7 +206,7 @@ pub mod pyth_solana_receiver {
let encoded_vaa = VaaAccount::load(&ctx.accounts.encoded_vaa)?;
209
+
let encoded_vaa = VaaAccount::load(&ctx.accounts.encoded_vaa)?;// IMPORTANT: This line checks that the encoded_vaa has ProcessingStatus::Verified. This check is critical otherwise the program could be tricked into accepting unverified VAAs.
199
210
let treasury:&AccountInfo<'_> = &ctx.accounts.treasury;
200
211
let price_update_account:&mutAccount<'_,PriceUpdateV1> =
/// The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.
277
287
/// Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized
0 commit comments