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
Copy file name to clipboardExpand all lines: EIPS/eip-7002.md
+8-34Lines changed: 8 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ status: Draft
8
8
type: Standards Track
9
9
category: Core
10
10
created: 2023-05-09
11
+
requires: 7685
11
12
---
12
13
13
14
## Abstract
@@ -39,6 +40,7 @@ Note, 0x00 withdrawal credentials can be changed into 0x01 withdrawal credential
39
40
| Name | Value | Comment |
40
41
| - | - | - |
41
42
|`WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS`|`0xEd8EA01d70Cb49726175BCf2778B9C982912e017`| Where to call and store relevant details about exit / partial withdrawal mechanism |
43
+
|`WITHDRAWAL_REQUEST_TYPE`|`0x01`| The [EIP-7685](./eip-7685.md) type prefix for withdrawal request |
42
44
| `SYSTEM_ADDRESS` | `0xfffffffffffffffffffffffffffffffffffffffe` | Address used to invoke system operation on contract
43
45
|`EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT`| 0 ||
44
46
|`WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT`| 1 ||
@@ -58,20 +60,17 @@ Note, 0x00 withdrawal credentials can be changed into 0x01 withdrawal credential
58
60
59
61
#### Withdrawal request operation
60
62
61
-
The new withdrawal request operation consists of the following fields:
63
+
The new withdrawal request operation is an [EIP-7685](./eip-7685.md) request
64
+
with type `0x01` and consists of the following fields:
62
65
63
66
1.`source_address`: `Bytes20`
64
67
2.`validator_pubkey`: `Bytes48`
65
68
3.`amount:``uint64`
66
69
67
-
RLP encoding of a withdrawal request **MUST** be computed as the following:
70
+
The [EIP-7685](./eip-7685)encoding of a withdrawal request **MUST** be computed as the follows:
The withdrawal requests contract is deployed like any other smart contract. A special synthetic address is generated by working backwards from the desired deployment transaction:
Beginning with the `FORK_BLOCK`, the block body **MUST** be appended with the list of withdrawal requests returned by `read_withdrawal_requests()`. RLP encoding of the extended block body structure **MUST** be computed as follows:
502
-
503
-
```python
504
-
block_body_rlp = RLP([
505
-
field_0,
506
-
...,
507
-
# Latest block body field before `withdrawal_requests`
508
-
field_n,
509
-
510
-
[req_0, ..., req_k],
511
-
])
512
-
```
513
-
514
-
Beginning with the `FORK_BLOCK`, the block header **MUST** be appended with the new **`withdrawal_requests_root`** field. The value of this field is the trie root committing to the list of requests in the block body. **`withdrawal_requests_root`** field value **MUST** be computed as follows:
515
-
516
-
```python
517
-
defcompute_trie_root_from_indexed_data(data):
518
-
trie = Trie.from([(i, obj) for i, obj inenumerate(data)])
0 commit comments