mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-12 19:54:34 +00:00
samples -> samples_length
This commit is contained in:
parent
424f838747
commit
fc3e651817
@ -437,13 +437,13 @@ def compute_previous_slot(slot: Slot) -> Slot:
|
||||
#### `compute_updated_sample_price`
|
||||
|
||||
```python
|
||||
def compute_updated_sample_price(prev_price: Gwei, samples: uint64, active_shards: uint64) -> Gwei:
|
||||
def compute_updated_sample_price(prev_price: Gwei, samples_length: uint64, active_shards: uint64) -> Gwei:
|
||||
adjustment_quotient = active_shards * SLOTS_PER_EPOCH * SAMPLE_PRICE_ADJUSTMENT_COEFFICIENT
|
||||
if samples > TARGET_SAMPLES_PER_BLOB:
|
||||
delta = max(1, prev_price * (samples - TARGET_SAMPLES_PER_BLOB) // TARGET_SAMPLES_PER_BLOB // adjustment_quotient)
|
||||
if samples_length > TARGET_SAMPLES_PER_BLOB:
|
||||
delta = max(1, prev_price * (samples_length - TARGET_SAMPLES_PER_BLOB) // TARGET_SAMPLES_PER_BLOB // adjustment_quotient)
|
||||
return min(prev_price + delta, MAX_SAMPLE_PRICE)
|
||||
else:
|
||||
delta = max(1, prev_price * (TARGET_SAMPLES_PER_BLOB - samples) // TARGET_SAMPLES_PER_BLOB // adjustment_quotient)
|
||||
delta = max(1, prev_price * (TARGET_SAMPLES_PER_BLOB - samples_length) // TARGET_SAMPLES_PER_BLOB // adjustment_quotient)
|
||||
return max(prev_price, MIN_SAMPLE_PRICE + delta) - delta
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user