Skip to content

Implement storage TTL bumping and archival handling for stream entries in streampay-stream #262

@greatest0fallt1me

Description

@greatest0fallt1me

Description

Long-running streams may span days or weeks, so persistent stream entries and instance storage must have their TTLs extended to avoid archival mid-stream. This addresses the org's "durable long-running jobs / multi-day stream windows" concern at the contract layer.

Requirements and Context

  • Bump persistent entry TTL (env.storage().persistent().extend_ttl(...)) for a stream on every read/write in its money paths.
  • Bump instance TTL (env.storage().instance().extend_ttl(...)) for admin/count keys.
  • Define and document threshold/extend-to constants tuned for multi-day/multi-week streams.
  • Handle restore semantics so a stream survives the entire start_time..end_time window plus a buffer.
  • 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-archival
  2. Implement changes
    • contracts/contracts/streampay-stream/src/storage.rs (centralized TTL bump helpers + constants)
    • contracts/contracts/streampay-stream/src/lib.rs (call bumps in read/write paths)
    • contracts/contracts/streampay-stream/src/test.rs (advance ledger sequence, assert TTL extended)
  3. Test and commit
    • cd contracts && cargo test -p streampay-stream ttl
    • Cover edge cases (long window near max TTL, repeated bumps)
    • Include test output and notes in the PR

Example commit message

feat: extend storage TTL to survive long stream windows

Acceptance Criteria

  • Stream persistent entries have TTL extended on every money-path access
  • Instance storage TTL is extended for admin/count keys
  • TTL thresholds are named constants and documented
  • cargo test advances ledger and asserts entries remain live

Guidelines

  • .rs files under contracts/contracts/streampay-stream/src/; tests via cargo test; NatSpec-style /// docs; minimum 95% test coverage; tune TTL for multi-week streams
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programrustRust implementationsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions