Repository navigation
[CRITICAL] Persistent storage TTLs can expire before claims/refunds — user funds permanently locked #166
Copy link
Copy link
Closed
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third CampaignCampaign: Third CampaigncriticalCritical severity - funds at riskCritical severity - funds at riskttl-storageTTL / storage lifecycleTTL / storage lifecycle
Description
Activity
- addedcriticalCritical severity - funds at riskCritical severity - funds at riskttl-storageTTL / storage lifecycleTTL / storage lifecycleGrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third CampaignCampaign: Third Campaign
on Aug 23, 2026 GauravKarakoti commented
on Aug 23, 2026 More actionsAllow me to work on this one
Hi team,
I'd like to work on resolving this issue. Here is my proposed plan of approach to prevent user funds from becoming locked due to expiring persistent storage TTLs:
Plan of Approach
-
Implement Read-Path TTL Bumping:
- Update all four contracts (
BetEntry,RefundRecord, claim windows, and referral earnings) to invoke Soroban'sextend_ttlon every read/query path. - Ensure TTLs are dynamically extended upon interaction to prevent active entries from expiring during resolution or payout windows.
- Update all four contracts (
-
Align TTL Thresholds with Claim Lifecycles:
- Adjust storage TTL initial values to be relative to the maximum possible claim window duration rather than a fixed creation-time value.
-
Expose Public
bump_ttlFunction:- Implement a permissionless
bump_ttlentrypoint across contracts, allowing any user or keeper to refresh TTLs for storage entries approaching expiration.
- Implement a permissionless
-
Testing & Validation:
- Add unit tests simulating market resolution extensions to verify storage entries remain accessible throughout the entire claim window.
- Verify that read operations and public
bump_ttlcalls correctly extend storage lifetimes without corrupting state.
I can implement these TTL updates and test cases promptly.
-
grantfox-oss commented
on Aug 23, 2026 grantfox-ossboton Aug 23, 2026 – with GrantFox OSSAuthorMore actions- added a commit that references this issue
on Aug 30, 2026 grantfox-oss commented
on Aug 30, 2026 grantfox-ossboton Aug 30, 2026 – with GrantFox OSSAuthorMore actions🎉 This issue has been marked as completed on GrantFox!
@samjay8's PR #191 was approved and merged by @Muyideen-js.
🏆 @samjay8: You earned 40 FoxPoints for this contribution! Your current tier: Builder (2,220 total points). Track your full progress on GrantFox.
👏 Great work, @samjay8! Keep contributing to SPulse-Org.
- added a commit that references this issue
on Aug 31, 2026 - added a commit that references this issue
on Aug 31, 2026 - added a commit that references this issue
on Aug 31, 2026
Metadata
Metadata
Assignees
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third CampaignCampaign: Third CampaigncriticalCritical severity - funds at riskCritical severity - funds at riskttl-storageTTL / storage lifecycleTTL / storage lifecycle
Summary
All four contracts store user-claimable state (bet entries, refund records, claim windows, referral earnings) in persistent storage entries with fixed TTLs that are never extended on the read path. If a market resolves or a payout window extends beyond the original TTL, the storage entry expires and the data is permanently lost — the user can no longer claim their refund or payout.
Impact
Fix
extend_ttlor equivalent) for entries that hold claimable state.bump_ttlpublic function callable by anyone for entries close to expiry.