Skip to content

Contracts - Add storage TTL/bump management for persistent commitment entries #468

@1nonlypiece

Description

@1nonlypiece

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

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions