Compute Budget
Solana compute unit (CU) costs for Rome EVM operations — atomic vs. iterative budgets and how to design CU-efficient Solidity contracts.
Every Solana transaction has a compute budget measured in Compute Units (CU). Understanding CU costs helps you design efficient Rome contracts.
Budget Overview
Atomic (VmAt)
~1,400,000 CU
Single Solana transaction
Iterative (VmIt)
Up to ~1,400,000 CU per leg; at most 160 iterations per session
Each leg is its own Solana transaction; adaptive opcodes/step — packed to each tx's CU budget
Each Solana transaction has a default budget of 200,000 CU, extendable to ~1.4M CU via compute budget instructions (added automatically by the Rome SDK).
Iterative execution is not unlimited. One session ends after 160 iterations, and the Rust Rome SDK's iterative composer plans at most 128 legs. A plan the wallet signs itself goes through rome_submitSignedV1Plan, which accepts at most 64 transactions per call. Most calls need far fewer. Legacy-track CPIs are refused inside an iterative session, so a call that makes them has to fit the atomic budget. See Relayed calls and long calls and Constraints.
CU Cost Estimates
EVM Operations
Transaction signature check (EVM-key lane)
~25,000 CU
The secp256k1_recover syscall, the same cost as the ecrecover precompile below
Simple transfer
~50,000-100,000 CU
Balance updates only
ERC-20 transfer
~100,000-150,000 CU
Includes SPL precompile call
Contract deployment (small)
~200,000-400,000 CU
Depends on bytecode size
Storage write (SSTORE)
~5,000-20,000 CU
Cold vs warm access
Precompile Operations
ecrecover
~25,700 CU
SHA-256
~257 CU per 32-byte word measured
Plus a small fixed cost. The program prices SHA-256, RIPEMD-160 and the identity precompile with one shared per-word figure of about 2,200 CU, sized to RIPEMD-160, the costliest of the three, so a SHA-256 call is charged more than it uses
BN254 ecAdd
Close to 0 CU
Cheaper than copying 32 bytes
BN254 ecMul
~4,200 CU
BN254 ecPairing
~22,000 CU plus ~12,800 CU per pair
A four-pair check is about 73,000 CU, well inside one atomic transaction
These figures come from the program's own calibration, which used compute units read back from a Solana node on a testnet deployment. They are not re-measured for this page; measure your own call with computeUnitsConsumed.
Optimization Techniques
1. Use Yul for Hot Paths
Solidity's optimizer produces reasonable code, but Yul (inline assembly) can reduce CU significantly for critical operations:
2. Cache PDA Derivations
PDA derivation via find_program_address is expensive. Store derived PDAs in contract storage rather than computing them on every call:
3. Hardcode Known Program IDs
Don't load program IDs from storage — use constants:
4. Minimize Account Count
Each account in a Solana transaction adds CU overhead. Reduce the number of accounts by:
Batching operations that share accounts
Using fewer intermediate accounts
Avoiding redundant ATA creation checks
5. Use Optimizer Settings
Build with npx hardhat compile --build-profile production.
Measuring CU Consumption
eth_estimateGas does not measure compute units, because one gas unit on Rome is one lamport of cost. It sizes your gas limit. Read compute from the Solana transaction behind an EVM hash: get its signatures with rome_solanaTxForEvmTx, fetch each with Solana's getTransaction and maxSupportedTransactionVersion: 1, and read computeUnitsConsumed, or open the call on the explorer. An iterative call has one transaction per leg. To size the gas limit before submitting:
Or via ethers.js:
What's Next
Constraints — full list of limits and boundaries
Last updated
Was this helpful?