This EIP charges access lists for their data footprint, closing a loophole that allows circumventing EIP-7623 floor pricing. This effectively reduces the worst-case block size by ~21% with minimal impact on users.
Access lists are only priced for storage but not for their data.
Furthermore, access lists can circumvent the EIP-7623 floor pricing by contributing to EVM gas while still leaving a non-negligible data footprint. This enables to achieve the maximal possible block size by combining access lists with calldata at a certain ratio.
Parameter | Value | Source |
---|---|---|
ACCESS_LIST_ADDRESS_COST |
2400 |
EIP-2930 |
ACCESS_LIST_STORAGE_KEY_COST |
1900 |
EIP-2930 |
TOTAL_COST_FLOOR_PER_TOKEN |
10 |
EIP-7623 |
Let access_list_nonzero_bytes
and access_list_zero_bytes
be the count of non-zero and zero bytes respectively in the addresses (20 bytes each) and storage keys (32 bytes each) contained within the access list.
The current formula for access list costs in EIP-2930 is:
access_list_cost = (
ACCESS_LIST_ADDRESS_COST * access_list_addresses
+ ACCESS_LIST_STORAGE_KEY_COST * access_list_storage_keys
)
The formula for access list costs changes to:
# Standard access list functionality cost
standard_access_list_cost = (
ACCESS_LIST_ADDRESS_COST * access_list_addresses
+ ACCESS_LIST_STORAGE_KEY_COST * access_list_storage_keys
)
# Additional data cost for access list bytes
access_list_tokens = access_list_nonzero_bytes * 4 + access_list_zero_bytes
access_list_data_cost = access_list_tokens * TOTAL_COST_FLOOR_PER_TOKEN
# Total access list cost
access_list_cost = standard_access_list_cost + access_list_data_cost
Transactions pay both the existing EIP-2930 functionality costs plus 40 gas per non-zero byte and 10 gas per zero byte counted across all addresses and storage keys in the access list.
Adding 40 gas per non-zero byte and 10 gas per zero byte ensures consistent pricing across all transaction data:
No threshold mechanism is used. The per-byte costs are always applied to maintain simplicity and prevent circumvention.
The additional cost makes EIP-2930 access lists economically irrational for gas optimization, effectively deprecating their use while maintaining compatibility.
At a gas limit of 60M:
With data pricing (assuming all non-zero bytes):
The maximum possible Snappy compressed block size can be achieved by using access lists and calldata together at a ratio were the transaction keeps paying the lower calldata price.
At a gas limit of 60M, the maximum possible compressed block size will be reduced from 2.71 MiB to 2.13 MiB.
This is a backwards incompatible gas repricing that requires a scheduled network upgrade.
Requires updates to gas estimation in wallets and nodes. Normal usage patterns remain largely unaffected.
The following is the EELS (Ethereum Execution Layer Specification) implementation:
TX_ACCESS_LIST_NONZERO_BYTE_COST = Uint(40)
TX_ACCESS_LIST_ZERO_BYTE_COST = Uint(10)
def count_access_list_bytes(access_list: Tuple[Access, ...]) -> Tuple[int, int]:
"""
Count zero and non-zero bytes in access list addresses and storage keys.
Returns a tuple of (zero_bytes, nonzero_bytes).
"""
zero_bytes = 0
nonzero_bytes = 0
for access in access_list:
# Count bytes in address (20 bytes)
for byte in access.account:
if byte == 0:
zero_bytes += 1
else:
nonzero_bytes += 1
# Count bytes in storage keys (32 bytes each)
for slot in access.slots:
for byte in slot:
if byte == 0:
zero_bytes += 1
else:
nonzero_bytes += 1
return zero_bytes, nonzero_bytes
def calculate_intrinsic_cost(tx: Transaction) -> Tuple[Uint, Uint]:
"""
Calculates the gas that is charged before execution is started.
"""
# ... existing calldata and base cost calculations ...
access_list_cost = Uint(0)
access_list_data_cost = Uint(0)
if isinstance(tx, (AccessListTransaction, FeeMarketTransaction,
BlobTransaction, SetCodeTransaction)):
# Standard EIP-2930 access list functionality costs
for access in tx.access_list:
access_list_cost += TX_ACCESS_LIST_ADDRESS_COST
access_list_cost += (
ulen(access.slots) * TX_ACCESS_LIST_STORAGE_KEY_COST
)
# EIP-7981: Additional data cost for access list bytes
zero_bytes, nonzero_bytes = count_access_list_bytes(tx.access_list)
access_list_data_cost = (
Uint(zero_bytes) * TX_ACCESS_LIST_ZERO_BYTE_COST +
Uint(nonzero_bytes) * TX_ACCESS_LIST_NONZERO_BYTE_COST
)
return (
Uint(
TX_BASE_COST
+ data_cost
+ create_cost
+ access_list_cost
+ access_list_data_cost # Added by EIP-7981
+ auth_cost
),
calldata_floor_gas_cost,
)
Reduces maximum block size from access lists, improving network stability. The additional cost is proportional to data usage while maintaining access list utility for backwards compatibility.
Copyright and related rights waived via CC0.