Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

ArbOS State Machine

ArbOS is the operating system layer that runs on top of the EVM. It manages L1/L2 pricing, retryable tickets, cross-chain messaging, and protocol-level state - all stored in the state trie under a dedicated system address.

State Layout

All ArbOS state lives at ARBOS_STATE_ADDRESS (0xa4b05...), organized into subspaces:

SubspaceIDPurpose
L2 Pricing0Base fee, gas backlog, per-block gas limit
L1 Pricing1L1 data costs, batch poster rewards, equilibration
Retryables2Retryable ticket storage and timeout queue
Address Table3Calldata compression address lookup table
Send Merkle5L2-to-L1 message accumulator
Blockhashes6L1 block number and hash cache
Programs8Stylus program metadata and parameters

Each subspace uses a key derivation scheme: hash(parent_key || offset[0..31]) || offset[31], which produces unique non-colliding storage slots.

Versioning

ArbOS evolves through version upgrades stored in the block header's mix_hash field. Each version maps to an EVM spec:

ArbOS VersionEVM SpecKey Features
v11ShanghaiPUSH0 opcode
v20CancunTransient storage, blob base fee
v30CancunStylus WASM support
v40PraguePrague EVM rules
v50PragueDia upgrade
v60PragueMulti-gas constraints, transaction filtering

The mix_hash header field encodes three values:

  • Bytes 0-7: send_count (cumulative L2-to-L1 messages)
  • Bytes 8-15: l1_block_number (L1 block at time of production)
  • Bytes 16-23: arbos_format_version

Gas Pricing

Arbitrum uses a two-layer gas model: L1 data posting costs and L2 execution costs.

L1 Pricing

L1 costs cover data availability - the cost of posting transaction data to Ethereum L1.

  • Transaction calldata is measured using Brotli compression to approximate actual batch size
  • Units are priced at l1_price_per_unit (wei per compressed byte)
  • An equilibration algorithm adjusts the L1 price to balance collected fees against actual batch posting costs
  • Poster fees are deducted from the transaction's gas budget before EVM execution

L2 Pricing

L2 costs cover computation on the Arbitrum chain.

  • Base fee uses an exponential backlog model: fees increase when demand exceeds the per-block gas limit
  • The exponential function uses a degree-4 Horner's method polynomial approximation
  • Three pricing models exist across versions:
    • Legacy (pre-v50): Simple gas accounting
    • SingleGas (v50): Unified gas constraint
    • MultiGas (v60): Eight resource dimensions tracked independently

Fee Distribution

After each transaction, collected fees are split:

RecipientSharePurpose
Network fee accountConfigurableProtocol revenue
Infrastructure fee accountConfigurableInfrastructure costs
Poster (coinbase)L1 data costReimburses L1 posting

Block Processing

Each block follows this sequence:

  1. StartBlock internal transaction - updates L1 pricing, reaps expired retryable tickets, caches L1 block hashes, computes per-block gas limit
  2. Batch posting report (if present) - records L1 batch costs for the pricing model
  3. User transactions - each goes through start_tx (gas charging, poster fee) → EVM execution → end_tx (fee distribution, refunds)
  4. Header derivation - mix_hash, extra_data (send root), and gas fields are computed from final state

Custom EVM Behavior

ArbReth modifies several EVM opcodes from their standard Ethereum behavior:

OpcodeStandardArbitrum
NUMBERL2 block numberL1 block number
BLOCKHASHL2 block hashesL1 block hashes (from cache)
BLOBBASEFEEBlob base feeAlways reverts (no blobs on L2)
PREVRANDAOBeacon randomnessConstant 0x...0001
COINBASEBlock proposerL1 batch poster address
DIFFICULTYMining difficultyConstant 1