_clampUserSums(u) exists to promote a staker's pre-risk deposit timestamps up to riskWindowStart once the active-risk window has opened, so their k=2 bonus score doesn't wrongly credit pre-risk calendar time. It is a no-op whenever riskWindowStart == 0 (window never opened yet).
withdraw() is only reachable when riskWindowStart == 0 -- the preceding guard reverts WithdrawsDisabled() for every other case. By the time execution reaches _clampUserSums(msg.sender) inside withdraw(), riskWindowStart == 0 is already guaranteed, so the call always hits _clampUserSums's own early return and never has any effect. It costs real gas (two SLOADs plus internal-call dispatch) on every single withdraw() for zero behavioral effect.
Likelihood:
Reason 1 Every successful withdraw() call reaches this dead call -- it's not conditional on any external state, it's structurally unreachable code within this one call site regardless of who calls it or when.
Reason 2 Any pool with active stakers who withdraw before risk materializes pays this cost on every single withdrawal, for the entire lifetime of every pool the factory ever creates.
Impact:
Impact 1 Modest but permanent gas overhead on a frequently-used user-facing function, for zero benefit -- pure waste compounding across every pool and every withdrawal, forever.
Impact 2 No fund-safety impact -- purely a gas/efficiency issue, correctly scoped as Low rather than a correctness finding.
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.