-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move: support automated address management (#17995)
## Description This PR adds automated address management support for `sui client publish` and `sui client upgrade`. The `chain_id` is resolved early in sui commands and propagated down where published ID resolution is needed. 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: docs to follow and merge at the same time as this PR, particularly [this section on upgrades](https://docs.sui.io/concepts/sui-move-concepts/packages/upgrade#example) - Note after this PR it is still required to set `[addresses]` to `0x0` in `Move.toml`. This requirement will be removed subsequently (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) - Existing e2e tests pass (and SDK tests now resolve chain ID for publish commands) --- ## 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: - [x] CLI: Running `sui client publish` or `sui client upgrade` will now cause package addresses to be tracked in the `Move.lock` file. This removes the need to manually record or edit `published-at` addresses in the `Move.toml` file going forward. See docs PR #18433 for full details. - [ ] Rust SDK:
- Loading branch information
1 parent
74616f0
commit 56f9c65
Showing
15 changed files
with
321 additions
and
67 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.