2

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 ?

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.