---
eip: 2583
label: EIP-2583
title: Penalty for account trie misses
status: Stagnant
type: Standards Track
category: Core
created: 2020-02-21
official: https://eips.ethereum.org/EIPS/eip-2583
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2583.md
canonical: https://eips.huatuo.xyz/eip-2583/
lang: en
tldr: Proposed an extra gas penalty when an opcode looks up an account that does not exist, to blunt DoS attacks that deliberately miss node caches.
tags: [gas, dos, state, opcodes, core]
---

# EIP-2583: Penalty for account trie misses

> This EIP introduces a gas penalty for opcodes which access the account for trie non-existent accounts.

**TL;DR:** Proposed an extra gas penalty when an opcode looks up an account that does not exist, to blunt DoS attacks that deliberately miss node caches.

## What problem does it solve?

Nodes rely heavily on caches to read state quickly. A cache hit is cheap, but a lookup for an address that is not in the state trie usually misses every cache and goes to disk. An attacker can exploit this by touching a fresh non-existent address every time, maximising disk reads per unit of gas. Caching "non-existence" does not help much, because the attacker never repeats an address and the junk entries evict useful ones.

Raising the base price of every state-access opcode (as [EIP-150](/eip-150/) and [EIP-1884](/eip-1884/) did) punishes all contracts for the worst case. EIP-2583 instead keeps normal prices for normal use and charges extra only on the "miss" path.

## How it works

- A constant `penalty` (left as TBD, suggested 2000 gas) is charged whenever an opcode that reads the account trie targets an address that **does not exist**.
- Affected: `BALANCE`, `EXTCODEHASH`, `EXTCODECOPY`, `EXTCODESIZE`, and the call family (`CALL`, `CALLCODE`, `DELEGATECALL`, `STATICCALL`).
- Not affected: `SELFDESTRUCT` (already costs 5000), `CREATE`/`CREATE2` (target is expected not to exist), `SELFBALANCE`, and base opcode costs in general.
- For calls, the penalty applies only when **no value** is sent and the destination does not exist (and is not a precompile). Value-transferring calls to new accounts already pay the 25,000 new-account charge.

| Op | value, dest | value, !dest | !value, dest | !value, !dest |
| --- | --- | --- | --- | --- |
| CALL / CALLCODE | no change | no change | no change | `penalty` |
| DELEGATECALL / STATICCALL | N/A | N/A | no change | `penalty` |

The author estimated that a 10M-gas transaction could cause about 14K trie lookups at the time, and that a 2000-gas penalty would cut that to about 3700. The spec also notes a ceiling: an attacker can route lookups through a relay contract, so a penalty much above about 800 gas may not add protection.

## Sample code

Pseudocode for the extra charge on `BALANCE`:

```python
PENALTY = 2000  # suggested value; TBD in the spec

def op_balance(evm, address):
    evm.charge_gas(BALANCE_BASE_COST)
    if not evm.state.account_exists(address):
        evm.charge_gas(PENALTY)          # trie miss
        evm.stack.push(0)
    else:
        evm.stack.push(evm.state.get_balance(address))
```

Solidity code paths that would pay it: the pre-call `EXTCODESIZE` check that Solidity performs on a high-level call to a non-existent `recipient`, and `addr.balance` on an empty address.

## Things to know

- **Status: Stagnant.** It was never adopted. Ethereum addressed the same class of DoS differently with [EIP-2929](/eip-2929/), which made the first access to any address or slot in a transaction expensive ("cold") and later accesses cheap ("warm").
- Several parts of the spec were left open: the exact penalty value, whether it applies to plain zero-value transactions, and how it should interact with self-destructed accounts.
- The backwards compatibility section examines real contracts, such as ERC-223-style `isContract` checks, and concludes most would be unaffected as long as the penalty stays below roughly 3000 gas.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-2583
