Skip to content

Add storage.rs TTL-pressure preflight returning required-extension estimate #673

Description

@greatest0fallt1me

Description

storage.rs extends TTLs but never tells callers how close keys are to archival. Add a preflight StorageTtlPressure { key, remaining_ledgers, recommended_bump } query so off-chain agents can pre-warm long-running markets before TTL expiry.

Requirements and Context

  • Pure read function, no mutation
  • Returns structured result; bounded result set
  • Driven by current Env::ledger().sequence()
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b feature/storage-ttl-pressure-preflight
  2. Implement changes
    • contracts/predictify-hybrid/src/storage.rs
    • contracts/predictify-hybrid/src/storage_layout_tests.rs
  3. Test and commit
    • cargo test -p predictify-hybrid ttl_pressure
    • Cover edge cases
    • Include test output and notes in the PR

Example commit message

feat: add TTL pressure preflight query to storage module

Acceptance Criteria

  • Query returns deterministic ordering by remaining_ledgers ascending
  • No state mutation under any branch
  • Recommended bump never exceeds maximum allowed extension

Guidelines

  • No unwrap() in production paths
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaign taskOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programenhancementNew feature or improvementrustRust implementationsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions