What's a block, and how big can it get?

What’s a block, and how big can it get?

Worst-case block size after Glamsterdam, why it matters for FOCIL, and what to make from block sizes and gas.

All numbers here use Glamsterdam rules, with a 60M gas limit as the reference point.

TL;DR

  • Ethereum has two byte limits on blocks. EIP-7934 caps the RLP-encoded EL block at 8 MiB, and the CL caps every gossip message at 10 MiB. They measure different things, and gas pricing doesn’t keep blocks under either of them.
  • The biggest block I found under Glamsterdam pricing isn’t a calldata block. It’s zero-byte calldata plus thousands of skipped EIP-7702 authorizations, which comes out at about 2x what calldata alone gives. At a 60M gas limit that’s 1.8 MiB.
  • With Glamsterdam pricing, the 8 MiB limit on the EL can be hit at a 266M gas limit. With EIP-8131 (CFI’d for Hegota), the 10 MiB limit on the CL breaks first, at 339M, while the EL block is still well under 8 MiB.
  • FOCIL needs “fits into the block” checks that only hold if the size limits never bind. The fix is to price every payload byte in gas, cap the max allowed gas limit at what the network can handle, and derive the CL size bound from the gas limit.

Two limits, two measures

When we talk about block sizes, there are two things that are easily confused:

The EL block is rlp(block): header, transactions, ommers and withdrawals. EIP-7934 checks it against 8 MiB. The block access list (BAL) is not part of it - the header only holds its hash. Same for execution requests, where the header only holds requests_hash.

The CL envelope is the SSZ-encoded SignedExecutionPayloadEnvelope. Since Gloas the execution payload travels in its own message, and the 10 MiB gossip cap is the only size limit on it. It carries the transactions and withdrawals, plus the BAL and the execution requests.

So, roughly, envelope ≈ EL block + BAL + requests. A check on the EL block alone can’t see the last two.

Item Counts against
Transactions (calldata, access lists, authorizations, blob hashes, envelope fields and signature) EL/CL
Withdrawals EL/CL
Header fields that are also in the payload (roots, bloom, gas fields, timestamp, extra data, …) EL/CL
parent_beacon_block_root EL/CL
Header-only fields (ommers_hash, difficulty, nonce, transactions_root, withdrawals_root, requests_hash, block_access_list_hash) EL
Ommers list (empty) EL
Block access list CL
Deposit requests (EIP-6110) CL
Withdrawal and consolidation requests (EIP-7002, EIP-7251) CL
Builder deposit and exit requests (EIP-8282) CL
block_hash, builder_index, beacon_block_root CL
BLS signature CL
SSZ offsets (4 B per transaction, plus a few for variable fields) CL

Blobs, receipts and logs count against neither. That’s why a deposit’s 576-byte log is free in both measures, while its 192-byte request lands in the CL limit.

The floor leaves free room

Since EIP-7623 a transaction pays

gas_used = max(intrinsic + execution, floor)

and since EIP-7976 the floor is 64 gas per calldata byte, zero or non-zero.

The important part is that this is a max, not a sum. Once a transaction is floor-bound, extra execution costs nothing, as long as intrinsic plus execution gas stays below the floor. If that execution also creates bytes, those bytes come on top of the calldata.

How much free room you get depends on the byte:

  • A zero byte costs 64 gas at the floor but only 4 intrinsic. That leaves 60 gas of free execution per byte.
  • A non-zero byte costs 16 intrinsic, which leaves 48.

Both size limits count uncompressed bytes, so zero bytes are the attacker’s best choice. Non-zero bytes only matter for compressed size (e.g. DoS attacks), where zeros compress away.

What the free room buys

The next question is what to spend that free gas on. You want whatever gives the most bytes per unit of execution gas without paying anything at the floor.

Data
Byte source Bytes Gas cost Bytes per 1k gas Lands in
Skipped 7702 authorization, max size 133 7,816 17.0 EL block
Cold SLOAD, 32-byte key 33 2,105 15.7 BAL
Cold account touch (BALANCE) 27 3,005 9.0 BAL
Deposit request via a relay contract 192 ~26,000 7.4 requests

