sui icon indicating copy to clipboard operation
sui copied to clipboard

move: automated address mgmt for pkg upgrades

Open rvantonder opened this issue 1 year ago • 1 comments
trafficstars

Description

This PR adds automated address management support for sui client upgrade. I'm building this out iteratively so that it's easier to reason about and ensure backwards-compatibility during the transition when a package does not yet have info tracking in Move.lock (i.e., supporting package publish will come next).

High-level:

  • If a package contains a Move.lock that contains info to support a package upgrade, then that is used, and a user does not have to (nor should they) maintain a published-at address in their Move.toml.

  • If a package does not have any Move.lock information to support a package upgrade, we will still fallback to Move.toml as we do today. Nothing changes.

  • If a package has both a Move.lock and Move.toml, then the Move.lock will be used (the user is free to delete published-at in their Move.toml). Caveat: If a published address is in both of these files, they must be the same (we will raise a Conflict error message otherwise).

  • Note after this PR it is still required to set [addresses] to 0x0 in Move.toml. This requirement will be removed after publish support is added (which also requires setting to 0x0 still). I didn't want to meddle with that logic all at once.

Test plan

How did you test the new or updated feature?

We cover three cases:

  • Upgrade with Move.toml only (existing package upgrade test)
  • Upgrade with Move.lock only (extension of existing package management test)
  • Upgrade with Move.lock and Move.toml with conflicting addresses error condition (new test)

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • [ ] Protocol:
  • [ ] Nodes (Validators and Full nodes):
  • [ ] Indexer:
  • [ ] JSON-RPC:
  • [ ] GraphQL:
  • [ ] CLI:
  • [ ] Rust SDK:

rvantonder avatar May 25 '24 00:05 rvantonder

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2024 11:38pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 26, 2024 11:38pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 26, 2024 11:38pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 26, 2024 11:38pm

vercel[bot] avatar May 25 '24 00:05 vercel[bot]

thanks for your enthusiasm @stefan-mysten! There is a snag and I need to update some things in this PR, but we are indeed close!!

rvantonder avatar May 29 '24 20:05 rvantonder

thanks for your enthusiasm @stefan-mysten! There is a snag and I need to update some things in this PR, but we are indeed close!!

Cool, let me know when that's fixed and I will get a review in!

stefan-mysten avatar May 30 '24 05:05 stefan-mysten