darkfi::validator::utils

Function header_rank

Source
pub fn header_rank(
    header: &Header,
    target: &BigUint,
) -> Result<(BigUint, BigUint)>
Expand description

Verify provided header is valid for provided mining target and compute its rank.

Header’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).