Skipped authorizations give the most bytes per gas. An authorization with the wrong chain ID is skipped before ecrecover runs, but the transaction stays valid. The skipped authorization only pays the intrinsic EXECUTION_PER_AUTH_BASE_COST of 7,816 gas (EIP-2780).

EIP-7702 only bounds each field by its integer width, so a tuple can be the full 133 bytes: a 33-byte chain ID, 9-byte nonce, 2-byte y-parity, 33-byte r and s, plus the address and list header. In Glamsterdam none of that is part of the floor.

The largest (uncompressed) blocks I found

Zero-filled calldata plus skipped authorizations

This is the biggest EL block I found. Each transaction looks like this:

  • type 4 (set-code), sent to the sender itself, so the base cost is 12,000
  • data = 234,031 zero bytes
  • 1,796 authorizations, each with chain_id = 2^256 - 1, address = 0xff..ff, nonce = 2^64 - 2, y_parity = 255, r = s = 2^256 - 1
  • gas limit 14,989,984, so four of them fill a 60M block

The floor is 12,000 + 64 * 234,031 = 14,989,984. The intrinsic cost is 12,000 + 4 * 234,031 + 7,816 * 1,796 = 14,985,660, just below the floor. The transaction pays the floor, and the authorizations ride along for free. Each transaction is about 473 KB.

I built this block with the Amsterdam execution spec. It’s valid, uses 59.96M gas, and comes out at 1,892,706 bytes (1.805 MiB).

For compressed size, the zero-filled calldata above would mostly compress away. Swap it for non-zero calldata (48 gas of free room per byte instead of 60) and use random r, s and chain IDs, and nothing compresses anymore. That version gets to about 1.62 MiB at 60M, against about 1.55 MiB for the SLOAD construction in EIP-8279.

Zero-filled calldata plus cold SLOADs

This is the known BAL bypass, using zero bytes. The transaction sends zero-bytes calldata to a contract that runs PUSH32 key, SLOAD, POP over distinct 32-byte keys, at 2,105 gas each. The keys look like 2^255 + i, so each one takes 33 bytes in the BAL.

Such a block is valid with 0.894 MiB of EL block plus the BAL on top. With the free room fully used it reaches about 1.73 MiB of envelope. Only the 0.894 MiB of calldata counts toward EIP-7934, though, because the BAL isn’t in the block.

How each EIP moves the worst case

Until a size limit binds, everything scales roughly linearly with the gas limit G. Each worst case is “bytes per gas * G”, and each threshold is “limit / bytes per gas”. Per-transaction base costs are tiny next to this (a few 12,000-gas bases per block), so I leave them out here.

Data (bytes at a 60M gas limit)
Pricing Calldata Auths / access lists BAL Total
Glamsterdam 937,500 956,802 39,216 1.84 MiB
+ EIP-8131 937,500 0 920,745 1.77 MiB
+ EIP-8131 + 8279 351,499 314,410 408,306 1.02 MiB

Glamsterdam: the EL block hits 8 MiB at 266M

Calldata uses up the floor at 64 gas per byte, so you get G / 64 calldata bytes. On the intrinsic side those bytes only use 4 gas each, so 60/64 of G is left for authorizations:

calldata  = G / 64
auths     = (60/64 · G) / 7,816
total     = G/64 · (1 + 60 · 133 / 7,816) = 2.021 · G/64 ≈ 0.0316 · G

Solving 0.0316 · G = 8 MiB gives G ≈ 266M. At that point the block holds 4,156,250 calldata bytes plus 31,906 authorizations (4,243,498 bytes), or 8.01 MiB.

