Gas Schedule
Overview
Section titled “Overview”Ashen gas is denominated in abstract cycles and charged by the VM during execution. The canonical schedule lives in the repo at:
docs/gas-schedules/gas-v1.json(machine-readable)docs/gas-schedules/gas-v1.md(human-readable)
This page summarizes the rules and how to read the schedule.
Conventions
Section titled “Conventions”- For any
per_32bcomponent, computewords32 = ceil(bytes / 32)and chargewords32 * per_32b. - For
per_32b_input/per_32b_output, apply the rule to input/output sizes independently. - Syscalls (including precompiles) always charge a dispatch base plus a syscall-specific cost.
High-Level Structure
Section titled “High-Level Structure”The schedule is grouped into three tables:
- Opcode costs: base cost for ALU, shifts, branches, mul/div.
- Memory/page costs: warm/cold load/store costs, page penalties, and the predecode byte charge.
- Syscalls/precompiles: storage, calls, hashing, signature verification, and chain context queries.
Highlights
Section titled “Highlights”Storage
Section titled “Storage”- Cold storage reads are more expensive than warm reads.
- Writes are charged on written value size.
- Range scans charge on query bytes and returned data bytes.
callandstatic_callcharge on calldata + return bytes.createcharges on code bytes.
Precompiles
Section titled “Precompiles”- Hashing:
keccak256,sha2_256,blake3 - Signature verification:
verify_sig - VRF verification:
verify_vrf_ed25519
Context
Section titled “Context”Low-cost syscalls for balance and block metadata:
gas_limit, balance_of, self_balance, block_hash, block_header.
Worked Example
Section titled “Worked Example”Storage write of 100 bytes:
words32 = ceil(100 / 32) = 4storage_write = dispatch_base (30) + base (400) + 4 * per_32b (8)- Total =
30 + 400 + 32 = 462
Full Schedule
Section titled “Full Schedule”Refer to docs/gas-schedules/gas-v1.md for the complete table and
docs/gas-schedules/gas-v1.json for the canonical machine-readable source.