Skip to content

Commit af506e5

Browse files
holimantkstanczak
authored andcommitted
EIP-2929: clarifications about scope revertals (ethereum#2984)
1 parent 843541a commit af506e5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

EIPS/eip-2929.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,18 @@ In the further future, there are similar benefits in the case of SNARK/STARK wit
4444

4545
For blocks where `block.number >= FORK_BLOCK`, the following changes apply.
4646

47-
### Storage read changes
47+
When executing a transaction, maintain a set `accessed_addresses: Set[Address]` and `accessed_storage_keys: Set[Tuple[Address, Bytes32]]` .
48+
49+
The sets are transaction-context-wide, implemented identically to other transaction-scoped constructs such as the self-destruct-list and global `refund` counter. In particular, if a scope reverts, the access lists should be in the state they were in before that scope was entered.
50+
51+
When a transaction execution begins,
52+
- `accessed_storage_keys` is initialized to empty, and
53+
- `accessed_addresses` is initialized to include
54+
- the `tx.sender`, `tx.to` (or the address being created if it is a contract creation transaction)
55+
- and the set of all precompiles.
4856

49-
When executing a transaction, maintain a set `accessed_addresses: Set[Address]` and `accessed_storage_keys: Set[Tuple[Address, Bytes32]]` (this is a transaction-context-wide set, implemented identically to self-destructs, in particular reverting similarly to how self-destructs revert). When a transaction execution begins, `accessed_storage_keys` is initialized to empty, and `accessed_addresses` is initialized to include the `tx.sender`, `tx.to` (or the address being created if it is a contract creation transaction) and the set of all precompiles.
57+
58+
### Storage read changes
5059

5160
When an address is either the target of a (`EXTCODESIZE` (`0x3B`), `EXTCODECOPY` (`0x3C`), `EXTCODEHASH` (`0x3F`) or `BALANCE` (`0x31`)) opcode or the target of a (`CALL` (`0xF1`), `CALLCODE` (`0xF2`), `DELEGATECALL` (`0xF4`), `STATICCALL` (`0xFA`)) opcode, the gas costs are computed as follows:
5261

0 commit comments

Comments
 (0)