Skip to content

Commit d8c486b

Browse files
committed
Rename DepositReceipt to DepositRequest
1 parent 84c4aeb commit d8c486b

File tree

12 files changed

+162
-162
lines changed

12 files changed

+162
-162
lines changed

presets/mainnet/electra.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ MAX_CONSOLIDATIONS: 1
3434

3535
# Execution
3636
# ---------------------------------------------------------------
37-
# 2**13 (= 8192) receipts
38-
MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD: 8192
37+
# 2**13 (= 8192) deposit requests
38+
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192
3939
# 2**4 (= 16) withdrawal requests
4040
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16
4141

presets/minimal/electra.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ MAX_CONSOLIDATIONS: 1
3535
# Execution
3636
# ---------------------------------------------------------------
3737
# [customized]
38-
MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD: 4
38+
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 4
3939
# [customized] 2**1 (= 2) withdrawal requests
4040
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 2
4141

specs/electra/beacon-chain.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
- [Validator cycle](#validator-cycle)
2525
- [Containers](#containers)
2626
- [New containers](#new-containers)
27-
- [`DepositReceipt`](#depositreceipt)
27+
- [`DepositRequest`](#depositrequest)
2828
- [`PendingBalanceDeposit`](#pendingbalancedeposit)
2929
- [`PendingPartialWithdrawal`](#pendingpartialwithdrawal)
3030
- [`ExecutionLayerWithdrawalRequest`](#executionlayerwithdrawalrequest)
@@ -92,8 +92,8 @@
9292
- [Updated `process_voluntary_exit`](#updated-process_voluntary_exit)
9393
- [Execution layer withdrawal requests](#execution-layer-withdrawal-requests)
9494
- [New `process_execution_layer_withdrawal_request`](#new-process_execution_layer_withdrawal_request)
95-
- [Deposit receipts](#deposit-receipts)
96-
- [New `process_deposit_receipt`](#new-process_deposit_receipt)
95+
- [Deposit requests](#deposit-requests)
96+
- [New `process_deposit_request`](#new-process_deposit_request)
9797
- [Consolidations](#consolidations)
9898
- [New `process_consolidation`](#new-process_consolidation)
9999
- [Testing](#testing)
@@ -119,7 +119,7 @@ The following values are (non-configurable) constants used throughout the specif
119119

120120
| Name | Value | Description |
121121
| - | - | - |
122-
| `UNSET_DEPOSIT_RECEIPTS_START_INDEX` | `uint64(2**64 - 1)` | *[New in Electra:EIP6110]* |
122+
| `UNSET_DEPOSIT_REQUESTS_START_INDEX` | `uint64(2**64 - 1)` | *[New in Electra:EIP6110]* |
123123
| `FULL_EXIT_REQUEST_AMOUNT` | `uint64(0)` | *[New in Electra:EIP7002]* |
124124

125125
### Withdrawal prefixes
@@ -170,7 +170,7 @@ The following values are (non-configurable) constants used throughout the specif
170170

171171
| Name | Value | Description |
172172
| - | - | - |
173-
| `MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD` | `uint64(2**13)` (= 8,192) | *[New in Electra:EIP6110]* Maximum number of deposit receipts allowed in each payload |
173+
| `MAX_DEPOSIT_REQUESTS_PER_PAYLOAD` | `uint64(2**13)` (= 8,192) | *[New in Electra:EIP6110]* Maximum number of deposit requests allowed in each payload |
174174
| `MAX_ATTESTER_SLASHINGS_ELECTRA` | `2**0` (= 1) | *[New in Electra:EIP7549]* |
175175
| `MAX_ATTESTATIONS_ELECTRA` | `2**3` (= 8) | *[New in Electra:EIP7549]* |
176176
| `MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD` | `uint64(2**4)` (= 16)| *[New in Electra:EIP7002]* Maximum number of execution layer withdrawal requests in each payload |
@@ -194,12 +194,12 @@ The following values are (non-configurable) constants used throughout the specif
194194

195195
### New containers
196196

197-
#### `DepositReceipt`
197+
#### `DepositRequest`
198198

199199
*Note*: The container is new in EIP6110.
200200

201201
```python
202-
class DepositReceipt(Container):
202+
class DepositRequest(Container):
203203
pubkey: BLSPubkey
204204
withdrawal_credentials: Bytes32
205205
amount: Gwei
@@ -345,7 +345,7 @@ class ExecutionPayload(Container):
345345
withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD]
346346
blob_gas_used: uint64
347347
excess_blob_gas: uint64
348-
deposit_receipts: List[DepositReceipt, MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD] # [New in Electra:EIP6110]
348+
deposit_requests: List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD] # [New in Electra:EIP6110]
349349
# [New in Electra:EIP7002:EIP7251]
350350
withdrawal_requests: List[ExecutionLayerWithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD]
351351
```
@@ -373,7 +373,7 @@ class ExecutionPayloadHeader(Container):
373373
withdrawals_root: Root
374374
blob_gas_used: uint64
375375
excess_blob_gas: uint64
376-
deposit_receipts_root: Root # [New in Electra:EIP6110]
376+
deposit_requests_root: Root # [New in Electra:EIP6110]
377377
withdrawal_requests_root: Root # [New in Electra:EIP7002:EIP7251]
378378
```
379379

@@ -422,7 +422,7 @@ class BeaconState(Container):
422422
next_withdrawal_validator_index: ValidatorIndex
423423
# Deep history valid from Capella onwards
424424
historical_summaries: List[HistoricalSummary, HISTORICAL_ROOTS_LIMIT]
425-
deposit_receipts_start_index: uint64 # [New in Electra:EIP6110]
425+
deposit_requests_start_index: uint64 # [New in Electra:EIP6110]
426426
deposit_balance_to_consume: Gwei # [New in Electra:EIP7251]
427427
exit_balance_to_consume: Gwei # [New in Electra:EIP7251]
428428
earliest_exit_epoch: Epoch # [New in Electra:EIP7251]
@@ -1011,7 +1011,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
10111011
withdrawals_root=hash_tree_root(payload.withdrawals),
10121012
blob_gas_used=payload.blob_gas_used,
10131013
excess_blob_gas=payload.excess_blob_gas,
1014-
deposit_receipts_root=hash_tree_root(payload.deposit_receipts), # [New in Electra:EIP6110]
1014+
deposit_requests_root=hash_tree_root(payload.deposit_requests), # [New in Electra:EIP6110]
10151015
withdrawal_requests_root=hash_tree_root(payload.withdrawal_requests), # [New in Electra:EIP7002:EIP7251]
10161016
)
10171017
```
@@ -1026,7 +1026,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
10261026
def process_operations(state: BeaconState, body: BeaconBlockBody) -> None:
10271027
# [Modified in Electra:EIP6110]
10281028
# Disable former deposit mechanism once all prior deposits are processed
1029-
eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_receipts_start_index)
1029+
eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index)
10301030
if state.eth1_deposit_index < eth1_deposit_index_limit:
10311031
assert len(body.deposits) == min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index)
10321032
else:
@@ -1044,7 +1044,7 @@ def process_operations(state: BeaconState, body: BeaconBlockBody) -> None:
10441044
for_ops(body.bls_to_execution_changes, process_bls_to_execution_change)
10451045
# [New in Electra:EIP7002:EIP7251]
10461046
for_ops(body.execution_payload.withdrawal_requests, process_execution_layer_withdrawal_request)
1047-
for_ops(body.execution_payload.deposit_receipts, process_deposit_receipt) # [New in Electra:EIP6110]
1047+
for_ops(body.execution_payload.deposit_requests, process_deposit_request) # [New in Electra:EIP6110]
10481048
for_ops(body.consolidations, process_consolidation) # [New in Electra:EIP7251]
10491049
```
10501050

@@ -1271,24 +1271,24 @@ def process_execution_layer_withdrawal_request(
12711271
))
12721272
```
12731273

1274-
##### Deposit receipts
1274+
##### Deposit requests
12751275

1276-
###### New `process_deposit_receipt`
1276+
###### New `process_deposit_request`
12771277

12781278
*Note*: This function is new in Electra:EIP6110.
12791279

12801280
```python
1281-
def process_deposit_receipt(state: BeaconState, deposit_receipt: DepositReceipt) -> None:
1282-
# Set deposit receipt start index
1283-
if state.deposit_receipts_start_index == UNSET_DEPOSIT_RECEIPTS_START_INDEX:
1284-
state.deposit_receipts_start_index = deposit_receipt.index
1281+
def process_deposit_request(state: BeaconState, deposit_request: DepositRequest) -> None:
1282+
# Set deposit request start index
1283+
if state.deposit_requests_start_index == UNSET_DEPOSIT_REQUESTS_START_INDEX:
1284+
state.deposit_requests_start_index = deposit_request.index
12851285

12861286
apply_deposit(
12871287
state=state,
1288-
pubkey=deposit_receipt.pubkey,
1289-
withdrawal_credentials=deposit_receipt.withdrawal_credentials,
1290-
amount=deposit_receipt.amount,
1291-
signature=deposit_receipt.signature,
1288+
pubkey=deposit_request.pubkey,
1289+
withdrawal_credentials=deposit_request.withdrawal_credentials,
1290+
amount=deposit_request.amount,
1291+
signature=deposit_request.signature,
12921292
)
12931293
```
12941294

@@ -1349,7 +1349,7 @@ def process_consolidation(state: BeaconState, signed_consolidation: SignedConsol
13491349
Modifications include:
13501350
1. Use `ELECTRA_FORK_VERSION` as the previous and current fork version.
13511351
2. Utilize the Electra `BeaconBlockBody` when constructing the initial `latest_block_header`.
1352-
3. *[New in Electra:EIP6110]* Add `deposit_receipts_start_index` variable to the genesis state initialization.
1352+
3. *[New in Electra:EIP6110]* Add `deposit_requests_start_index` variable to the genesis state initialization.
13531353
4. *[New in Electra:EIP7251]* Initialize new fields to support increasing the maximum effective balance.
13541354

13551355
```python
@@ -1369,7 +1369,7 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32,
13691369
eth1_data=Eth1Data(block_hash=eth1_block_hash, deposit_count=uint64(len(deposits))),
13701370
latest_block_header=BeaconBlockHeader(body_root=hash_tree_root(BeaconBlockBody())),
13711371
randao_mixes=[eth1_block_hash] * EPOCHS_PER_HISTORICAL_VECTOR, # Seed RANDAO with Eth1 entropy
1372-
deposit_receipts_start_index=UNSET_DEPOSIT_RECEIPTS_START_INDEX, # [New in Electra:EIP6110]
1372+
deposit_requests_start_index=UNSET_DEPOSIT_REQUESTS_START_INDEX, # [New in Electra:EIP6110]
13731373
)
13741374

13751375
# Process deposits

specs/electra/fork.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def upgrade_to_electra(pre: deneb.BeaconState) -> BeaconState:
9090
withdrawals_root=pre.latest_execution_payload_header.withdrawals_root,
9191
blob_gas_used=pre.latest_execution_payload_header.blob_gas_used,
9292
excess_blob_gas=pre.latest_execution_payload_header.excess_blob_gas,
93-
deposit_receipts_root=Root(), # [New in Electra:EIP6110]
93+
deposit_requests_root=Root(), # [New in Electra:EIP6110]
9494
withdrawal_requests_root=Root(), # [New in Electra:EIP7002],
9595
)
9696

@@ -146,7 +146,7 @@ def upgrade_to_electra(pre: deneb.BeaconState) -> BeaconState:
146146
# Deep history valid from Capella onwards
147147
historical_summaries=pre.historical_summaries,
148148
# [New in Electra:EIP6110]
149-
deposit_receipts_start_index=UNSET_DEPOSIT_RECEIPTS_START_INDEX,
149+
deposit_requests_start_index=UNSET_DEPOSIT_REQUESTS_START_INDEX,
150150
# [New in Electra:EIP7251]
151151
deposit_balance_to_consume=0,
152152
exit_balance_to_consume=0,

specs/electra/validator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def compute_on_chain_aggregate(network_aggregates: Sequence[Attestation]) -> Att
8080

8181
```python
8282
def get_eth1_pending_deposit_count(state: BeaconState) -> uint64:
83-
eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_receipts_start_index)
83+
eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_requests_start_index)
8484
if state.eth1_deposit_index < eth1_deposit_index_limit:
8585
return min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index)
8686
else:

0 commit comments

Comments
 (0)