The bonus pool is meant to be split by a k=2 time-weighted score (amount × (T − entry)²), which crushes
late entrants to a near-zero share so that stakers who actually bore at-risk time earn the reward.
When the observed risk window has zero effective duration, globalScore evaluates to 0 and
_bonusShare falls back to a pure amount-weighted split. In that fallback a staker who entered late
with a large principal receives a share proportional to stake instead of the ~0 the time-weighting
intends, diluting the bonus owed to the stakers who bore the risk.
globalScore == 0 is reached whenever every deposit's effective (T − entry) collapses to zero:
riskWindowStart == riskWindowEnd (window opened and closed the same block), a window first observed
at/after expiry, or a riskWindowStart > riskWindowEnd inversion after a registry re-attack (which
underflow-guards every per-entry term to 0).
Likelihood:
Occurs when the BattleChain registry drives the pool through a zero-duration risk window — an
UNDER_ATTACK → PRODUCTION transition observed in the same block, or a PRODUCTION → UNDER_ATTACK
re-attack that seals riskWindowStart after riskWindowEnd.
Occurs only while no honest staker has sealed a positive-duration window via pokeRiskWindow(); in a
normal window the k=2 crush already defeats a late entrant.
Impact:
The bonus is redistributed toward raw principal, so a late whale can capture ~99% of the bonus a
risk-bearing early staker earned (measured in PoC: 299.7 / 300).
Bounded: principal is never lost and the pool stays solvent (conservation holds); the effect is
confined to the bonus pool and is registry-gated, not attacker-forceable.
test/audit/Escalation.t.sol — a whale with 1000× the honest staker's principal captures the bonus
under the fallback, yet no principal is lost and the bonus never over-distributes:
Make the degenerate case explicit rather than silently amount-weighting, and forbid the inverted window:
(Alternatively, keep the fallback but document it as an accepted redistribution in the payout natspec.)
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.