forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move: validate dependencies' published addresses (MystenLabs#8919)
## Description Validate `published-at` properties in `Move.toml` for all transitive package dependencies on `publish`. ## Test Plan Covered by existing `simtest` and publish tests. Added additional test to exercise the case where `published-at` is not set. --- 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) - [x] 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 Copied from `doc/in-progress/move_published_at_property.md`: > Package dependencies are now required to specify a `published-at` field in `Move.toml` that specifies the address that the dependency is published at. For example, The SUI framework is published at address `0x2`. So, the `Move.toml` file for the SUI framework has a corresponding line that says: > ```toml published-at = "0x2" ``` > > If your package depends on another package, like the SUI framework, your package will be linked against the `published-at` address specified by the SUI framework on-chain once you publish your package. When publishing, we resolve all of your package dependencies (i.e., transitive dependencies) to link against. This means we recommend publishing packages where all dependencies have a `published-at` address in their manifest. The publish command will fail by default if this is not the case. If needed, you may use the `--with-unpublished-dependencies` flag with the publish command to bypass the requirement that all dependencies require a `published-at` address. When using `--with-unpublished-dependencies`, all unpublished dependencies are treated as if they are part of your package.
- Loading branch information
1 parent
f39cb01
commit feb8654
Showing
22 changed files
with
249 additions
and
48 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
8 changes: 8 additions & 0 deletions
8
...c/unit_tests/data/custom_properties_in_manifest_dependency_invalid_published_at/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "CustomPropertiesInManifestDependencyInvalidPublishedAt" | ||
version = "0.0.0" | ||
# oops we put a non-ID value for published-at... | ||
published-at = "mystery" | ||
|
||
[addresses] | ||
main = "0x0" |
6 changes: 6 additions & 0 deletions
6
...ests/data/custom_properties_in_manifest_dependency_invalid_published_at/sources/main.move
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module main::main { | ||
public entry fun main() {} | ||
} |
8 changes: 8 additions & 0 deletions
8
...c/unit_tests/data/custom_properties_in_manifest_dependency_missing_published_at/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "CustomPropertiesInManifestDependencyMissingPublishedAt" | ||
version = "0.0.0" | ||
# oops we there's no published-at field, so a package that depends on us should fail when published... | ||
# published-at = "0x777" | ||
|
||
[addresses] | ||
main = "0x0" |
6 changes: 6 additions & 0 deletions
6
...ests/data/custom_properties_in_manifest_dependency_missing_published_at/sources/main.move
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module main::main { | ||
public entry fun main() {} | ||
} |
10 changes: 10 additions & 0 deletions
10
.../sui-core/src/unit_tests/data/custom_properties_in_manifest_ensure_published_at/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "CustomPropertiesInManifestEnsurePublishedAt" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
CustomPropertiesInManifestDependencyMissingPublishedAt = { local = "../custom_properties_in_manifest_dependency_missing_published_at" } | ||
CustomPropertiesInManifestDependencyInvalidPublishedAt = { local = "../custom_properties_in_manifest_dependency_invalid_published_at" } | ||
|
||
[addresses] | ||
main = "0x0" |
6 changes: 6 additions & 0 deletions
6
...e/src/unit_tests/data/custom_properties_in_manifest_ensure_published_at/sources/main.move
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module main::main { | ||
public entry fun main() {} | ||
} |
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.