Descriptions:
🔒 Security & Maintenance
Issue #6:
Developer Goal: Manage the "Time to Live" (TTL) for market data to prevent data loss due to Soroban's state expiration.
Files to Modify:
contracts/predict-iq/src/modules/markets.rs
contracts/predict-iq/src/modules/bets.rs
Detailed Logic:
- State Types: Distinguish between
Instance (contract config/counters) and Persistent (large market data).
- Bumping Strategy:
- Every bet placed must call
e.storage().persistent().bump_ttl(&DataKey::Market(id), LOW_THRESHOLD, HIGH_THRESHOLD).
LOW_THRESHOLD: ~1 day (ledger depth).
HIGH_THRESHOLD: ~30 days (ledger depth).
- Archiving: Implement a
prune_market(id) function that can only be called 30 days after a market is Resolved and all prizes are claimed.
Verification Checklist:
Descriptions:
🔒 Security & Maintenance
Issue #6:
Developer Goal: Manage the "Time to Live" (TTL) for market data to prevent data loss due to Soroban's state expiration.
Files to Modify:
contracts/predict-iq/src/modules/markets.rscontracts/predict-iq/src/modules/bets.rsDetailed Logic:
Instance(contract config/counters) andPersistent(large market data).e.storage().persistent().bump_ttl(&DataKey::Market(id), LOW_THRESHOLD, HIGH_THRESHOLD).LOW_THRESHOLD: ~1 day (ledger depth).HIGH_THRESHOLD: ~30 days (ledger depth).prune_market(id)function that can only be called 30 days after a market isResolvedand all prizes are claimed.Verification Checklist:
soroban-clito inspect the TTL of a market entry after multiple bets. Verify it stays above the minimum threshold.git checkout -b features/issue-1-advanced-payout-rewardsdevelopbranch[ ]git checkout -b features/issue-6-State Footprint & TTL Management (Persistent Storage)developbranch