Skip to content

[High] Test lifecycle correctness when persistent entries are archived and restored mid-flight #418

Description

@james2177

Description:
Soroban archives persistent entries whose TTL lapses, and they have to be restored before use. Build tests that force archival of each key type (the intent, solver, bond, fill history, proof, and idempotency keys) at every lifecycle stage. Assert that the contract behaves safely, either failing loudly or working after restore, and never silently treats archived as absent.

Problem Statement & Context:
"Absent" and "archived" look similar to naive code. An archived ExtensionGranted or proof replay key that reads as false or None enables a double extension or a replay.

Scope & Acceptance Criteria:

  • A test per key type per relevant state, using the testutils ledger TTL controls.
  • Identify every has() / get().unwrap_or(default) whose default would be unsafe if the entry were archived, and fix each one (a longer TTL, a tombstone, or keeping it with the parent record).
  • Document the findings in docs/145-*.md or a new archival doc.
  • Out of scope: off-chain restore automation.

Implementation Guidelines:

  1. Key Files/Modules: all contracts' storage helpers, and the test files.
  2. Design/Architecture: Replay and one-shot flags must live at least as long as the thing they guard.
  3. Edge Cases/Constraints: Behaviour differences between the test environment and the network for archived reads. Confirm them against the Soroban docs.
  4. Testing: As described in the scope.

Definition of "Done":

  • Tests plus fixes merged, and the doc updated.
  • Reviewed and approved.

Resources:

Complexity: High (200 points)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programhigh (200 pts)Drips Wave complexity: high, 200 pointssecuritySecurity hardening or audit finding

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions