Description
RecoveryStorage in recovery.rs persists MarketRecovery records for emergency procedures, but unbounded recovery history grows persistent storage and rent cost over time. Add an upper bound on retained recovery records per market plus an admin prune entrypoint, mirroring the existing event-archive pruning.
Requirements and Context
- Cap retained recovery records in
contracts/predictify-hybrid/src/recovery.rs.
- Add an admin-gated prune function (with
require_auth) and expose it via lib.rs.
- Ensure pruning never removes the active recovery state of an unresolved market.
- 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/recovery-history-bounds
- Implement changes
contracts/predictify-hybrid/src/recovery.rs, contracts/predictify-hybrid/src/lib.rs
- Test and commit
cargo test -p predictify-hybrid -- recovery
- Cover edge cases: prune with active recovery present, prune count > stored
- Include test output and notes in the PR
Example commit message
feat: bound recovery history and add admin prune
Acceptance Criteria
Guidelines
- Minimum 95% coverage on touched code, validate auth and storage growth bounds
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
RecoveryStorageinrecovery.rspersistsMarketRecoveryrecords for emergency procedures, but unbounded recovery history grows persistent storage and rent cost over time. Add an upper bound on retained recovery records per market plus an admin prune entrypoint, mirroring the existing event-archive pruning.Requirements and Context
contracts/predictify-hybrid/src/recovery.rs.require_auth) and expose it vialib.rs.Suggested Execution
contracts/predictify-hybrid/src/recovery.rs,contracts/predictify-hybrid/src/lib.rscargo test -p predictify-hybrid -- recoveryExample commit message
Acceptance Criteria
Guidelines