Skip to content

Implement contract dependency resolution and version management #498

Description

@Just-Bamford

Description

Problem

Sorokit currently lacks a consistent way to model dependencies between Soroban contracts. Applications integrating multiple contracts must manually track required contract versions and can encounter runtime failures when a dependency changes or becomes incompatible.

Solution

Introduce a contract dependency resolver that builds a dependency graph from contract metadata, tracks required versions, and validates compatibility before a contract is used. The resolver should detect conflicting version requirements and expose enough context for callers to understand which dependency caused the conflict.

Support cached dependency metadata and explicit refresh so applications can avoid unnecessary network requests while still detecting upgrades.

Acceptance Criteria

  • Contract dependencies can be registered and represented as a dependency graph
  • Dependency versions are tracked and validated against required constraints
  • Conflicting or incompatible versions return a structured Sorokit error
  • Nested/transitive dependencies are resolved correctly
  • Dependency metadata supports configurable caching and refresh
  • Resolution does not enter infinite loops when circular dependencies exist
  • Tests cover direct, nested, conflicting, circular, and missing dependencies
  • Public APIs are exported through src/soroban/index.ts and src/index.ts

Note for Contributors

Review the existing Soroban contract metadata and client patterns before introducing new abstractions. Keep dependency resolution separate from contract invocation so existing callers remain backward compatible. Include tests for both successful resolution and failure paths.

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