Skip to content

Storage archival recovery / resurrection strategy #149

Description

@ibrahimmosouf-png

Storage archival recovery / resurrection strategy

Labels: reliability, storage, priority/high
Difficulty: High · Effort: M
Backlog slot: 62

Problem Statement

Soroban's TTL model archives entries that are not bumped in time. The contract currently relies on read-path bump, but: (a) off-chain indexing clients do not call read paths, so their cached views go stale; (b) any code path that hasn't been touched for PERSISTENT_BUMP_THRESHOLD (≈30 days) can be archived silently; (c) there is no documented, end-to-end documented "what if archival happens" recovery playbook.

Why it Matters

  • Archival is not contract-level loss — it is observable in transaction results but produces panics for callers hitting archived entries without try_* variants.
  • A documented strategy with automated "resurrection" entrypoints is a bar all serious Soroban projects clear.

Technical Context

  • storage.rs::bump_persistent() is the only TTL extension.
  • get_milestone(env, index) panics on archived keys via unwrap_or_else.

Expected Outcome

  1. Add a public resurrect_storage(env) that recreates canonical DataKey entries (no-op if present, fresh reads if archived) and emits a storage_restored event.
  2. Document the playbook in docs/storage-recovery.md including failure modes for archived milestones when storage quota is exhausted.
  3. Add try_get_milestone non-panicking variant for off-chain indexers.

Acceptance Criteria

  • E2E test that archives a record, calls resurrect_storage, then asserts behaviour.
  • Docs published at docs/storage-recovery.md.
  • Off-chain node-operator runbook added to CONTRIBUTING.md.

Files Likely Affected

  • campaign/src/storage.rs, campaign/src/lib.rs, docs/storage-recovery.md

Dependencies

Issue #33.


Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26priority/highImported from .github/ISSUES_TO_CREATE.mdreliabilityImported from .github/ISSUES_TO_CREATE.mdstorageImported from .github/ISSUES_TO_CREATE.md

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions