`adjustment_quotient` to use `previous_epoch`

This commit is contained in:
terence tsao 2021-05-09 17:08:54 -07:00 committed by GitHub
parent 637cf0743c
commit e38f758d21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -714,11 +714,11 @@ def process_pending_headers(state: BeaconState) -> None:
```python ```python
def charge_confirmed_header_fees(state: BeaconState) -> None: def charge_confirmed_header_fees(state: BeaconState) -> None:
new_gasprice = state.shard_gasprice new_gasprice = state.shard_gasprice
previous_epoch = get_previous_epoch(state)
adjustment_quotient = ( adjustment_quotient = (
get_active_shard_count(state, get_current_epoch(state)) get_active_shard_count(state, previous_epoch)
* SLOTS_PER_EPOCH * GASPRICE_ADJUSTMENT_COEFFICIENT * SLOTS_PER_EPOCH * GASPRICE_ADJUSTMENT_COEFFICIENT
) )
previous_epoch = get_previous_epoch(state)
previous_epoch_start_slot = compute_start_slot_at_epoch(previous_epoch) previous_epoch_start_slot = compute_start_slot_at_epoch(previous_epoch)
for slot in range(previous_epoch_start_slot, previous_epoch_start_slot + SLOTS_PER_EPOCH): for slot in range(previous_epoch_start_slot, previous_epoch_start_slot + SLOTS_PER_EPOCH):
for shard_index in range(get_active_shard_count(state, previous_epoch)): for shard_index in range(get_active_shard_count(state, previous_epoch)):