Rename MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING to MAX_PENDING_DEPOSITS_PER_EPOCH

This commit is contained in:
Mikhail Kalinin 2024-09-05 14:14:23 +06:00
parent 8c726ff723
commit 67cc3a5ac2
4 changed files with 9 additions and 9 deletions

View File

@ -47,4 +47,4 @@ MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8
# Pending deposits processing # Pending deposits processing
# --------------------------------------------------------------- # ---------------------------------------------------------------
# 2**4 ( = 4) pending deposits # 2**4 ( = 4) pending deposits
MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING: 16 MAX_PENDING_DEPOSITS_PER_EPOCH: 16

View File

@ -47,4 +47,4 @@ MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 1
# Pending deposits processing # Pending deposits processing
# --------------------------------------------------------------- # ---------------------------------------------------------------
# 2**4 ( = 4) pending deposits # 2**4 ( = 4) pending deposits
MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING: 16 MAX_PENDING_DEPOSITS_PER_EPOCH: 16

View File

@ -184,7 +184,7 @@ The following values are (non-configurable) constants used throughout the specif
### Pending deposits processing ### Pending deposits processing
| Name | Value | Description | | Name | Value | Description |
| - | - | - | | - | - | - |
| `MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING` | `uint64(2**4)` (= 16)| *[New in Electra:EIP6110]* Maximum number of pending deposits to process per epoch | | `MAX_PENDING_DEPOSITS_PER_EPOCH` | `uint64(2**4)` (= 16)| *[New in Electra:EIP6110]* Maximum number of pending deposits to process per epoch |
## Configuration ## Configuration
@ -896,7 +896,7 @@ def apply_pending_deposit(state: BeaconState, deposit: PendingDeposit) -> None:
Iterating over `pending_deposits` queue this function runs the following checks before applying pending deposit: Iterating over `pending_deposits` queue this function runs the following checks before applying pending deposit:
1. All Eth1 bridge deposits are processed before the first deposit request gets processed. 1. All Eth1 bridge deposits are processed before the first deposit request gets processed.
2. Deposit position in the queue is finalized. 2. Deposit position in the queue is finalized.
3. Deposit does not exceed the `MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING` limit. 3. Deposit does not exceed the `MAX_PENDING_DEPOSITS_PER_EPOCH` limit.
4. Deposit does not exceed the activation churn limit. 4. Deposit does not exceed the activation churn limit.
```python ```python
@ -924,7 +924,7 @@ def process_pending_deposits(state: BeaconState) -> None:
break break
# Check if number of processed deposits has not reached the limit, otherwise, stop processing. # Check if number of processed deposits has not reached the limit, otherwise, stop processing.
if next_deposit_index >= MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING: if next_deposit_index >= MAX_PENDING_DEPOSITS_PER_EPOCH:
break break
# Read validator state # Read validator state

View File

@ -194,7 +194,7 @@ def test_process_pending_deposits_not_finalized(spec, state):
def test_process_pending_deposits_limit_is_reached(spec, state): def test_process_pending_deposits_limit_is_reached(spec, state):
# set pending deposits to the maximum # set pending deposits to the maximum
amount = spec.EFFECTIVE_BALANCE_INCREMENT * 1 amount = spec.EFFECTIVE_BALANCE_INCREMENT * 1
for i in range(spec.MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING + 2): for i in range(spec.MAX_PENDING_DEPOSITS_PER_EPOCH + 2):
wc = state.validators[i].withdrawal_credentials wc = state.validators[i].withdrawal_credentials
pd = prepare_pending_deposit(spec, i, amount, withdrawal_credentials=wc, signed=True) pd = prepare_pending_deposit(spec, i, amount, withdrawal_credentials=wc, signed=True)
state.pending_deposits.append(pd) state.pending_deposits.append(pd)
@ -209,10 +209,10 @@ def test_process_pending_deposits_limit_is_reached(spec, state):
# deposit_balance_to_consume was reset to 0 # deposit_balance_to_consume was reset to 0
assert state.deposit_balance_to_consume == 0 assert state.deposit_balance_to_consume == 0
# no deposits above limit were processed # no deposits above limit were processed
assert state.pending_deposits == new_pending_deposits[spec.MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING:] assert state.pending_deposits == new_pending_deposits[spec.MAX_PENDING_DEPOSITS_PER_EPOCH:]
for i in range(spec.MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING): for i in range(spec.MAX_PENDING_DEPOSITS_PER_EPOCH):
assert state.balances[i] == pre_balances[i] + amount assert state.balances[i] == pre_balances[i] + amount
for i in range(spec.MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING, spec.MAX_PENDING_DEPOSITS_PER_EPOCH_PROCESSING + 2): for i in range(spec.MAX_PENDING_DEPOSITS_PER_EPOCH, spec.MAX_PENDING_DEPOSITS_PER_EPOCH + 2):
assert state.balances[i] == pre_balances[i] assert state.balances[i] == pre_balances[i]