Expand description
Block difficulty adjustment calculations for contextual validation.
This module supports the following consensus rule calculations:
ThresholdBits
from the Zcash Specification,- the Testnet minimum difficulty adjustment from ZIPs 205 and 208, and
median-time-past
.
Structs§
- Adjusted
Difficulty 🔒 - Contains the context needed to calculate the adjusted difficulty for a block.
Constants§
- BLOCK_
MAX_ TIME_ SINCE_ MEDIAN - The maximum number of seconds between the
median-time-past
of a block, and the block’stime
field. - POW_
ADJUSTMENT_ BLOCK_ SPAN - The overall block span used for adjusting Zcash block difficulty.
- POW_
DAMPING_ FACTOR - The damping factor for median timespan variance.
- POW_
MAX_ ADJUST_ DOWN_ PERCENT - The maximum downward adjustment percentage for median timespan variance.
- POW_
MAX_ ADJUST_ UP_ PERCENT - The maximum upward adjustment percentage for median timespan variance.
- POW_
MEDIAN_ BLOCK_ SPAN - The median block span for time median calculations.