Skip to main content

Module compute

Module compute 

Source
Expand description

Compute-budget introspection helpers.

These read sol_remaining_compute_units (SIMD-0049). That proposal is Withdrawn and its feature gate has never been activated on mainnet-beta, devnet, or testnet, so an on-chain program that references the syscall is rejected at deploy time. The module is compiled for on-chain targets only with the remaining-compute-units-syscall feature; host builds keep it so tests can exercise the guard logic.

Functionsยง

check_compute_units
Fail if fewer than minimum compute units remain.
remaining_compute_units
Read the current remaining compute units.
require_compute_units
Require at least minimum compute units and return the current balance.