ConfidencePool.stake() records each deposit with an entry timestamp. Pre-risk deposits are later promoted to riskWindowStart by _clampUserSums(), while deposits made after the risk window has opened should use the current block.timestamp directly.
The stake() function contains a defensive floor that attempts to move newEntry forward to riskWindowStart when newEntry < start. That branch is dead code. stake() observes the registry before newEntry is computed, so the first active-risk stake can only set riskWindowStart to the same block timestamp. Later stakes happen at timestamps greater than or equal to the already stored riskWindowStart.
Likelihood:
The unreachable check is evaluated whenever a stake is recorded while riskWindowStart is nonzero.
On the first active-risk stake, _observePoolState() sets riskWindowStart from the current block.timestamp before newEntry is loaded, making newEntry == start.
On every later stake, normal timestamp monotonicity makes the current block.timestamp greater than or equal to the stored riskWindowStart.
Impact:
No funds are at risk. Just a branch with dead code logic which is never reachable.
The dead branch makes the entry-time logic look more complex than it is, which can slow future review and maintenance.
Copy paste the given test in the ConfidencePool.riskWindow.t.sol to run it
Remove the unreachable floor and keep the entry timestamp as the current block timestamp.
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.