Expand description
Chernoff lower-tail threshold for Binomial(S, p).
Threshold (additive Chernoff, lower tail): Let μ = S * p, where S is slots_in_epoch and p is per-slot win probability. t = sqrt( 2 * μ * ln(1/τ) ) r = floor( μ - t ), clamped to [0, S]
Property:
For X ~ Binomial(S, p), P[ X < r ] <= τ (conservative bound)
This holds for all p in [0,1] and any S.
Notes:
- Provide ln(1/τ) as a FixedU128 constant (precomputed off-chain).
- Examples: τ = 1% => ln(100) ≈ 4.605170185988092 -> inner ≈ 4_605_170_185_988_091_904 τ = 0.5% => ln(200) ≈ 5.298317366548036 -> inner ≈ 5_298_317_366_548_036_000 τ = 0.1% => ln(1000) ≈ 6.907755278982137 -> inner ≈ 6_907_755_278_982_137_000
- To decide throughput relevance before calling this (cheap filter), compute μ_floor = floor(S * p) and require μ_floor >= E_relevance (e.g., >= 10 for τ=1%).
Structs§
- Operator
Epoch Expectations - Expectations for one operator at epoch end (slots-based, Chernoff-calibrated).
Constants§
- E_BASE
- Threshold for number of bundles operator can produce based on their stake share. Operators whose expected bundles from their threshold < E_BASE will not be checked since they are not throughput relevant.
- LN_
1_ OVER_ TAU_ 1_ PERCENT - For τ = 1%: ln(1/τ) = ln(100) ≈ 4.605170185988092 Represent in FixedU128 by multiplying by 1e18 and rounding.
Functions§
- operator_
expected_ bundles_ in_ epoch - Compute epoch-end expectations for an operator using the exact VRF threshold. Returns None if the operator is not throughput-relevant this epoch.