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: versioned toolchain compilation to verify source (MystenLabs#15731
) ## Description Implements versioned toolchain builds to verify bytecode when publishing packages. That is, on `publish`, verifies package dependencies and compiles modules with prior compiler versions if needed. Guarded by `SUI_RUN_TOOLCHAIN_BUILD`. discussion. ## Test Plan Added a test that requires a dep to compile with the current compiler by reading from Move.lock. Supporting a prior compiler is TBD. All new functionality gated for now by `SUI_RUN_TOOLCHAIN_BUILD`. --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] 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
- Loading branch information
1 parent
f60db87
commit 169b592
Showing
13 changed files
with
734 additions
and
140 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "sui-source-validation" | ||
version = "0.1.0" | ||
version.workspace = true | ||
authors = ["Mysten Labs <[email protected]>"] | ||
license = "Apache-2.0" | ||
publish = false | ||
|
@@ -11,7 +11,9 @@ path = "src/lib.rs" | |
|
||
[dependencies] | ||
anyhow.workspace = true | ||
colored.workspace = true | ||
thiserror.workspace = true | ||
tracing.workspace = true | ||
futures.workspace = true | ||
|
||
sui-json-rpc-types.workspace = true | ||
|
@@ -20,12 +22,20 @@ sui-sdk.workspace = true | |
sui-move-build.workspace = true | ||
|
||
move-binary-format.workspace = true | ||
move-bytecode-source-map.workspace = true | ||
move-command-line-common.workspace = true | ||
move-compiler.workspace = true | ||
move-core-types.workspace = true | ||
move-package.workspace = true | ||
move-symbol-pool.workspace = true | ||
|
||
tar.workspace = true | ||
tempfile.workspace = true | ||
flate2.workspace = true | ||
ureq.workspace = true | ||
workspace-hack.workspace = true | ||
|
||
|
||
[dev-dependencies] | ||
|
||
expect-test.workspace = true | ||
|
10 changes: 10 additions & 0 deletions
10
crates/sui-source-validation/fixture/versioned-a-depends-on-b/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 = "a" | ||
version = "0.0.1" | ||
published-at = "$STORAGE_ID" | ||
|
||
[dependencies] | ||
b = { local = "../versioned-b" } | ||
|
||
[addresses] | ||
a = "$RUNTIME_ID" |
11 changes: 11 additions & 0 deletions
11
crates/sui-source-validation/fixture/versioned-a-depends-on-b/sources/a.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,11 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module a::a { | ||
use b::b::b; | ||
use b::b::c; | ||
|
||
public fun a() : u64 { | ||
b() + c() | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
crates/sui-source-validation/fixture/versioned-b/Move.lock
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,11 @@ | ||
# @generated by Move, please check-in and do not edit manually. | ||
|
||
[move] | ||
version = 0 | ||
manifest_digest = "C70E0438875A0C3B10FA5995F317F701134E629D1B2E5F3DCA3621E50034F809" | ||
deps_digest = "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855" | ||
|
||
[move.toolchain-version] | ||
compiler-version = "$COMPILER_VERSION" | ||
edition = "legacy" | ||
flavor = "sui" |
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,7 @@ | ||
[package] | ||
name = "b" | ||
version = "0.0.2" | ||
published-at = "$STORAGE_ID" | ||
|
||
[addresses] | ||
b = "$RUNTIME_ID" |
12 changes: 12 additions & 0 deletions
12
crates/sui-source-validation/fixture/versioned-b/sources/b.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,12 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module b::b { | ||
public fun b(): u64 { | ||
42 | ||
} | ||
|
||
public fun c(): u64 { | ||
b() + 1 | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
crates/sui-source-validation/fixture/versioned-b/sources/c.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,8 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module b::c { | ||
public fun c(): u64 { | ||
43 | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
crates/sui-source-validation/fixture/versioned-b/sources/d.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,8 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module b::d { | ||
public fun d(): u64 { | ||
44 | ||
} | ||
} |
Oops, something went wrong.