Skip to content

[#196] Define storage TTL policy and safe terminal cleanup - #204

Merged
arisu6804 merged 2 commits into
RemitFlow:mainfrom
Baskarayelu:feat/issue-196-ttl-policy
Aug 27, 2026
Merged

[#196] Define storage TTL policy and safe terminal cleanup#204
arisu6804 merged 2 commits into
RemitFlow:mainfrom
Baskarayelu:feat/issue-196-ttl-policy

Conversation

@Baskarayelu

Copy link
Copy Markdown

Summary

  • Define explicit TTL classes for instance state, active transfers, terminal transfers, caller allowlists, and account operation counters.
  • Centralize persistent TTL bumps behind monotonic, threshold-based storage helpers.
  • Move AccountOpCount to its declared persistent storage tier and apply a dedicated quota TTL.
  • Add permissionless, idempotent terminal-transfer cleanup with a hard 20-id batch bound.
  • Preserve pending escrow records and all settlement/accounting behavior; add policy documentation and regression coverage.

Design notes

extend_ttl is threshold-based and monotonic, so repeated writes are idempotent for healthy entries while records in their renewal window are restored to the class horizon. Terminal records use a shorter retention class for future terminal writes, while existing longer TTLs are never shortened.

Cleanup is direct-key and bounded. It only removes Claimed or Cancelled records, ignores pending/missing/repeated ids, never scans the transfer counter, and does not change escrow liability or account quotas.

Validation

  • cargo test --lib — 140 passed, 4 pre-existing ignored.
  • cargo fmt --all -- --check
  • git diff --cached --check
  • Budget regression measures a full 20-id cleanup request and enforces the default CPU ceiling.

Closes #196

@arisu6804
arisu6804 merged commit 8c58cdd into RemitFlow:main Aug 27, 2026
0 of 3 checks passed
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.

perf(contract): define TTL policy for transfers, callers, and admin state

2 participants