-
Notifications
You must be signed in to change notification settings - Fork 35
Feature: Add smart contract storage optimization with TTL management #85
Copy link
Copy link
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programenhancementNew feature or requestNew feature or requestmediumDifficulty: MediumDifficulty: Mediumsmart-contractsSoroban smart contractsSoroban smart contracts
Description
Problem
Smart contract storage entries don't have explicit TTL (time-to-live) management. Soroban charges rent for persistent storage, and unused entries waste funds.
Context
Efficient storage management reduces operational costs and keeps the contract lean.
Proposed Solution
- Set appropriate TTLs for different data types
- Implement cleanup functions for expired data
- Use
temporarystorage for short-lived data (e.g., flash loan guards) - Use
instancestorage for frequently accessed globals
Acceptance Criteria
- Storage types chosen appropriately (temporary vs persistent vs instance)
- TTL set for all persistent entries
- Cleanup function for expired entries
- Tests verify TTL behavior
Technical Notes
- Files: All contract modules that use
env.storage() - Soroban storage types:
temporary,persistent,instance
Constraints
- Must not delete data that's still needed
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programenhancementNew feature or requestNew feature or requestmediumDifficulty: MediumDifficulty: Mediumsmart-contractsSoroban smart contractsSoroban smart contracts