Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Improve dependency management with network-agnostic packages and standardized address configuration #15949

Open
mshakeg opened this issue Feb 14, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@mshakeg
Copy link

mshakeg commented Feb 14, 2025

🚀 Feature Request

Enhance dependency management in Move packages by introducing standardized practices for network-agnostic dependencies and flexible address configuration, along with compiler support for address overrides.

Motivation

Currently, Move package developers face significant challenges when managing dependencies across different networks (testnet, mainnet, etc.). These issues are particularly evident with widely-used packages like ThalaLabs' FixedPoint64 (https://github.com/ThalaLabs/fixed_point64).

Key pain points:

  1. Network-Specific Package Revisions

    • Packages maintain different revisions/branches solely for network addresses (e.g., FixedPoint64 has "mainnet" and "dev-testnet" revs)
    • Forces developers to specify different revs of the same package just to get the correct network address
    • Creates artificial dependency conflicts when different dependency chains reference the same package but with different network-specific revs
  2. Address Override Limitations

    • Cannot override concrete addresses specified in dependency Move.toml files
    • Results in errors like:
      "Error": "Move compilation failed: Unable to resolve packages: Attempted to assign a different value '0x4dca...' to an already-assigned named address '0xf6ac...'"
      
  3. Dependency Resolution Conflicts

    • When different dependency chains require the same package but specified different revs(i.e. branches) to use the [addresses] that were required at the time of a particular network deployment, compilation fails:
      "Error": "Move compilation failed: Conflicting dependencies found: package 'FixedPoint64' conflicts with 'FixedPoint64'"
      
    • This would not be an issue if developers could consistently use the main rev/branch for the dependencies instead of having to toggle between branches for different networks.

Pitch

Describe the solution you'd like

  1. Standardized Package Structure

    • Require dependencies to maintain network-agnostic main branch
    • Move.toml in main branch uses placeholder addresses:
      [addresses]
      fixed_point64 = "_"
    • Network addresses documented in networks.toml:
      [aptos-mainnet]
      fixed_point64 = "0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9"
      
      [aptos-testnet]
      fixed_point64 = "0xf6ac92851b1fb5c94662c1cc3848b4e677bbdbd37df473a7c2af401d6fde402"
  2. Enhanced Compiler Features

    • Allow address overrides at any level in dependency chain
    • Recognize identical packages with different network addresses as the same package
    • Support cascading address resolution:
      1. Check parent package's networks.toml
      2. Check dependency's networks.toml
      3. Allow CLI override via --named-addresses
  3. Version Management

    • Package versions reflect code changes, not network deployments
    • Use tags/releases for actual functionality changes
    • Network addresses completely separated from version control

Describe alternatives you've considered

Branch-Based Network Configuration

  • Current approach (status quo)
  • Creates artificial dependency conflicts
  • Mixes deployment configuration with code versioning

Are you willing to open a pull request?

Not at the moment

Additional context

This proposal builds on and complements the network configuration feature request (#15938), adding specific improvements for dependency management.

This would significantly improve the developer experience by:

  • Eliminating network-specific dependency conflicts
  • Simplifying package versioning
  • Providing clear standards for package maintainers
  • Making address management more flexible and maintainable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant