Here's a transaction that requests 1million compute units https://explorer.solana.com/tx/kmkRyvKjWtDuHMbPEGkouXe4Nm3ysdGgiGbr5bzsdnQrXfs7FqnpDWaRBf4KBU91hghPJjTC2Tyv5mcNeTV8nbb?cluster=devnet
Here's a transaction without requesting compute units https://explorer.solana.com/tx/4tbnLrFq7cgBRB3Yr2Jv5iNV2VXwN33NHR9y6G8VurbjnApw5oCdpYHkiJv1KWHFyHcvbbnYXQE2hgevVdAPJCHx?cluster=devnet
Transaction is a simple SOL transfer of 0.1 SOL
const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
units: 1_000_000,
});
// Define the amount to transfer
const transferAmount = 0.1; // 0.1 SOL
// Create a transfer instruction for transferring SOL from wallet_1 to wallet_2
const transferInstruction = SystemProgram.transfer({
fromPubkey: wallet_1.publicKey,
toPubkey: wallet_2.publicKey,
lamports: transferAmount * LAMPORTS_PER_SOL, // Convert transferAmount to lamports
});
// Add the transfer instruction to a new transaction
const transaction = new Transaction().add(
modifyComputeUnits,
transferInstruction
);
// Send the transaction to the network
const transactionSignature = await sendAndConfirmTransaction(
connection,
transaction,
[wallet_1] // signer
);
Transaction fee still seems to be 0.00005, but not sure if that's just because the requested compute units aren't being used.