Contracts - Add storage TTL/bump management for persistent commitment entries
Description
The escrow contract writes commitments to persistent storage in contracts/escrow/src/lib.rs without bumping their TTL, risking entry expiry for long-duration commitments. Add TTL bump logic so active commitments persist for at least their full duration.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Bump persistent entry TTL on create and on each mutation
- Tie the TTL to the commitment
maturity
- Avoid unnecessary bumps to control fees
- Add tests in
contracts/escrow/src/test.rs exercising the bump calls
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/storage-ttl-bump
- Implement changes
- Add TTL bump calls in the
save/index_owner helpers in contracts/escrow/src/lib.rs
- Add tests in
contracts/escrow/src/test.rs
- Document TTL strategy in
contracts/README.md
- Add comments on fee tradeoffs
- Test and commit
- Run tests, cover edge cases
- Include test output and notes
Example commit message
feat: add persistent storage TTL bumps for commitments
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Contracts - Add storage TTL/bump management for persistent commitment entries
Description
The escrow contract writes commitments to persistent storage in
contracts/escrow/src/lib.rswithout bumping their TTL, risking entry expiry for long-duration commitments. Add TTL bump logic so active commitments persist for at least their full duration.Requirements and context
maturitycontracts/escrow/src/test.rsexercising the bump callsSuggested execution
git checkout -b feature/storage-ttl-bumpsave/index_ownerhelpers incontracts/escrow/src/lib.rscontracts/escrow/src/test.rscontracts/README.mdExample commit message
feat: add persistent storage TTL bumps for commitmentsGuidelines