The envelope can get bigger still, because a block effectively has three budgets of G that can all be used at once. Every transaction pays max(execution, floor), which gives a floor budget and an execution budget, and EIP-8037 adds a separate state-gas budget. Here’s how the worst envelope spends them at G = 330M:

  • Floor: 5.16M zero-filled calldata bytes, which go into the EL block.
  • Execution: the calldata’s intrinsic cost uses 20.6M. Skipped authorizations take the next 190M and add 3.23 MB to the EL block, stopping once it reaches 8 MiB. The remaining 119M goes to cold SLOADs, which add 1.87 MB to the BAL, where EIP-7934 doesn’t look.
  • State: separate creation transactions deploy about 216 KB of zero-filled code, at 1,530 state gas per byte and at most 64 KiB per contract. That code lands in the BAL too.

That’s 8 MiB of EL block plus about 2.1 MB of BAL, so the envelope hits 10 MiB at about 330M while the EL block is still valid.

+ EIP-8131: the order flips

EIP-8131 charges every content byte at the floor, including authorizations (133 * 64 gas each). Authorizations now compete with calldata for the same floor budget, so that trick is gone.

What’s left in the EL block is RLP framing. An access-list address carries 20 content bytes but encodes to 23. Mixed with calldata that gives 1.044 · G/64, so the EL block hits 8 MiB at about 514M.

But 8131 doesn’t touch the BAL, so the SLOAD trick still works on the envelope:

total ≈ G/64 + 33 · (60/64 · G) / 2,105 + G/1,530 ≈ 0.0310 · G

That’s 10 MiB at about 339M. With 8131 alone, the CL limit breaks long before the EL limit. A block that passes EIP-7934 comfortably can still be too big to gossip, and nothing on the EL side notices.

+ EIP-8279: runtime data

EIP-8279 meters the bytes execution creates at 64 gas each against the floor, so SLOADs stop being free. I assume it also meters deposit requests, as proposed in this PR. Deposits have no count limit anywhere, so without that they’d be the next bypass: at about 26,000 gas per 192-byte request, they’d fill the free room and push the envelope to 1.44 · G/64.

With both covered, what’s left is RLP framing in the BAL. The worst pattern is the one EIP-8279 describes: BALANCE on access-list addresses, mixed with calldata. That gives 1.146 · G/64, or 1.02 MiB at 60M, which matches 8279’s own figure of about 1.01 MiB. The envelope then hits 10 MiB at about 585M, and the EL block still hits 8 MiB at 514M.

Where the limits break

Data
Pricing EL block reaches 8 MiB Envelope passes 10 MiB (EL block still valid) Worst envelope at 60M
Glamsterdam 266M 330M 1.84 MiB
+ EIP-8131 514M 339M 1.77 MiB
+ EIP-8131 + 8279 514M 585M 1.02 MiB

At a 60M gas limit none of this is reachable. Two things stand out:

  • Today, the EL limit breaks first.
  • With 8131 alone, the CL limit breaks first, by a wide margin. Shipping 8131 without 8279 makes the gap between the two limits worse.

Why this matters for FOCIL

FOCIL lets attesters reject a block that leaves out an inclusion-list transaction that could have been appended. “Could have been appended” is checked by gas, nonce and balance.

That breaks as soon as a byte limit can bind. A transaction may fit by gas, but appending it pushes the block over 8 MiB, so the block would be invalid. The builder can’t include it, yet attesters still expect it. Paweł brought this up on the FOCIL thread, and his execution-specs PR #4041 patches it by re-encoding the block with the transaction appended and checking its RLP size.

Measuring the size like this can’t fully solve it, for four reasons:

  • It only sees the EL block. Appending a transaction also adds BAL bytes, possibly deposit requests, and SSZ offsets to the envelope. The BAL part dominates: an IL transaction is at most 8 KiB, but with 16.7M gas (EIP-7825) of cold SLOADs it adds about 260 KB of BAL.
  • Checking the CL side would mean executing. FOCIL’s check is cheap on purpose: it never runs the transaction. BAL and request bytes only exist after execution, so a size check on the envelope would make every attester execute every IL transaction that was left out.
  • The envelope’s size isn’t the EL’s to compute. The EL doesn’t SSZ-encode. An exact check would also have to bake in the CL’s container layout, which the CL can change in its own forks.
  • It measures a block that wouldn’t exist. The check keeps the header unchanged, but appending a transaction raises gas_used, and its encoding can grow by a byte. Right at the limit, the check can say “fits” when the real block wouldn’t, and the builder loses the slot.

