1

I am using the ComputeBudgetProgram.setComputeUnitLimit & ComputeBudgetProgram.setComputeUnitPrice instructions to reduce the CU budget for a small transfer transaction and increase the PriorityFee.

I presume I need to request enough of a budget for the two ComputeBudgetProgram instructions themselves. How many CUs are consumed for each?

1 Answer 1

4

Edit: 150 CUs are consumed by the ComputeBudget program, per https://github.com/solana-labs/solana/blob/a36e1b211d144f3cf0f2a6f68da7600b49454c1a/runtime/src/block_cost_limits.rs#L45

It will also fail on duplicates to avoid someone spamming with transactions that only use the ComputeBudget program.

You can see the reference code: https://github.com/solana-labs/solana/blob/ca115594ff61086d67b4fec8977f5762e526a457/program-runtime/src/compute_budget.rs#L151-L242

1

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.