Currently mainet
have a computation limit of 1.2m compute units limit, while devnet
has 200k compute units limit.
Is there a way to increase the computation limit in devnet
?
Compute budget for a single transaction can be changed by adding an instruction call to the Compute Budget Program. By default the compute budget is set the product of 200k compute units * number of instructions.
Note: To change the compute budget for a transaction, you must make the one of the first three instructions of the transaction the instruction that sets the budget.
import {
ComputeBudgetProgram,
} from "@solana/web3.js";
const additionalComputeBudgetInstruction = ComputeBudgetProgram.requestUnits({
units: 400000, // max of 1.4m
additionalFee: 0,
});
Complete guide in the cookbook