Skip to content

Revision — Gas, Fees & EIP-1559

The EVM part gave the shared world computer a promise — no program runs forever — and named the leash gas. The consensus part decided whose block wins each slot but left the harder half open: what goes in that block, and what it costs to put it there. This part filled the hole. It turned the one-word promise into an actual number, in ether, that lands on a real transaction.

The whole part rests on one clean split, stated on the overview page and never re-merged: metering is a fact about a computation (how much of the block’s bounded budget it consumes, counted in gas), and pricing is a fact about a market (what one unit of that budget costs right now, in ether per gas). Metering is physics; pricing is economics. Almost every fee question dissolves the moment you know which of the two you are looking at. This recap walks the spine — gas unit, gas accounting, the old auction, EIP-1559, the base-fee controller, blockspace economics — and ties each back to that split and to the book’s throughline.

The first move was to make gas measure burden, not size. A transaction is not billed by the byte; it is billed by what it makes every node on Earth do. The gas-as-a-metering-unit page anchored this on the book’s companion EVM, ethmini, where every opcode carries a fixed cost and the ordering tells the whole story:

Op gas what it burdens the network with
─────────────────────────────────────────────────────────
ADD / SUB 3 a few CPU cycles, nothing persists
MUL 5 a little more CPU
SLOAD 100 read a slot every full node already holds
SSTORE 200 GROW state every full node keeps FOREVER

Arithmetic is cheap, reading state is dear, and writing state — growing the set of bytes every archival node must store for the life of the chain — is dearest of all. The exact numbers in ethmini are simplified, but the shape of the incentive matches real Ethereum, where a plain ETH transfer meters at a fixed 21,000 gas and an SSTORE into a fresh slot costs thousands. That shape is the metering job doing exactly what it exists to do: charge in proportion to the lasting cost an operation imposes on strangers who will re-run and re-store it.

Two properties make gas trustworthy. First, the schedule is identical on every node — it has to be, because the EVM is deterministic, and if two nodes disagreed on what an op costs they would disagree on gas_used, on whether a transaction ran dry, and therefore on the resulting state. Second, gas is charged before the op runs, so the meter can never go negative and no computation can sneak past its budget. And bounding a single transaction is not enough: every block also carries a block gas limit (around 30 million gas on mainnet as of 2024), so no single block can demand unbounded work to verify. That per-block cap is the scarcity every later page prices.

Gas accounting: limit, used, and the fee formula

Section titled “Gas accounting: limit, used, and the fee formula”

Metering a transaction produces three numbers, untangled on the gas-limit-gas-used-and-the-fee-formula page:

  • gas_limit — the maximum you authorize the transaction to burn. You set it in advance, before anyone knows exactly how far execution will go.
  • gas_used — the gas actually consumed, known only after the EVM runs. For a transfer it is a flat 21,000; for a contract call it depends on which branches ran.
  • price per gas — the pricing half, in ether per gas, which the rest of the part is about.

The cost is the product of the metering half and the pricing half:

cost (in ether) = gas_used × price_per_gas

The subtle, load-bearing rule is what happens when a transaction asks for more than its gas_limit allows. It does not pause and beg for more. It runs out of gas, reverts every state change it made, and is still charged for the gas it burned up to that point. In ethmini you can see the revert as a structural fact: the interpreter mutates a clone of storage and only hands the new state back on a clean halt, so an out-of-gas run leaves the original untouched — yet the gas is gone. That asymmetry — state reverts, payment does not — is deliberate. It means the attacker who submits deliberately failing work still pays for the CPU they wasted on every node, which is precisely what stops “cheap failure” from becoming a denial-of-service vector.

From blind auctions to a protocol-set price

Section titled “From blind auctions to a protocol-set price”

With metering settled, the part turned to pricing, and told the story in the order it actually happened.

Before August 2021, the first-price-auctions-before-1559 page explained, pricing was a raw first-price auction. Each transaction named a single gasPrice; the proposer greedily packed the highest bidders until the block filled; and you paid exactly what you bid. The pain was structural, not incidental. A first-price sealed-bid auction has no truthful strategy — the right bid depends on guessing what everyone else will bid — so users overpaid to be safe, underpaid and got stuck for hours, and every wallet reinvented the same fragile guessing game. Blurring metering and pricing into one number the user had to divine produced the worst experience of the whole part.

EIP-1559, live since the August 2021 London upgrade and detailed on the eip-1559-base-fee-and-priority-fee page, replaced the guess with a computation. It split the price into two parts:

effective_price = base_fee + priority_fee (tip)
│ │
│ └── paid to the validator, incentive to include you
└── set BY THE PROTOCOL, not bid; and BURNED, paid to no one

