Skip to content

Implement Soroban storage expiration tracking and renewal utilities #502

Description

@Just-Bamford

Description

Problem

Soroban storage entries have expiration requirements, but Sorokit does not provide a high-level mechanism for inspecting expiration state, estimating renewal requirements, or identifying storage approaching its expiration threshold.

Solution

Create storage expiration utilities that inspect contract entries, calculate their remaining lifetime, and generate renewal operations when required. Support configurable warning thresholds and optional automatic renewal workflows.

Acceptance Criteria

  • calculateStorageRent(contractId) exposes estimated renewal requirements
  • Storage entries can be evaluated for current and projected expiration
  • renewContractStorage(contractId) builds the required renewal operation
  • Configurable warning thresholds identify entries nearing expiration
  • Auto-renewal can be explicitly enabled or disabled
  • Renewal failures expose structured error information
  • Tests cover active, near-expiry, expired, and renewal-failure scenarios
  • APIs are exported through src/soroban/index.ts and src/index.ts

Note for Contributors

Keep estimation separate from transaction submission. Avoid assuming a fixed network rent value when the required information can be obtained dynamically. Test expiration calculations around boundary conditions.

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend / SDK logicenhancementNew feature or requestsmart-contractSoroban contract related

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions