darkfi::validator::utils

Function block_rank

Source
pub fn block_rank(block: &BlockInfo, target: &BigUint) -> (BigUint, BigUint)
Expand description

Compute a block’s rank, assuming that its valid, based on provided mining target.

Block’s rank is the tuple of its squared mining target distance from max 32 bytes int, along with its squared RandomX hash number distance from max 32 bytes int. Genesis block has rank (0, 0).