Skip to content

Gas & limits ​

Two separate meters apply to a contract call:

  • Fuel inside the VM — every WASM instruction and host function burns fuel; the call has a budget.
  • Gas at the transaction level — what the sender pays, in uNRO. See Gas & fees.

After the call, the fuel burned becomes gas units: ceil(fuel / NEUROCHAIN_FUEL_PER_GAS_UNIT), at least 1, with the rate defaulting to 20 000 fuel per gas unit. The 50 units prepaid for a contract call (GAS_CONTRACT_CALL) are then refunded or topped up to match.

Limits ​

ConstantValueWhat happens at the limit
MAX_CONTRACT_GAS1 000 000 fuel per top-level callOut of fuel → the call traps, everything rolls back, fee and nonce are consumed
MAX_BYTECODE_SIZE512 KiBDeploy refused
MAX_CALL_DEPTH8 nested call_contractcall_contract returns -1
MAX_STATE_GROWTH_BYTES_PER_TX64 KiB of new storage per callset_storage writes nothing
allocate single request1 MiBRequest is clamped

Fuel prices of host functions ​

Host functionFuelConstant
get_storage800 + 5 × value lengthFUEL_STORAGE_READ_BASE, FUEL_STORAGE_READ_PER_BYTE
set_storage5 000 + 50 × (key + value length)FUEL_STORAGE_WRITE_BASE, FUEL_STORAGE_WRITE_PER_BYTE

Other host functions and plain WASM instructions are metered by the interpreter's default fuel costs. Planned AI host functions will each get a named fuel price.

These are protocol constants; contracts and clients should not depend on their exact values staying the same.