EIP-7706 Introduction of a separate gas type dedicated to calldata (Separate gas type for calldata)
No call decision · Fees & gas · EIP status Stagnant · created 2024-05-13
This proposal gives transaction calldata its own base fee and per-block gas limit, separate from execution gas and blob gas, reducing the maximum block size while lowering the average cost of calldata.
Why it is needed
The main argument against raising the gas limit, making calldata cheaper, or increasing the number of blobs is that the theoretical maximum size an Ethereum block can reach is already too large. In practice the average block size is only about 100kB, while the theoretical maximum is 1,875,000 bytes (30,000,000 divided by 16). Because of this gap, a way is needed to make calldata cheaper on average without increasing the worst-case block size. EIP-7706 solves this the same way EIP-4844 did for blobs, by giving calldata its own base fee and per-block gas limit.
What changes
Today
- Calldata shares the same gas limit and base fee as execution gas.
- The calldata gas cost is fixed at 16 per nonzero byte and 4 per zero byte.
- The theoretical maximum block size is very large, at 30,000,000/16 = 1,875,000 bytes.
- Execution gas and blob gas use different base fee adjustment mechanisms from each other.
After EIP-7706
- A calldata-specific base fee and per-block gas limit (gas_limits[0]//4) are introduced.
- The new transaction type carries execution, blob, and calldata fees as a three-element vector.
- All three gas types use the same EIP-4844-style base fee adjustment algorithm.
- The calldata target rises to 187,500 bytes per block, about twice the current average.
Who is affected
- Users: Transactions that use a lot of calldata (for example, rollup data submissions) may see lower average costs.
- Wallet & app developers: The three-element fee vectors (max_fees_per_gas, priority_fees_per_gas) of the new transaction type must be handled.
- Client teams: Vectorization of the block header's gas_limits, gas_used, and excess_gas, and integration of the base fee adjustment logic, must be implemented.
- Block builders: With three gas types instead of two, block construction optimization becomes more complex.
In depth
The new transaction type and fee vectors
After FORK_BLKNUM, a new EIP-2718 transaction with TransactionType = NEW_TX_TYPE is added. Its payload has the form [chain_id, nonce, gas_limit, to, value, data, access_list, blob_versioned_hashes, max_fees_per_gas, priority_fees_per_gas, y_parity, r, s], where max_fees_per_gas and priority_fees_per_gas are each length-3 vectors (integers from 0 to 2**64-1) in the order execution, blob, calldata. This transaction's intrinsic cost follows the EIP-4844 approach, except that the existing 16/4 gas cost for calldata is excluded.
Backward-compatible handling of existing transaction types
The get_max_fees and get_priority_fees functions also convert existing types into the three-element vector form. BLOB_TX_TYPE maps to [max_fee_per_gas, max_fee_per_blob_gas, max_fee_per_gas], the EIP-1559 type maps to [max_fee_per_gas, 0, max_fee_per_gas], and the legacy type maps to [gasprice, 0, gasprice], treating the calldata base fee and priority fee the same as execution gas.
Calldata gas calculation
get_calldata_gas counts each zero byte of calldata as 1 token and each nonzero byte as TOKENS_PER_NONZERO_BYTE (4) tokens, then multiplies by CALLDATA_GAS_PER_TOKEN (4) to derive the gas amount. This formula is restructured to produce the same values as the current calldata gas cost (16 per nonzero byte, 4 per zero byte).
Per-block calldata gas limit
The calldata-specific gas limit is set according to CALLDATA_GAS_LIMIT_RATIO (4) as gas_limits[2] = gas_limits[0] // 4. The execution gas limit (gas_limits[0]) continues to follow the existing adjustment formula, and the blob gas limit (gas_limits[1]) is fixed at MAX_BLOB_GAS_PER_BLOCK.
Integration of target ratios and base fee adjustment
With LIMIT_TARGET_RATIOS = [2, 2, 4], execution and blob gas target 1/2 of their limit, while calldata targets 1/4 of its limit. The calldata target is 187,500 bytes per block, about twice current average calldata usage. All three gas types share calc_excess_gas and get_block_basefees (fake_exponential, MIN_BASE_FEE_PER_GAS=1, BASE_FEE_UPDATE_FRACTION=8), applying the same EIP-4844-style base fee adjustment.
Changes to the block header structure
The blob_gas_used, gas_used, base_fee_per_gas, gas_limit, and excess_blob_gas fields are removed from the block header and replaced with three fields of type [int, int, int]: gas_limits, gas_used, and excess_gas. The order within each vector is execution gas, blob gas, calldata gas.
Economic impact and backward compatibility
Existing-type transactions are approximated to treat the calldata base fee and priority fee the same as execution gas, so they can continue to be used without major loss, but the author expects users to migrate to the new transaction type over time. On the block construction side, the number of gas types grows from two to three, making builder optimization more complex, but since more than 90% of blocks have spare capacity, the author notes that a simple greedy algorithm can still produce results close enough to optimal.
Current status
This EIP's status is Stagnant, and the values of FORK_BLKNUM and NEW_TX_TYPE remain TBD. The provided material contains no record of a call decision on whether to include this in a fork.