Normal behavior: once a pool reaches expiry, stakers should be able to call claimExpired() and recover their stake plus any owed bonus when the agreement has not been corrupted during the pool term. DESIGN.md states that resolving EXPIRED while the registry is still active-risk is correct because the agreement survived the term the stakers underwrote.
The issue is that pokeRiskWindow() can still be called after expiry while the pool is unresolved. If the registry is UNDER_ATTACK after the pool has already expired, anyone can call pokeRiskWindow() and set riskWindowStart to expiry. This makes the pool eligible for the auto-CORRUPTED backstop later, even though the observed risk started after the pool term ended.
Later, claimExpired() checks only whether riskWindowStart != 0. Since pokeRiskWindow() set it after expiry, the pool can auto-resolve as bad-faith CORRUPTED and sweep all funds to recoveryAddress.
Likelihood:
The pool expires before any active-risk state is observed.
The registry is later observed in UNDER_ATTACK or PROMOTION_REQUESTED.
Any permissionless caller calls pokeRiskWindow() before stakers call claimExpired().
The registry later reaches CORRUPTED, and the moderator does not resolve before the grace backstop.
Impact:
Stakers permanently lose all unclaimed principal and bonus.
The full pool balance is swept to recoveryAddress through the bad-faith CORRUPTED path.
The pool settles based on post-expiry risk, even though stakers only underwrote risk until expiry.
Add this test to test/unit/ClaimExpiredRegistryGate.t.sol.
Run:
Expected result:
This shows that 150 tokens of staker principal plus 30 bonus tokens are swept to recoveryAddress, while both stakers receive zero.
Do not allow pokeRiskWindow() to open a risk window after the pool has expired. Post-expiry resolution should go through claimExpired().
Alternatively, prevent _markRiskWindowStart() from setting riskWindowStart after expiry.
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.