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

[cli 4.2.4] Preparing for CLI release #15027

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aptos-move/framework/src/built_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub struct BuildOptions {
default_value_if("move_2", "true", "2.0"))]
pub compiler_version: Option<CompilerVersion>,
#[clap(long, value_parser = clap::value_parser!(LanguageVersion),
default_value_if("move_2", "true", "2.0"))]
default_value_if("move_2", "true", "2.1"))]
pub language_version: Option<LanguageVersion>,
#[clap(long)]
pub skip_attribute_checks: bool,
Expand Down Expand Up @@ -139,8 +139,8 @@ impl BuildOptions {
pub fn move_2() -> Self {
BuildOptions {
bytecode_version: Some(VERSION_7),
language_version: Some(LanguageVersion::V2_0),
compiler_version: Some(CompilerVersion::V2_0),
language_version: Some(LanguageVersion::latest_stable()),
compiler_version: Some(CompilerVersion::latest_stable()),
..Self::default()
}
}
Expand Down
6 changes: 5 additions & 1 deletion crates/aptos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
All notable changes to the Aptos CLI will be captured in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and the format set out by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

## [4.2.4] - 2024/10/21
- Releasing Move 2.1, which adds compound assignments (`x += 1`) and loop labels to the language. See [Move 2 Release Notes](https://aptos.dev/en/build/smart-contracts/book/move-2).
- multiple bug fixes in the Move 2 compilation chain.
- `aptos move fmt` formats move files inside the `tests` and `examples` directory of a package.
- Add `aptos update prover-dependencies`, which installs the dependency of Move prover, boogie, z3 and cvc5.
- Added `aptos update prover-dependencies`, which installs the dependency of Move prover, boogie, z3 and cvc5.
- Update the default version of `movefmt` to be installed from 1.0.4 to 1.0.5
- Update the local-testnet logs to use `println` for regular output and reserve `eprintln` for errors.
- Set compiler V2 as default when using `aptos move prove`.
Expand Down
2 changes: 1 addition & 1 deletion crates/aptos/src/common/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ pub struct MovePackageDir {
pub language_version: Option<LanguageVersion>,

/// Select bytecode, language version, and compiler to support Move 2:
/// Same as `--bytecode_version=7 --language_version=2.0 --compiler_version=2.0`
/// Same as `--bytecode_version=7 --language_version=2.1 --compiler_version=2.0`
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 attributes for the field language_version above, we have default_value_if("move_2", "true", "2.0"): should we change this to default_value_if("move_2", "true", "2.1")?

#[clap(long, verbatim_doc_comment)]
pub move_2: bool,
}
Expand Down
6 changes: 3 additions & 3 deletions testsuite/single_node_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class RunGroupConfig:
modify-global-resource 1 VM 36 0.921 1.015 2799.1
modify-global-resource 100 VM 36 0.839 1.04 35206.7
publish-package 1 VM 36 0.886 1.039 147
mix_publish_transfer 1 VM 36 0.918 1.086 2149.7
mix_publish_transfer 1 VM 36 0.918 1.086 2079.7
batch100-transfer 1 VM 36 0.727 1.018 740.9
vector-picture30k 1 VM 36 0.863 1.024 110.6
vector-picture30k 100 VM 36 0.573 1.027 2025.7
Expand Down Expand Up @@ -825,10 +825,10 @@ def print_table(
print("\n".join(errors))
print(
"""If you expect your PR to change the performance, you need to recalibrate the values.
To do so, you should run the test on your branch 6 times
To do so, you should run the test on your branch 6 times
(https://github.com/aptos-labs/aptos-core/actions/workflows/workflow-run-execution-performance.yaml).
Then go to Humio calibration link (https://gist.github.com/igor-aptos/7b12ca28de03894cddda8e415f37889e),
update it to your branch, and export values as CSV, and then open and copy values inside
update it to your branch, and export values as CSV, and then open and copy values inside
testsuite/single_node_performance.py testsuite), and add Blockchain oncall as the reviewer.
"""
)
Expand Down
2 changes: 1 addition & 1 deletion third_party/move/move-compiler/src/parser/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn require_move_2(context: &mut Context, loc: Loc, description: &str) -> bool {
require_language_version_msg(
context,
loc,
LanguageVersion::V2,
LanguageVersion::V2_0,
&format!("Move 2 language construct is not enabled: {}", description),
)
}
Expand Down
16 changes: 10 additions & 6 deletions third_party/move/move-compiler/src/shared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ impl Flags {
pub fn set_language_version(self, language_version: LanguageVersion) -> Self {
Self {
language_version,
lang_v2: language_version >= LanguageVersion::V2,
lang_v2: language_version >= LanguageVersion::V2_0,
..self
}
}
Expand All @@ -627,20 +627,23 @@ pub enum LanguageVersion {
#[value(name = "1")]
V1,
#[value(name = "2")]
V2, /* V2 is the same as V2_0, here for the parser */
V2, /* V2 is the same as V2_1, here for the parser */
#[value(name = "2.0")]
V2_0,
#[value(name = "2.1")]
V2_1,
#[value(name = "2.2")]
V2_2,
}

impl LanguageVersion {
fn to_ordinal(self) -> usize {
use LanguageVersion::*;
match self {
LanguageVersion::V1 => 0,
LanguageVersion::V2 => 1,
LanguageVersion::V2_0 => 1,
LanguageVersion::V2_1 => 2,
V1 => 0,
V2_0 => 1,
V2 | V2_1 => 2,
V2_2 => 3,
}
}
}
Expand Down Expand Up @@ -672,6 +675,7 @@ impl std::fmt::Display for LanguageVersion {
LanguageVersion::V2 => "2",
LanguageVersion::V2_0 => "2.0",
LanguageVersion::V2_1 => "2.1",
LanguageVersion::V2_2 => "2.2",
})
}
}
Expand Down
29 changes: 17 additions & 12 deletions third_party/move/move-model/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl CompilerVersion {
Ok(())
}
},
CompilerVersion::V2_0 | CompilerVersion::V2_1 => Ok(()),
_ => Ok(()),
}
}
}
Expand All @@ -190,15 +190,17 @@ pub enum LanguageVersion {
V1,
/// The 2.0 version of Move.
V2_0,
/// The currently unstable 2.1 version of Move
/// The 2.1 version of Move,
V2_1,
/// The currently unstable 2.2 version of Move
V2_2,
}

