Skip to content

Commit

Permalink
Update EIP-6110: harmonize request eips with 7685 changes (#8949)
Browse files Browse the repository at this point in the history
* harmonize request eips with 7685 changes

* fix link
  • Loading branch information
lightclient authored Oct 10, 2024
1 parent 3e0aee3 commit f88a24b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
10 changes: 4 additions & 6 deletions EIPS/eip-6110.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ Deposits are a type of [EIP-7685](./eip-7685.md) request, with the following enc

```python
request_type = DEPOSIT_REQUEST_TYPE
request_data = pubkey ++ withdrawal_credentials ++ amount ++ signature ++ index
request_data = get_deposit_request_data(block.receipts)
```

Note that the request payload is just the concatenation of the elements returned by the contract.
The encoded deposits will be committed to by the `requestsHash` in the block header
following the format defined by EIP-7685.
Note that `deposits` is the list of the deposits parsed from the block's logs.

#### Block validity

Expand Down Expand Up @@ -104,8 +102,8 @@ def get_deposit_request_data(receipts)
deposit_request = event_data_to_deposit_request(log.data)
deposit_requests.append(deposit_request)

# Concatenate list of deposit request data and prepend the type
return DEPOSIT_REQUEST_TYPE + b''.join(deposit_requests)
# Concatenate list of deposit request data
return b''.join(deposit_requests)
```

### Consensus layer
Expand Down
6 changes: 2 additions & 4 deletions EIPS/eip-7002.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,14 @@ with type `0x01` and consists of the following fields:
2. `validator_pubkey`: `Bytes48`
3. `amount:` `uint64`

The [EIP-7685](./eip-7685) encoding of a withdrawal request is computed as follows.
The [EIP-7685](./eip-7685.md) encoding of a withdrawal request is computed as follows.
Note that `amount` is returned by the contract little-endian, and must be encoded as such.

```python
request_type = WITHDRAWAL_REQUEST_TYPE
request_data = source_address ++ validator_pubkey ++ amount
request_data = ssz.serialize(read_withdrawal_requests())
```

The size of encoded withdrawal `request_data` is 76 bytes.

#### Withdrawal Request Contract

The contract has three different code paths, which can be summarized at a high level as follows:
Expand Down
5 changes: 2 additions & 3 deletions EIPS/eip-7251.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@ The new consolidation request is an [EIP-7685](./eip-7685.md) request with type
2. `source_pubkey`: `Bytes48`
3. `target_pubkey`: `Bytes48`

The [EIP-7685](./eip-7685.md) encoding of a consolidation request is as follows. Note we simply return the
encoded request value as returned by the contract.
The [EIP-7685](./eip-7685.md) encoding of a consolidation request is as follows. Note we simply return the encoded request value as returned by the contract.

```python
request_type = CONSOLIDATION_REQUEST_TYPE
request_data = source_address ++ source_pubkey ++ target_pubkey
request_data = ssz.serialize(dequeue_consolidation_requests())
```

#### Consolidation request contract
Expand Down

0 comments on commit f88a24b

Please sign in to comment.