"""Smith sub-WoT threshold criterion. The Smith criterion requires a minimum number of votes from Smith members (forgerons) for certain decisions to be valid. Formula: ceil(SmithWotSize ^ S) """ from __future__ import annotations import math def smith_threshold(smith_wot_size: int, exponent: float = 0.1) -> int: """Compute the minimum number of Smith member votes required. Parameters ---------- smith_wot_size: Number of active Smith members. exponent: S in the formula ``ceil(smith_wot_size^S)``. Returns ------- int Minimum Smith votes required. """ if smith_wot_size <= 0: raise ValueError("smith_wot_size doit etre strictement positif") return math.ceil(smith_wot_size ** exponent)