Skip to content

Commit

Permalink
add compute budget for last redeem tx separately
Browse files Browse the repository at this point in the history
it depends on the first txs and simulation will fail otherwise
  • Loading branch information
kev1n-peters committed Mar 19, 2024
1 parent 371d77b commit 132f206
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sdk/src/contexts/solana/utils/computeBudget/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function determinePriorityFee(
): Promise<number> {
// https://twitter.com/0xMert_/status/1768669928825962706

let fee = 1; // Set fee to 100,000 microlamport by default
let fee = 1; // Set fee to 1 microlamport by default

try {
const recentFeesResponse = await connection.getRecentPrioritizationFees({
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/contexts/solana/utils/sendAndConfirmPostVaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ export async function postVaaWithRetry(
vaa,
commitment,
);
for (const unsignedTransaction of unsignedTransactions) {
await addComputeBudget(connection, unsignedTransaction, []);
}

const postVaaTransaction = unsignedTransactions.pop()!;

for (const unsignedTransaction of unsignedTransactions) {
await addComputeBudget(connection, unsignedTransaction);
}
const responses = await sendAndConfirmTransactionsWithRetry(
connection,
modifySignTransaction(signTransaction, ...signers),
Expand All @@ -55,6 +54,7 @@ export async function postVaaWithRetry(
maxRetries,
);
//While the signature_set is used to create the final instruction, it doesn't need to sign it.
await addComputeBudget(connection, postVaaTransaction);
responses.push(
...(await sendAndConfirmTransactionsWithRetry(
connection,
Expand Down
1 change: 0 additions & 1 deletion wormhole-connect/src/utils/wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export const postVaa = async (
pk.toString(),
Buffer.from(signedVAA),
MAX_VAA_UPLOAD_RETRIES_SOLANA,
undefined,
);
};

Expand Down

0 comments on commit 132f206

Please sign in to comment.