impl Default for LanguageVersion {
fn default() -> Self {
static MOVE_LANGUAGE_V2: Lazy<bool> = Lazy::new(|| read_bool_env_var("MOVE_LANGUAGE_V2"));
if *MOVE_LANGUAGE_V2 {
Self::V2_0
Self::latest_stable()
} else {
Self::V1
}
Expand All @@ -215,10 +217,10 @@ impl FromStr for LanguageVersion {
let s1 = s.replace(UNSTABLE_MARKER, "");
match s1.as_str() {
"1" => Ok(Self::V1),
"2" | "2.0" => Ok(Self::V2_0),
"2.1" => Ok(Self::V2_1),
"2.0" => Ok(Self::V2_0),
"2" | "2.1" => Ok(Self::V2_1),
_ => bail!(
"unrecognized language version `{}` (supported versions: `1`, `2`, `2.0`)",
"unrecognized language version `{}` (supported versions: `1`, `2`, `2.0`, `2.1`)",
s
),
}
Expand All @@ -231,6 +233,7 @@ impl From<LanguageVersion> for CompilerLanguageVersion {
LanguageVersion::V1 => CompilerLanguageVersion::V1,
LanguageVersion::V2_0 => CompilerLanguageVersion::V2_0,
LanguageVersion::V2_1 => CompilerLanguageVersion::V2_1,
LanguageVersion::V2_2 => CompilerLanguageVersion::V2_2,
}
}
}
Expand All @@ -239,21 +242,21 @@ impl LanguageVersion {
/// Whether the language version is unstable. An unstable version
/// should not be allowed on production networks.
pub fn unstable(self) -> bool {
use LanguageVersion::*;
match self {
LanguageVersion::V1 => false,
LanguageVersion::V2_0 => false,
LanguageVersion::V2_1 => true,
V1 | V2_0 | V2_1 => false,
V2_2 => true,
}
}

/// The latest language version.
pub fn latest() -> Self {
LanguageVersion::V2_1
LanguageVersion::V2_2
}

/// The latest stable language version.
pub fn latest_stable() -> Self {
LanguageVersion::V2_0
LanguageVersion::V2_1
}

/// Whether the language version is equal to greater than `ver`
Expand All @@ -267,7 +270,8 @@ impl LanguageVersion {
env::get_bytecode_version_from_env(version).unwrap_or(match self {
LanguageVersion::V1 => VERSION_DEFAULT,
LanguageVersion::V2_0 => VERSION_DEFAULT_LANG_V2,
LanguageVersion::V2_1 => VERSION_DEFAULT_LANG_V2, // Update once we have v8 bytecode
LanguageVersion::V2_1 => VERSION_DEFAULT_LANG_V2,
LanguageVersion::V2_2 => VERSION_DEFAULT_LANG_V2, // Update once we have v8 bytecode
})
}
}
Expand All @@ -281,6 +285,7 @@ impl Display for LanguageVersion {
LanguageVersion::V1 => "1",
LanguageVersion::V2_0 => "2.0",
LanguageVersion::V2_1 => "2.1",
LanguageVersion::V2_2 => "2.2",
},
if self.unstable() { UNSTABLE_MARKER } else { "" }
)
Expand Down
4 changes: 2 additions & 2 deletions third_party/move/move-prover/tests/testsuite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ fn test_runner_for_feature(path: &Path, feature: &Feature) -> datatest_stable::R

let mut error_writer = Buffer::no_color();
let result = if feature.v2 {
options.language_version = Some(LanguageVersion::V2_0);
options.language_version = Some(LanguageVersion::latest());
run_move_prover_v2(&mut error_writer, options)
} else {
options.model_builder.language_version = LanguageVersion::V2_0;
options.model_builder.language_version = LanguageVersion::latest();
run_move_prover(&mut error_writer, options)
};
let mut diags = match result {
Expand Down
Loading