You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We define access events as follows. When an access event takes place, the accessed data is saved to the Verkle tree (even if it was not modified). An access event is of the form`(address, sub_key, leaf_key)`, determining what data is being accessed.
38
+
Whenever the state is read, one or more of the access events of the form`(address, sub_key, leaf_key)` take place, determining what data is being accessed. We define access events as follows:
39
39
40
40
#### Access events for account headers
41
41
@@ -46,21 +46,21 @@ When:
46
46
3. any address is the target of the `BALANCE` opcode
47
47
4. a _deployed_ contract calls `CODECOPY`
48
48
49
-
process this access events:
49
+
process this access event:
50
50
51
51
```
52
52
(address, 0, BASIC_DATA_LEAF_KEY)
53
53
```
54
54
55
55
Note: a non-value-bearing `SELFDESTRUCT` or `*CALL`, targetting a precompile, will not cause the `BASIC_DATA_LEAF_KEY` to be added to the witness.
56
56
57
-
If a `*CALL` or `SELFDESTRUCT` is value-bearing (ie. it transfers nonzero wei), whether or not the callee is a precompile, process this additional access event:
57
+
If a `*CALL` or `SELFDESTRUCT` is value-bearing (ie. it transfers nonzero wei), whether or not the `callee` is a precompile, process this additional access event:
58
58
59
59
```
60
-
(origin, 0, BASIC_DATA_LEAF_KEY)
60
+
(caller, 0, BASIC_DATA_LEAF_KEY)
61
61
```
62
62
63
-
Note: when checking for the existence of the callee, the existence check is done by validating that there is an extension-and-suffix tree at the corresponding stem, and does not rely on `CODEHASH_LEAF_KEY`.
63
+
Note: when checking for the existence of the `callee`, the existence check is done by validating that there is an extension-and-suffix tree at the corresponding stem, and does not rely on `CODEHASH_LEAF_KEY`.
64
64
65
65
When calling `EXTCODEHASH` on a non-precompile target, process the access event:
66
66
@@ -111,21 +111,21 @@ In the conditions below, “chunk chunk_id is accessed” is understood to mean
111
111
112
112
### Write Events
113
113
114
-
We define **write events** as follows. Note that when a write takes place, an access event also takes place (so the definition below should be a subset of the definition of access lists) A write event is of the form `(address, sub_key, leaf_key)`, determining what data is being written to.
114
+
We define **write events** as follows. Note that when a write takes place, an access event also takes place (so the definition below should be a subset of the definition of access events). A write event is of the form `(address, sub_key, leaf_key)`, determining what data is being written to.
115
115
116
116
#### Write events for account headers
117
117
118
118
When a nonzero-balance-sending `*CALL` or `SELFDESTRUCT` with a given sender and recipient takes place, process these write events:
119
119
120
120
```
121
-
(origin, 0, BASIC_DATA_LEAF_KEY)
122
-
(target, 0, BASIC_DATA_LEAF_KEY)
121
+
(caller, 0, BASIC_DATA_LEAF_KEY)
122
+
(callee, 0, BASIC_DATA_LEAF_KEY)
123
123
```
124
124
125
125
if no account exists at `callee_address`, also process:
126
126
127
127
```
128
-
(target, 0, CODEHASH_LEAF_KEY)
128
+
(callee, 0, CODEHASH_LEAF_KEY)
129
129
```
130
130
131
131
When a contract creation is initialized, process these write events:
@@ -166,7 +166,7 @@ For `i` in `0 ... (len(code)+30)//31`.
166
166
167
167
Note: since no access list existed for code up until this EIP, note that no warm costs are charged for code accesses.
168
168
169
-
### Transactions
169
+
### Transaction
170
170
171
171
#### Access events
172
172
@@ -221,15 +221,13 @@ When executing a transaction, maintain four sets:
221
221
222
222
When an **access** event of `(address, sub_key, leaf_key)` occurs, perform the following checks:
223
223
224
-
* Perform the following steps unless `address` is either:
225
-
* the transaction's originator;
226
-
* the transactions's target;
224
+
* Perform the following steps unless event is a _Transaction access event_;
227
225
* If `(address, sub_key)` is not in `accessed_subtrees`, charge `WITNESS_BRANCH_COST` gas and add that tuple to `accessed_subtrees`.
228
226
* If `leaf_key` is not `None` and `(address, sub_key, leaf_key)` is not in `accessed_leaves`, charge `WITNESS_CHUNK_COST` gas and add it to `accessed_leaves`
229
227
230
228
When a **write** event of `(address, sub_key, leaf_key)` occurs, perform the following checks:
231
229
232
-
* If `address` is either the transaction's originator or target, skip the following steps.
230
+
* If event is _Transaction write event_, skip the following steps.
233
231
* If `(address, sub_key)` is not in `edited_subtrees`, charge `SUBTREE_EDIT_COST` gas and add that tuple to `edited_subtrees`.
234
232
* If `leaf_key` is not `None` and `(address, sub_key, leaf_key)` is not in `edited_leaves`, charge `CHUNK_EDIT_COST` gas and add it to `edited_leaves`
235
233
* Additionally, if there was no value stored at `(address, sub_key, leaf_key)` (ie. the state held `None` at that position), charge `CHUNK_FILL_COST`
@@ -243,23 +241,6 @@ Note that values should only be added to the witness if there is sufficient gas
243
241
* this minimum 1/64th gas reservation is checked **AFTER** charging the witness costs when performing a `CALL`, `CODECALL`, `DELEGATECALL` or`STATICCALL`
244
242
* this 1/64th of the gas is subtracted **BEFORE** charging the witness costs when performing a `CREATE` or `CREATE2`
245
243
246
-
### Replacement for access lists
247
-
248
-
We replace [EIP-2930](./eip-2930.md) access lists with an SSZ structure of the form:
0 commit comments