EIP-4488 Lowering calldata gas cost and capping total calldata volume (Transaction calldata gas cost reduction with total calldata limit)

No call decision · Scaling & data · EIP status Stagnant · created 2021-11-23

A proposal to lower the gas cost per byte of calldata included in a transaction from 16 to 3 and to cap the total amount of calldata allowed in a single block, in order to reduce rollup fees without burdening the network.

Why it is needed

Rollups are currently the only scaling method that can be trusted right now, but even their fees remain too expensive for many users. Data sharding, the long-term solution, will take a long time to implement and deploy, so a short-term measure is needed to bridge the gap. However, simply lowering the calldata gas cost on its own creates problems. The current average block size is 60 to 90 kB, but if the gas cost is lowered from 16 to 3 without a total cap, the theoretical maximum block size could grow from about 1.9 MB to 10 MB. Past experiments with roughly 500 kB blocks already caused some bootstrap nodes to go down, so such a sharp increase risks placing an unmanageable burden on the Ethereum p2p network. This proposal therefore introduces the gas cost reduction together with a cap on total calldata per block, to reduce rollup costs without putting the network at risk.

What changes

Today

After EIP-4488

Who is affected

In depth

Calldata gas cost reduction

The gas cost per byte of calldata is lowered to NEW_CALLDATA_GAS_COST, which is 3. The same value of 3 applies regardless of whether the byte is zero or non-zero. This is far cheaper than the current calldata pricing scheme and directly reduces the cost for rollups to post compressed transaction data to L1.

Total calldata limit per block

For a block to be valid, the sum of calldata length across all included transactions must not exceed the following: sum(len(tx.calldata)) <= BASE_MAX_CALLDATA_PER_BLOCK + len(block.txs) * CALLDATA_PER_TX_STIPEND. Here, BASE_MAX_CALLDATA_PER_BLOCK is 1,048,576 and CALLDATA_PER_TX_STIPEND is 300. That is, the cap is set by adding a per-transaction stipend to the base limit.

Why lowering the gas cost alone is not enough

If only the gas cost is lowered from 16 to 3 without any separate limit, the theoretical maximum block size calculated from the gas limit grows from about 1,875,000 bytes to about 10,000,000 bytes. This could place an unprecedented burden on Ethereum's p2p networking layer, and in fact, past experimental tests with blocks of about 500kB caused some bootstrap nodes to go down. Applying both the gas cost reduction and the total limit together is said to capture most of the benefit of the price reduction while avoiding this security risk.

Existing concerns about multi-dimensional resource limits and counterarguments

The Ethereum community has traditionally been reluctant to adopt rules that simultaneously constrain two different resources, such as gas and calldata, because this turns the problem block producers must solve from a simple one-dimensional problem into a complex knapsack problem. However, since EIP-1559, in many cases it is sufficient for a simple algorithm to just include all transactions that meet the priority fee and base fee conditions, yielding near-optimal results. In addition, sophisticated strategies for MEV (maximal extractable value) extraction already exist, and research on proposer/builder separation, which separates the proposer role from the role of actually constructing the block, is already underway, so a two-dimensional optimization problem is not seen as posing a fundamentally new risk.

The role of the stipend mechanism

A sample survey of blocks from 13500000 to 13529000 found that 90% of all transactions had less than 300 bytes of calldata. Setting CALLDATA_PER_TX_STIPEND to 300 means that even when a block's calldata is full, producers can still continue to include low-calldata transactions, which make up 90% of their mempool. Thanks to this, even with a simple transaction selection algorithm, the two-dimensional optimization problem is not significantly disadvantaged in practice.

Backward compatibility and transition method

Because this proposal changes the gas cost itself, it is not backward compatible and must be applied through a scheduled network upgrade (hard fork). Users can continue using the network with no change on their end. Miners and block producers only need to follow the rule of not adding more transactions once a block's total calldata reaches the cap, but they may also apply heuristics for better returns, such as replacing a single transaction with a lot of data with several transactions that each have less data.

Security considerations and status

Under this proposal, a block's instantaneous burst data capacity does not increase and in fact decreases slightly, but the average data capacity increases, raising the burden of history storage. In the worst case, this could reach about 1,262,861 bytes per 12-second slot, or about 3.0TB per year, and to mitigate this, it is recommended that a history expiry proposal such as EIP-4444 be introduced at the same time or shortly after. This EIP is currently in Stagnant status, with no active discussion or adoption in progress, so whether and when it will actually be applied remains undetermined.

Original EIP · ← EIPs