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
- Fork the repo and create a branch
git checkout -b feature/storage-ttl-pressure-preflight
- Implement changes
contracts/predictify-hybrid/src/storage.rs
contracts/predictify-hybrid/src/storage_layout_tests.rs
- 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
Guidelines
- No
unwrap() in production paths
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
storage.rsextends TTLs but never tells callers how close keys are to archival. Add a preflightStorageTtlPressure { key, remaining_ledgers, recommended_bump }query so off-chain agents can pre-warm long-running markets before TTL expiry.Requirements and Context
Env::ledger().sequence()Suggested Execution
contracts/predictify-hybrid/src/storage.rscontracts/predictify-hybrid/src/storage_layout_tests.rscargo test -p predictify-hybrid ttl_pressureExample commit message
Acceptance Criteria
remaining_ledgersascendingGuidelines
unwrap()in production paths