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

Package Upgrade documentation #10475

Merged
merged 9 commits into from
Apr 6, 2023
Merged

Conversation

ronny-mysten
Copy link
Contributor

Description

Documentation for package upgrades.

Test Plan

Locally


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

@ronny-mysten ronny-mysten requested a review from amnn April 6, 2023 08:14
@vercel
Copy link

vercel bot commented Apr 6, 2023

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

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Apr 6, 2023 4:43pm
explorer-storybook ⬜️ Ignored (Inspect) Apr 6, 2023 4:43pm
sui-wallet-kit ⬜️ Ignored (Inspect) Apr 6, 2023 4:43pm
wallet-adapter ⬜️ Ignored (Inspect) Apr 6, 2023 4:43pm

@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label Apr 6, 2023
TransferObjects([Result(0)],Input(0)),
]

Sender: <PUBLISHER-ID>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this the address of the package owner? Is it confusing to introduce a new ID type in this topic that is used only in this topic?

"AddressOwner": String("<PUBLISHER-ID>"),
},
"objectType": String("<ORIGINAL-PACKAGE-ID>::sui_package::<MODULE-NAME>"),
"objectId": String("<PUBLISHER-ID>"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the objectID matches the publisher ID?

]
```

The result includes an **Object changes** section with two pieces of information you need for upgrading, an `UpgradeCap` ID and your package ID.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it need the packageId? And this ID is not the ORIGINAL PACKAGE ID?


The result includes an **Object changes** section with two pieces of information you need for upgrading, an `UpgradeCap` ID and your package ID.

You can identify the different objects using the `Object.objectType` value in the response. The `UpgradeCap` entry has a value of `String("0x2::package::UpgradeCap")` and the `objectType` for the package reads `String("<PACKAGE-ID>::sui_package::<MODULE-NAME>")`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it calls out package ID but then says objectType - it took me a minute to see PACKAGE ID in the string. maybe call out that the objectType includes the package ID?


The `published-at` value allows the Move compiler to verify dependencies against on-chain versions of those packages.

After a while, you decide to upgrade your `sui_package` to include some requested features. Before running the `upgrade` command, you need to edit the manifest again. In the `[addresses]` section, you update the `sui_package` address value to `0x0` again so the validator issues a new address for the upgrade package. You can leave the `published-at` value the same, because it is only read by the toolchain when publishing a dependent package. The saved manifest now resembles the following:
Copy link
Contributor

@randall-Mysten randall-Mysten Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validator - Since this is a specific node type is there a different word to use here?

sui_package = "0x0"
```

With the new manifest and code in place, it's time to use the `sui client upgrade` command to upgrade your package. Pass the `UpgradeCap` ID to the `--upgrade-capability` flag.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the example output this is UPGRADE CAP ID

sui_package = "<ORIGINAL-PACKAGE-ID>"
```

The `published-at` value changes with every upgrade. The ID for the `sui_package` in the `[addresses]` section always points to the original ID after upgrading. You must always change that value back to `0x0`, however, before running the `upgrade` command so the validator knows to create a new ID for the upgrade.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original package ID

@ronny-mysten ronny-mysten enabled auto-merge (squash) April 6, 2023 16:43
@ronny-mysten ronny-mysten merged commit d49f514 into MystenLabs:main Apr 6, 2023
sblackshear pushed a commit to sblackshear/sui that referenced this pull request Apr 10, 2023
## Description 

Documentation for package upgrades.

## Test Plan 

Locally

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants