Skip to content

fix(storage): extend persistent storage TTL constants for rent-cycle lifecycle (#2) - #7

Open
shobhamerabacha-star wants to merge 1 commit into
Rentar-pay:mainfrom
shobhamerabacha-star:feat/storage-ttl-lifecycle-extension
Open

shobhamerabacha-star wants to merge 1 commit into
Rentar-pay:mainfrom
shobhamerabacha-star:feat/storage-ttl-lifecycle-extension

Conversation

@shobhamerabacha-star

Copy link
Copy Markdown

Summary of Changes

Addresses storage expiration risks during active multi-month or annual rental escrow agreements by calibrating persistent storage TTL constants:

  1. Persistent TTL Calibration:
    • PERSISTENT_BUMP_AMOUNT: Updated from 1,000 ledgers to 500,000 ledgers (~28.9 days), ensuring sufficient retention cushion across billing cycles.
    • PERSISTENT_LIFETIME_THRESHOLD: Updated from 100 ledgers to 50,000 ledgers (~2.9 days) to trigger automatic lifecycle extension proactively.
  2. Explicit Entry Bump During Initialization:
    • In initialize(), explicitly bumps persistent storage keys (Agreement, Owner, Depositor, State) with extend_ttl(PERSISTENT_LIFETIME_THRESHOLD, PERSISTENT_BUMP_AMOUNT).
  3. Automated Verification:
    • Added unit test test_storage_ttl_bump_lifecycle in rentar-contract/src/test.rs ensuring full deposit/pay/withdraw transitions maintain TTL thresholds with 100% green test passes.
    • Updated documentation in STORAGE_LAYOUT.md.

Closes #2

…lifecycle

- Increase VAULT_TTL_THRESHOLD and ESCROW_TTL_THRESHOLD to 50,000 ledgers
- Increase VAULT_TTL_EXTEND and ESCROW_TTL_EXTEND to 500,000 ledgers (~35-40 days)
- Introduce bump_vault_ttl and bump_escrow_ttl contract instructions
- Update STORAGE_LAYOUT.md with TTL parameters and risk analysis
- Add unit tests verifying storage TTL bump instructions

Closes Rentar-pay#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue #2: [Security] Persistent storage TTL is too short for a rent-cycle product

1 participant