EIP-7557 · Stagnant · Core · 2023-10-01
EIP-7557: Block-level Warming with fair cost savings
Proposed that when several transactions in a block access the same cold account or storage slot, the cold-access cost is charged once and the excess base fee and priority fee are refunded to senders at the end of the block.
What problem does it solve?
Since EIP-2929, the first ("cold") access to an account or storage slot in a transaction costs much more than later ("warm") accesses, because the node may have to fetch it from disk. But warmth is tracked per transaction. If 50 transactions in one block call the same popular contract, each pays the full cold price, even though the node loads it once per block.
The authors expected this mismatch to grow: with stateless/verkle designs such as EIP-6800, loading contract code would be charged per chunk and become much more expensive, and with account abstraction many transactions would load the same shared wallet implementation. Overcharging those transactions burns base fee needlessly and hands block producers extra priority fees.
How it works
Transactions keep paying exactly as today during execution; nothing a contract can observe changes. The difference is a settlement step at the end of the block.
- Collect. The builder scans every transaction's EIP-2930
accessListand groups, per address and per slot, the senders that declared it and the priority fee each paid. - Refund the burn. For an item shared by N transactions, the cold cost is burned only once overall: each sender gets back
(N-1)/Nof the cold-access base fee, subject to a floor so that each entry still costs at leastMIN_ACCESS_LIST_ENTRY_COST = 32gas (to stop DoS via huge shared access lists). - Refund the tip. The block producer keeps one cold-access priority fee, at the highest tip rate among the sharers. The rest of the priority fees collected for that item is returned to senders in proportion to what each contributed.
- Pay out. A new system-level "cost redistribution" operation, modelled on EIP-4895 withdrawals, runs after all transactions: it credits each sender and debits the coinbase for its share. Balances change only from the next block on, so earlier transactions in the block are never affected by later ones.
To keep access lists from bloating history, the spec also suggests a block_access_list in the execution payload, with each transaction referencing shared entries by a 2-byte index.
Sample code
Simplified per-item base-fee refund (illustrative; applies the 32-gas floor as the spec text describes it):
const COLD_SLOAD_COST = 2100;
const MIN_ACCESS_LIST_ENTRY_COST = 32;
// senders: every tx sender that listed this storage slot in its access list
function burnRefunds(senders: string[], baseFeePerGas: bigint): Map<string, bigint> {
const n = senders.length;
const refunds = new Map<string, bigint>();
if (n < 2) return refunds; // nothing shared, nothing refunded
const share = Math.floor((COLD_SLOAD_COST * (n - 1)) / n); // (N-1)/N of the cold cost
const gas = Math.min(share, COLD_SLOAD_COST - MIN_ACCESS_LIST_ENTRY_COST); // each sender still pays >= 32 gas
for (const s of senders) {
refunds.set(s, (refunds.get(s) ?? 0n) + BigInt(gas) * baseFeePerGas);
}
return refunds;
}
Things to know
- Status is Stagnant. It was never scheduled for a network upgrade.
- Only items declared in a transaction's access list take part; undeclared accesses are charged as usual.
- Some details are loose in the spec. For example, its pseudocode applies the 32-gas minimum differently from the prose, and it says there are no block structure changes yet later proposes a
block_access_listfield and a new system operation. Read it as a design sketch, not a finished spec. - EIP-7863 is an alternative block-level warming proposal that does not redistribute savings between senders and the builder in this way. The separate idea of block-level access lists for parallel execution is pursued in EIP-7928.