The check behind “could have been appended” has to give every attester the same answer, run without executing anything, and only say yes when the builder really can append the transaction. Gas meets all three, because T.gas is a static upper bound on what the transaction can use. Bytes can only meet them if size is bounded by gas too.

The fix: make size follow from gas

There’s a simpler way out: If every byte that ends up in the payload costs enough gas, the byte limits can never be what makes a block full. Then FOCIL only reasons about gas, builders only pack gas, and the CL can derive a tight size bound from the gas limit.

1. Price every payload byte

Ship EIP-8131 and EIP-8279 together - both CFI’d for Hegota. 8131 covers transaction content and 8279 covers the data execution creates.

Deposit requests have no count limit anywhere, so 8279 also needs to meter them. This PR adds that as one more trigger: a deposit event from the deposit contract meters its 192 request bytes.

The other request types (7002, 7251, 8282) have hard per-block caps in their predeploys, so they go into the constant C, like withdrawals.

With all of this in place, k is about 1.15.

2. Cap the max allowed gas limit, not the bytes

This is what actually fixes FOCIL. Add one header check, gas_limit <= MAX_GAS_LIMIT, set so the worst case can’t reach 8 MiB of EL block or 10 MiB of envelope:

  • about 500M with the pricing above
  • 256M if 8131 and 8279 don’t make it into Hegota - that’s still below both 266M and 330M

EIP-7934’s check can stay as a backstop. It just can never bite on a block that’s valid by gas, so nobody has to reason about it, and the size check in PR #4041 becomes unnecessary.

A cap on transaction bytes only would be additive and easier for FOCIL than an RLP check. But it leaves the BAL and requests out, so it doesn’t protect the 10 MiB limit, and builders still have a second thing to pack against.

The underlying problem is that the gas limit can’t outgrow what the network can handle. Going higher means repricing data or raising the message limit.

3. Give the CL a tight envelope bound

Once size follows from gas, the CL can reject oversized envelopes right away:

max_envelope_size = C + ceil(k * bid.gas_limit / 64)

With k = 1.25 the bound is about 1.12 MiB plus C at 60M instead of 10 MiB, so the biggest envelope nodes will forward shrinks roughly 9x. The same bound should apply to envelopes fetched by req/resp.

k has to come from a proper derivation with some margin. If the bound is too tight, nodes drop valid payloads at the gossip layer and building becomes more difficult.

If the bound really covers every byte source, a block can only be full by gas, and FOCIL’s check can stay gas, nonce and balance. That still needs two things: a complete size bound (a byte source I missed would break it), and an EIP that sets the maximum gas limit, which doesn’t exist yet.

Appendix: worst case by gas limit

Worst-case EL block (rlp(block)) and CL envelope in MiB at different gas limits. The envelope column is the largest envelope whose EL block still passes the 8 MiB check. Bold means the limit is broken: over 8 MiB for the EL block, over 10 MiB for the envelope.

Gas limit Glamsterdam EL Glamsterdam CL + 8131 EL + 8131 CL + 8131 + 8279 EL + 8131 + 8279 CL
60M 1.81 1.84 0.93 1.77 0.93 1.02
100M 3.01 3.07 1.56 2.95 1.56 1.71
150M 4.52 4.61 2.33 4.43 2.33 2.56
200M 6.02 6.15 3.11 5.91 3.11 3.41
250M 7.53 7.68 3.89 7.38 3.89 4.27
300M 9.03 9.14 4.67 8.86 4.67 5.12
400M 12.05 11.97 6.22 11.81 6.22 6.83
500M 15.06 14.81 7.78 14.77 7.78 8.54
600M 18.07 16.84 9.33 16.84 9.33 10.24