-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[execution] Update to deps-only mode #20102
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...es/sui-core/src/unit_tests/data/move_upgrade/dep_only_upgrade_new_friend_module/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 = "package_upgrade_base" | ||
version = "0.0.1" | ||
edition = "2024.beta" | ||
|
||
[addresses] | ||
base_addr = "0x0" | ||
|
||
[dependencies] | ||
Sui = { local = "../../../../../../sui-framework/packages/sui-framework" } |
20 changes: 20 additions & 0 deletions
20
...ore/src/unit_tests/data/move_upgrade/dep_only_upgrade_new_friend_module/sources/base.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,20 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module base_addr::base { | ||
|
||
public struct A<T> { | ||
f1: bool, | ||
f2: T | ||
} | ||
|
||
public fun return_0(): u64 { abort 42 } | ||
|
||
public fun plus_1(x: u64): u64 { x + 1 } | ||
|
||
public(package) fun friend_fun(x: u64): u64 { x } | ||
|
||
fun non_public_fun(y: bool): u64 { if (y) 0 else 1 } | ||
|
||
entry fun entry_fun() { } | ||
} |
18 changes: 18 additions & 0 deletions
18
...nit_tests/data/move_upgrade/dep_only_upgrade_new_friend_module/sources/friend_module.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,18 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module base_addr::friend_module { | ||
|
||
public struct A<T> { | ||
field1: u64, | ||
field2: T | ||
} | ||
|
||
public fun friend_call(): u64 { base_addr::base::friend_fun(1) } | ||
|
||
public fun return_0(): u64 { 0 } | ||
|
||
public fun plus_1(x: u64): u64 { x + 1 } | ||
|
||
fun non_public_fun(y: bool): u64 { if (y) 0 else 1 } | ||
} |
6 changes: 6 additions & 0 deletions
6
...tests/data/move_upgrade/dep_only_upgrade_new_friend_module/sources/new_friend_module.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 base_addr::new_friend_module; | ||
|
||
public fun friend_call(): u64 { base_addr::base::friend_fun(1) } |
10 changes: 10 additions & 0 deletions
10
crates/sui-core/src/unit_tests/data/move_upgrade/dep_only_upgrade_new_module/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 = "package_upgrade_base" | ||
version = "0.0.1" | ||
edition = "2024.beta" | ||
|
||
[addresses] | ||
base_addr = "0x0" | ||
|
||
[dependencies] | ||
Sui = { local = "../../../../../../sui-framework/packages/sui-framework" } |
20 changes: 20 additions & 0 deletions
20
...s/sui-core/src/unit_tests/data/move_upgrade/dep_only_upgrade_new_module/sources/base.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,20 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module base_addr::base { | ||
|
||
public struct A<T> { | ||
f1: bool, | ||
f2: T | ||
} | ||
|
||
public fun return_0(): u64 { abort 42 } | ||
|
||
public fun plus_1(x: u64): u64 { x + 1 } | ||
|
||
public(package) fun friend_fun(x: u64): u64 { x } | ||
|
||
fun non_public_fun(y: bool): u64 { if (y) 0 else 1 } | ||
|
||
entry fun entry_fun() { } | ||
} |
18 changes: 18 additions & 0 deletions
18
...e/src/unit_tests/data/move_upgrade/dep_only_upgrade_new_module/sources/friend_module.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,18 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module base_addr::friend_module { | ||
|
||
public struct A<T> { | ||
field1: u64, | ||
field2: T | ||
} | ||
|
||
public fun friend_call(): u64 { base_addr::base::friend_fun(1) } | ||
|
||
public fun return_0(): u64 { 0 } | ||
|
||
public fun plus_1(x: u64): u64 { x + 1 } | ||
|
||
fun non_public_fun(y: bool): u64 { if (y) 0 else 1 } | ||
} |
4 changes: 4 additions & 0 deletions
4
...core/src/unit_tests/data/move_upgrade/dep_only_upgrade_new_module/sources/new_module.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,4 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module base_addr::new_module; |
10 changes: 10 additions & 0 deletions
10
crates/sui-core/src/unit_tests/data/move_upgrade/dep_only_upgrade_remove_module/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 = "package_upgrade_base" | ||
version = "0.0.1" | ||
edition = "2024.beta" | ||
|
||
[addresses] | ||
base_addr = "0x0" | ||
|
||
[dependencies] | ||
Sui = { local = "../../../../../../sui-framework/packages/sui-framework" } |
20 changes: 20 additions & 0 deletions
20
...ui-core/src/unit_tests/data/move_upgrade/dep_only_upgrade_remove_module/sources/base.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,20 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module base_addr::base { | ||
|
||
public struct A<T> { | ||
f1: bool, | ||
f2: T | ||
} | ||
|
||
public fun return_0(): u64 { abort 42 } | ||
|
||
public fun plus_1(x: u64): u64 { x + 1 } | ||
|
||
public(package) fun friend_fun(x: u64): u64 { x } | ||
|
||
fun non_public_fun(y: bool): u64 { if (y) 0 else 1 } | ||
|
||
entry fun entry_fun() { } | ||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to slice out the new module here, retry the publish, and see that it succeeds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have that exact test pretty much here: https://github.com/MystenLabs/sui/blob/main/crates/sui-core/src/unit_tests/move_package_upgrade_tests.rs#L573
This is the same package but without
new_module.move
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a slightly different from what I am asking. As it stands, it is not guaranteed that the error in this test from the fact that there is a new module.
If you take the modules list and splice it out, you would guarantee that within this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated so they all start from the valid
dep_only_upgrade
(which is verified in each unit test), and then files are explicitly added or removed from that.