parent
70c2c8ec4b
commit
d9c85d8f9d
|
@ -39,6 +39,7 @@ import {
|
|||
buildEncodedVaaCreateInstruction,
|
||||
buildWriteEncodedVaaWithSplitInstructions,
|
||||
getGuardianSetIndex,
|
||||
overrideGuardianSet,
|
||||
trimSignatures,
|
||||
} from "./vaa";
|
||||
import {
|
||||
|
@ -446,6 +447,7 @@ export class PythSolanaReceiver {
|
|||
encodedVaaAddress: PublicKey;
|
||||
closeInstructions: InstructionWithEphemeralSigners[];
|
||||
}> {
|
||||
vaa = overrideGuardianSet(vaa); // Short term fix Wormhole officially server guardian set 4 vaas
|
||||
const postInstructions: InstructionWithEphemeralSigners[] = [];
|
||||
const closeInstructions: InstructionWithEphemeralSigners[] = [];
|
||||
const encodedVaaKeypair = new Keypair();
|
||||
|
|
|
@ -13,7 +13,7 @@ export const POST_UPDATE_COMPUTE_BUDGET = 35000;
|
|||
/**
|
||||
* A hard-coded budget for the compute units required for the `updatePriceFeed` instruction in the Pyth Push Oracle program.
|
||||
*/
|
||||
export const UPDATE_PRICE_FEED_COMPUTE_BUDGET = 190000;
|
||||
export const UPDATE_PRICE_FEED_COMPUTE_BUDGET = 55000;
|
||||
/**
|
||||
* A hard-coded budget for the compute units required for the `initEncodedVaa` instruction in the Wormhole program.
|
||||
*/
|
||||
|
|
|
@ -52,6 +52,18 @@ export function trimSignatures(
|
|||
return trimmedVaa;
|
||||
}
|
||||
|
||||
export const PREVIOUS_GUARDIAN_SET_INDEX = 4;
|
||||
export const CURRENT_GUARDIAN_SET_INDEX = 4;
|
||||
export function overrideGuardianSet(vaa: Buffer): Buffer {
|
||||
let guardianSetIndex = getGuardianSetIndex(vaa);
|
||||
|
||||
if (guardianSetIndex <= 3) {
|
||||
vaa.writeUint32BE(CURRENT_GUARDIAN_SET_INDEX, 1);
|
||||
}
|
||||
|
||||
return vaa;
|
||||
}
|
||||
|
||||
/**
|
||||
* The start of the VAA bytes in an encoded VAA account. Before this offset, the account contains a header.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue