Skip to content

#159 Add storage TTL management with automatic instance and persistent state extension#207

Open
webdevayo wants to merge 1 commit into
BCPathway:mainfrom
webdevayo:feature/159-storage-ttl-management
Open

#159 Add storage TTL management with automatic instance and persistent state extension#207
webdevayo wants to merge 1 commit into
BCPathway:mainfrom
webdevayo:feature/159-storage-ttl-management

Conversation

@webdevayo
Copy link
Copy Markdown

Summary

Implements full Storage TTL (Time-To-Live) management across all smart contracts to prevent on-chain state from expiring. This ensures balances, allowances, lockups, and instance storage remain valid as long as the contract is actively used.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Smart contract improvement
  • 🧪 Test coverage improvement
  • 🏗️ CI/Build improvement

Related Issue

Closes #159

Changes Made

  • Implemented centralized TTL management for instance and persistent storage
  • Extended instance TTL on every public contract entry function
  • Added TTL refresh for balances, allowances, and lockup storage
  • Introduced extend_balance_ttl(address) for user-level balance TTL extension
  • Added extend_ttl() for instance-level TTL management
  • Ensured expired balances and allowances safely return 0 instead of failing
  • Added lockup TTL handling for lock and withdraw operations
  • Added regression tests for TTL persistence and recovery scenarios
  • Verified all public functions manually for TTL injection coverage via static inspection (grep + code walkthrough)

Testing

How has this been tested?

  • Rust unit tests pass (cargo test) — executed via CI due to local Cargo registry/DNS limitations
  • SDK compiles (npm run build in sdk/)
  • Manual testing against Soroban testnet
  • New tests added for changes

Test commands run:

# Contract tests (run in CI due to local network limitations)
cargo test

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@webdevayo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add storage TTL management with automatic instance and persistent data extension

1 participant