The base fee is no longer a bid — it is a number the protocol itself computes from how full recent blocks were, so the whole network reads the same fair market price off-chain before submitting anything. Crucially, the base fee is burned: it is destroyed, paid to no validator. That removes the incentive for a proposer to stuff a block with their own fake high-fee transactions to inflate their take, and it keeps the base fee an honest congestion signal rather than proposer revenue. The priority fee, or tip, is the only part the user still chooses, and it is small — just enough to make including your transaction worth the validator’s marginal effort. A user now sets a maxFeePerGas ceiling and a maxPriorityFeePerGas tip, pays base_fee + tip up to that ceiling, and is refunded the difference. The blind guess is gone.

The base fee is not conjured from nowhere; it is steered by a feedback controller, the subject of the block-elasticity-and-the-base-fee-controller page. EIP-1559 made blocks elastic: instead of one hard limit, a block has a target (half the maximum) and a hard cap at twice the target. The target is the setpoint; the cap absorbs bursts.

After each block, the protocol nudges the next base fee based on how full the block was relative to target, by at most 12.5% per block:

block was ... → next base fee
────────────────────────────────────────────
exactly at target → unchanged
above target (busy) → raised, up to +12.5%
below target (quiet) → lowered, up to −12.5%
completely full → raised the full +12.5%
completely empty → lowered the full −12.5%

This is a proportional controller with a bounded step, and its behaviour is exactly what a controller should give you. Sustained demand above target drives the base fee up geometrically — persistently full blocks roughly double the fee about every 5–6 blocks (a minute or so at 12-second slots) — until enough price-sensitive users drop out and blocks settle back toward half-full. Sustained calm drives it back down at the same bounded rate. The bounded step is the key design choice: the base fee cannot spike ten-fold between two blocks, so it is predictable. You can look at the current base fee, know it can move at most 12.5% before the next block confirms, and estimate with confidence — the thing the first-price auction could never offer. The controller does not eliminate high fees under real demand; it makes them smooth and forecastable instead of a blind gamble.

The final content page, fee-estimation-and-blockspace-economics, zoomed out from the mechanism to the market it implements. Blockspace is a genuinely scarce, rivalrous commodity: the block gas limit is fixed, everyone’s transaction competes for the same slots, and one included transaction crowds out another. The fee is what rations it, and that fee does several jobs at once:

  • It is a spam filter. Because failing still costs gas, flooding the network with junk is expensive in proportion to the work it forces on every node. Price is the DoS defence — the same defence the EVM part first reached for when it introduced gas.
  • It is a rationing rule. When demand exceeds the target, the base-fee controller raises the price until demand fits. High fees are not a bug; they are the market clearing under scarcity, and the smoothness of EIP-1559 is what makes the rationing bearable.
  • The burn shares cost across all holders. The burned base fee leaves circulation entirely. It is not paid to any one party; by reducing supply it distributes the cost of congestion — very roughly — across everyone who holds ether, rather than handing it all to whoever happened to propose the block.

And the part’s blunt closing lesson: “cheap” is never free — the bill is always paid somewhere. Low fees on a base layer, pushed too far, get paid in one of three currencies. In hardware, if the block gas limit is raised so high that only well-resourced machines can keep up. In centralization, if verifying the chain becomes so costly that ordinary people stop running nodes and must trust a handful who can. Or on an L2, where cheapness is real but achieved by executing off the base layer and posting compressed proofs or data back down — moving the cost, not deleting it. Every proposal to make Ethereum “cheaper” is really a proposal about which of these three accounts to charge, and an architect’s job is to name the account.

Step back and the part is one idea worked out in six moves: pricing metered blockspace is how untrusting strangers keep a shared world computer both cheap to check and hard to flood. Metering is the child of determinism — every node runs the same gas schedule, so every node agrees on gas_used to the unit, for the same reason the EVM must be deterministic at all. Pricing is the child of scarcity — a block holds only so much gas, consensus lets exactly one proposer fill it, so blockspace is rivalrous and needs a market. EIP-1559 is what a good market looks like when you refuse to blur those two jobs: a protocol-computed, burned base fee that reads congestion honestly, a small tip the user still chooses, and a bounded controller that keeps the whole thing predictable.

That is the book’s throughline made literal. Untrusting strangers agree on the state of the shared machine because every one of them can re-run it and re-check the gas — cheap to verify. They keep it running, and keep the flood out, by making everyone pay in proportion to the lasting burden they impose — costly to abuse. The gas meter and the fee market are the two halves of that single sentence. Every part after this one — scaling, data availability, the L2s that inherit exactly the “move the cost, don’t delete it” logic above — is a variation on how to keep both halves true as the world computer grows.