diff --git a/enigma-core/app/Cargo.lock b/enigma-core/app/Cargo.lock index 5775bd1a..444a293c 100644 --- a/enigma-core/app/Cargo.lock +++ b/enigma-core/app/Cargo.lock @@ -628,6 +628,7 @@ dependencies = [ "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sgx_types 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)", "sgx_urts 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)", + "thiserror 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "web3 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2243,6 +2244,24 @@ dependencies = [ "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "thiserror" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thiserror-impl 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "thread-id" version = "3.3.0" @@ -3040,6 +3059,8 @@ dependencies = [ "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thiserror 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "205684fd018ca14432b12cce6ea3d46763311a571c3d294e71ba3f01adcf1aad" +"checksum thiserror-impl 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "57e4d2e50ca050ed44fb58309bdce3efa79948f84f9993ad1978de5eebdce5a7" "checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" diff --git a/enigma-core/app/cross-test-utils/src/lib.rs b/enigma-core/app/cross-test-utils/src/lib.rs index d99cdd94..f55fbd30 100644 --- a/enigma-core/app/cross-test-utils/src/lib.rs +++ b/enigma-core/app/cross-test-utils/src/lib.rs @@ -12,15 +12,15 @@ use std::fs::File; use std::io::Read; use std::path::PathBuf; use std::process::Command; -pub use enigma_types::{ContractAddress, StateKey, Hash256}; +pub use enigma_types::{StateKey, Hash256}; use enigma_crypto::{KeyPair, symmetric, rand}; use enigma_crypto::hash::{Sha256, Keccak256}; use serde_json::{*, Value}; use rmp_serde::{Serializer}; use serde::{Serialize}; -pub fn generate_contract_address() -> ContractAddress { - let mut address = ContractAddress::default(); +pub fn generate_contract_address() -> Hash256 { + let mut address = Hash256::default(); rand::random(address.as_mut()).unwrap(); address } @@ -56,17 +56,17 @@ pub fn get_bytecode_from_path(contract_path: &str) -> Vec { } // creates a non trivial reproducible stateKey from the contract address -pub fn get_fake_state_key(contract_address: ContractAddress) -> [u8; 32] { +pub fn get_fake_state_key(contract_address: Hash256) -> [u8; 32] { contract_address.keccak256().sha256().into() } -pub fn make_encrypted_response(req: &Value, addresses: Vec, keys: Option>) -> Value { +pub fn make_encrypted_response(req: &Value, addresses: Vec, keys: Option>) -> Value { // Making the response if !req["data"]["Request"].is_null() { // Just makes sure that {data:{Request}} Exists. - assert_eq!(serde_json::from_value::>(req["data"]["Request"].clone()).unwrap(), addresses); + assert_eq!(serde_json::from_value::>(req["data"]["Request"].clone()).unwrap(), addresses); } - let _response_data: Vec<(ContractAddress, StateKey)> = if let Some(keys) = keys { + let _response_data: Vec<(Hash256, StateKey)> = if let Some(keys) = keys { addresses.into_iter().zip(keys.into_iter()).collect() } else { addresses.into_iter().map(|addr| (addr, get_fake_state_key(addr))).collect() diff --git a/enigma-core/app/src/db/dal.rs b/enigma-core/app/src/db/dal.rs index 01cc5913..90f94c7b 100644 --- a/enigma-core/app/src/db/dal.rs +++ b/enigma-core/app/src/db/dal.rs @@ -290,7 +290,7 @@ mod test { use crate::db::{tests::create_test_db, dal::CRUDInterface, primitives::{Array32u8, DeltaKey, Stype}}; use hex::ToHex; - use enigma_types::ContractAddress; + use enigma_types::Hash256; #[test] fn test_new_db() { @@ -383,7 +383,7 @@ mod test { #[should_panic] fn test_delete_contract_dk() { let (mut db, _dir) = create_test_db(); - let addr: ContractAddress = [2u8; 32].into(); + let addr: Hash256 = [2u8; 32].into(); let dk_code = DeltaKey::new(addr, Stype::ByteCode); let dk_delta = DeltaKey::new(addr, Stype::Delta(0)); let v_code = b"This is a Contract"; diff --git a/enigma-core/app/src/db/iterator.rs b/enigma-core/app/src/db/iterator.rs index a8e6afce..c9c33459 100644 --- a/enigma-core/app/src/db/iterator.rs +++ b/enigma-core/app/src/db/iterator.rs @@ -1,7 +1,7 @@ use common_u::errors::{DBErr, DBErrKind}; use db::dal::{CRUDInterface, DB}; use db::primitives::{DeltaKey, SplitKey, Stype}; -use enigma_types::ContractAddress; +use enigma_types::Hash256; use failure::Error; use hex::{FromHex, ToHex}; use rocksdb::DB as rocks_db; @@ -43,11 +43,11 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// let dk1 = DeltaKey {contract_address, key_type: Stype::Delta(1)}; /// let val1 = b"Enigma".to_vec(); /// let dk2 = DeltaKey {contract_address, key_type: Stype::Delta(2)}; @@ -58,7 +58,7 @@ pub trait P2PCalls { /// let (key, tip): (DeltaKey, Vec)= db.get_tip(&contract_address).unwrap(); /// assert_eq!(tip, val2); /// ``` - fn get_tip(&self, address: &ContractAddress) -> Result<(K, Vec), Error>; + fn get_tip(&self, address: &Hash256) -> Result<(K, Vec), Error>; /// return the latest delta for each of the required addresses. /// # Examples @@ -67,11 +67,11 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// # let dk1 = DeltaKey {contract_address, key_type: Stype::Delta(1)}; /// # let val1 = b"Enigma".to_vec(); /// # let dk2 = DeltaKey {contract_address, key_type: Stype::Delta(2)}; @@ -79,7 +79,7 @@ pub trait P2PCalls { /// # let key_vals = vec![(dk1, val1.clone()), (dk2, val2.clone())]; /// # let _ = db.insert_tuples(&key_vals); /// - /// # let other_contract_address: ContractAddress = [4u8; 32].into(); + /// # let other_contract_address: Hash256 = [4u8; 32].into(); /// let other_dk = DeltaKey {contract_address: other_contract_address, key_type: Stype::Delta(1)}; /// let other_val = b"delta1".to_vec(); /// let _ = db.insert_tuples(&vec![(other_dk, other_val.clone())]); @@ -93,7 +93,7 @@ pub trait P2PCalls { /// } /// } /// ``` - fn get_tips(&self, address_list: &[ContractAddress]) -> ResultVec<(K, Vec)>; + fn get_tips(&self, address_list: &[Hash256]) -> ResultVec<(K, Vec)>; /// get a list of all valid addresses in the DB. /// # Examples @@ -102,11 +102,11 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// # let dk1 = DeltaKey {contract_address, key_type: Stype::Delta(1)}; /// # let val1 = b"Enigma".to_vec(); /// # let dk2 = DeltaKey {contract_address, key_type: Stype::Delta(2)}; @@ -114,15 +114,15 @@ pub trait P2PCalls { /// # let key_vals = vec![(dk1, val1.clone()), (dk2, val2.clone())]; /// # let _ = db.insert_tuples(&key_vals); /// - /// # let other_contract_address: ContractAddress = [4u8; 32].into(); + /// # let other_contract_address: Hash256 = [4u8; 32].into(); /// # let other_dk = DeltaKey {contract_address: other_contract_address, key_type: Stype::Delta(1)}; /// # let other_val = b"delta1".to_vec(); /// # let _ = db.insert_tuples(&vec![(other_dk, other_val.clone())]); - /// let all_addresses: Vec = db.get_all_addresses().unwrap(); + /// let all_addresses: Vec = db.get_all_addresses().unwrap(); /// let expected_addresses = vec![contract_address, other_contract_address]; /// assert_eq!(all_addresses, expected_addresses); /// ``` - fn get_all_addresses(&self) -> ResultVec; + fn get_all_addresses(&self) -> ResultVec; /// get the delta of the required address and key. /// # Examples @@ -131,11 +131,11 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// # let dk1 = DeltaKey {contract_address, key_type: Stype::Delta(1)}; /// # let val1 = b"Enigma".to_vec(); /// # let dk2 = DeltaKey {contract_address, key_type: Stype::Delta(2)}; @@ -154,18 +154,18 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// let dk_bytecode = DeltaKey {contract_address, key_type: Stype::ByteCode}; /// let contract = b"This is a Contract".to_vec(); /// let _ = db.insert_tuples(&vec![(dk_bytecode, contract.clone())]); /// let db_contract = db.get_contract(contract_address).unwrap(); /// assert_eq!(contract, db_contract); /// ``` - fn get_contract(&self, address: ContractAddress) -> ResultVec; + fn get_contract(&self, address: Hash256) -> ResultVec; /// returns a list of the latest deltas for all addresses that exist in the DB. /// # Examples @@ -174,11 +174,11 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// # let dk1 = DeltaKey {contract_address, key_type: Stype::Delta(1)}; /// # let val1 = b"Enigma".to_vec(); /// # let dk2 = DeltaKey {contract_address, key_type: Stype::Delta(2)}; @@ -186,7 +186,7 @@ pub trait P2PCalls { /// # let key_vals = vec![(dk1, val1.clone()), (dk2, val2.clone())]; /// # let _ = db.insert_tuples(&key_vals); /// - /// # let other_contract_address: ContractAddress = [4u8; 32].into(); + /// # let other_contract_address: Hash256 = [4u8; 32].into(); /// # let other_dk = DeltaKey {contract_address: other_contract_address, key_type: Stype::Delta(1)}; /// # let other_val = b"delta1".to_vec(); /// # let _ = db.insert_tuples(&vec![(other_dk, other_val.clone())]); @@ -211,11 +211,11 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// # let dk1 = DeltaKey {contract_address, key_type: Stype::Delta(1)}; /// # let val1 = b"Enigma".to_vec(); /// # let dk2 = DeltaKey {contract_address, key_type: Stype::Delta(2)}; @@ -235,11 +235,11 @@ pub trait P2PCalls { /// # extern crate enigma_core_app; /// # extern crate enigma_types; /// # use enigma_core_app::db::{dal::DB, primitives::{DeltaKey, Stype}, iterator::P2PCalls}; - /// # use enigma_types::ContractAddress; + /// # use enigma_types::Hash256; /// /// # let tempdir = tempfile::tempdir().unwrap(); /// # let mut db = DB::new(tempdir.path(), true).unwrap(); - /// # let contract_address: ContractAddress = [2u8; 32].into(); + /// # let contract_address: Hash256 = [2u8; 32].into(); /// # let dk1 = DeltaKey {contract_address, key_type: Stype::Delta(1)}; /// # let val1 = b"Enigma".to_vec(); /// # let dk2 = DeltaKey {contract_address, key_type: Stype::Delta(2)}; @@ -260,7 +260,7 @@ pub trait P2PCalls { impl P2PCalls for DB { #[logfn(TRACE)] - fn get_tip(&self, address: &ContractAddress) -> Result<(K, Vec), Error> { + fn get_tip(&self, address: &Hash256) -> Result<(K, Vec), Error> { // check and extract the CF from the DB // to_hex converts the [u8] to str let str_addr = address.to_hex(); @@ -277,7 +277,7 @@ impl P2PCalls for DB { } #[logfn(TRACE)] - fn get_tips(&self, address_list: &[ContractAddress]) -> ResultVec<(K, Vec)> { + fn get_tips(&self, address_list: &[Hash256]) -> ResultVec<(K, Vec)> { let mut deltas_list = Vec::with_capacity(address_list.len()); trace!("DB: Get Tips, Address List: {:?}",address_list); for address in address_list { @@ -290,7 +290,7 @@ impl P2PCalls for DB { /// get_all_addresses will return a list of all addresses that are valid. /// meaning if an address was'nt saved according to the hex format the function will ignore it. #[logfn(TRACE)] - fn get_all_addresses(&self) -> Result, Error> { + fn get_all_addresses(&self) -> Result, Error> { trace!("DB: Get all addresses"); // get a list of all CF's (addresses) in our DB let mut cf_list = rocks_db::list_cf(&self.options, &self.location)?; @@ -306,7 +306,7 @@ impl P2PCalls for DB { let addr_list = cf_list .iter() .filter_map(|address_str| { - let mut address = ContractAddress::default(); + let mut address = Hash256::default(); let slice_address = match address_str.from_hex() { Ok(slice) => slice, // if the address is not a correct hex then it is not a correct address. @@ -330,14 +330,14 @@ impl P2PCalls for DB { } #[logfn(TRACE)] - fn get_contract(&self, contract_address: ContractAddress) -> ResultVec { + fn get_contract(&self, contract_address: Hash256) -> ResultVec { let key = DeltaKey { contract_address, key_type: Stype::ByteCode }; Ok(self.read(&key).map_err(|_| DBErr { command: "get_contract".to_string(), kind: DBErrKind::MissingKey(contract_address.to_hex()) })?) } #[logfn(TRACE)] fn get_all_tips(&self) -> ResultVec<(K, Vec)> { - let _address_list: Vec = self.get_all_addresses()?; + let _address_list: Vec = self.get_all_addresses()?; self.get_tips(&_address_list[..]) } @@ -416,7 +416,7 @@ impl P2PCalls for DB { #[cfg(test)] mod test { use db::{CRUDInterface, P2PCalls, tests::create_test_db}; - use enigma_types::ContractAddress; + use enigma_types::Hash256; use db::primitives::{DeltaKey, Stype}; #[test] @@ -499,7 +499,7 @@ mod test { fn test_get_tips_multi_row_per_add_success() { let (mut db, _dir) = create_test_db(); - let contract_address: ContractAddress = [7u8; 32].into(); + let contract_address: Hash256 = [7u8; 32].into(); let key_type_a = Stype::Delta(1); let dk_a = DeltaKey { contract_address, key_type: key_type_a }; @@ -520,12 +520,12 @@ mod test { fn test_get_tips_multi_add_success() { let (mut db, _dir) = create_test_db(); - let contract_address_a: ContractAddress = [7u8; 32].into(); + let contract_address_a: Hash256 = [7u8; 32].into(); let key_type_a = Stype::Delta(1); let dk_a = DeltaKey { contract_address: contract_address_a, key_type: key_type_a }; let v_a = b"Enigma_a"; - let contract_address_b: ContractAddress = [4u8; 32].into(); + let contract_address_b: Hash256 = [4u8; 32].into(); let key_type_b = Stype::Delta(2); let dk_b = DeltaKey { contract_address: contract_address_b, key_type: key_type_b }; @@ -549,12 +549,12 @@ mod test { fn test_get_tips_no_addr() { let (mut db, _dir) = create_test_db(); - let contract_address_a: ContractAddress = [7u8; 32].into(); + let contract_address_a: Hash256 = [7u8; 32].into(); let key_type_a = Stype::Delta(1); let dk_a = DeltaKey { contract_address: contract_address_a, key_type: key_type_a }; let v_a = b"Enigma_a"; - let contract_address_b: ContractAddress = [4u8; 32].into(); + let contract_address_b: Hash256 = [4u8; 32].into(); db.create(&dk_a, &v_a[..]).unwrap(); @@ -566,12 +566,12 @@ mod test { fn test_get_tips_no_deltas() { let (mut db, _dir) = create_test_db(); - let contract_address_a: ContractAddress = [7u8; 32].into(); + let contract_address_a: Hash256 = [7u8; 32].into(); let key_type_a = Stype::State; let dk_a = DeltaKey { contract_address: contract_address_a, key_type: key_type_a }; let v_a = b"Enigma_a"; - let contract_address_b: ContractAddress = [4u8; 32].into(); + let contract_address_b: Hash256 = [4u8; 32].into(); let key_type_b = Stype::ByteCode; let dk_b = DeltaKey { contract_address: contract_address_b, key_type: key_type_b }; let v_b = b"Enigma_b"; @@ -586,17 +586,17 @@ mod test { fn test_get_all_addresses_success() { let (mut db, _dir) = create_test_db(); - let contract_address_a: ContractAddress = [7u8; 32].into(); + let contract_address_a: Hash256 = [7u8; 32].into(); let key_type_a = Stype::State; let dk_a = DeltaKey { contract_address: contract_address_a, key_type: key_type_a }; let v_a = b"Enigma_state_1"; - let contract_address_b: ContractAddress = [4u8; 32].into(); + let contract_address_b: Hash256 = [4u8; 32].into(); let key_type_b = Stype::ByteCode; let dk_b = DeltaKey { contract_address: contract_address_b, key_type: key_type_b }; let v_b = b"Enigma_byte_code_2"; - let contract_address_c: ContractAddress = [67u8; 32].into(); + let contract_address_c: Hash256 = [67u8; 32].into(); let key_type_c = Stype::Delta(78); let dk_c = DeltaKey { contract_address: contract_address_c, key_type: key_type_c }; let v_c = b"Enigma_delta_3"; @@ -607,7 +607,7 @@ mod test { db.create(&dk_b, &v_b[..]).unwrap(); db.create(&dk_c, &v_c[..]).unwrap(); - let accepted_addresses: Vec = db.get_all_addresses().unwrap(); + let accepted_addresses: Vec = db.get_all_addresses().unwrap(); assert_eq!(expected_addresses, accepted_addresses); } @@ -615,17 +615,17 @@ mod test { fn test_get_all_addresses_invalid_cf() { let (mut db, _dir) = create_test_db(); - let contract_address_a: ContractAddress = [7u8; 32].into(); + let contract_address_a: Hash256 = [7u8; 32].into(); let key_type_a = Stype::State; let dk_a = DeltaKey { contract_address: contract_address_a, key_type: key_type_a }; let v_a = b"Enigma_state_1"; - let contract_address_b: ContractAddress = [4u8; 32].into(); + let contract_address_b: Hash256 = [4u8; 32].into(); let key_type_b = Stype::ByteCode; let dk_b = DeltaKey { contract_address: contract_address_b, key_type: key_type_b }; let v_b = b"Enigma_byte_code_2"; - let contract_address_c: ContractAddress = [67u8; 32].into(); + let contract_address_c: Hash256 = [67u8; 32].into(); let key_type_c = Stype::Delta(78); let dk_c = DeltaKey { contract_address: contract_address_c, key_type: key_type_c }; let v_c = b"Enigma_delta_3"; @@ -640,7 +640,7 @@ mod test { let _cf = db.database.create_cf(&cf_str, &db.options).unwrap(); - let accepted_addresses: Vec = db.get_all_addresses().unwrap(); + let accepted_addresses: Vec = db.get_all_addresses().unwrap(); assert_eq!(expected_addresses, accepted_addresses); } @@ -687,7 +687,7 @@ mod test { fn test_get_deltas() { let (mut db, _dir) = create_test_db(); - let contract_address: ContractAddress = [7u8; 32].into(); + let contract_address: Hash256 = [7u8; 32].into(); let key_type_a = Stype::Delta(1); let dk_a = DeltaKey { contract_address, key_type: key_type_a }; diff --git a/enigma-core/app/src/db/primitives.rs b/enigma-core/app/src/db/primitives.rs index 92a9c363..25df33ce 100644 --- a/enigma-core/app/src/db/primitives.rs +++ b/enigma-core/app/src/db/primitives.rs @@ -1,4 +1,4 @@ -use enigma_types::ContractAddress; +use enigma_types::Hash256; use failure::Error; use hex::{FromHex, ToHex}; use std::str; @@ -10,7 +10,7 @@ pub struct VecKey(pub Vec); #[derive(Clone, Copy, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)] pub struct DeltaKey { - pub contract_address: ContractAddress, + pub contract_address: Hash256, pub key_type: Stype, } @@ -56,7 +56,7 @@ impl Default for Stype { } impl DeltaKey { - pub fn new(contract_address: ContractAddress, key_type: Stype) -> DeltaKey { DeltaKey { contract_address, key_type } } + pub fn new(contract_address: Hash256, key_type: Stype) -> DeltaKey { DeltaKey { contract_address, key_type } } } impl SplitKey for DeltaKey { @@ -88,7 +88,7 @@ impl SplitKey for DeltaKey { _ => bail!("Failed parsing the Key, key does not contain a correct index"), }; // if the address is not a correct hex then it not a correct address. - let contract_address = ContractAddress::from_hex(&_hash)?; + let contract_address = Hash256::from_hex(&_hash)?; Ok(DeltaKey { contract_address, key_type }) } } diff --git a/enigma-core/app/src/esgx/ocalls_u.rs b/enigma-core/app/src/esgx/ocalls_u.rs index b51c6488..44dd0013 100644 --- a/enigma-core/app/src/esgx/ocalls_u.rs +++ b/enigma-core/app/src/esgx/ocalls_u.rs @@ -2,7 +2,7 @@ use crate::db::{CRUDInterface, DeltaKey, P2PCalls, ResultType, ResultTypeVec, Stype, DB}; use enigma_tools_m::utils::LockExpectMutex; use enigma_crypto::hash::Sha256; -use enigma_types::{ContractAddress, EnclaveReturn, Hash256, RawPointer}; +use enigma_types::{EnclaveReturn, Hash256, RawPointer}; use lru_cache::LruCache; use std::sync::Mutex; use std::{ptr, slice}; @@ -12,7 +12,7 @@ lazy_static! { static ref DELTAS_CACHE: Mutex>>> = #[no_mangle] -pub unsafe extern "C" fn ocall_update_state(db_ptr: *const RawPointer, id: &ContractAddress, enc_state: *const u8, state_len: usize) -> EnclaveReturn { +pub unsafe extern "C" fn ocall_update_state(db_ptr: *const RawPointer, id: &Hash256, enc_state: *const u8, state_len: usize) -> EnclaveReturn { let encrypted_state = slice::from_raw_parts(enc_state, state_len); let key = DeltaKey::new(*id, Stype::State); @@ -36,7 +36,7 @@ pub unsafe extern "C" fn ocall_update_state(db_ptr: *const RawPointer, id: &Cont #[no_mangle] pub unsafe extern "C" fn ocall_new_delta(db_ptr: *const RawPointer, enc_delta: *const u8, delta_len: usize, - contract_address: &ContractAddress, delta_index_: *const u32) -> EnclaveReturn { + contract_address: &Hash256, delta_index_: *const u32) -> EnclaveReturn { let delta_index = ptr::read(delta_index_); let encrypted_delta = slice::from_raw_parts(enc_delta, delta_len); let key = DeltaKey::new(*contract_address, Stype::Delta(delta_index)); @@ -58,7 +58,7 @@ pub unsafe extern "C" fn ocall_new_delta(db_ptr: *const RawPointer, #[no_mangle] -pub unsafe extern "C" fn ocall_get_state_size(db_ptr: *const RawPointer, addr: &ContractAddress, state_size: *mut usize) -> EnclaveReturn { +pub unsafe extern "C" fn ocall_get_state_size(db_ptr: *const RawPointer, addr: &Hash256, state_size: *mut usize) -> EnclaveReturn { let mut cache_id = addr.to_vec(); let _state_key = DeltaKey::new(*addr, Stype::State); let db: &mut DB = match (*db_ptr).get_mut_ref() { @@ -82,7 +82,7 @@ pub unsafe extern "C" fn ocall_get_state_size(db_ptr: *const RawPointer, addr: & #[no_mangle] -pub unsafe extern "C" fn ocall_get_state(db_ptr: *const RawPointer, addr: &ContractAddress, state_ptr: *mut u8, state_size: usize) -> EnclaveReturn { +pub unsafe extern "C" fn ocall_get_state(db_ptr: *const RawPointer, addr: &Hash256, state_ptr: *mut u8, state_size: usize) -> EnclaveReturn { let mut cache_id = addr.to_vec(); cache_id.extend_from_slice(&state_size.to_be_bytes()); @@ -115,7 +115,7 @@ pub unsafe extern "C" fn ocall_get_state(db_ptr: *const RawPointer, addr: &Contr #[no_mangle] -pub unsafe extern "C" fn ocall_get_deltas_sizes(db_ptr: *const RawPointer, addr: &ContractAddress, +pub unsafe extern "C" fn ocall_get_deltas_sizes(db_ptr: *const RawPointer, addr: &Hash256, start: *const u32, end: *const u32, res_ptr: *mut usize, res_len: usize) -> EnclaveReturn { @@ -156,9 +156,9 @@ pub unsafe extern "C" fn ocall_get_deltas_sizes(db_ptr: *const RawPointer, addr: #[no_mangle] -pub unsafe extern "C" fn ocall_get_deltas(db_ptr: *const RawPointer, addr: &ContractAddress, - start: *const u32, end: *const u32, - res_ptr: *mut u8, res_len: usize) -> EnclaveReturn { +pub unsafe extern "C" fn ocall_get_deltas(db_ptr: *const RawPointer, addr: &Hash256, + start: *const u32, end: *const u32, + res_ptr: *mut u8, res_len: usize) -> EnclaveReturn { let mut cache_id = addr.to_vec(); cache_id.extend_from_slice(&(*start).to_be_bytes()); cache_id.extend_from_slice(&(*end).to_be_bytes()); @@ -199,7 +199,7 @@ pub unsafe extern "C" fn ocall_get_deltas(db_ptr: *const RawPointer, addr: &Cont #[no_mangle] pub unsafe extern "C" fn ocall_remove_delta(db_ptr: *const RawPointer, - contract_address: &ContractAddress, delta_index_: *const u32) -> EnclaveReturn { + contract_address: &Hash256, delta_index_: *const u32) -> EnclaveReturn { let delta_index = ptr::read(delta_index_); let key = DeltaKey::new(*contract_address, Stype::Delta(delta_index)); let db: &mut DB = match (*db_ptr).get_mut_ref() { @@ -223,7 +223,7 @@ pub unsafe extern "C" fn ocall_remove_delta(db_ptr: *const RawPointer, } } -fn get_deltas(db: &mut DB, addr: ContractAddress, start: u32, end: u32) -> ResultTypeVec<(DeltaKey, Vec)> { +fn get_deltas(db: &mut DB, addr: Hash256, start: u32, end: u32) -> ResultTypeVec<(DeltaKey, Vec)> { let key_start = DeltaKey::new(addr, Stype::Delta(start)); let key_end = DeltaKey::new(addr, Stype::Delta(end)); diff --git a/enigma-core/app/src/km_u.rs b/enigma-core/app/src/km_u.rs index 21d120cb..b00c750d 100644 --- a/enigma-core/app/src/km_u.rs +++ b/enigma-core/app/src/km_u.rs @@ -3,7 +3,7 @@ use crate::common_u::errors::EnclaveFailError; use crate::db::DB; use enigma_types::traits::SliceCPtr; -use enigma_types::{EnclaveReturn, ContractAddress, PubKey, RawPointer}; +use enigma_types::{EnclaveReturn, Hash256, PubKey, RawPointer}; use failure::Error; use sgx_types::{sgx_enclave_id_t, sgx_status_t}; use crate::auto_ffi::{ecall_ptt_req, ecall_ptt_res, ecall_build_state, ecall_get_user_key}; @@ -11,7 +11,7 @@ use crate::auto_ffi::{ecall_ptt_req, ecall_ptt_res, ecall_build_state, ecall_get /// This function builds the states that it received in ptt_req and ptt_res /// It returns a Vec of the failed contract addresses #[logfn(TRACE)] -pub fn ptt_build_state(db: &mut DB, eid: sgx_enclave_id_t) -> Result, Error> { +pub fn ptt_build_state(db: &mut DB, eid: sgx_enclave_id_t) -> Result, Error> { let mut ret = EnclaveReturn::Success; let mut failed_ptr = 0u64; @@ -28,10 +28,10 @@ pub fn ptt_build_state(db: &mut DB, eid: sgx_enclave_id_t) -> Result; let part = unsafe { Box::from_raw(box_ptr) }; - let part: Vec = part + let part: Vec = part .chunks(32) .map(|s| { - let mut arr = ContractAddress::default(); + let mut arr = Hash256::default(); arr.copy_from_slice(s); arr }) @@ -95,7 +95,7 @@ pub mod tests { Stype::{Delta, State}, tests::create_test_db}; use crate::esgx::{general::init_enclave_wrapper, equote}; use self::cross_test_utils::*; - use enigma_types::{ContractAddress, DhKey}; + use enigma_types::{Hash256, DhKey}; use enigma_crypto::{KeyPair, symmetric, hash::{self, Sha256, Keccak256}}; use rmp_serde::{Deserializer, Serializer}; use serde::{Deserialize, Serialize}; @@ -171,7 +171,7 @@ pub mod tests { assert_ne!(sig.to_vec(), vec![0u8; 64]); } - pub fn instantiate_encryption_key(addresses: Vec, eid: sgx_enclave_id_t) { + pub fn instantiate_encryption_key(addresses: Vec, eid: sgx_enclave_id_t) { let req = ptt_req(eid).unwrap(); let mut des = Deserializer::new(&req.0[..]); @@ -223,7 +223,7 @@ pub mod tests { // assert!(address_result.iter().all(|x| address_set.contains(x))); } - fn fill_the_db(db: &mut DB) -> (Vec, Vec) { + fn fill_the_db(db: &mut DB) -> (Vec, Vec) { let addresses = vec![b"first".sha256(), b"second".sha256(), b"third".sha256()]; let mut stuff = vec![ (DeltaKey { contract_address: addresses[2], key_type: State }, vec![8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8]), diff --git a/enigma-core/app/src/main.rs b/enigma-core/app/src/main.rs index 80b8d2d7..3d927410 100644 --- a/enigma-core/app/src/main.rs +++ b/enigma-core/app/src/main.rs @@ -2,6 +2,8 @@ extern crate enigma_core_app; #[macro_use] extern crate log; extern crate log_derive; +#[macro_use] +extern crate failure; use log::{debug, info}; @@ -20,12 +22,13 @@ use db::DB; use cli::Opt; use structopt::StructOpt; use futures::Future; +use failure::{Fallible, format_err}; -fn main() { +fn main() -> Fallible<()> { let opt: Opt = Opt::from_args(); - let log_level = log::LevelFilter::from_str(&opt.log_level).unwrap(); + let log_level = log::LevelFilter::from_str(&opt.log_level)?; let datadir = opt.data_dir.clone().unwrap_or_else(|| dirs::home_dir().unwrap().join(".enigma")); let hostname = os::hostname(); @@ -33,8 +36,10 @@ fn main() { debug!("CLI params: {:?}", opt); - - let enclave = esgx::general::init_enclave_wrapper().map_err(|e| {error!("Init Enclave Failed {:?}", e);}).unwrap(); + let enclave = esgx::general::init_enclave_wrapper().map_err(|e| { + error!("Init Enclave Failed sgx_status_t = {:?}", e); + failure::format_err!("Init Enclave Failed sgx_status_t = {}", e) + })?; let eid = enclave.geteid(); info!("Init Enclave Successful. Enclave id {}", eid); @@ -43,6 +48,7 @@ fn main() { server .run(move |multi| ipc_listener::handle_message(&mut db, multi, &opt.spid, eid, opt.retries)) - .wait() - .unwrap(); -} \ No newline at end of file + .wait()?; + + Ok(()) +} diff --git a/enigma-core/app/src/networking/ipc_listener.rs b/enigma-core/app/src/networking/ipc_listener.rs index 7543420e..2f28ca93 100644 --- a/enigma-core/app/src/networking/ipc_listener.rs +++ b/enigma-core/app/src/networking/ipc_listener.rs @@ -72,7 +72,7 @@ pub(self) mod handling { use enigma_crypto::hash::Keccak256; use enigma_tools_u::esgx::equote as equote_tools; use enigma_tools_u::attestation_service::{service::AttestationService, constants::ATTESTATION_SERVICE_URL}; - use enigma_types::ContractAddress; + use enigma_types::Hash256; use failure::Error; use hex::{FromHex, ToHex}; use rmp_serde::Deserializer; @@ -152,7 +152,7 @@ pub(self) mod handling { #[logfn(TRACE)] pub fn get_tip(db: &DB, input: &str) -> ResponseResult { - let address = ContractAddress::from_hex(&input)?; + let address = Hash256::from_hex(&input)?; let (tip_key, tip_data) = db.get_tip::(&address)?; let key = tip_key.key_type.unwrap_delta(); @@ -163,7 +163,8 @@ pub(self) mod handling { #[logfn(TRACE)] pub fn get_tips(db: &DB, input: &[String]) -> ResponseResult { let mut tips_results = Vec::with_capacity(input.len()); - let addresses : Vec = input.iter().map(|data| ContractAddress::from_hex(&data).unwrap()).collect(); + let addresses = input.iter() + .map(|data| Hash256::from_hex(&data)).collect::,Error>>()?; let tips = db.get_tips::(&addresses)?; for (key, data) in tips { let delta = IpcDelta::from_delta_key(key, &data)?; @@ -192,7 +193,7 @@ pub(self) mod handling { #[logfn(TRACE)] pub fn get_delta(db: &DB, input: IpcDelta) -> ResponseResult { let address = input.contract_address.ok_or(P2PErr { cmd: "GetDelta".to_string(), msg: "Address Missing".to_string() })?; - let address = ContractAddress::from_hex(&address)?; + let address = Hash256::from_hex(&address)?; let delta_key = DeltaKey::new(address, Stype::Delta(input.key)); let delta = db.get_delta(delta_key)?; Ok(IpcResponse::GetDelta { result: IpcResults::Delta(delta.to_hex()) }) @@ -202,7 +203,7 @@ pub(self) mod handling { pub fn get_deltas(db: &DB, input: &[IpcDeltasRange]) -> ResponseResult { let mut results = Vec::with_capacity(input.len()); for data in input { - let address = ContractAddress::from_hex(&data.address)?; + let address = Hash256::from_hex(&data.address)?; let from = DeltaKey::new(address, Stype::Delta(data.from)); let to = DeltaKey::new(address, Stype::Delta(data.to)); @@ -222,14 +223,14 @@ pub(self) mod handling { #[logfn(TRACE)] pub fn get_contract(db: &DB, input: &str) -> ResponseResult { - let address = ContractAddress::from_hex(&input)?; + let address = Hash256::from_hex(&input)?; let data = db.get_contract(address).unwrap_or_default(); Ok(IpcResponse::GetContract { result: IpcResults::GetContract{address: address.to_hex(), bytecode: data} }) } #[logfn(TRACE)] pub fn update_new_contract(db: &mut DB, address: String, bytecode: &[u8]) -> ResponseResult { - let address_arr = ContractAddress::from_hex(&address)?; + let address_arr = Hash256::from_hex(&address)?; let delta_key = DeltaKey::new(address_arr, Stype::ByteCode); db.force_update(&delta_key, bytecode)?; Ok(IpcResponse::UpdateNewContract { address, result: IpcResults::Status(Status::Passed) }) @@ -238,7 +239,7 @@ pub(self) mod handling { #[logfn(TRACE)] pub fn update_new_contract_on_deployment(db: &mut DB, address: String, bytecode: &str, delta: IpcDelta) -> ResponseResult { let mut tuples = Vec::with_capacity(DEPLOYMENT_VALS_LEN); - let address_arr = ContractAddress::from_hex(&address)?; + let address_arr = Hash256::from_hex(&address)?; let bytecode = bytecode.from_hex()?; let bytecode_delta_key = DeltaKey::new(address_arr, Stype::ByteCode); @@ -261,7 +262,7 @@ pub(self) mod handling { #[logfn(TRACE)] pub fn remove_contract(db: &mut DB, address: String) -> ResponseResult { - let addr_arr = ContractAddress::from_hex(&address)?; + let addr_arr = Hash256::from_hex(&address)?; // the key_type of dk is irrelevant since we are removing all the contract data let dk = DeltaKey::new(addr_arr, Stype::ByteCode); let result = match db.delete_contract(&dk) { @@ -283,7 +284,7 @@ pub(self) mod handling { for delta in deltas.into_iter() { let address = delta.contract_address.ok_or(P2PErr { cmd: "UpdateDeltas".to_string(), msg: "Address Missing".to_string() })?; - let address = ContractAddress::from_hex(&address)?; + let address = Hash256::from_hex(&address)?; let data = delta.data.ok_or(P2PErr { cmd: "UpdateDeltas".to_string(), msg: "Delta Data Missing".to_string() })?; let delta_key = DeltaKey::new(address, Stype::Delta(delta.key)); @@ -311,7 +312,7 @@ pub(self) mod handling { } fn delete_data_from_db(db: &mut DB, addr: &str, key_type: Stype) -> Result { - let addr_arr = ContractAddress::from_hex(addr)?; + let addr_arr = Hash256::from_hex(addr)?; let dk = DeltaKey::new(addr_arr, key_type); match db.delete(&dk) { Ok(_) => Ok(IpcResults::Status(Status::Passed)), @@ -390,7 +391,7 @@ pub(self) mod handling { pub fn deploy_contract(db: &mut DB, input: IpcTask, eid: sgx_enclave_id_t) -> ResponseResult { let bytecode = input.pre_code.expect("Bytecode Missing"); - let contract_address = ContractAddress::from_hex(&input.address)?; + let contract_address = Hash256::from_hex(&input.address)?; let enc_args = input.encrypted_args.from_hex()?; let constructor = input.encrypted_fn.from_hex()?; let mut user_pubkey = [0u8; 64]; @@ -425,7 +426,7 @@ pub(self) mod handling { #[logfn(DEBUG)] pub fn compute_task(db: &mut DB, input: IpcTask, eid: sgx_enclave_id_t) -> ResponseResult { let enc_args = input.encrypted_args.from_hex()?; - let address = ContractAddress::from_hex(&input.address)?; + let address = Hash256::from_hex(&input.address)?; let callable = input.encrypted_fn.from_hex()?; let mut user_pubkey = [0u8; 64]; user_pubkey.clone_from_slice(&input.user_dhkey.from_hex()?); @@ -460,7 +461,7 @@ mod test { use super::*; use crate::db::{DeltaKey, P2PCalls, Stype, tests::create_test_db}; use serde_json::Value; - use enigma_types::ContractAddress; + use enigma_types::Hash256; pub const SPID: &str = "B0335FD3BC1CCA8F804EB98A6420592D"; pub const RETRIES: u32 = 10; @@ -495,7 +496,7 @@ mod test { let data: Vec<(DeltaKey, Vec)> = data .into_iter() .map(|tip| { - let contract_address: ContractAddress = serde_json::from_value(tip["address"].clone()).unwrap(); + let contract_address: Hash256 = serde_json::from_value(tip["address"].clone()).unwrap(); let key: u32 = serde_json::from_value(tip["key"].clone()).unwrap(); let delta_key = DeltaKey { contract_address, key_type: Stype::Delta(key) }; let data: Vec = serde_json::from_value(tip["delta"].clone()).unwrap(); diff --git a/enigma-core/app/src/wasm_u/mod.rs b/enigma-core/app/src/wasm_u/mod.rs index 7274ca6c..2defcb95 100644 --- a/enigma-core/app/src/wasm_u/mod.rs +++ b/enigma-core/app/src/wasm_u/mod.rs @@ -3,7 +3,7 @@ pub mod wasm; use crate::common_u::errors::EnclaveFailError; use crate::db::{Delta, DeltaKey, Stype}; use std::{fmt, convert::TryFrom}; -use enigma_types::{EnclaveReturn, ExecuteResult, ContractAddress}; +use enigma_types::{EnclaveReturn, ExecuteResult, Hash256}; use failure::Error; use sgx_types::*; @@ -78,9 +78,9 @@ impl fmt::Debug for WasmTaskFailure{ } } -impl TryFrom<(ExecuteResult, ContractAddress, EnclaveReturn, sgx_status_t)> for WasmResult { +impl TryFrom<(ExecuteResult, Hash256, EnclaveReturn, sgx_status_t)> for WasmResult { type Error = Error; - fn try_from(exec: (ExecuteResult, ContractAddress, EnclaveReturn, sgx_status_t)) -> Result { + fn try_from(exec: (ExecuteResult, Hash256, EnclaveReturn, sgx_status_t)) -> Result { let get_output = |exec_result: ExecuteResult| -> Result, Self::Error> { if exec_result.output.is_null() { bail!("The 'output' pointer in ExecuteResult is null: {:?}", exec_result); diff --git a/enigma-core/app/src/wasm_u/wasm.rs b/enigma-core/app/src/wasm_u/wasm.rs index 244faaa6..3a4b2772 100755 --- a/enigma-core/app/src/wasm_u/wasm.rs +++ b/enigma-core/app/src/wasm_u/wasm.rs @@ -1,4 +1,4 @@ -use enigma_types::{ContractAddress, EnclaveReturn, ExecuteResult, PubKey, RawPointer, traits::SliceCPtr}; +use enigma_types::{Hash256, EnclaveReturn, ExecuteResult, PubKey, RawPointer, traits::SliceCPtr}; use super::WasmResult; use crate::db::DB; use std::convert::TryInto; @@ -7,8 +7,8 @@ use sgx_types::*; use crate::auto_ffi::{ecall_deploy, ecall_execute}; #[logfn(TRACE)] -pub fn deploy(db: &mut DB, eid: sgx_enclave_id_t, bytecode: &[u8], constructor: &[u8], args: &[u8], - contract_address: &ContractAddress, user_pubkey: &PubKey, gas_limit: u64)-> Result { +pub fn deploy(db: &mut DB, eid: sgx_enclave_id_t, bytecode: &[u8], constructor: &[u8], args: &[u8], + contract_address: &Hash256, user_pubkey: &PubKey, gas_limit: u64) -> Result { let mut retval = EnclaveReturn::Success; let mut result = ExecuteResult::default(); let db_ptr = unsafe { RawPointer::new_mut(db) }; @@ -32,8 +32,8 @@ pub fn deploy(db: &mut DB, eid: sgx_enclave_id_t, bytecode: &[u8], constructor: } #[logfn(TRACE)] -pub fn execute(db: &mut DB, eid: sgx_enclave_id_t, bytecode: &[u8], callable: &[u8], args: &[u8], - user_pubkey: &PubKey, contract_address: &ContractAddress, gas_limit: u64)-> Result { +pub fn execute(db: &mut DB, eid: sgx_enclave_id_t, bytecode: &[u8], callable: &[u8], args: &[u8], + user_pubkey: &PubKey, contract_address: &Hash256, gas_limit: u64) -> Result { let mut retval = EnclaveReturn::Success; let mut result = ExecuteResult::default(); let db_ptr = unsafe { RawPointer::new_mut(db) }; @@ -69,7 +69,7 @@ mod tests { use crate::db::{DB, tests::create_test_db}; use crate::wasm_u::wasm; use self::ethabi::{Contract, Token, token::{LenientTokenizer, Tokenizer}}; - use enigma_types::{ContractAddress, DhKey, PubKey}; + use enigma_types::{Hash256, DhKey, PubKey}; use enigma_crypto::symmetric; use hex::FromHex; use sgx_types::*; @@ -88,7 +88,7 @@ mod tests { } } - fn compile_and_deploy_wasm_contract(db: &mut DB, eid: sgx_enclave_id_t, test_path: &str, contract_address: ContractAddress, constructor: &[u8], args: &[u8], user_pubkey: &PubKey) -> WasmResult { + fn compile_and_deploy_wasm_contract(db: &mut DB, eid: sgx_enclave_id_t, test_path: &str, contract_address: Hash256, constructor: &[u8], args: &[u8], user_pubkey: &PubKey) -> WasmResult { let wasm_code = get_bytecode_from_path(test_path); println!("Bytecode size: {}KB\n", wasm_code.len() / 1024); @@ -97,7 +97,7 @@ mod tests { fn compile_deploy_execute(db: &mut DB, test_path: &str, - contract_address: ContractAddress, + contract_address: Hash256, constructor: &str, constructor_arguments: &[Token], func: &str, @@ -300,10 +300,10 @@ mod tests { } fn compile_deploy_contract_execute(db: &mut DB, - test_path: &str, - contract_address: ContractAddress, - constructor: &str, - constructor_arguments: &[Token]) -> (sgx_urts::SgxEnclave, WasmTaskResult) { + test_path: &str, + contract_address: Hash256, + constructor: &str, + constructor_arguments: &[Token]) -> (sgx_urts::SgxEnclave, WasmTaskResult) { let enclave = init_enclave_wrapper().unwrap(); instantiate_encryption_key(vec![contract_address], enclave.geteid()); @@ -329,12 +329,12 @@ mod tests { } fn compile_compute_task_execute(db: &mut DB, - enclave: &sgx_urts::SgxEnclave, - deploy_res: &WasmTaskResult, - func: &str, - func_args: &[Token], - contract_address: ContractAddress) -> (WasmTaskResult, - DhKey) { + enclave: &sgx_urts::SgxEnclave, + deploy_res: &WasmTaskResult, + func: &str, + func_args: &[Token], + contract_address: Hash256) -> (WasmTaskResult, + DhKey) { let exe_code = &deploy_res.output; let (keys, shared_key, _, _) = exchange_keys(enclave.geteid()); let encrypted_callable = symmetric::encrypt(func.as_bytes(), &shared_key).unwrap(); diff --git a/enigma-core/app/tests/integration_utils/mod.rs b/enigma-core/app/tests/integration_utils/mod.rs index 08c3c3d6..05f500be 100644 --- a/enigma-core/app/tests/integration_utils/mod.rs +++ b/enigma-core/app/tests/integration_utils/mod.rs @@ -15,7 +15,7 @@ extern crate rand; extern crate tempfile; use self::cross_test_utils::{generate_contract_address, generate_user_address, make_encrypted_response, - get_fake_state_key, get_bytecode_from_path, ContractAddress, + get_fake_state_key, get_bytecode_from_path, Hash256, ERC20UserAddress, sign_message}; use self::app::*; use self::futures::Future; @@ -29,7 +29,6 @@ use self::regex::Regex; use self::hex::{ToHex, FromHex}; use self::ethabi::{Token}; use self::enigma_crypto::{asymmetric::KeyPair, symmetric}; -use self::enigma_types::Hash256; use self::rand::{thread_rng, Rng}; use app::db::DB; use self::tempfile::TempDir; @@ -149,7 +148,7 @@ pub fn parse_packed_msg(msg: &str) -> Value { Deserialize::deserialize(&mut Deserializer::new(&msg_bytes[..])).unwrap() } -pub fn mock_principal_res(msg: &str, addrs: Vec) -> Vec { +pub fn mock_principal_res(msg: &str, addrs: Vec) -> Vec { let unpacked_msg: Value = parse_packed_msg(msg); let enc_response: Value = make_encrypted_response(&unpacked_msg, addrs, None); @@ -158,7 +157,7 @@ pub fn mock_principal_res(msg: &str, addrs: Vec) -> Vec { serialized_enc_response } -pub fn run_ptt_round(port: &'static str, addrs: Vec) -> Value { +pub fn run_ptt_round(port: &'static str, addrs: Vec) -> Value { // set encrypted request message to send to the principal node let msg_req = get_ptt_req_msg(); diff --git a/enigma-core/enclave/src/km_t/mod.rs b/enigma-core/enclave/src/km_t/mod.rs index 7c523b7c..9c2c8d7c 100644 --- a/enigma-core/enclave/src/km_t/mod.rs +++ b/enigma-core/enclave/src/km_t/mod.rs @@ -9,15 +9,15 @@ use enigma_runtime_t::ocalls_t as runtime_ocalls_t; use enigma_tools_t::common::errors_t::EnclaveError; use enigma_tools_m::utils::LockExpectMutex; use enigma_crypto::{Encryption, CryptoError}; -use enigma_types::{ContractAddress, RawPointer, StateKey}; +use enigma_types::{Hash256, RawPointer, StateKey}; use std::collections::HashMap; use std::sync::SgxMutex; lazy_static! { - pub static ref STATE_KEYS: SgxMutex> = SgxMutex::new(HashMap::new()); + pub static ref STATE_KEYS: SgxMutex> = SgxMutex::new(HashMap::new()); } -pub fn get_state_key(address: ContractAddress) -> Result { +pub fn get_state_key(address: Hash256) -> Result { let statekeys_guard = STATE_KEYS.lock_expect("State Keys"); statekeys_guard .get(&address) @@ -33,7 +33,7 @@ pub fn encrypt_state(state: ContractState) -> Result, state.encrypt(&key) } -pub fn get_state(db_ptr: *const RawPointer, addr: ContractAddress) -> Result { +pub fn get_state(db_ptr: *const RawPointer, addr: Hash256) -> Result { let guard = STATE_KEYS.lock_expect("State Keys"); let key = guard.get(&addr).ok_or(CryptoError::MissingKeyError { key_type: "State Key" })?; diff --git a/enigma-core/enclave/src/km_t/principal.rs b/enigma-core/enclave/src/km_t/principal.rs index 1f01acf9..ff52a4b6 100644 --- a/enigma-core/enclave/src/km_t/principal.rs +++ b/enigma-core/enclave/src/km_t/principal.rs @@ -8,7 +8,7 @@ use enigma_crypto::asymmetric::KeyPair; use enigma_crypto::{Encryption, CryptoError}; use enigma_tools_m::primitives::km_primitives::MsgID; use enigma_tools_m::primitives::km_primitives::{PrincipalMessage, PrincipalMessageType}; -use enigma_types::{ContractAddress, StateKey, RawPointer}; +use enigma_types::{Hash256, StateKey, RawPointer}; use std::collections::HashMap; use std::sync::SgxMutex; use std::u32; @@ -51,7 +51,7 @@ pub(crate) fn ecall_ptt_res_internal(msg_slice: &[u8]) -> Result<(), EnclaveErro Ok(()) } -pub(crate) unsafe fn ecall_build_state_internal(db_ptr: *const RawPointer) -> Result, EnclaveError> { +pub(crate) unsafe fn ecall_build_state_internal(db_ptr: *const RawPointer) -> Result, EnclaveError> { let guard = STATE_KEYS.lock_expect("State Keys"); let mut failed_contracts = Vec::with_capacity(guard.len()); debug_println!("building state for {} contracts", guard.len()); @@ -140,7 +140,7 @@ pub mod tests { use enigma_crypto::hash::Sha256; use enigma_crypto::asymmetric::KeyPair; use enigma_tools_m::primitives::km_primitives::{PrincipalMessage, PrincipalMessageType}; - use enigma_types::{ContractAddress, RawPointer}; + use enigma_types::{Hash256, RawPointer}; use std::string::ToString; @@ -165,7 +165,7 @@ pub mod tests { // Mimicking the Principal/KM Node let km_node_keys = KeyPair::new().unwrap(); - let restype: Vec<(ContractAddress, StateKey)> = address.clone().into_iter().zip(state_keys.into_iter()).collect(); + let restype: Vec<(Hash256, StateKey)> = address.clone().into_iter().zip(state_keys.into_iter()).collect(); let res_obj = PrincipalMessage::new_id(PrincipalMessageType::Response(restype), req_obj.get_id(), km_node_keys.get_pubkey()); let dh_key = km_node_keys.derive_key(&req_obj.get_pubkey()).unwrap(); @@ -180,7 +180,7 @@ pub mod tests { assert_eq!(ecall_build_state_internal(db_ptr).unwrap(), vec![address[2]]) } - fn get_states_deltas(address: &[ContractAddress], keys: &[StateKey]) -> Vec> { + fn get_states_deltas(address: &[Hash256], keys: &[StateKey]) -> Vec> { let jsons: Vec = vec![ json!({"widget":{"debug":"on","window":{"title":"Sample Konfabulator Widget","name":"main_window","width":500,"height":500},"image":{"src":"Images/Sun.png","name":"sun1","hOffset":250,"vOffset":250,"alignment":"center"},"text":{"data":"Click Here","size":36,"style":"bold","name":"text1","hOffset":250,"vOffset":100,"alignment":"center","onMouseUp":"sun1.opacity = (sun1.opacity / 100) * 90;"}}}), serde_json::from_str(r#"{ "name": "John Doe", "age": 43, "phones": [ "+44 1234567", "+44 2345678" ] }"#).unwrap(), diff --git a/enigma-core/enclave/src/lib.rs b/enigma-core/enclave/src/lib.rs index f5cb2f37..f58c9f3c 100755 --- a/enigma-core/enclave/src/lib.rs +++ b/enigma-core/enclave/src/lib.rs @@ -46,7 +46,7 @@ use enigma_tools_t::{ quote_t, storage_t, }; use enigma_types::{ - ContractAddress, DhKey, EnclaveReturn, ExecuteResult, Hash256, PubKey, RawPointer, ResultStatus, + DhKey, EnclaveReturn, ExecuteResult, Hash256, PubKey, RawPointer, ResultStatus, }; use sgx_types::*; @@ -91,7 +91,7 @@ pub unsafe extern "C" fn ecall_execute( args: *const u8, args_len: usize, user_key: &[u8; 64], - contract_address: &ContractAddress, + contract_address: &Hash256, gas_limit: *const u64, db_ptr: *const RawPointer, result: &mut ExecuteResult, @@ -147,7 +147,7 @@ pub unsafe extern "C" fn ecall_deploy( constructor_len: usize, args: *const u8, args_len: usize, - address: &ContractAddress, + address: &Hash256, user_key: &PubKey, gas_limit: *const u64, db_ptr: *const RawPointer, @@ -320,7 +320,7 @@ unsafe fn ecall_execute_internal( args: &[u8], user_key: &PubKey, io_key: &DhKey, - address: ContractAddress, + address: Hash256, gas_limit: u64, db_ptr: *const RawPointer, result: &mut ExecuteResult, @@ -374,7 +374,7 @@ unsafe fn ecall_deploy_internal( bytecode: &[u8], constructor: &[u8], args: &[u8], - address: ContractAddress, + address: Hash256, user_key: &PubKey, io_key: &DhKey, gas_limit: u64, diff --git a/enigma-principal/app/Cargo.lock b/enigma-principal/app/Cargo.lock index c5b2f945..9cc73110 100644 --- a/enigma-principal/app/Cargo.lock +++ b/enigma-principal/app/Cargo.lock @@ -7,10 +7,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "aho-corasick" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -33,7 +33,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "arrayref" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -51,9 +51,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "atty" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -63,6 +64,11 @@ name = "autocfg" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "backtrace" version = "0.3.38" @@ -91,6 +97,11 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "1.2.1" @@ -98,12 +109,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "blake2b_simd" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -136,10 +147,10 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -184,9 +195,9 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -207,8 +218,8 @@ name = "chrono" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -218,11 +229,11 @@ version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -234,18 +245,9 @@ dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "colour" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "constant_time_eq" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -267,8 +269,8 @@ dependencies = [ "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -355,7 +357,7 @@ name = "crypto-mac" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -375,10 +377,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -388,7 +390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling_core 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -399,7 +401,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -426,13 +428,13 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "dtoa" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -447,7 +449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "encoding_rs" -version = "0.8.20" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -462,8 +464,8 @@ dependencies = [ "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.6 (git+https://github.com/elichai/ring.git?rev=sgx-0.14.6)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -471,7 +473,7 @@ dependencies = [ name = "enigma-principal-app" version = "0.3.0" dependencies = [ - "colour 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "enigma-crypto 0.3.0", "enigma-tools-m 0.3.0", @@ -482,21 +484,24 @@ dependencies = [ "ethabi 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-serde 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-test 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log-derive 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "secp256k1 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "sgx_types 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)", "sgx_urts 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)", "structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "web3 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -515,9 +520,9 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log-derive 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "rmp-serde 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -532,19 +537,20 @@ dependencies = [ "ethabi 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "gethostname 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gethostname 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log-derive 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log4rs 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.26 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.9.22 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.27 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "sgx_types 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)", "sgx_urts 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)", + "thiserror 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "web3 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -555,8 +561,8 @@ version = "0.3.0" dependencies = [ "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "cbindgen 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -564,7 +570,7 @@ name = "envy" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -610,10 +616,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -656,9 +662,9 @@ name = "failure_derive" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -675,7 +681,7 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -738,7 +744,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -760,7 +766,7 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -769,12 +775,12 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -782,11 +788,11 @@ name = "globset" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bstr 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -798,8 +804,8 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -824,12 +830,26 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hex-serde" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hmac" version = "0.4.2" @@ -852,12 +872,12 @@ dependencies = [ [[package]] name = "http" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -867,7 +887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -881,7 +901,7 @@ name = "humantime" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -893,11 +913,11 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -908,7 +928,7 @@ dependencies = [ "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -937,7 +957,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -947,7 +967,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -971,15 +991,15 @@ name = "impl-serde" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "indexmap" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1000,7 +1020,7 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1010,9 +1030,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1024,8 +1044,8 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1049,7 +1069,7 @@ dependencies = [ "jsonrpc-core 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1062,7 +1082,7 @@ dependencies = [ "jsonrpc-core 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1077,8 +1097,8 @@ dependencies = [ "jsonrpc-core-client 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1105,7 +1125,7 @@ name = "libsecp256k1" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "hmac-drbg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1137,7 +1157,7 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1149,7 +1169,7 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1159,9 +1179,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1183,10 +1203,10 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "log-mdc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde-value 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", "thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1205,7 +1225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memchr" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1218,7 +1238,7 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.14" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1226,7 +1246,7 @@ name = "mime_guess" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1285,9 +1305,9 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.26 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.27 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", "schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1311,27 +1331,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num-integer" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num_cpus" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1342,7 +1362,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl" -version = "0.10.26" +version = "0.10.27" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1350,7 +1370,7 @@ dependencies = [ "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1360,10 +1380,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl-sys" -version = "0.9.53" +version = "0.9.54" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1375,7 +1395,7 @@ name = "ordered-float" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1392,7 +1412,7 @@ version = "3.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1419,7 +1439,7 @@ name = "parking_lot" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1507,7 +1527,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1521,13 +1541,13 @@ dependencies = [ "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quick-error" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1543,7 +1563,7 @@ name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1599,10 +1619,10 @@ dependencies = [ [[package]] name = "rand" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1645,7 +1665,7 @@ name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1727,29 +1747,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "redox_users" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" -version = "1.3.1" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.12" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1762,31 +1781,31 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.9.22" +version = "0.9.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "encoding_rs 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1811,16 +1830,16 @@ name = "rlp" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rmp" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1829,8 +1848,8 @@ version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rmp 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1839,18 +1858,19 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rmp 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rust-argon2" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1865,7 +1885,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rustc-hex" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1947,10 +1967,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1959,27 +1979,27 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.42" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1987,9 +2007,9 @@ name = "serde_urlencoded" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1998,21 +2018,21 @@ name = "serde_yaml" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sgx_types" version = "1.0.9" -source = "git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9#2042ce64fd377e790584c96a4bfd4c32de2d03ea" +source = "git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9#46837a05facee93622cdf5c3a1d542525c4fce75" [[package]] name = "sgx_urts" version = "1.0.9" -source = "git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9#2042ce64fd377e790584c96a4bfd4c32de2d03ea" +source = "git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9#46837a05facee93622cdf5c3a1d542525c4fce75" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "sgx_types 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)", @@ -2032,7 +2052,7 @@ dependencies = [ [[package]] name = "sha2" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2061,7 +2081,7 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2094,7 +2114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "strsim" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2129,10 +2149,10 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2142,9 +2162,9 @@ name = "synstructure" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2155,28 +2175,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "term" -version = "0.5.2" +name = "textwrap" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "thiserror" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thiserror-impl 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2191,7 +2219,7 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2223,7 +2251,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2232,7 +2260,7 @@ dependencies = [ "tokio-reactor 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-sync 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-udp 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2301,7 +2329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2324,7 +2352,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2356,7 +2384,7 @@ dependencies = [ [[package]] name = "tokio-threadpool" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2365,7 +2393,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2426,7 +2454,7 @@ name = "toml" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2468,7 +2496,7 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2489,10 +2517,10 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2502,7 +2530,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2540,7 +2568,7 @@ dependencies = [ [[package]] name = "url" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2588,7 +2616,7 @@ dependencies = [ [[package]] name = "wasi" -version = "0.7.0" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2608,9 +2636,9 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2672,24 +2700,26 @@ dependencies = [ [metadata] "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" +"checksum aho-corasick 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5f56c476256dc249def911d6f7580b5fc7e875895b5d7ee88f5d602208035744" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" "checksum arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841" -"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" +"checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum backtrace 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)" = "690a62be8920ccf773ee00ef0968649b0e724cda8bd5b12286302b4ae955fdf5" "checksum backtrace-sys 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "5b3a000b9c543553af61bc01cbfc403b04b5caa9e421033866f2e98061eb3e61" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" +"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" "checksum block-buffer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1339a1042f5d9f295737ad4d9a6ab6bf81c84a933dba110b9200cd6d1448b814" "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" "checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -"checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" +"checksum bstr 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fe8a65814ca90dfc9705af76bb6ba3c6e2534489a72270e797e603783bb4990b" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" @@ -2701,8 +2731,7 @@ dependencies = [ "checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum colour 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a328d8ddb37e76b43ee7da69a58f59c0c72d5cf8c091d004712f3154b41cd7" -"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" "checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" "checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" @@ -2722,10 +2751,10 @@ dependencies = [ "checksum digest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e5b29bf156f3f4b3c4f610a25ff69370616ae6e0657d416de22645483e72af0a" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" -"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" +"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum elastic-array-plus 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "562cc8504a01eb20c10fb154abd7c4baeb9beba2329cf85838ee2bd48a468b18" -"checksum encoding_rs 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)" = "87240518927716f79692c2ed85bfe6e98196d18c6401ec75355760233a7e12e9" +"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum envy 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "20664407d5097b5a861dffb0c32af2be7215a0050415cb50232aec36d73f69df" "checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" "checksum etcommon-bigint 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "e8375b615f02fc1ea1aea0a323e11c1084c841bd530a6dc57b9e1da80a502abd" @@ -2749,16 +2778,18 @@ dependencies = [ "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fceb69994e330afed50c93524be68c42fa898c2d9fd4ee8da03bd7363acd26f2" -"checksum gethostname 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4ab273ca2a31eb6ca40b15837ccf1aa59a43c5db69ac10c542be342fae2e01d" -"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" +"checksum gethostname 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" "checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" +"checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" +"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +"checksum hex-serde 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3486d7bc9e52c4c5fc1856ae8a5e4ab41d2499fc20bbc44492e244e8bf1b7012" "checksum hmac 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a13f4163aa0c5ca1be584aace0e2212b2e41be5478218d4f657f5f778b2ae2a" "checksum hmac-drbg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4fe727d41d2eec0a6574d887914347e5ff96a3b87177817e2a9820c5c87fecc2" -"checksum http 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "2790658cddc82e82b08e25176c431d7015a0adeb1718498715cbd20138a0bf68" +"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" "checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" @@ -2770,10 +2801,10 @@ dependencies = [ "checksum impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b" "checksum impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" "checksum impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "58e3cae7e99c7ff5a995da2cf78dd0a5383740eda71d98cf7b1910c301ac69b8" -"checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" +"checksum indexmap 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b54058f0a6ff80b6803da8faf8997cde53872b38f4023728f6830b06cd3c0dc" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" "checksum jsonrpc-core 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97b83fdc5e0218128d0d270f2f2e7a5ea716f3240c8518a58bc89e6716ba8581" "checksum jsonrpc-core-client 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c889ca27072f038496a62f38356e8f827acf194d7276030120265362b2974eab" "checksum jsonrpc-http-server 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541257be6c8f75a41812575150dfa1120d3ee3a852601f2ca8ac9bcb73575c4e" @@ -2787,16 +2818,16 @@ dependencies = [ "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" "checksum lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" -"checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" +"checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum log-derive 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2c7f436d3b5b51857b145075009f3a0d88dd37d2e93f42bb227045f4562a131e" "checksum log-mdc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" "checksum log4rs 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e229f32d17a1a822df4bb22ffdf1c7449d0ece700f310e87254a297be31c3b63" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" +"checksum memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" -"checksum mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "dd1d63acd1b78403cc0c325605908475dd9b9a3acbf65ed8bcab97e27014afcf" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" "checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" @@ -2805,13 +2836,13 @@ dependencies = [ "checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" -"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" -"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" -"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" +"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" -"checksum openssl 0.10.26 (registry+https://github.com/rust-lang/crates.io-index)" = "3a3cc5799d98e1088141b8e01ff760112bbd9f19d850c124500566ca6901a585" +"checksum openssl 0.10.27 (registry+https://github.com/rust-lang/crates.io-index)" = "e176a45fedd4c990e26580847a525e39e16ec32ac78957dbf62ded31b3abfd6f" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)" = "465d16ae7fc0e313318f7de5cecf57b2fbe7511fd213978b457e1c96ff46736f" +"checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" "checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" "checksum parity-codec 3.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2b9df1283109f542d8852cd6b30e9341acc2137481eb6157d2e62af68b0afec9" @@ -2827,16 +2858,16 @@ dependencies = [ "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum primitive-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2288eb2a39386c4bc817974cc413afe173010dc80e470fcb1e9a35580869f024" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" +"checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" "checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" "checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" "checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" @@ -2851,20 +2882,20 @@ dependencies = [ "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" +"checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" +"checksum regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" +"checksum regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "b28dfe3fe9badec5dbf0a79a9cccad2cfc2ab5484bdb3e44cbd1ae8b3ba2be06" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum reqwest 0.9.22 (registry+https://github.com/rust-lang/crates.io-index)" = "2c2064233e442ce85c77231ebd67d9eca395207dec2127fe0bbedde4bd29a650" +"checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.14.6 (git+https://github.com/elichai/ring.git?rev=sgx-0.14.6)" = "" "checksum rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3a44d5ae8afcb238af8b75640907edc6c931efcfab2c854e81ed35fa080f84cd" -"checksum rmp 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f594cb7ff8f1c5a7907f6be91f15795c8301e0d5718eb007fb5832723dd716e" +"checksum rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "0f10b46df14cf1ee1ac7baa4d2fbc2c52c0622a4b82fa8740e37bc452ac0184f" "checksum rmp-serde 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)" = "011e1d58446e9fa3af7cdc1fb91295b10621d3ac4cb3a85cc86385ee9ca50cd3" "checksum rmp-serde 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4a31c0798045f039ace94e0166f76478b3ba83116ec7c9d4bc934c5b13b8df21" -"checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" +"checksum rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" -"checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" +"checksum rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" "checksum schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021" @@ -2876,36 +2907,37 @@ dependencies = [ "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" "checksum serde-value 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7a663f873dedc4eac1a559d4c6bc0d0b2c34dc5ac4702e105014b8281489e44f" -"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" -"checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "21b01d7f0288608a01dca632cf1df859df6fd6ffa885300fc275ce2ba6221953" "checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" "checksum sgx_types 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)" = "" "checksum sgx_urts 1.0.9 (git+https://github.com/baidu/rust-sgx-sdk.git?rev=v1.0.9)" = "" "checksum sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d963c78ce367df26d7ea8b8cc655c651b42e8a1e584e869c1e17dae3ccb116a" -"checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" +"checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" +"checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum strsim 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "032c03039aae92b350aad2e3779c352e104d919cb192ba2fabbd7b831ce4f0f6" +"checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" "checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7" "checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107" "checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" +"checksum syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -"checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thiserror 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "205684fd018ca14432b12cce6ea3d46763311a571c3d294e71ba3f01adcf1aad" +"checksum thiserror-impl 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "57e4d2e50ca050ed44fb58309bdce3efa79948f84f9993ad1978de5eebdce5a7" "checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" @@ -2919,7 +2951,7 @@ dependencies = [ "checksum tokio-reactor 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146" "checksum tokio-sync 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76" "checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" -"checksum tokio-threadpool 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd2c6a3885302581f4401c82af70d792bb9df1700e7437b0aeb4ada94d5388c" +"checksum tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c32ffea4827978e9aa392d2f743d973c1dfa3730a2ed3f22ce1e6984da848c" "checksum tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6131e780037787ff1b3f8aad9da83bca02438b72277850dd6ad0d455e0e20efc" "checksum tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827" "checksum tokio-udp 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b" @@ -2933,22 +2965,22 @@ dependencies = [ "checksum uint 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2143cded94692b156c356508d92888acc824db5bffc0b4089732264c6fcf86d4" "checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" +"checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" "checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" -"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" "checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" "checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" "checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum web3 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "076f34ed252d74a8521e3b013254b1a39f94a98f23aae7cfc85cda6e7b395664" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" diff --git a/enigma-principal/app/Cargo.toml b/enigma-principal/app/Cargo.toml index e465f536..a6f030fc 100644 --- a/enigma-principal/app/Cargo.toml +++ b/enigma-principal/app/Cargo.toml @@ -13,6 +13,7 @@ enigma-tools-m = { path = "../../enigma-tools-m" } ethabi = "8.0.1" etcommon-rlp = "0.2" failure = "0.1.3" +thiserror = "1.0.9" rustc-hex = "1.0.0" serde_json = "1.0" serde = "1.0" @@ -20,12 +21,14 @@ serde_derive = "1.0" rmp-serde = "0.13.7" structopt = "0.2.10" url = "1.7.1" -colour = "0.3" +crossbeam-utils = "0.7" dirs = "1.0" web3 = { version = "0.8", default-features = false, features=["http", "tls"] } jsonrpc-http-server = "11.0.0" log = "0.4.6" log-derive = "0.3" +lazy_static = "1.3.0" +hex-serde = "0.1.0" envy = "0.3.2" itertools = "0.8.1" secp256k1 = "0.12" diff --git a/enigma-principal/app/src/boot_network/deploy_scripts.rs b/enigma-principal/app/src/boot_network/deploy_scripts.rs deleted file mode 100644 index d70bfc5a..00000000 --- a/enigma-principal/app/src/boot_network/deploy_scripts.rs +++ /dev/null @@ -1,77 +0,0 @@ -use enigma_tools_u::web3_utils::w3utils; -use failure::Error; -use rustc_hex::ToHex; -use std::{str, sync::Arc, thread, time}; -use web3::{ - contract::{Contract, Options}, - futures::Future, - transports::Http, - types::Address, - Web3, -}; - -/// TESTING: deploy the dummy contract -fn deploy_dummy_miner(w3: &Web3, deployer: &str) -> Result, Error> { - // contract path - let path = "../app/tests/principal_node/contracts/Dummy.json"; - // build deploy params - let gas_limit: u64 = 5_999_999; - let poll_interval: u64 = 1; - let confirmations: usize = 0; - let (abi, bytecode) = w3utils::load_contract_abi_bytecode(path)?; - - let tx = w3utils::DeployParams::new(deployer, abi, bytecode, gas_limit, poll_interval, confirmations)?; - // deploy - let contract = w3utils::deploy_contract(&w3, &tx, ())?; - Ok(contract) -} - -/// TESTING: mimic block creation to test the watch blocks method of the principal node -pub fn forward_blocks(w3: &Arc>, interval: u64, deployer: Address) -> Result<(), Error> { - let contract = deploy_dummy_miner(&w3, &deployer.to_fixed_bytes().to_hex())?; - println!("deployed dummy contract at address = {:?}", contract.address()); - loop { - let gas_limit: u64 = 5_999_999; - let mut options = Options::default(); - options.gas = Some(gas_limit.into()); - // contract.call("mine",(),deployer,options ).wait().expect("error calling mine on miner."); - let res = contract.call("mine", (), deployer, options).wait(); - match res { - Ok(_) => println!("\u{2692}"), - Err(e) => println!("[-] error mining block =>{:?}", e), - }; - thread::sleep(time::Duration::from_secs(interval)); - } -} - -#[cfg(test)] -mod test { - use esgx::general::init_enclave_wrapper; - use std::env; - - /// This function is important to enable testing both on the CI server and local. - /// On the CI Side: - /// The ethereum network url is being set into env variable 'NODE_URL' and taken from there. - /// Anyone can modify it by simply doing $export NODE_URL= and then running the tests. - /// The default is set to ganache cli "http://localhost:8545" - fn get_node_url() -> String { env::var("NODE_URL").unwrap_or("http://localhost:8545".to_string()) } - - #[test] - fn test_deploy_enigma_contract_environment() { - let enclave = init_enclave_wrapper().unwrap(); - let _eid = enclave.geteid(); - // load the config - // let deploy_config = "../app/tests/principal_node/contracts/deploy_config.json"; - // let mut config = deploy_scripts::load_config(deploy_config).unwrap(); - // // modify to dynamic address - // config.set_ethereum_url(get_node_url()); - // deploy all contracts. - // let signer_addr = get_signing_address(eid).unwrap(); - // let _enigma_contract = EnigmaContract::deploy_contract(Path::new(&config.enigma_token_contract_path), - // Path::new(&config.enigma_contract_path), - // &get_node_url(), - // None, - // &signer_addr).unwrap(); - } - -} diff --git a/enigma-principal/app/src/boot_network/mod.rs b/enigma-principal/app/src/boot_network/mod.rs deleted file mode 100644 index 4b0b0abe..00000000 --- a/enigma-principal/app/src/boot_network/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod deploy_scripts; -pub mod keys_provider_http; -pub mod principal_manager; -pub mod principal_utils; diff --git a/enigma-principal/app/src/boot_network/principal_manager.rs b/enigma-principal/app/src/boot_network/principal_manager.rs deleted file mode 100644 index 7f0dea11..00000000 --- a/enigma-principal/app/src/boot_network/principal_manager.rs +++ /dev/null @@ -1,503 +0,0 @@ -use std::{fs::File, io::prelude::*, str, sync::Arc, thread}; - -use failure::Error; -use rustc_hex::ToHex; -use serde_derive::*; -use serde_json; -use sgx_types::sgx_enclave_id_t; -use web3::{ - futures::Future, - transports::Http, - types::{Address, H160, H256, U256}, - Web3, -}; -use envy; - -use enigma_crypto::EcdsaSign; -use boot_network::{deploy_scripts, keys_provider_http::PrincipalHttpServer, principal_utils::Principal}; -use enigma_tools_u::{ - attestation_service::service, - esgx::equote::retry_quote, - web3_utils::enigma_contract::{ContractFuncs, ContractQueries, EnigmaContract}, -}; -use epoch_u::epoch_provider::EpochProvider; -use esgx; -use enigma_tools_u::common_u::errors::Web3Error; -use std::path::PathBuf; - -use secp256k1::key::SecretKey; -use secp256k1::Message; -use secp256k1::Secp256k1; - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct PrincipalConfig { - // Path to IEnigma.Json ** probably a good place to document that IEnigma.Json is used because parsing the entire Enigma.json will fail to due missing types - pub enigma_contract_path: String, - // Not 100% sure on this one. Path to where we download the enigma.json ABI from? Either way, probably unused - pub enigma_contract_remote_path: String, - // Address of the deployed contract -- expected to be set externally - pub enigma_contract_address: String, - // Ethereum address of the *operating address* of the KM - pub account_address: String, - // Chain ID of the ethereum node we're working with - pub chain_id: u64, - // TODO: Not sure what this does - pub test_net: bool, - // Flag whether we're using a predefined private key (true) or self-generated keys in SGX (false) - pub with_private_key: bool, - // Private key, as hex string (without "0x"). Only used if with_private_key is set to true - pub private_key: String, - // Uh - pub url: String, - // Length of epoch in blocks - pub epoch_size: usize, - // TODO: this - pub polling_interval: u64, - // TODO: this - pub max_epochs: Option, - // TODO: this - pub spid: String, - // Address of SGX attestation proxy (enigma attestation service) - pub attestation_service_url: String, - // Number of retires before we give up on connection to attestation service? - pub attestation_retries: u32, - // JSON-RPC port. Usually 3040 - pub http_port: u16, - // Number of confirmations on-chain before accepting a transaction as complete - pub confirmations: u64, -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct RegistrationParams { - pub signing_address: String, - pub report: String, - pub signature: String, -} - -pub struct ReportManager { - pub config: PrincipalConfig, - as_service: service::AttestationService, - pub eid: sgx_enclave_id_t, -} - -pub struct PrincipalManager { - pub config: PrincipalConfig, - pub contract: Arc, - pub report_manager: ReportManager, - pub eid: sgx_enclave_id_t, -} - -pub struct SgxEthereumSigner { - eid: sgx_enclave_id_t, -} - -impl SgxEthereumSigner { - pub fn new(eid: sgx_enclave_id_t) -> SgxEthereumSigner { - SgxEthereumSigner{ eid } - } -} - -impl EcdsaSign for SgxEthereumSigner { - fn sign_hashed(&self, to_sign: &[u8; 32]) -> [u8; 65] { - match esgx::equote::sign_ethereum(self.eid, to_sign) { - Ok(sig) => sig, - Err(err) => { - panic!("Error signing data: {:?}", err); - } - // println!("Signed data: {:?}", sig.to_vec().to_hex()); - } - } -} - -pub struct PrivateKeyEthereumSigner { - private_key: [u8; 32] -} - -impl PrivateKeyEthereumSigner { - pub fn new(private_key: [u8; 32]) -> PrivateKeyEthereumSigner { - PrivateKeyEthereumSigner{ private_key } - } -} - -impl EcdsaSign for PrivateKeyEthereumSigner { - fn sign_hashed(&self, to_sign: &[u8; 32]) -> [u8; 65] { - let s = Secp256k1::signing_only(); - let msg = Message::from_slice(to_sign).unwrap(); - let key = SecretKey::from_slice(&self.private_key).unwrap(); - let (v, sig_bytes) = s.sign_recoverable(&msg, &key).serialize_compact(); - - let mut sig_recoverable: [u8; 65] = [0u8; 65]; - sig_recoverable[0..64].copy_from_slice(&sig_bytes); - sig_recoverable[64] = (v.to_i32() + 27) as u8; - sig_recoverable - } -} - -impl ReportManager { - pub fn new(config: PrincipalConfig, eid: sgx_enclave_id_t) -> Result { - let as_service = service::AttestationService::new_with_retries(&config.attestation_service_url, config.attestation_retries); - Ok(ReportManager { config, as_service, eid }) - } - - pub fn get_signing_address(&self) -> Result { - let _signing_address = esgx::equote::get_register_signing_address(self.eid)?; - let signing_address = _signing_address.to_vec().to_hex(); - Ok(signing_address) - } - - pub fn get_ethereum_address(&self) -> Result { - if self.config.with_private_key { - return Ok(self.config.account_address.clone()); - } - let _signing_address = esgx::equote::get_ethereum_address(self.eid)?; - let signing_address = _signing_address.to_vec().to_hex(); - Ok(signing_address) - } - - #[logfn(DEBUG)] - pub fn get_registration_params(&self) -> Result { - let signing_address = self.get_signing_address()?; - let mode = option_env!("SGX_MODE").unwrap_or_default(); - let enc_quote = retry_quote(self.eid, &self.config.spid, 18)?; - - let report: String; - let signature: String; - if mode == "SW" { - // Software Mode - println!("Simulation mode"); - report = enc_quote; - signature = String::new(); - } else { - // Hardware Mode - println!("Hardware mode"); - let response = self.as_service.get_report(enc_quote)?; - report = response.result.report_string; - signature = response.result.signature; - } - Ok(RegistrationParams { signing_address, report, signature }) - } -} - -impl PrincipalConfig { - // load json config into the struct - #[logfn(DEBUG)] - pub fn load_config(config_path: &str) -> Result { - info!("loading Principal config"); - // All configurations from env should be with the same names of the - // PrincipalConfig struct fields in uppercase letters - match envy::from_env::() { - Ok(config) => Ok(config), - Err(_) => { - info!("trying to load from path: {:?}", config_path); - let mut f = File::open(config_path)?; - - let mut contents = String::new(); - f.read_to_string(&mut contents)?; - - Ok(serde_json::from_str(&contents)?) - } - } - } -} -impl PrincipalManager { - pub fn get_web3(&self) -> Arc> { Arc::clone(&self.contract.web3) } -} - -// General interface of a Sampler == The entity that manages the principal node logic. -pub trait Sampler { - /// load with config from file - fn new(config: PrincipalConfig, contract: Arc, report_manager: ReportManager) -> Result - where Self: Sized; - - fn get_signing_address(&self) -> Result; - - fn get_contract_address(&self) -> Address; - - fn get_account_address(&self) -> Address; - - fn get_network_url(&self) -> String; - - fn get_block_number(&self) -> Result; - - fn register>(&self, signing_address: H160, gas_limit: G) -> Result; - - fn verify_identity_or_register>(&self, gas_limit: G) -> Result, Error>; - - /// after initiation, this will run the principal node and block. - fn run>(&self, path: PathBuf, reset_epoch: bool, gas: G) -> Result<(), Error>; -} - -impl Sampler for PrincipalManager { - fn new(config: PrincipalConfig, contract: Arc, report_manager: ReportManager) -> Result { - let eid = report_manager.eid; - // let registration_params = report_manager.get_registration_params()?; - Ok(PrincipalManager { config, contract, report_manager, eid }) - } - - fn get_signing_address(&self) -> Result { - let sig_addr = self.report_manager.get_signing_address()?; - Ok(sig_addr.parse()?) - } - - fn get_contract_address(&self) -> Address { self.contract.address() } - - // noinspection RsBorrowChecker - fn get_account_address(&self) -> Address { self.contract.account } - - fn get_network_url(&self) -> String { self.config.url.clone() } - - fn get_block_number(&self) -> Result { - let block_number = match self.get_web3().eth().block_number().wait() { - Ok(block_number) => block_number, - Err(err) => return Err(Web3Error { - message: format!("Current block number not available: {:?}", err), - }.into()), - }; - Ok(block_number) - } - - #[logfn(DEBUG)] - fn register>(&self, signing_address: H160, gas_limit: G) -> Result { - let registration_params = self.report_manager.get_registration_params()?; - // the register method on the Enigma contract expects a staking address - // since it's suited for the workers as well. - // staking is irrelevant for the KM and therefore we are sending an empty address - let staking_address = H160::zero(); - println!("Registering"); - let receipt = self.contract.register( - staking_address, - signing_address, - registration_params.report, - registration_params.signature, - gas_limit, - self.config.confirmations as usize, - )?; - Ok(receipt.transaction_hash) - } - - /// Verifies whether the worker is registered in the Enigma contract. - /// If not, create a `register` transaction. - /// - /// # Arguments - /// - /// * `gas_limit` - The gas limit of the `register` transaction - #[logfn(DEBUG)] - fn verify_identity_or_register>(&self, gas_limit: G) -> Result, Error> { - let signing_address = self.get_signing_address()?; - let registered_signing_address = self.contract.get_signing_address()?; - if signing_address == registered_signing_address { - debug!("Already registered with enigma signing address {:?}", registered_signing_address); - Ok(None) - } else { - let tx = self.register(signing_address, gas_limit)?; - debug!("Registered by transaction {:?}", tx); - Ok(Some(tx)) - } - } - - /// Warms up the application. - /// 1. Register the worker if not already registered - /// 2. Create an `EpochProvider` which loads the local `EpochState` if available - /// 3. Start the JSON-RPC server - /// 4. Watch the blocks for new epochs - /// - /// # Arguments - /// - /// * `path` - path to the directory in which we store the epoch state. - /// * `reset_epoch` - If true, reset the epoch state - /// * `gas_limit` - The gas limit for all Enigma contract transactions - #[logfn(INFO)] - fn run>(&self, path: PathBuf, reset_epoch: bool, gas_limit: G) -> Result<(), Error> { - let gas_limit: U256 = gas_limit.into(); - self.verify_identity_or_register(gas_limit)?; - // get enigma contract - // Start the WorkerParameterized Web3 log filter - let eid: Arc = Arc::new(self.eid); - let epoch_provider = Arc::new(EpochProvider::new(eid, path, self.contract.clone())?); - if reset_epoch { - epoch_provider.epoch_state_manager.reset()?; - } - - // Start the JSON-RPC Server - let port = self.config.http_port; - let server_ep = Arc::clone(&epoch_provider); - thread::spawn(move || { - let server = PrincipalHttpServer::new(server_ep, port); - server.start(); - }); - - // watch blocks - let polling_interval = self.config.polling_interval; - let epoch_size = self.config.epoch_size; - self.contract.watch_blocks( - epoch_size, - polling_interval, - epoch_provider, - gas_limit, - self.config.confirmations as usize, - self.config.max_epochs, - ); - Ok(()) - } -} - -/// Helper method to start 'miner' that simulates blocks. -pub fn run_miner(account: Address, w3: Arc>, interval: u64) -> thread::JoinHandle<()> { - thread::spawn(move || { - deploy_scripts::forward_blocks(&Arc::clone(&w3), interval, account).unwrap(); - }) -} - -//////////////////////// TESTS ///////////////////////////////////////// - -#[cfg(test)] -mod test { - extern crate tempfile; - use std::{env, path::Path, sync::Arc, sync::Mutex, thread, time}; - use self::tempfile::TempDir; - - use web3::{ - futures::{Future, stream::Stream}, - transports::Http, - types::{FilterBuilder, Log}, - Web3, - }; - - use enigma_tools_u::web3_utils::{enigma_contract::EnigmaContract, w3utils}; - use epoch_u::epoch_types::{WorkersParameterizedEvent, WORKER_PARAMETERIZED_EVENT}; - use esgx::general::init_enclave_wrapper; - - use super::*; - - const GAS_LIMIT: usize = 5999999; - /// This function is important to enable testing both on the CI server and local. - /// On the CI Side: - /// The ethereum network url is being set into env variable 'NODE_URL' and taken from there. - /// Anyone can modify it by simply doing $export NODE_URL= and then running the tests. - /// The default is set to ganache cli "http://localhost:8545" - pub fn get_node_url() -> String { env::var("NODE_URL").unwrap_or(String::from("http://localhost:8545")) } - - /// helps in assertion to check if a random event was indeed broadcast. - pub fn filter_random(w3: &Arc>, contract_addr: Option<&str>, event_name: &str) -> Result, Error> { - let logs = w3utils::filter_blocks(w3, contract_addr, event_name)?; - Ok(logs) - } - - #[logfn(DEBUG)] - pub fn get_config() -> Result { - let config_path = "../app/tests/principal_node/config/principal_test_config.json"; - let config = PrincipalConfig::load_config(config_path)?; - Ok(config) - } - - pub fn init_no_deploy(eid: u64) -> Result { - let mut config = get_config()?; - let enclave_manager = ReportManager::new(config.clone(), eid)?; - let ethereum_signer = Box::new(SgxEthereumSigner{eid}) as Box; - let contract = Arc::new(EnigmaContract::from_deployed( - &config.enigma_contract_address, - Path::new(&config.enigma_contract_path), - Some(&config.account_address), - config.chain_id, - &config.url, - ethereum_signer, - )?); - let _gas_limit = 5_999_999; - config.max_epochs = None; - let principal: PrincipalManager = PrincipalManager::new(config.clone(), contract, enclave_manager).unwrap(); - Ok(principal) - } - - // TODO: The two tests below require the Enigma contract to be deployed - /// Not a standalone unit test, must be coordinated with the Enigma Contract tests - #[test] - #[ignore] - fn test_set_worker_params() { - let tempdir = tempfile::tempdir().unwrap(); - let gas_limit: U256 = 5999999.into(); - let enclave = init_enclave_wrapper().unwrap(); - let eid = enclave.geteid(); - let principal = init_no_deploy(eid).unwrap(); - principal.verify_identity_or_register(gas_limit).unwrap(); - - let block_number = principal.get_block_number().unwrap(); - let eid_safe = Arc::new(eid); - let epoch_provider = EpochProvider::new(eid_safe, tempdir.into_path(), principal.contract.clone()).unwrap(); - epoch_provider.epoch_state_manager.reset().unwrap(); - epoch_provider.set_worker_params(block_number, gas_limit, 0).unwrap(); - } - - /// This test is more like a system-test than a unit-test. - /// It is only dependent on an ethereum node running under the NODE_URL evn var or the default localhost:8545 - /// First it deploys all the contracts related (EnigmaToken, Enigma) and runs miner to simulate blocks. - /// Second, it spawns a background thread to poll for events and searchses for the WorkersParameterized event. - /// Then, the principal register (full process including quote) and then, - /// starts watching blocks and emits random with WorkersParameterized event. - /// The testing is looking for atleast 2 emmits of the WorkersParameterized event and compares the event triggerd - /// If the event name is different or if it takes more than 30 seconds then the test will fail. - #[test] - #[ignore] - fn test_full_principal_logic() { - let tempdir = tempfile::tempdir().unwrap(); - let _gas_limit: U256 = 5999999.into(); - let enclave = init_enclave_wrapper().unwrap(); - let eid = enclave.geteid(); - let principal = init_no_deploy(eid).unwrap(); - let account = principal.get_account_address(); - - // run simulated miner - run_miner(account, Arc::clone(&principal.contract.web3), 1); - - let contract = Arc::clone(&principal.contract); - let child = thread::spawn(move || { - let event = WorkersParameterizedEvent::new(); - let event_sig = event.0.signature(); - let filter = FilterBuilder::default() - .address(vec![contract.address()]) - .topics(Some(vec![event_sig.into()]), None, None, None) - .build(); - - let event_future = contract - .web3 - .eth_filter() - .create_logs_filter(filter) - .then(|filter| { - filter.unwrap().stream(time::Duration::from_secs(1)).for_each(|log| { - println!("Got {} log: {:?}", WORKER_PARAMETERIZED_EVENT, log); - Ok(()) - }) - }) - .map_err(|err| eprintln!("Unable to process WorkersParameterized log: {:?}", err)); - event_future.wait().unwrap(); - }); - - // run principal - principal.run(tempdir.into_path(), true, GAS_LIMIT).unwrap(); - child.join().unwrap(); - } - - #[test] - fn test_load_config_from_env() { - env::set_var("ENIGMA_CONTRACT_PATH", "../app/tests/principal_node/contracts/IEnigma.json"); - env::set_var("ENIGMA_CONTRACT_REMOTE_PATH",""); - env::set_var("ENIGMA_CONTRACT_ADDRESS", "59d3631c86BbE35EF041872d502F218A39FBa150"); - env::set_var("ACCOUNT_ADDRESS","1df62f291b2e969fb0849d99d9ce41e2f137006e"); - env::set_var("TEST_NET","true"); - env::set_var("WITH_PRIVATE_KEY", "false"); - env::set_var("PRIVATE_KEY", ""); - env::set_var("URL", "http://172.20.0.2:9545"); - env::set_var("EPOCH_SIZE", "10"); - env::set_var("POLLING_INTERVAL", "1"); - env::set_var("MAX_EPOCHS","10"); - env::set_var("SPID", "B0335FD3BC1CCA8F804EB98A6420592D"); - env::set_var("ATTESTATION_SERVICE_URL", "https://sgx.enigma.co/api"); - env::set_var("ATTESTATION_RETRIES", "11"); - env::set_var("HTTP_PORT","3040"); - env::set_var("CONFIRMATIONS","0"); - env::set_var("CHAIN_ID", "13"); - let config = PrincipalConfig::load_config("this is not a path").unwrap(); - assert_eq!(config.polling_interval, 1); - assert_eq!(config.http_port, 3040); - assert_eq!(config.attestation_retries, 11); - } -} diff --git a/enigma-principal/app/src/boot_network/principal_utils.rs b/enigma-principal/app/src/boot_network/principal_utils.rs deleted file mode 100644 index 20e60ed8..00000000 --- a/enigma-principal/app/src/boot_network/principal_utils.rs +++ /dev/null @@ -1,72 +0,0 @@ -use std::{sync::Arc, thread, time}; - -use web3::{futures::Future, types::U256}; - -use enigma_tools_u::web3_utils::enigma_contract::EnigmaContract; -use epoch_u::epoch_provider::EpochProvider; - -// this trait should extend the EnigmaContract into Principal specific functions. -pub trait Principal { - fn watch_blocks>( - &self, - epoch_size: usize, - polling_interval: u64, - epoch_provider: Arc, - gas_limit: G, - confirmations: usize, - max_epochs: Option - ); -} - -impl Principal for EnigmaContract { - /// Watches the blocks for new epoch using the epoch size and the previous epoch block number. - /// For each new epoch, set the worker parameters. - #[logfn(INFO)] - fn watch_blocks>( - &self, - epoch_size: usize, - polling_interval: u64, - epoch_provider: Arc, - gas_limit: G, - confirmations: usize, - max_epochs: Option - ) { - let gas_limit: U256 = gas_limit.into(); - let max_epochs = max_epochs.unwrap_or(0); - let mut epoch_counter = 0; - loop { - let block_number = match self.web3.eth().block_number().wait() { - Ok(block_number) => block_number, - Err(err) => { - error!("Unable to fetch block number: {:?}", err); - thread::sleep(time::Duration::from_secs(polling_interval)); - continue; - } - }; - let curr_block = block_number.low_u64() as usize; - let prev_block = match epoch_provider.epoch_state_manager.last(true) { - Ok(state) => state.confirmed_state.unwrap().ether_block_number, - Err(_) => U256::zero(), - }; - let prev_block_ref = prev_block.low_u64() as usize; - trace!("Blocks @ previous: {}, current: {}, next: {}", prev_block_ref, curr_block, (prev_block_ref + epoch_size)); - if prev_block_ref == 0 || curr_block >= (prev_block_ref + epoch_size) { - trace!("New epoch for block number {} [epoch size {}]", curr_block, epoch_size); - epoch_provider - .set_worker_params(block_number, gas_limit, confirmations) - .expect("Unable to set worker params. Please recover manually."); - } else { - trace!("Epoch still active"); - } - thread::sleep(time::Duration::from_secs(polling_interval)); - if max_epochs != 0 { - // in order to avoid overflow - don't increment when max_epochs is 0 - epoch_counter += 1; - if epoch_counter == max_epochs { - error!("reached max_epochs {} , stopping.", max_epochs); - break; - } - } - } - } -} diff --git a/enigma-principal/app/src/cli/app.rs b/enigma-principal/app/src/cli/app.rs deleted file mode 100644 index bd2fa0d8..00000000 --- a/enigma-principal/app/src/cli/app.rs +++ /dev/null @@ -1,127 +0,0 @@ -use boot_network::{ - keys_provider_http::{PrincipalHttpServer, StateKeyRequest}, - principal_manager::{ - self, - PrincipalManager, - ReportManager, - Sampler, - PrincipalConfig, - SgxEthereumSigner, - PrivateKeyEthereumSigner - }, -}; -use cli; -use enigma_crypto::EcdsaSign; -use enigma_tools_u::{esgx::general::storage_dir, web3_utils::enigma_contract::EnigmaContract}; -use epoch_u::epoch_provider::EpochProvider; -use esgx::general::ENCLAVE_DIR; -use failure::Error; -use sgx_types::sgx_enclave_id_t; -use std::{fs::File, io::prelude::*, path::Path, sync::Arc}; -use structopt::StructOpt; -use rustc_hex::FromHex; - -pub fn create_signer(eid: sgx_enclave_id_t, with_private_key: bool, private_key: &[u8]) -> Box { - if with_private_key { - let mut pk_32 = [0u8; 32]; - pk_32.copy_from_slice(private_key); - let signer = Box::new(PrivateKeyEthereumSigner::new(pk_32)) as Box; - signer - } else { - let signer = Box::new(SgxEthereumSigner::new(eid)) as Box; - signer - } -} - -#[logfn(INFO)] -pub fn start(eid: sgx_enclave_id_t) -> Result<(), Error> { - let opt = cli::options::Opt::from_args(); - let mut principal_config = PrincipalConfig::load_config(opt.principal_config.as_str())?; - let report_manager = ReportManager::new(principal_config.clone(), eid)?; - let signing_address = report_manager.get_signing_address()?; - let ethereum_address = report_manager.get_ethereum_address()?; - let mut path = storage_dir(ENCLAVE_DIR)?; - - let private_key = principal_config.private_key.from_hex()?; - - let ethereum_signer = create_signer(eid, principal_config.with_private_key, &private_key); - - if opt.info { - cli::options::print_info(&signing_address, ðereum_address); - } else if opt.sign_address { - path.push("principal-sign-addr.txt"); - let mut file = File::create(&path)?; - let prefixed_signing_address = format!("0x{}", signing_address); - file.write_all(prefixed_signing_address.as_bytes())?; - println!("Wrote signing address: {:?} in file: {:?}", prefixed_signing_address, path); - - path.pop(); - path.push("ethereum-account-addr.txt"); - let mut file = File::create(&path)?; - let prefixed_ethereum_address = format!("0x{}", ethereum_address); - file.write_all(prefixed_ethereum_address.as_bytes())?; - println!("Wrote ethereum address: {:?} in file: {:?}", prefixed_ethereum_address, path); - - } else if opt.deploy { - unimplemented!("Self-deploy mode not yet implemented. Fix issues with linked libraries in the Enigma contract."); - } else { - println!("[Mode:] run node NO DEPLOY."); - // step1 : build the config of the principal node - // optional : set time limit for the principal node - let contract_address = opt.contract_address.unwrap_or_else(|| principal_config.enigma_contract_address.clone()); - let enigma_contract = Arc::new(EnigmaContract::from_deployed( - &contract_address, - Path::new(&principal_config.enigma_contract_path), - Some(ðereum_address), - principal_config.chain_id, - &principal_config.url, - ethereum_signer, - )?); - - principal_config.max_epochs = if opt.time_to_live > 0 { Some(opt.time_to_live) } else { None }; - - let gas_limit = 5_999_999; - - let principal: PrincipalManager = PrincipalManager::new(principal_config.clone(), enigma_contract, report_manager)?; - println!("Connected to the Enigma contract: {:?} with account: {:?}", &contract_address, principal.get_account_address()); - - // step 2 optional - run miner to simulate blocks - let join_handle = if opt.mine > 0 { - Some(principal_manager::run_miner(principal.get_account_address(), principal.get_web3(), opt.mine as u64)) - } else { - None - }; - - let eid_safe = Arc::new(eid); - //TODO: Ugly, refactor to instantiate only once, consider passing to the run method - let epoch_provider = EpochProvider::new(eid_safe, path.clone(), principal.contract.clone())?; - if opt.reset_epoch_state { - epoch_provider.epoch_state_manager.reset()?; - } - // step3 : run the principal manager - if opt.register { - match principal.verify_identity_or_register(gas_limit)? { - Some(tx) => println!("Registered Principal with tx: {:?}", tx), - None => println!("Principal already registered"), - }; - } else if opt.set_worker_params { - let block_number = principal.get_block_number()?; - let tx = epoch_provider.set_worker_params(block_number, gas_limit, principal_config.confirmations as usize)?; - println!("The setWorkersParams tx: {:?}", tx); - } else if opt.confirm_worker_params { - let block_number = principal.get_block_number()?; - let tx = epoch_provider.confirm_worker_params(block_number, gas_limit, principal_config.confirmations as usize)?; - println!("The setWorkersParams tx: {:?}", tx); - } else if opt.get_state_keys.is_some() { - let request: StateKeyRequest = serde_json::from_str(&opt.get_state_keys.unwrap())?; - let response = PrincipalHttpServer::get_state_keys(&epoch_provider, request)?; - println!("The getStateKeys response: {}", serde_json::to_string(&response)?); - } else { - principal.run(path, false, gas_limit).unwrap(); - } - if let Some(t) = join_handle { - t.join().unwrap(); - } - } - Ok(()) -} diff --git a/enigma-principal/app/src/cli/mod.rs b/enigma-principal/app/src/cli/mod.rs deleted file mode 100644 index ddab52a3..00000000 --- a/enigma-principal/app/src/cli/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod app; -pub mod options; diff --git a/enigma-principal/app/src/cli/options.rs b/enigma-principal/app/src/cli/options.rs deleted file mode 100644 index 47bc496e..00000000 --- a/enigma-principal/app/src/cli/options.rs +++ /dev/null @@ -1,127 +0,0 @@ -use structopt::StructOpt; -use url::Url; - -#[derive(StructOpt, Debug)] -#[structopt(name = "basic")] -pub struct Opt { - /// Run info mode and shutdown. (Not actually running the node) - #[structopt(short = "i", long = "info")] - pub info: bool, - - /// Output the signing address only - #[structopt(short = "w", long = "write-sign-address")] - pub sign_address: bool, - - /// Run the Register procedure and shutdown - #[structopt(short = "r", long = "register")] - pub register: bool, - - /// Run the Set Worker Params procedure and shutdown - #[structopt(short = "p", long = "set-worker-params")] - pub set_worker_params: bool, - - /// Confirm the Worker Params in the local state and shutdown - #[structopt(short = "f", long = "confirm-worker-params")] - pub confirm_worker_params: bool, - - /// Get state keys and shutdown - #[structopt(short = "k", long = "get-state-keys")] - pub get_state_keys: Option, - - /// Optional: The Enigma contract address, use the config if not provided - #[structopt(short = "c", long = "contract-address")] - pub contract_address: Option, - - /// Optional: Reset the Epoch state in storage - #[structopt(short = "s", long = "reset-epoch-state")] - pub reset_epoch_state: bool, - - /// Optional: Deploy the Enigma contract related infrastructure - #[structopt(short = "d", long = "deploy")] - pub deploy: bool, - - /// Optional currently ignored: Deploy to a different network (not the localhost:port) - #[structopt(short = "n", long = "network", default_value = "http://.c")] - pub network: Url, - - /// Optional: simulate blocks mining --mine <> - #[structopt(short = "m", long = "mine", default_value = "0")] - pub mine: usize, - - /// Optional: how many loops to perform (seconds) for the principal in time (TTL) - #[structopt(short = "x", long = "time-to-live", default_value = "0")] - pub time_to_live: usize, - - /// Optional: if --deploy then change default to custom config file - #[structopt(short = "y", long = "deploy-config", default_value = "../app/tests/principal_node/config/deploy_config.json")] - pub deploy_config: String, - - /// Optional: change the default principal node config - #[structopt(short = "z", long = "principal-config", default_value = "../app/tests/principal_node/config/principal_test_config.json")] - pub principal_config: String, - - /// Optional: change the minimum log level - #[structopt(short = "l", long = "log-level", default_value = "info")] - pub log_level: String, -} - -// fn all_colours() { -// black!("black "); -// red!("red "); -// green!("green "); -// yellow!("yellow "); -// blue!("blue "); -// magenta!("magenta "); -// cyan!("cyan "); -// white!("white "); -// dark_black!("dark_black "); -// dark_red!("dark_red "); -// dark_green!("dark_green "); -// dark_yellow!("dark_yellow "); -// dark_blue!("dark_blue "); -// dark_magenta!("dark_magenta "); -// dark_cyan!("dark_cyan "); -// dark_white!("dark_white "); -// prnt!("default colour\n\n"); -//} - -pub fn print_logo() { - yellow!("<>------------------------------------------<>\n"); - magenta!( - " -\t╔═╗ ┌┐┌ ┬ ┌─┐ ┌┬┐ ┌─┐ -\t║╣ │││ │ │ ┬ │││ ├─┤ -\t╚═╝ ┘└┘ ┴ └─┘ ┴ ┴ ┴ ┴ \n -\t╔═╗ ┬─┐ ┬ ┌┐┌ ┌─┐ ┬ ┌─┐ ┌─┐ ┬ -\t╠═╝ ├┬┘ │ │││ │ │ ├─┘ ├─┤ │ -\t╩ ┴└─ ┴ ┘└┘ └─┘ ┴ ┴ ┴ ┴ ┴─┘\n -\t╔╗╔ ┌─┐ ┌┬┐ ┌─┐ -\t║║║ │ │ ││ ├┤ -\t╝╚╝ └─┘ ─┴┘ └─┘\n" - ); - yellow!("<>------------------------------------------<>\n"); -} -pub fn print_info(signing_address: &str, ethereum_address: &str) { - print_logo(); - yellow!("<>------------------------------------------<>\n"); - green!("--info => Print the signing address and help.\n"); - green!("--verbose => Verbosity of the log output (up to 5 -vvvvv).\n"); - green!("--debug-stdout => Print the debugging directly to stdout.\n"); - green!("--write-sign-address => Write the signing address to ~/.enigma/principal-sign-addr.txt.\n"); - green!("--register => Run the Register procedure and shutdown.\n"); - green!("--set-worker-params => Run the Set Worker Params procedure and shutdown.\n"); - green!("--confirm-worker-params => Confirm the Worker Params in the local state and shutdown.\n"); - green!("--get-state-keys => Get the state keys from the message and shutdown.\n"); - green!("--contract-address => The Enigma contract address, use the config if not provided.\n"); - green!("--reset-epoch-state => Optional: Reset the Epoch state in storage.\n"); - green!("--deploy => Optional, deploy the Enigma contract.\n"); - green!("--network => Currently ignored, use a custom network (use config file instead).\n"); - green!("--mine => Optional, simulate new blocks, speed = seconds interval.\n"); - green!("--time-to-live