This EIP charges access lists 40 gas per non-zero byte and 10 gas per zero byte for their data footprint, closing a loophole that allows circumventing EIP-7623 floor pricing.
Access lists can circumvent EIP-7623 by filling blocks with uncharged data. Each address uses 20 bytes and each storage key uses 32 bytes, but these are not charged for their data footprint. This allows transactions to achieve larger block sizes than intended by combining access lists with calldata.
Parameter | Value | Source |
---|---|---|
ACCESS_LIST_ADDRESS_COST |
2400 |
EIP-2930 |
ACCESS_LIST_STORAGE_KEY_COST |
1900 |
EIP-2930 |
ACCESS_LIST_NONZERO_BYTE_COST |
40 |
New in this EIP |
ACCESS_LIST_ZERO_BYTE_COST |
10 |
New in this EIP |
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_data_cost = (
ACCESS_LIST_NONZERO_BYTE_COST * access_list_nonzero_bytes
+ ACCESS_LIST_ZERO_BYTE_COST * access_list_zero_bytes
)
# 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.
Current pricing with 36M gas limit:
With data pricing (assuming all non-zero bytes):
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.