From ac0a8892aeba869e6a6204046acbd0383bd98ccc Mon Sep 17 00:00:00 2001 From: Qinxuan Chen Date: Fri, 19 Jun 2020 04:58:33 +0800 Subject: [PATCH] feat: upgrade some dependecies (#1126) Signed-off-by: koushiro --- fil-proofs-tooling/Cargo.toml | 10 +++++----- fil-proofs-tooling/src/metadata.rs | 11 +++++------ filecoin-proofs/Cargo.toml | 14 +++++++------- filecoin-proofs/src/bin/paramfetch.rs | 2 +- filecoin-proofs/src/bin/phase2.rs | 12 ++++-------- .../tests/paramfetch/support/session.rs | 5 +++-- .../tests/parampublish/support/session.rs | 5 +++-- filecoin-proofs/tests/support/mod.rs | 4 ++-- sha2raw/Cargo.toml | 1 - storage-proofs/core/Cargo.toml | 6 +++--- storage-proofs/core/src/crypto/sloth.rs | 2 +- 11 files changed, 34 insertions(+), 38 deletions(-) diff --git a/fil-proofs-tooling/Cargo.toml b/fil-proofs-tooling/Cargo.toml index d1623fe57..fe2a9b1ce 100644 --- a/fil-proofs-tooling/Cargo.toml +++ b/fil-proofs-tooling/Cargo.toml @@ -19,7 +19,7 @@ lazy_static = "1.2" glob = "0.3" human-size = "0.4" prettytable-rs = "0.8" -regex = "=1.3.7" +regex = "1.3.7" commandspec = "0.12.2" chrono = { version = "0.4.7", features = ["serde"] } memmap = "0.7.0" @@ -31,14 +31,14 @@ storage-proofs = { path = "../storage-proofs"} filecoin-proofs = { path = "../filecoin-proofs"} tempfile = "3.0.8" cpu-time = "1.0.0" -git2 = "0.13" -heim = "0.0.9" -futures-preview = "0.3.0-alpha.17" +git2 = "0.13.6" +heim = { version = "0.1.0-beta.1", features = ["host", "memory", "cpu"] } +async-std = "1.6" raw-cpuid = "7.0.3" blake2s_simd = "0.5.6" fil_logger = "0.1" log = "0.4.8" -uom = "0.26" +uom = "0.28" merkletree = "0.20.0" bincode = "1.1.2" anyhow = "1.0.23" diff --git a/fil-proofs-tooling/src/metadata.rs b/fil-proofs-tooling/src/metadata.rs index 80fe4b0c6..c653dd610 100644 --- a/fil-proofs-tooling/src/metadata.rs +++ b/fil-proofs-tooling/src/metadata.rs @@ -67,15 +67,14 @@ pub struct SystemMetadata { impl SystemMetadata { pub fn new() -> Result { - let host = futures::executor::block_on(heim::host::platform()) + use async_std::task::block_on; + let host = block_on(async { heim::host::platform().await }) .map_err(|_| anyhow!("Failed to retrieve host information"))?; - - let memory = futures::executor::block_on(heim::memory::memory()) + let memory = block_on(async { heim::memory::memory().await }) .map_err(|_| anyhow!("Failed to retrieve memory information"))?; - let cpu_logical = futures::executor::block_on(heim::cpu::logical_count()) + let cpu_logical = block_on(async { heim::cpu::logical_count().await }) .map_err(|_| anyhow!("Failed to retrieve cpu logical count information"))?; - - let cpu_physical = futures::executor::block_on(heim::cpu::physical_count()) + let cpu_physical = block_on(async { heim::cpu::physical_count().await }) .map_err(|_| anyhow!("Failed to retrieve cpu physical count information"))?; let cpuid = raw_cpuid::CpuId::new(); diff --git a/filecoin-proofs/Cargo.toml b/filecoin-proofs/Cargo.toml index 0cd6d6432..a9a5acd16 100644 --- a/filecoin-proofs/Cargo.toml +++ b/filecoin-proofs/Cargo.toml @@ -19,10 +19,10 @@ colored = "1.6" pbr = "1.0" byteorder = "1" itertools = "0.9" -serde_cbor = "0.10.2" +serde_cbor = "0.11.1" serde = { version = "1.0", features = ["rc", "derive"] } serde_json = "1.0" -regex = "=1.3.7" +regex = "1.3.7" ff = { version = "0.2.1", package = "fff" } blake2b_simd = "0.5" bellperson = "0.8.0" @@ -31,7 +31,7 @@ fil-sapling-crypto = "0.6.0" clap = "2" log = "0.4.7" fil_logger = "0.1" -env_proxy = "0.3" +env_proxy = "0.4" os_type = "2.2.0" flate2 = { version = "1.0.9", features = ["rust_backend"]} tar = "0.4.26" @@ -49,7 +49,7 @@ typenum = "1.11.2" bitintr = "0.3.0" gperftools = { version = "0.2", optional = true } phase2 = { package = "phase21", version = "0.6.0" } -simplelog = "0.7.4" +simplelog = "0.8.0" rand_chacha = "0.2.1" dialoguer = "0.6.2" generic-array = "0.13.2" @@ -58,13 +58,13 @@ humansize = "1.1.0" indicatif = "0.14.0" [dependencies.reqwest] -version = "0.9" +version = "0.10" default-features = false -features = ["default-tls-vendored"] +features = ["blocking", "native-tls-vendored"] [dev-dependencies] criterion = "0.3" -rexpect = "0.3.0" +rexpect = "0.4.0" pretty_assertions = "0.6.1" failure = "0.1.7" tempfile = "3" diff --git a/filecoin-proofs/src/bin/paramfetch.rs b/filecoin-proofs/src/bin/paramfetch.rs index a3e75ffa9..521f2dfae 100644 --- a/filecoin-proofs/src/bin/paramfetch.rs +++ b/filecoin-proofs/src/bin/paramfetch.rs @@ -13,7 +13,7 @@ use clap::{values_t, App, Arg, ArgMatches}; use flate2::read::GzDecoder; use itertools::Itertools; use pbr::{ProgressBar, Units}; -use reqwest::{header, Client, Proxy, Url}; +use reqwest::{blocking::Client, header, Proxy, Url}; use tar::Archive; use filecoin_proofs::param::*; diff --git a/filecoin-proofs/src/bin/phase2.rs b/filecoin-proofs/src/bin/phase2.rs index b72aec474..baebef9ea 100644 --- a/filecoin-proofs/src/bin/phase2.rs +++ b/filecoin-proofs/src/bin/phase2.rs @@ -673,8 +673,7 @@ fn setup_new_logger(proof: Proof, hasher: Hasher, sector_size: u64) { LevelFilter::Info, simplelog::Config::default(), TerminalMode::Mixed, - ) - .unwrap(), + ), WriteLogger::new(LevelFilter::Info, simplelog::Config::default(), log_file), ]) .expect("failed to setup logger"); @@ -700,8 +699,7 @@ fn setup_contribute_logger(path_before: &str) { LevelFilter::Info, simplelog::Config::default(), TerminalMode::Mixed, - ) - .unwrap(), + ), WriteLogger::new(LevelFilter::Info, simplelog::Config::default(), log_file), ]) .expect("failed to setup logger"); @@ -736,8 +734,7 @@ fn setup_verify_logger(param_paths: &[&str]) { LevelFilter::Info, simplelog::Config::default(), TerminalMode::Mixed, - ) - .unwrap(), + ), WriteLogger::new(LevelFilter::Info, simplelog::Config::default(), log_file), ]) .expect("failed to setup logger"); @@ -764,8 +761,7 @@ fn setup_verifyd_logger(proof: Proof, hasher: Hasher, sector_size: u64) { LevelFilter::Info, simplelog::Config::default(), TerminalMode::Mixed, - ) - .unwrap(), + ), WriteLogger::new(LevelFilter::Info, simplelog::Config::default(), log_file), ]) .expect("failed to setup logger"); diff --git a/filecoin-proofs/tests/paramfetch/support/session.rs b/filecoin-proofs/tests/paramfetch/support/session.rs index 8f6195fbf..8c2c9d268 100644 --- a/filecoin-proofs/tests/paramfetch/support/session.rs +++ b/filecoin-proofs/tests/paramfetch/support/session.rs @@ -3,7 +3,8 @@ use std::io::Read; use std::path::{Path, PathBuf}; use failure::SyncFailure; -use rexpect::session::PtyBashSession; +use rexpect::session::PtyReplSession; +use tempfile; use tempfile::TempDir; use crate::support::{cargo_bin, spawn_bash_with_retries}; @@ -107,7 +108,7 @@ impl ParamFetchSessionBuilder { /// An active pseudoterminal (pty) used to interact with paramfetch. pub struct ParamFetchSession { - pty_session: PtyBashSession, + pty_session: PtyReplSession, _cache_dir: TempDir, } diff --git a/filecoin-proofs/tests/parampublish/support/session.rs b/filecoin-proofs/tests/parampublish/support/session.rs index 796f61981..ce12aa1c2 100644 --- a/filecoin-proofs/tests/parampublish/support/session.rs +++ b/filecoin-proofs/tests/parampublish/support/session.rs @@ -4,7 +4,8 @@ use std::path::{Path, PathBuf}; use failure::SyncFailure; use rand::Rng; -use rexpect::session::PtyBashSession; +use rexpect::session::PtyReplSession; +use tempfile; use tempfile::TempDir; use storage_proofs::parameter_cache::{CacheEntryMetadata, PARAMETER_CACHE_ENV_VAR}; @@ -154,7 +155,7 @@ impl ParamPublishSessionBuilder { /// An active pseudoterminal (pty) used to interact with parampublish. pub struct ParamPublishSession { - pty_session: PtyBashSession, + pty_session: PtyReplSession, _cache_dir: TempDir, } diff --git a/filecoin-proofs/tests/support/mod.rs b/filecoin-proofs/tests/support/mod.rs index 4978664ef..949df53d4 100644 --- a/filecoin-proofs/tests/support/mod.rs +++ b/filecoin-proofs/tests/support/mod.rs @@ -3,7 +3,7 @@ use std::{env, thread}; use failure::format_err; use filecoin_proofs::param::ParameterData; -use rexpect::session::PtyBashSession; +use rexpect::session::PtyReplSession; use rexpect::spawn_bash; use std::collections::btree_map::BTreeMap; use std::fs::File; @@ -66,7 +66,7 @@ pub fn cargo_bin>(name: S) -> PathBuf { pub fn spawn_bash_with_retries( retries: u8, timeout: Option, -) -> Result { +) -> Result { let result = spawn_bash(timeout); if result.is_ok() || retries == 0 { result diff --git a/sha2raw/Cargo.toml b/sha2raw/Cargo.toml index be89de0a5..e42305615 100644 --- a/sha2raw/Cargo.toml +++ b/sha2raw/Cargo.toml @@ -23,7 +23,6 @@ version = "1.4.0" [dev-dependencies] digest = { version = "0.8", features = ["dev", "std"] } -hex-literal = "0.1" sha2 = "0.8.1" rand = "0.7.3" rand_xorshift = "0.2.0" diff --git a/storage-proofs/core/Cargo.toml b/storage-proofs/core/Cargo.toml index 0f1f06fc9..9f95b4623 100644 --- a/storage-proofs/core/Cargo.toml +++ b/storage-proofs/core/Cargo.toml @@ -15,7 +15,7 @@ bench = false rand = "0.7" merkletree = "0.20.0" byteorder = "1" -config = "0.9.3" +config = { version = "0.10.1", default-features = false, features = ["toml"] } itertools = "0.9" lazy_static = "1.2" memmap = "0.7" @@ -45,9 +45,9 @@ cpu-time = { version = "1.0", optional = true } gperftools = { version = "0.2", optional = true } [dev-dependencies] -proptest = "0.7" +proptest = "0.10" criterion = "0.3" -femme = "1.2.0" +femme = "2.1.0" bitvec = "0.17" rand_xorshift = "0.2.0" pretty_assertions = "0.6.1" diff --git a/storage-proofs/core/src/crypto/sloth.rs b/storage-proofs/core/src/crypto/sloth.rs index ff3b09b6c..c4a991aa0 100644 --- a/storage-proofs/core/src/crypto/sloth.rs +++ b/storage-proofs/core/src/crypto/sloth.rs @@ -25,7 +25,7 @@ mod tests { use super::*; use ff::PrimeField; use paired::bls12_381::{Fr, FrRepr}; - use proptest::{prop_compose, proptest, proptest_helper}; + use proptest::{prop_compose, proptest}; // the modulus from `bls12_381::Fr` // The definition of MODULUS and comment defining r come from paired/src/bls_12_381/fr.rs.