Skip to content

Spike] Profile Soroban Instance vs Persistent DataKey Storage Rent & TTL Expiration Strategy #25

Description

@Darkvader-ship-it

Estimated Effort: 2 weeks / 8 days

Impacted Subsystems / Files:

  • contracts/phase-protocol/src/lib.rs
  • scripts/deploy-phase-sep50.ts

Context & Problem Statement:
Soroban ledger entries require active TTL rent bumps to avoid archiving. The contract in contracts/phase-protocol/src/lib.rs mixes instance storage with persistent storage across UserPhase, TokenOwner, and Collection data keys without automated bump logic, risking protocol lockout if storage entries expire.

Technical Requirements & Scope:

  1. Profile storage rent costs for all DataKey variants over 100,000 ledgers.
  2. Implement automated env.storage().persistent().extend_ttl() invocations inside high-frequency functions (settle, initiate_phase, transfer).
  3. Create a standalone TypeScript utility script in scripts/extend-protocol-ttl.ts that scans and extends storage TTLs for all protocol state entries.
  4. Document storage rent budgeting guidelines for protocol maintainers.

Multi-File Change Surface:
Touches contracts/phase-protocol/src/lib.rs storage invocation paths and adds deployment maintenance tooling under scripts/.

Acceptance Criteria:

  • All persistent contract keys automatically maintain minimum 30-day TTL buffer.
  • Script scripts/extend-protocol-ttl.ts executes successfully against testnet without hitting fee limits.

Suggested Approach / Investigation Steps:

  1. Simulate 6-month ledger advancement using Soroban test environment.
  2. Add extend_ttl calls inside contracts/phase-protocol/src/lib.rs.
  3. Validate TTL extension behavior using Stellar Expert explorer.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions