Skip to content

Feat/archival resilience - #475

Open
akinboyewaSamson wants to merge 7 commits into
ZyntariHQ:mainfrom
akinboyewaSamson:feat/archival-resilience
Open

Feat/archival resilience#475
akinboyewaSamson wants to merge 7 commits into
ZyntariHQ:mainfrom
akinboyewaSamson:feat/archival-resilience

Conversation

@akinboyewaSamson

Copy link
Copy Markdown

closes #465

Summary

This PR overhauls the TTL management and archival behavior of the invoice-payment contract to ensure that critical audit logs and payment history remain discoverable and recoverable even after ledger archival. It moves the contract away from a short touch-to-live expiration strategy to an explicit retention policy.

Related Issue(s)

Type of Change

  • Feature
  • Fix
  • Refactor
  • Documentation
  • Chore

Description

  • TTL Strategy Overhaul: Increased MIN_TTL to 3,153,600 ledgers (~6 months) and BUMP_TTL to 6,312,000 ledgers (~1 year).
  • Archival Error Handling: Implemented existence checking using the SDK's has() and get() functions. A PaymentArchived = 22 error code is explicitly returned when an entry has been archived rather than treating it as missing.
  • Client & Backend Enhancements: PaymentHistoryPage now differentiates between missing history slots with archived_skipped and corrupt_skipped rather than a generic gaps_skipped. The TypeScript client definitions (types.ts, codec.ts, and error-manifest.ts) were updated to reflect this.
  • Ops Tooling:
    • Added an extend_history_ttl admin entry point in lib.rs and the TS client for batched extensions of historical index records.
    • Added an ops script, invoke-restore-payment.sh, that leverages stellar contract restore for manual operations recovery of archived footprints.
    • Enhanced the diagnostic tool history_index_status to scan the entire index and distinctly report intact, archived, and corrupted record counts.

Testing Evidence

  • Executed the full Rust suite via cargo test -p invoice-payment. All 168 tests, including newly implemented tests verifying index status reporting and administrative TTL extension rules, successfully pass.
  • Successfully built the updated TypeScript client using npm run build in soroban/client, verifying proper typings.

Screenshots

N/A - No UI visual behavior changes involved.

Checklist

  • Code builds successfully
  • Tests added/updated where applicable
  • Documentation updated if needed
  • Linked issue referenced
  • Ready for review

@Cedarich

Copy link
Copy Markdown
Contributor

@akinboyewaSamson

akinboyewaSamson and others added 5 commits August 25, 2026 04:52
…/methods

Add missing ERROR_DESC entries for AssetNotFound (21) and PaymentArchived (22).
Add missing METHOD_AUTH/METHOD_DESC entries for list_assets, allowlist_count,
rebuild_allowlist_index, and extend_history_ttl.

Regenerate schema.json to include all 22 errors and 27 methods so the
ABI drift CI check passes.

@Cedarich Cedarich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly reduce the change made to the files

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.

Define a retention policy and TTL strategy so payment records are not archived out of the audit log

3 participants