Expand description
DarkFi PoW module
Structsยง
- This struct represents the information required by the PoW algorithm
Constantsยง
- How many most recent blocks to use to verify new blocksโ timestamp
- Time limit in the future of what blocks can be
- BUF_
SIZE ๐Ring buffer length. Must be == DIFFICULTY_WINDOW + DIFFICULTY_LAG - CUT_
BEGIN ๐Already known cutoff start index for this config - CUT_END ๐Already known cutoff end index for this config
- DIFFICULTY_
WINDOW ๐Amount of max items(blocks) to use for next difficulty calculation. Must be >= 2 and == BUF_SIZE - DIFFICULTY_LAG. - RETAINED ๐Max items to use for next difficulty calculation. Must be DIFFICULTY_WINDOW - 2 * DIFFICULTY_CUT
- _DIFFICULTY_
CUT ๐Used to calculate how many items to retain for next difficulty calculation. We are keeping the middle items, meaning cutting both from frond and back of the ring buffer, ending up with max DIFFICULTY_WINDOW - 2DIFFICULTY_CUT items. (2DIFFICULTY_CUT <= DIFFICULTY_WINDOW-2) must be true. - _DIFFICULTY_
LAG ๐Amount of latest blocks to exlude from the calculation. Our ring buffer has length: DIFFICULTY_WINDOW + DIFFICULTY_LAG, but we only use DIFFICULTY_WINDOW items in calculations. Must be == BUF_SIZE - DIFFICULTY_WINDOW.
Functionsยง
- Mine provided block, based on provided PoW module next mine target.