V0.11.0 release (#696)

* Update the version to 0.11.0 for non-upgradable crates

* Fix target version for the current upgrade functions

* Upgrade native client

* Upgrade socks5 client

* Upgrade mixnode

* Upgrade gateway
This commit is contained in:
Bogdan-Ștefan Neacşu
2021-07-21 16:10:27 +03:00
committed by GitHub
parent 46b49eea2f
commit 191b3c09e2
14 changed files with 209 additions and 24 deletions
Generated
+7 -7
View File
@@ -349,7 +349,7 @@ dependencies = [
[[package]]
name = "client-core"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"config",
"crypto",
@@ -1673,7 +1673,7 @@ dependencies = [
[[package]]
name = "nym-client"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"clap",
"client-core",
@@ -1703,7 +1703,7 @@ dependencies = [
[[package]]
name = "nym-client-wasm"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"console_error_panic_hook",
"crypto",
@@ -1724,7 +1724,7 @@ dependencies = [
[[package]]
name = "nym-gateway"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"clap",
"config",
@@ -1754,7 +1754,7 @@ dependencies = [
[[package]]
name = "nym-mixnode"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"bs58 0.4.0",
"clap",
@@ -1786,7 +1786,7 @@ dependencies = [
[[package]]
name = "nym-network-requester"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"clap",
"dirs",
@@ -1807,7 +1807,7 @@ dependencies = [
[[package]]
name = "nym-socks5-client"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"clap",
"client-core",
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "client-core"
version = "0.11.0-rc1"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
edition = "2018"
@@ -28,4 +28,4 @@ topology = { path = "../../common/topology" }
validator-client = { path = "../../common/client-libs/validator-client" }
[dev-dependencies]
tempfile = "3.1.0"
tempfile = "3.1.0"
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "nym-client"
version = "0.11.0-rc1"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
edition = "2018"
@@ -43,4 +43,4 @@ validator-client = { path = "../../common/client-libs/validator-client" }
version-checker = { path = "../../common/version-checker" }
[dev-dependencies]
serde_json = "1.0" # for the "textsend" example
serde_json = "1.0" # for the "textsend" example
+53 -2
View File
@@ -242,6 +242,50 @@ fn patch_010_upgrade(
config
}
fn minor_011_upgrade(
mut config: Config,
_matches: &ArgMatches,
config_version: &Version,
package_version: &Version,
) -> Config {
let to_version = package_version;
print_start_upgrade(&config_version, &to_version);
println!(
"Setting mixnet contract address to {}",
DEFAULT_MIXNET_CONTRACT_ADDRESS
);
config
.get_base_mut()
.set_mixnet_contract(DEFAULT_MIXNET_CONTRACT_ADDRESS);
// The default validator endpoint changed
println!(
"Setting validator REST endpoint to {:?}",
default_validator_rest_endpoints()
);
config
.get_base_mut()
.set_custom_validators(default_validator_rest_endpoints());
config
.get_base_mut()
.set_custom_version(to_version.to_string().as_ref());
config.save_to_file(None).unwrap_or_else(|err| {
eprintln!("failed to overwrite config file! - {:?}", err);
print_failed_upgrade(&config_version, &to_version);
process::exit(1);
});
print_successful_upgrade(config_version, to_version);
config
}
fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version) {
loop {
let config_version = parse_config_version(&config);
@@ -253,8 +297,15 @@ fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version
config = match config_version.major {
0 => match config_version.minor {
9 => minor_010_upgrade(config, matches, &config_version, &package_version),
10 => patch_010_upgrade(config, matches, &config_version, &package_version),
9 => minor_010_upgrade(config, matches, &config_version, &Version::new(0, 10, 0)),
10 => match config_version.patch {
0 => {
patch_010_upgrade(config, matches, &config_version, &Version::new(0, 10, 1))
}
_ => {
minor_011_upgrade(config, matches, &config_version, &Version::new(0, 11, 0))
}
},
_ => unsupported_upgrade(config_version, package_version),
},
_ => unsupported_upgrade(config_version, package_version),
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "nym-socks5-client"
version = "0.11.0-rc1"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
edition = "2018"
+53 -2
View File
@@ -242,6 +242,50 @@ fn patch_010_upgrade(
config
}
fn minor_011_upgrade(
mut config: Config,
_matches: &ArgMatches,
config_version: &Version,
package_version: &Version,
) -> Config {
let to_version = package_version;
print_start_upgrade(&config_version, &to_version);
println!(
"Setting mixnet contract address to {}",
DEFAULT_MIXNET_CONTRACT_ADDRESS
);
config
.get_base_mut()
.set_mixnet_contract(DEFAULT_MIXNET_CONTRACT_ADDRESS);
// The default validator endpoint changed
println!(
"Setting validator REST endpoint to {:?}",
default_validator_rest_endpoints()
);
config
.get_base_mut()
.set_custom_validators(default_validator_rest_endpoints());
config
.get_base_mut()
.set_custom_version(to_version.to_string().as_ref());
config.save_to_file(None).unwrap_or_else(|err| {
eprintln!("failed to overwrite config file! - {:?}", err);
print_failed_upgrade(&config_version, &to_version);
process::exit(1);
});
print_successful_upgrade(config_version, to_version);
config
}
fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version) {
loop {
let config_version = parse_config_version(&config);
@@ -253,8 +297,15 @@ fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version
config = match config_version.major {
0 => match config_version.minor {
9 => minor_010_upgrade(config, matches, &config_version, &package_version),
10 => patch_010_upgrade(config, matches, &config_version, &package_version),
9 => minor_010_upgrade(config, matches, &config_version, &Version::new(0, 10, 0)),
10 => match config_version.patch {
0 => {
patch_010_upgrade(config, matches, &config_version, &Version::new(0, 10, 1))
}
_ => {
minor_011_upgrade(config, matches, &config_version, &Version::new(0, 11, 0))
}
},
_ => unsupported_upgrade(config_version, package_version),
},
_ => unsupported_upgrade(config_version, package_version),
+1 -1
View File
@@ -1,7 +1,7 @@
[package]
name = "nym-client-wasm"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jedrzej Stuczynski <andrew@nymtech.net>"]
version = "0.11.0-rc1"
version = "0.11.0"
edition = "2018"
keywords = ["nym", "sphinx", "wasm", "webassembly", "privacy", "client"]
license = "Apache-2.0"
+1 -1
View File
@@ -3,7 +3,7 @@
[package]
name = "nym-gateway"
version = "0.11.0-rc1"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
edition = "2018"
+42 -2
View File
@@ -238,6 +238,41 @@ fn patch_010_upgrade(
upgraded_config
}
fn minor_011_upgrade(
config: Config,
_matches: &ArgMatches,
config_version: &Version,
package_version: &Version,
) -> Config {
let to_version = package_version;
print_start_upgrade(&config_version, &to_version);
println!(
"Setting validator REST endpoint to {:?}",
default_validator_rest_endpoints()
);
println!(
"Setting mixnet contract address to {}",
DEFAULT_MIXNET_CONTRACT_ADDRESS
);
let upgraded_config = config
.with_custom_version(to_version.to_string().as_ref())
.with_custom_validators(default_validator_rest_endpoints())
.with_custom_mixnet_contract(DEFAULT_MIXNET_CONTRACT_ADDRESS);
upgraded_config.save_to_file(None).unwrap_or_else(|err| {
eprintln!("failed to overwrite config file! - {:?}", err);
fail_upgrade(&config_version, &to_version)
});
print_successful_upgrade(config_version, to_version);
upgraded_config
}
// TODO: to be renamed once the release version is decided (so presumably either 0.10.2 or 0.11.0)
fn undetermined_version_upgrade(
config: Config,
@@ -300,9 +335,14 @@ fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version
config = match config_version.major {
0 => match config_version.minor {
9 => minor_010_upgrade(config, matches, &config_version, &package_version),
9 => minor_010_upgrade(config, matches, &config_version, &Version::new(0, 10, 0)),
10 => match config_version.patch {
0 => patch_010_upgrade(config, matches, &config_version, &package_version),
0 => {
patch_010_upgrade(config, matches, &config_version, &Version::new(0, 10, 1))
}
1 => {
minor_011_upgrade(config, matches, &config_version, &Version::new(0, 11, 0))
}
_ => undetermined_version_upgrade(
config,
matches,
+1 -1
View File
@@ -3,7 +3,7 @@
[package]
name = "nym-mixnode"
version = "0.11.0-rc1"
version = "0.11.0"
authors = [
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
"Jędrzej Stuczyński <andrew@nymtech.net>",
+43
View File
@@ -263,6 +263,43 @@ fn patch_0_10_1_upgrade(
Ok(upgraded_config)
}
fn minor_0_11_upgrade(
config: Config,
_matches: &ArgMatches,
config_version: &Version,
package_version: &Version,
) -> Result<Config, UpgradeError> {
let to_version = package_version;
print_start_upgrade(&config_version, &to_version);
println!(
"Setting validator REST endpoint to {:?}",
default_validator_rest_endpoints()
);
println!(
"Setting mixnet contract address to {}",
DEFAULT_MIXNET_CONTRACT_ADDRESS
);
let upgraded_config = config
.with_custom_version(to_version.to_string().as_ref())
.with_custom_validators(default_validator_rest_endpoints())
.with_custom_mixnet_contract(DEFAULT_MIXNET_CONTRACT_ADDRESS);
upgraded_config.save_to_file(None).map_err(|err| {
(
to_version.clone(),
format!("failed to overwrite config file! - {:?}", err),
)
})?;
print_successful_upgrade(config_version, to_version);
Ok(upgraded_config)
}
// TODO: to be renamed once the release version is decided (so presumably either 0.10.2 or 0.11.0)
fn undetermined_version_upgrade(
config: Config,
@@ -382,6 +419,12 @@ fn do_upgrade(mut config: Config, matches: &ArgMatches, package_version: Version
&config_version,
&Version::new(0, 10, 1),
),
1 => minor_0_11_upgrade(
config,
matches,
&config_version,
&Version::new(0, 11, 0),
),
_ => undetermined_version_upgrade(
config,
matches,
@@ -3,7 +3,7 @@
[package]
name = "nym-network-requester"
version = "0.11.0-rc1"
version = "0.11.0"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
edition = "2018"
+1 -1
View File
@@ -1627,7 +1627,7 @@ dependencies = [
[[package]]
name = "nym-validator-api"
version = "0.11.0-rc1"
version = "0.11.0"
dependencies = [
"anyhow",
"clap",
+1 -1
View File
@@ -3,7 +3,7 @@
[package]
name = "nym-validator-api"
version = "0.11.0-rc1"
version = "0.11.0"
authors = [
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
"Jędrzej Stuczyński <andrew@nymtech.net>",