Merge branch 'master' into fo-6418-dont-export-bigint

# Conflicts:
#	dapps/src/tests/helpers/registrar.rs
#	ethcore/evm/src/interpreter/shared_cache.rs
#	ethcore/light/src/client/header_chain.rs
#	ethcore/light/src/client/mod.rs
#	ethcore/light/src/net/mod.rs
#	ethcore/light/src/on_demand/request.rs
#	ethcore/light/src/on_demand/tests.rs
#	ethcore/light/src/provider.rs
#	ethcore/node_filter/src/lib.rs
#	ethcore/src/block.rs
#	ethcore/src/blockchain/blockchain.rs
#	ethcore/src/client/test_client.rs
#	ethcore/src/engines/authority_round/mod.rs
#	ethcore/src/engines/basic_authority.rs
#	ethcore/src/engines/mod.rs
#	ethcore/src/engines/tendermint/mod.rs
#	ethcore/src/engines/validator_set/contract.rs
#	ethcore/src/engines/validator_set/multi.rs
#	ethcore/src/engines/validator_set/safe_contract.rs
#	ethcore/src/engines/vote_collector.rs
#	ethcore/src/miner/external.rs
#	ethcore/src/miner/miner.rs
#	ethcore/src/miner/service_transaction_checker.rs
#	ethcore/src/miner/work_notify.rs
#	ethcore/src/pod_account.rs
#	ethcore/src/pod_state.rs
#	ethcore/src/snapshot/block.rs
#	ethcore/src/snapshot/consensus/work.rs
#	ethcore/src/snapshot/mod.rs
#	ethcore/src/snapshot/service.rs
#	ethcore/src/spec/spec.rs
#	ethcore/src/state/backend.rs
#	ethcore/src/trace/db.rs
#	ethcore/src/verification/queue/mod.rs
#	ethcore/src/verification/verification.rs
#	parity/informant.rs
#	rpc/src/v1/helpers/dispatch.rs
#	rpc/src/v1/helpers/light_fetch.rs
#	rpc/src/v1/helpers/signing_queue.rs
#	rpc/src/v1/impls/eth.rs
#	rpc/src/v1/impls/eth_filter.rs
#	rpc/src/v1/impls/eth_pubsub.rs
#	rpc/src/v1/impls/light/eth.rs
#	rpc/src/v1/impls/signing.rs
#	rpc/src/v1/tests/helpers/miner_service.rs
#	rpc/src/v1/tests/helpers/snapshot_service.rs
#	rpc/src/v1/tests/helpers/sync_provider.rs
#	rpc/src/v1/tests/mocked/eth.rs
#	stratum/src/lib.rs
#	sync/src/blocks.rs
#	sync/src/chain.rs
#	sync/src/light_sync/mod.rs
#	sync/src/tests/helpers.rs
#	sync/src/tests/snapshot.rs
#	updater/src/updater.rs
#	util/src/lib.rs
#	util/triehash/src/lib.rs
This commit is contained in:
Fredrik 2017-09-04 18:32:55 +02:00
commit e54784bfeb
127 changed files with 375 additions and 260 deletions

33
Cargo.lock generated
View File

@ -494,6 +494,7 @@ dependencies = [
name = "ethcore"
version = "1.8.0"
dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bloomable 0.1.0",
"bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -532,17 +533,20 @@ dependencies = [
"native-contracts 0.1.0",
"num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"price-info 1.7.0",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.2.0",
"rlp_derive 0.1.0",
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"semantic_version 0.1.0",
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"stats 0.1.0",
"table 0.1.0",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"triehash 0.1.0",
"using_queue 0.1.0",
"vm 0.1.0",
"wasm 0.1.0",
@ -665,6 +669,7 @@ dependencies = [
"heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.2.0",
"rlp_derive 0.1.0",
@ -673,6 +678,7 @@ dependencies = [
"smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"stats 0.1.0",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"triehash 0.1.0",
"vm 0.1.0",
]
@ -777,6 +783,7 @@ dependencies = [
"jsonrpc-tcp-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -810,6 +817,7 @@ dependencies = [
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"triehash 0.1.0",
"vergen 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -926,6 +934,7 @@ dependencies = [
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"triehash 0.1.0",
]
[[package]]
@ -945,6 +954,7 @@ dependencies = [
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-wasm 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.2.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"vm 0.1.0",
@ -1661,6 +1671,7 @@ dependencies = [
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"native-contracts 0.1.0",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1902,6 +1913,7 @@ dependencies = [
"parity-rpc-client 1.4.0",
"parity-updater 1.8.0",
"parity-whisper 0.1.0",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0",
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1945,6 +1957,7 @@ dependencies = [
"parity-hash-fetch 1.8.0",
"parity-reactor 0.1.0",
"parity-ui 1.8.0",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (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.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1985,6 +1998,7 @@ dependencies = [
"mime_guess 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"native-contracts 0.1.0",
"parity-reactor 0.1.0",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2030,6 +2044,7 @@ dependencies = [
name = "parity-rpc"
version = "1.8.0"
dependencies = [
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
"ethash 1.8.0",
@ -2064,6 +2079,7 @@ dependencies = [
"order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-reactor 0.1.0",
"parity-updater 1.8.0",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.2.0",
@ -2092,6 +2108,7 @@ dependencies = [
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-rpc 1.8.0",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2135,7 +2152,7 @@ dependencies = [
[[package]]
name = "parity-ui-precompiled"
version = "1.4.0"
source = "git+https://github.com/paritytech/js-precompiled.git#d809723e58bcb36c0f8d2eca5ca94abbb3690544"
source = "git+https://github.com/paritytech/js-precompiled.git#f34bdb63272fd59edf2062dda44113831964d800"
dependencies = [
"parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2156,6 +2173,7 @@ dependencies = [
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-hash-fetch 1.8.0",
"parity-reactor 0.1.0",
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"path 0.1.0",
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2651,6 +2669,10 @@ dependencies = [
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "semantic_version"
version = "0.1.0"
[[package]]
name = "semver"
version = "0.1.20"
@ -3107,6 +3129,15 @@ dependencies = [
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "triehash"
version = "0.1.0"
dependencies = [
"ethcore-bigint 0.1.3",
"hash 0.1.0",
"rlp 0.2.0",
]
[[package]]
name = "typeable"
version = "0.1.2"

View File

@ -17,6 +17,7 @@ number_prefix = "0.2"
rpassword = "0.2.1"
semver = "0.6"
ansi_term = "0.9"
parking_lot = "0.4"
regex = "0.2"
isatty = "0.1"
toml = "0.4"

View File

@ -13,6 +13,7 @@ futures = "0.1"
linked-hash-map = "0.3"
log = "0.3"
parity-dapps-glue = "1.7"
parking_lot = "0.4"
mime = "0.2"
mime_guess = "1.6.1"
rand = "0.3"

View File

@ -32,7 +32,7 @@ use hyper;
use hyper::status::StatusCode;
use {Embeddable, SyncStatus, random_filename};
use util::Mutex;
use parking_lot::Mutex;
use page::LocalPageEndpoint;
use handlers::{ContentHandler, ContentFetcherHandler};
use endpoint::{Endpoint, EndpointPath, Handler};

View File

@ -23,7 +23,7 @@ use std::time::{Instant, Duration};
use fetch::{self, Fetch};
use futures::Future;
use parity_reactor::Remote;
use util::Mutex;
use parking_lot::Mutex;
use hyper::{server, Decoder, Encoder, Next, Method, Control};
use hyper::net::HttpStream;

View File

@ -24,6 +24,7 @@ extern crate futures;
extern crate itertools;
extern crate linked_hash_map;
extern crate mime_guess;
extern crate parking_lot;
extern crate rand;
extern crate rustc_hex;
extern crate serde;
@ -74,7 +75,7 @@ use std::collections::HashMap;
use std::mem;
use std::path::PathBuf;
use std::sync::Arc;
use util::RwLock;
use parking_lot::RwLock;
use jsonrpc_http_server::{self as http, hyper, Origin};

View File

@ -16,7 +16,7 @@
use std::{io, thread, time};
use std::sync::{atomic, mpsc, Arc};
use util::Mutex;
use parking_lot::Mutex;
use futures::{self, Future};
use fetch::{self, Fetch};

View File

@ -21,7 +21,8 @@ use rustc_hex::FromHex;
use hash_fetch::urlhint::ContractClient;
use bigint::hash::H256;
use util::{Bytes, Address, Mutex, ToPretty};
use util::{Bytes, Address, ToPretty};
use parking_lot::Mutex;
const REGISTRAR: &'static str = "8e4e9b13d4b45cb0befc93c3061b1408f67316b2";
const URLHINT: &'static str = "deadbeefcafe0000000000000000000000000000";

View File

@ -11,6 +11,7 @@ build = "build.rs"
"ethcore-ipc-codegen" = { path = "../ipc/codegen" }
[dependencies]
ansi_term = "0.9"
bit-set = "0.4"
bloomchain = "0.1"
bn = { git = "https://github.com/paritytech/bn" }
@ -46,6 +47,7 @@ lru-cache = "0.1.0"
native-contracts = { path = "native_contracts" }
num = "0.1"
num_cpus = "1.2"
parking_lot = "0.4"
price-info = { path = "../price-info" }
rand = "0.3"
rlp = { path = "../util/rlp" }
@ -62,6 +64,8 @@ bloomable = { path = "../util/bloomable" }
vm = { path = "vm" }
wasm = { path = "wasm" }
hash = { path = "../util/hash" }
triehash = { path = "../util/triehash" }
semantic_version = { path = "../util/semantic_version" }
[dev-dependencies]
native-contracts = { path = "native_contracts", features = ["test_contracts"] }

View File

@ -17,6 +17,7 @@ log = "0.3"
rlp = { path = "../../util/rlp" }
vm = { path = "../vm" }
parity-wasm = "0.12"
parking_lot = "0.4"
ethcore-logger = { path = "../../logger" }
wasm-utils = { git = "https://github.com/paritytech/wasm-utils" }
hash = { path = "../../util/hash" }

View File

@ -18,7 +18,7 @@ use std::sync::Arc;
use hash::KECCAK_EMPTY;
use heapsize::HeapSizeOf;
use bigint::hash::H256;
use util::Mutex;
use parking_lot::Mutex;
use util::cache::MemoryLruCache;
use bit_set::BitSet;
use super::super::instructions;

View File

@ -24,6 +24,7 @@ extern crate ethcore_bigint as bigint;
extern crate ethjson;
extern crate rlp;
extern crate parity_wasm;
extern crate parking_lot;
extern crate wasm_utils;
extern crate ethcore_logger;
extern crate heapsize;

View File

@ -32,8 +32,10 @@ itertools = "0.5"
bincode = "0.8.0"
serde = "1.0"
serde_derive = "1.0"
parking_lot = "0.4"
stats = { path = "../../util/stats" }
hash = { path = "../../util/hash" }
triehash = { path = "../../util/triehash" }
[features]
default = []

View File

@ -132,7 +132,7 @@ pub fn compute_root<I>(cht_num: u64, iterable: I) -> Option<H256>
}
if v.len() == SIZE as usize {
Some(::util::triehash::trie_root(v))
Some(::triehash::trie_root(v))
} else {
None
}

View File

@ -39,11 +39,10 @@ use rlp::{Encodable, Decodable, DecoderError, RlpStream, Rlp, UntrustedRlp};
use heapsize::HeapSizeOf;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::RwLock;
use util::kvdb::{DBTransaction, KeyValueDB};
use cache::Cache;
use util::Mutex;
use parking_lot::{Mutex, RwLock};
use smallvec::SmallVec;
@ -557,7 +556,7 @@ mod tests {
use cache::Cache;
use time::Duration;
use util::Mutex;
use parking_lot::Mutex;
fn make_db() -> Arc<::util::KeyValueDB> {
Arc::new(::util::kvdb::in_memory(0))

View File

@ -30,10 +30,10 @@ use ethcore::spec::Spec;
use ethcore::service::ClientIoMessage;
use ethcore::encoded;
use io::IoChannel;
use parking_lot::{Mutex, RwLock};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Mutex, RwLock};
use util::kvdb::{KeyValueDB, CompactionProfile};
use self::header_chain::{AncestryIter, HeaderChain};

View File

@ -28,7 +28,7 @@ use io::{IoContext, IoError, IoHandler, IoService};
use util::kvdb::{Database, DatabaseConfig};
use cache::Cache;
use util::Mutex;
use parking_lot::Mutex;
use super::{Client, Config as ClientConfig};
@ -117,11 +117,11 @@ mod tests {
use super::Service;
use devtools::RandomTempPath;
use ethcore::spec::Spec;
use std::sync::Arc;
use cache::Cache;
use time::Duration;
use util::Mutex;
use parking_lot::Mutex;
#[test]
fn it_works() {

View File

@ -78,6 +78,7 @@ extern crate futures;
extern crate itertools;
extern crate rand;
extern crate rlp;
extern crate parking_lot;
#[macro_use]
extern crate rlp_derive;
extern crate serde;
@ -86,6 +87,7 @@ extern crate stats;
extern crate time;
extern crate vm;
extern crate hash;
extern crate triehash;
#[cfg(feature = "ipc")]
extern crate ethcore_ipc as ipc;

View File

@ -32,7 +32,7 @@ use request::{CompleteRequest, Kind};
use bincode;
use time;
use util::{RwLock, Mutex};
use parking_lot::{RwLock, Mutex};
/// Number of time periods samples should be kept for.
pub const MOVING_SAMPLE_SIZE: usize = 256;

View File

@ -25,7 +25,8 @@ use network::{HostInfo, NetworkProtocolHandler, NetworkContext, PeerId};
use rlp::{RlpStream, UntrustedRlp};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{DBValue, Mutex, RwLock};
use util::DBValue;
use parking_lot::{Mutex, RwLock};
use time::{Duration, SteadyTime};
use std::collections::{HashMap, HashSet};
@ -288,7 +289,7 @@ pub type PeerMap = HashMap<PeerId, Mutex<Peer>>;
mod id_guard {
use network::PeerId;
use util::RwLockReadGuard;
use parking_lot::RwLockReadGuard;
use super::{PeerMap, ReqId};

View File

@ -608,7 +608,7 @@ fn id_guard() {
pending_requests.insert(req_id_1, req.clone(), 0.into(), ::time::SteadyTime::now());
pending_requests.insert(req_id_2, req, 1.into(), ::time::SteadyTime::now());
proto.peers.write().insert(peer_id, ::util::Mutex::new(Peer {
proto.peers.write().insert(peer_id, ::parking_lot::Mutex::new(Peer {
local_credits: flow_params.create_credits(),
status: status(provider.client.chain_info()),
capabilities: capabilities.clone(),

View File

@ -27,7 +27,7 @@ use ethcore::executed::{Executed, ExecutionError};
use futures::{Async, Poll, Future};
use futures::sync::oneshot::{self, Sender, Receiver, Canceled};
use network::PeerId;
use util::{RwLock, Mutex};
use parking_lot::{RwLock, Mutex};
use net::{
self, Handler, PeerStatus, Status, Capabilities,

View File

@ -32,7 +32,8 @@ use request::{self as net_request, IncompleteRequest, CompleteRequest, Output, O
use rlp::{RlpStream, UntrustedRlp};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Address, Bytes, DBValue, HashDB, Mutex};
use parking_lot::Mutex;
use util::{Address, Bytes, DBValue, HashDB};
use util::memorydb::MemoryDB;
use util::trie::{Trie, TrieDB, TrieError};
@ -710,7 +711,7 @@ impl Body {
pub fn check_response(&self, cache: &Mutex<::cache::Cache>, body: &encoded::Body) -> Result<encoded::Block, Error> {
// check the integrity of the the body against the header
let header = self.0.as_ref()?;
let tx_root = ::util::triehash::ordered_trie_root(body.rlp().at(0).iter().map(|r| r.as_raw().to_vec()));
let tx_root = ::triehash::ordered_trie_root(body.rlp().at(0).iter().map(|r| r.as_raw().to_vec()));
if tx_root != header.transactions_root() {
return Err(Error::WrongTrieRoot(header.transactions_root(), tx_root));
}
@ -740,7 +741,7 @@ impl BlockReceipts {
/// Check a response with receipts against the stored header.
pub fn check_response(&self, cache: &Mutex<::cache::Cache>, receipts: &[Receipt]) -> Result<Vec<Receipt>, Error> {
let receipts_root = self.0.as_ref()?.receipts_root();
let found_root = ::util::triehash::ordered_trie_root(receipts.iter().map(|r| ::rlp::encode(r).into_vec()));
let found_root = ::triehash::ordered_trie_root(receipts.iter().map(|r| ::rlp::encode(r).into_vec()));
match receipts_root == found_root {
true => {
@ -853,7 +854,8 @@ impl TransactionProof {
mod tests {
use super::*;
use bigint::hash::H256;
use util::{MemoryDB, Address, Mutex};
use util::{MemoryDB, Address};
use parking_lot::Mutex;
use util::trie::{Trie, TrieMut, SecTrieDB, SecTrieDBMut};
use util::trie::recorder::Recorder;
use hash::keccak;
@ -937,7 +939,7 @@ mod tests {
}).collect::<Vec<_>>();
let mut header = Header::new();
let receipts_root = ::util::triehash::ordered_trie_root(
let receipts_root = ::triehash::ordered_trie_root(
receipts.iter().map(|x| ::rlp::encode(x).into_vec())
);

View File

@ -23,7 +23,7 @@ use futures::Future;
use network::{PeerId, NodeId};
use net::*;
use bigint::hash::H256;
use util::Mutex;
use parking_lot::Mutex;
use time::Duration;
use ::request::{self as basic_request, Response};

View File

@ -25,7 +25,7 @@ use ethcore::transaction::PendingTransaction;
use ethcore::ids::BlockId;
use ethcore::encoded;
use bigint::hash::H256;
use util::RwLock;
use parking_lot::RwLock;
use cht::{self, BlockInfo};
use client::{LightChainClient, AsLightClient};

View File

@ -15,3 +15,4 @@ ethcore-network = { path = "../../util/network" }
native-contracts = { path = "../native_contracts" }
futures = "0.1"
log = "0.3"
parking_lot = "0.4"

View File

@ -22,6 +22,7 @@ extern crate ethcore_bigint as bigint;
extern crate ethcore_network as network;
extern crate native_contracts;
extern crate futures;
extern crate parking_lot;
#[cfg(test)] extern crate ethcore_io as io;
#[macro_use] extern crate log;
@ -31,7 +32,8 @@ use native_contracts::PeerSet as Contract;
use network::{NodeId, ConnectionFilter, ConnectionDirection};
use ethcore::client::{BlockChainClient, BlockId, ChainNotify};
use bigint::hash::H256;
use util::{Mutex, Address, Bytes};
use util::{Address, Bytes};
use parking_lot::Mutex;
use futures::Future;
const MAX_CACHE_SIZE: usize = 4096;

View File

@ -23,7 +23,7 @@ use self::stores::{AddressBook, DappsSettingsStore, NewDappsPolicy};
use std::fmt;
use std::collections::{HashMap, HashSet};
use std::time::{Instant, Duration};
use util::{RwLock};
use parking_lot::RwLock;
use ethstore::{
SimpleSecretStore, SecretStore, Error as SSError, EthStore, EthMultiStore,
random_string, SecretVaultRef, StoreAccountRef, OpaqueSecret,

View File

@ -20,11 +20,12 @@ use std::cmp;
use std::sync::Arc;
use std::collections::HashSet;
use hash::{keccak, KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP};
use triehash::ordered_trie_root;
use rlp::{UntrustedRlp, RlpStream, Encodable, Decodable, DecoderError};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Bytes, Address, ordered_trie_root};
use util::{Bytes, Address};
use util::error::{Mismatch, OutOfBounds};
use basic_types::{LogBloom, Seal};

View File

@ -24,6 +24,7 @@ use bloomchain as bc;
use heapsize::HeapSizeOf;
use bigint::prelude::U256;
use bigint::hash::{H256, H2048};
use parking_lot::{Mutex, RwLock};
use util::*;
use rlp::*;
use header::*;
@ -43,6 +44,7 @@ use db::{self, Writable, Readable, CacheUpdatePolicy};
use cache_manager::CacheManager;
use encoded;
use engines::epoch::{Transition as EpochTransition, PendingTransition as PendingEpochTransition};
use ansi_term::Colour;
const LOG_BLOOMS_LEVELS: usize = 3;
const LOG_BLOOMS_ELEMENTS_PER_INDEX: usize = 16;

View File

@ -269,6 +269,34 @@ impl Impl for Ripemd160 {
}
}
// calculate modexp: exponentiation by squaring. the `num` crate has pow, but not modular.
fn modexp(mut base: BigUint, mut exp: BigUint, modulus: BigUint) -> BigUint {
use num::Integer;
match (base.is_zero(), exp.is_zero()) {
(_, true) => return BigUint::one(), // n^0 % m
(true, false) => return BigUint::zero(), // 0^n % m, n>0
(false, false) if modulus <= BigUint::one() => return BigUint::zero(), // a^b % 1 = 0.
_ => {}
}
let mut result = BigUint::one();
base = base % &modulus;
// fast path for base divisible by modulus.
if base.is_zero() { return BigUint::zero() }
while !exp.is_zero() {
if exp.is_odd() {
result = (result * &base) % &modulus;
}
exp = exp >> 1;
base = (base.clone() * base) % &modulus;
}
result
}
impl Impl for ModexpImpl {
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), Error> {
let mut reader = input.chain(io::repeat(0));
@ -297,34 +325,6 @@ impl Impl for ModexpImpl {
let exp = read_num(exp_len);
let modulus = read_num(mod_len);
// calculate modexp: exponentiation by squaring. the `num` crate has pow, but not modular.
fn modexp(mut base: BigUint, mut exp: BigUint, modulus: BigUint) -> BigUint {
use num::Integer;
match (base.is_zero(), exp.is_zero()) {
(_, true) => return BigUint::one(), // n^0 % m
(true, false) => return BigUint::zero(), // 0^n % m, n>0
(false, false) if modulus <= BigUint::one() => return BigUint::zero(), // a^b % 1 = 0.
_ => {}
}
let mut result = BigUint::one();
base = base % &modulus;
// fast path for base divisible by modulus.
if base.is_zero() { return result }
while !exp.is_zero() {
if exp.is_odd() {
result = (result * &base) % &modulus;
}
exp = exp >> 1;
base = (base.clone() * base) % &modulus;
}
result
}
// write output to given memory, left padded and same length as the modulus.
let bytes = modexp(base, exp, modulus).to_bytes_be();
@ -506,11 +506,45 @@ impl Impl for Bn128PairingImpl {
#[cfg(test)]
mod tests {
use super::{Builtin, Linear, ethereum_builtin, Pricer, Modexp};
use super::{Builtin, Linear, ethereum_builtin, Pricer, Modexp, modexp as me};
use ethjson;
use bigint::prelude::U256;
use util::BytesRef;
use rustc_hex::FromHex;
use num::{BigUint, Zero, One};
#[test]
fn modexp_func() {
// n^0 % m == 1
let mut base = BigUint::parse_bytes(b"12345", 10).unwrap();
let mut exp = BigUint::zero();
let mut modulus = BigUint::parse_bytes(b"789", 10).unwrap();
assert_eq!(me(base, exp, modulus), BigUint::one());
// 0^n % m == 0
base = BigUint::zero();
exp = BigUint::parse_bytes(b"12345", 10).unwrap();
modulus = BigUint::parse_bytes(b"789", 10).unwrap();
assert_eq!(me(base, exp, modulus), BigUint::zero());
// n^m % 1 == 0
base = BigUint::parse_bytes(b"12345", 10).unwrap();
exp = BigUint::parse_bytes(b"789", 10).unwrap();
modulus = BigUint::one();
assert_eq!(me(base, exp, modulus), BigUint::zero());
// if n % d == 0, then n^m % d == 0
base = BigUint::parse_bytes(b"12345", 10).unwrap();
exp = BigUint::parse_bytes(b"789", 10).unwrap();
modulus = BigUint::parse_bytes(b"15", 10).unwrap();
assert_eq!(me(base, exp, modulus), BigUint::zero());
// others
base = BigUint::parse_bytes(b"12345", 10).unwrap();
exp = BigUint::parse_bytes(b"789", 10).unwrap();
modulus = BigUint::parse_bytes(b"97", 10).unwrap();
assert_eq!(me(base, exp, modulus), BigUint::parse_bytes(b"55", 10).unwrap());
}
#[test]
fn identity() {

View File

@ -23,7 +23,7 @@ use engines::{Engine, EpochVerifier};
use header::Header;
use rand::Rng;
use util::RwLock;
use parking_lot::RwLock;
// do "heavy" verification on ~1/50 blocks, randomly sampled.
const HEAVY_VERIFY_RATE: f32 = 0.02;

View File

@ -24,7 +24,8 @@ use itertools::Itertools;
// util
use hash::keccak;
use util::{Bytes, PerfTimer, Mutex, RwLock, MutexGuard};
use timer::PerfTimer;
use util::Bytes;
use util::{journaldb, DBValue, TrieFactory, Trie};
use util::Address;
use util::trie::TrieSpec;
@ -57,6 +58,7 @@ use io::*;
use log_entry::LocalizedLogEntry;
use miner::{Miner, MinerService, TransactionImportResult};
use native_contracts::Registry;
use parking_lot::{Mutex, RwLock, MutexGuard};
use rand::OsRng;
use receipt::{Receipt, LocalizedReceipt};
use rlp::UntrustedRlp;

View File

@ -25,6 +25,7 @@ use rustc_hex::FromHex;
use hash::keccak;
use bigint::prelude::U256;
use bigint::hash::{H256, H2048};
use parking_lot::RwLock;
use util::*;
use rlp::*;
use ethkey::{Generator, Random};

View File

@ -19,7 +19,8 @@
use std::ops::Deref;
use std::hash::Hash;
use std::collections::HashMap;
use util::{DBTransaction, KeyValueDB, RwLock};
use parking_lot::RwLock;
use util::{DBTransaction, KeyValueDB};
use rlp;

View File

@ -44,6 +44,8 @@ use itertools::{self, Itertools};
use rlp::{UntrustedRlp, encode};
use bigint::prelude::{U256, U128};
use bigint::hash::{H256, H520};
use semantic_version::SemanticVersion;
use parking_lot::{Mutex, RwLock};
use util::*;
mod finality;

View File

@ -21,6 +21,7 @@ use std::collections::BTreeMap;
use std::cmp;
use bigint::prelude::U256;
use bigint::hash::{H256, H520};
use parking_lot::RwLock;
use util::*;
use ethkey::{recover, public_to_address, Signature};
use account_provider::AccountProvider;
@ -33,6 +34,7 @@ use evm::Schedule;
use ethjson;
use header::{Header, BlockNumber};
use client::Client;
use semantic_version::SemanticVersion;
use super::signer::EngineSigner;
use super::validator_set::{ValidatorSet, SimpleList, new_validator_set};

View File

@ -56,6 +56,7 @@ use transaction::{UnverifiedTransaction, SignedTransaction};
use ethkey::Signature;
use bigint::prelude::U256;
use bigint::hash::H256;
use semantic_version::SemanticVersion;
use util::*;
/// Default EIP-210 contrat code.

View File

@ -32,6 +32,7 @@ use hash::keccak;
use std::cmp;
use bigint::prelude::{U128, U256};
use bigint::hash::{H256, H520};
use parking_lot::RwLock;
use util::*;
use client::{Client, EngineClient};
use error::{Error, BlockError};
@ -50,6 +51,7 @@ use super::transition::TransitionHandler;
use super::vote_collector::VoteCollector;
use self::message::*;
use self::params::TendermintParams;
use semantic_version::SemanticVersion;
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum Step {

View File

@ -19,6 +19,7 @@
use std::sync::Weak;
use bigint::hash::H256;
use parking_lot::RwLock;
use util::*;
use futures::Future;

View File

@ -20,7 +20,8 @@ use std::collections::BTreeMap;
use std::sync::Weak;
use engines::{Call, Engine};
use bigint::hash::H256;
use util::{Bytes, Address, RwLock};
use parking_lot::RwLock;
use util::{Bytes, Address};
use ids::BlockId;
use header::{BlockNumber, Header};
use client::{Client, BlockChainClient};

View File

@ -23,6 +23,7 @@ use hash::keccak;
use bigint::prelude::U256;
use bigint::hash::{H160, H256};
use parking_lot::RwLock;
use util::*;
use util::cache::MemoryLruCache;
use rlp::{UntrustedRlp, RlpStream};
@ -354,7 +355,7 @@ impl ValidatorSet for ValidatorSafeContract {
// ensure receipts match header.
// TODO: optimize? these were just decoded.
let found_root = ::util::triehash::ordered_trie_root(
let found_root = ::triehash::ordered_trie_root(
receipts.iter().map(::rlp::encode).map(|x| x.to_vec())
);
if found_root != *old_header.receipts_root() {

View File

@ -20,6 +20,7 @@ use std::fmt::Debug;
use std::collections::{BTreeMap, HashSet, HashMap};
use std::hash::Hash;
use bigint::hash::{H256, H520};
use parking_lot:: RwLock;
use util::*;
use rlp::{Encodable, RlpStream};

View File

@ -37,6 +37,7 @@ use evm::Schedule;
use ethjson;
use rlp::{self, UntrustedRlp};
use vm::LastHashes;
use semantic_version::SemanticVersion;
/// Parity tries to round block.gas_limit to multiple of this constant
pub const PARITY_GAS_LIMIT_DETERMINANT: U256 = U256([37, 0, 0, 0]);

View File

@ -99,11 +99,15 @@ extern crate lru_cache;
extern crate native_contracts;
extern crate num_cpus;
extern crate num;
extern crate parking_lot;
extern crate price_info;
extern crate rand;
extern crate rlp;
extern crate hash;
extern crate heapsize;
extern crate triehash;
extern crate ansi_term;
extern crate semantic_version;
#[macro_use]
extern crate rlp_derive;
@ -151,6 +155,7 @@ pub mod service;
pub mod snapshot;
pub mod spec;
pub mod state;
pub mod timer;
pub mod trace;
pub mod transaction;
pub mod verification;

View File

@ -19,7 +19,7 @@ use std::sync::Arc;
use std::time::{Instant, Duration};
use bigint::prelude::U256;
use bigint::hash::H256;
use util::Mutex;
use parking_lot::Mutex;
/// External miner interface.
pub trait ExternalMinerService: Send + Sync {

View File

@ -20,7 +20,9 @@ use std::sync::Arc;
use bigint::prelude::U256;
use bigint::hash::H256;
use parking_lot::{Mutex, RwLock};
use util::*;
use timer::PerfTimer;
use using_queue::{UsingQueue, GetAction};
use account_provider::{AccountProvider, SignError as AccountError};
use state::State;
@ -42,6 +44,7 @@ use miner::service_transaction_checker::ServiceTransactionChecker;
use price_info::{Client as PriceInfoClient, PriceInfo};
use price_info::fetch::Client as FetchClient;
use header::{Header, BlockNumber};
use ansi_term::Colour;
/// Different possible definitions for pending transaction set.
#[derive(Debug, PartialEq)]

View File

@ -21,7 +21,7 @@ use types::ids::BlockId;
use futures::{future, Future};
use native_contracts::ServiceTransactionChecker as Contract;
use bigint::prelude::U256;
use util::Mutex;
use parking_lot::Mutex;
const SERVICE_TRANSACTION_CONTRACT_REGISTRY_NAME: &'static str = "service_transaction_checker";

View File

@ -29,7 +29,7 @@ use bigint::prelude::U256;
use bigint::hash::{H64, H256, clean_0x};
use ethereum::ethash::Ethash;
use ethash::SeedHashCompute;
use util::Mutex;
use parking_lot::Mutex;
use miner::{self, Miner, MinerService};
use client::Client;
use block::IsBlock;

View File

@ -26,6 +26,7 @@ use ethash::SeedHashCompute;
use hyper::Url;
use bigint::prelude::U256;
use bigint::hash::H256;
use parking_lot::Mutex;
use util::*;
use ethereum::ethash::Ethash;

View File

@ -20,6 +20,7 @@ use itertools::Itertools;
use hash::{keccak};
use bigint::prelude::U256;
use bigint::hash::H256;
use triehash::sec_trie_root;
use util::*;
use state::Account;
use ethjson;

View File

@ -20,6 +20,7 @@ use std::fmt;
use std::collections::BTreeMap;
use itertools::Itertools;
use bigint::hash::H256;
use triehash::sec_trie_root;
use util::*;
use pod_account::{self, PodAccount};
use types::state_diff::StateDiff;

View File

@ -29,6 +29,7 @@ use miner::Miner;
use snapshot::ManifestData;
use snapshot::service::{Service as SnapshotService, ServiceParams as SnapServiceParams};
use std::sync::atomic::AtomicBool;
use ansi_term::Colour;
#[cfg(feature="ipc")]
use nanoipc;

View File

@ -24,7 +24,7 @@ use views::BlockView;
use rlp::{DecoderError, RlpStream, UntrustedRlp};
use bigint::hash::H256;
use util::Bytes;
use util::triehash::ordered_trie_root;
use triehash::ordered_trie_root;
const HEADER_FIELDS: usize = 8;
const BLOCK_FIELDS: usize = 2;
@ -193,7 +193,7 @@ mod tests {
b.transactions.push(t2.into());
let receipts_root = b.header.receipts_root().clone();
b.header.set_transactions_root(::util::triehash::ordered_trie_root(
b.header.set_transactions_root(::triehash::ordered_trie_root(
b.transactions.iter().map(::rlp::encode).map(|out| out.into_vec())
));

View File

@ -223,7 +223,7 @@ impl Rebuilder for PowRebuilder {
use views::BlockView;
use snapshot::verify_old_block;
use bigint::prelude::U256;
use util::triehash::ordered_trie_root;
use triehash::ordered_trie_root;
let rlp = UntrustedRlp::new(chunk);
let item_count = rlp.item_count()?;

View File

@ -33,7 +33,7 @@ use ids::BlockId;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Bytes, HashDB, DBValue, snappy};
use util::Mutex;
use parking_lot::Mutex;
use util::journaldb::{self, Algorithm, JournalDB};
use util::kvdb::KeyValueDB;
use util::trie::{TrieDB, TrieDBMut, Trie, TrieMut};

View File

@ -36,7 +36,8 @@ use service::ClientIoMessage;
use io::IoChannel;
use bigint::hash::H256;
use util::{Bytes, Mutex, RwLock, RwLockReadGuard, UtilError};
use parking_lot::{Mutex, RwLock, RwLockReadGuard};
use util::{Bytes, UtilError};
use util::journaldb::Algorithm;
use util::kvdb::{Database, DatabaseConfig};
use util::snappy;

View File

@ -24,7 +24,8 @@ use blockchain::BlockChain;
use snapshot::{chunk_secondary, Error as SnapshotError, Progress, SnapshotComponents};
use snapshot::io::{PackedReader, PackedWriter, SnapshotReader, SnapshotWriter};
use util::{Mutex, snappy};
use parking_lot::Mutex;
use util::snappy;
use util::kvdb::{self, KeyValueDB, DBTransaction};
use std::sync::Arc;

View File

@ -29,7 +29,7 @@ use bigint::hash::H256;
use util::journaldb::{self, Algorithm};
use util::kvdb::{Database, DatabaseConfig};
use util::memorydb::MemoryDB;
use util::Mutex;
use parking_lot::Mutex;
use devtools::RandomTempPath;
use std::sync::Arc;

View File

@ -16,7 +16,7 @@
//! Watcher for snapshot-related chain events.
use util::Mutex;
use parking_lot::Mutex;
use client::{BlockChainClient, Client, ChainNotify};
use ids::BlockId;
use service::ClientIoMessage;

View File

@ -42,6 +42,7 @@ use state::backend::Basic as BasicBackend;
use trace::{NoopTracer, NoopVMTracer};
use bigint::prelude::U256;
use bigint::hash::{H256, H2048};
use parking_lot::RwLock;
use util::*;
/// Parameters common to ethereum-like blockchains.

View File

@ -26,7 +26,8 @@ use std::sync::Arc;
use state::Account;
use bigint::hash::H256;
use util::{Address, MemoryDB, Mutex};
use parking_lot::Mutex;
use util::{Address, MemoryDB};
use util::hashdb::{AsHashDB, HashDB, DBValue};
/// State backend. See module docs for more details.

View File

@ -25,7 +25,8 @@ use util::hashdb::HashDB;
use state::{self, Account};
use header::BlockNumber;
use hash::keccak;
use util::{Address, DBTransaction, UtilError, Mutex};
use parking_lot::Mutex;
use util::{Address, DBTransaction, UtilError};
use bloom_journal::{Bloom, BloomJournal};
use db::COL_ACCOUNT_BLOOM;
use byteorder::{LittleEndian, ByteOrder};

View File

@ -22,7 +22,8 @@ use bloomchain::{Number, Config as BloomConfig};
use bloomchain::group::{BloomGroupDatabase, BloomGroupChain, GroupPosition, BloomGroup};
use heapsize::HeapSizeOf;
use bigint::hash::{H256, H264};
use util::{KeyValueDB, DBTransaction, RwLock};
use util::{KeyValueDB, DBTransaction};
use parking_lot::RwLock;
use header::BlockNumber;
use trace::{LocalizedTrace, Config, Filter, Database as TraceDatabase, ImportRequest, DatabaseExtras};
use db::{self, Key, Writable, Readable, CacheUpdatePolicy};

View File

@ -25,6 +25,7 @@ use std::collections::{VecDeque, HashSet, HashMap};
use heapsize::HeapSizeOf;
use bigint::prelude::U256;
use bigint::hash::H256;
use parking_lot::{Condvar, Mutex, RwLock};
use util::*;
use io::*;
use error::*;

View File

@ -23,6 +23,7 @@
use std::collections::HashSet;
use hash::keccak;
use triehash::ordered_trie_root;
use heapsize::HeapSizeOf;
use bigint::hash::H256;
use util::*;
@ -272,6 +273,7 @@ mod tests {
use hash::keccak;
use bigint::prelude::U256;
use bigint::hash::{H256, H2048};
use triehash::ordered_trie_root;
use util::*;
use ethkey::{Random, Generator};
use header::*;

View File

@ -14,6 +14,7 @@ mime = "0.2"
mime_guess = "1.6.1"
rand = "0.3"
rustc-hex = "1.0"
parking_lot = "0.4"
fetch = { path = "../util/fetch" }
ethcore-util = { path = "../util" }
ethcore-bigint = { path = "../util/bigint" }

View File

@ -191,7 +191,7 @@ fn random_temp_path() -> PathBuf {
mod tests {
use rustc_hex::FromHex;
use std::sync::{Arc, mpsc};
use util::Mutex;
use parking_lot::Mutex;
use futures::future;
use fetch::{self, Fetch};
use parity_reactor::Remote;

View File

@ -30,6 +30,7 @@ extern crate futures;
extern crate mime_guess;
extern crate native_contracts;
extern crate parity_reactor;
extern crate parking_lot;
extern crate rand;
extern crate rustc_hex;
extern crate hash;

View File

@ -216,7 +216,8 @@ pub mod tests {
use super::*;
use super::guess_mime_type;
use util::{Bytes, Address, Mutex, ToPretty};
use parking_lot::Mutex;
use util::{Bytes, Address, ToPretty};
pub struct FakeRegistrar {
pub calls: Arc<Mutex<Vec<(String, String)>>>,

2
js/package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "parity.js",
"version": "1.8.17",
"version": "1.8.18",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "parity.js",
"version": "1.8.17",
"version": "1.8.18",
"main": "release/index.js",
"jsnext:main": "src/index.js",
"author": "Parity Team <admin@parity.io>",

View File

@ -157,6 +157,7 @@ pub fn execute(cmd: BlockchainCmd) -> Result<(), String> {
fn execute_import_light(cmd: ImportBlockchain) -> Result<(), String> {
use light::client::{Service as LightClientService, Config as LightClientConfig};
use light::cache::Cache as LightDataCache;
use parking_lot::Mutex;
let timer = Instant::now();
@ -190,7 +191,7 @@ fn execute_import_light(cmd: ImportBlockchain) -> Result<(), String> {
// create dirs used by parity
cmd.dirs.create_dirs(false, false, false)?;
let cache = Arc::new(::util::Mutex::new(
let cache = Arc::new(Mutex::new(
LightDataCache::new(Default::default(), ::time::Duration::seconds(0))
));

View File

@ -27,7 +27,7 @@ use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Bytes, version_data, Address};
use util::journaldb::Algorithm;
use util::Colour;
use ansi_term::Colour;
use ethsync::{NetworkConfiguration, is_valid_node_url};
use ethcore::ethstore::ethkey::{Secret, Public};
use ethcore::client::{VMType};

View File

@ -16,7 +16,7 @@
extern crate ansi_term;
use self::ansi_term::Colour::{White, Yellow, Green, Cyan, Blue};
use self::ansi_term::Style;
use self::ansi_term::{Colour, Style};
use std::sync::{Arc};
use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering as AtomicOrdering};
@ -36,7 +36,8 @@ use number_prefix::{binary_prefix, Standalone, Prefixed};
use parity_rpc::{is_major_importing};
use parity_rpc::informant::RpcStats;
use bigint::hash::H256;
use util::{RwLock, Mutex, Colour, Bytes};
use util::Bytes;
use parking_lot::{RwLock, Mutex};
/// Format byte counts to standard denominations.
pub fn format_bytes(b: usize) -> String {

View File

@ -31,7 +31,7 @@ use futures::{future, Future};
use parity_reactor::Remote;
use util::RwLock;
use parking_lot::RwLock;
// Attepmt to cull once every 10 minutes.
const TOKEN: TimerToken = 1;

View File

@ -34,6 +34,7 @@ extern crate isatty;
extern crate jsonrpc_core;
extern crate num_cpus;
extern crate number_prefix;
extern crate parking_lot;
extern crate regex;
extern crate rlp;
extern crate rpassword;

View File

@ -38,7 +38,7 @@ use parity_rpc::dispatch::{FullDispatcher, LightDispatcher};
use parity_rpc::informant::{ActivityNotifier, ClientNotifier};
use parity_rpc::{Metadata, NetworkSettings};
use updater::Updater;
use util::{Mutex, RwLock};
use parking_lot::{Mutex, RwLock};
#[derive(Debug, PartialEq, Clone, Eq, Hash)]
pub enum Api {

View File

@ -37,7 +37,9 @@ use node_health;
use parity_reactor::EventLoop;
use parity_rpc::{NetworkSettings, informant, is_major_importing};
use updater::{UpdatePolicy, Updater};
use util::{Colour, version, Mutex, Condvar};
use ansi_term::Colour;
use util::version;
use parking_lot::{Condvar, Mutex};
use node_filter::NodeFilter;
use params::{
@ -170,7 +172,7 @@ impl ::local_store::NodeInfo for FullNodeInfo {
fn execute_light(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> Result<(bool, Option<String>), String> {
use light::client as light_client;
use ethsync::{LightSyncParams, LightSync, ManageNetwork};
use util::RwLock;
use parking_lot::{Mutex, RwLock};
// load spec
let spec = cmd.spec.spec(&cmd.dirs.cache)?;
@ -205,7 +207,7 @@ fn execute_light(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) ->
// TODO: configurable cache size.
let cache = LightDataCache::new(Default::default(), ::time::Duration::minutes(GAS_CORPUS_EXPIRATION_MINUTES));
let cache = Arc::new(::util::Mutex::new(cache));
let cache = Arc::new(Mutex::new(cache));
// start client and create transaction queue.
let mut config = light_client::Config {

View File

@ -8,12 +8,14 @@ authors = ["Parity Technologies <admin@parity.io>"]
[lib]
[dependencies]
ansi_term = "0.9"
cid = "0.2"
futures = "0.1"
futures-cpupool = "0.1"
log = "0.3"
multihash ="0.6"
order-stat = "0.1"
parking_lot = "0.4"
rand = "0.3"
rust-crypto = "0.2"
rustc-hex = "1.0"

View File

@ -20,6 +20,7 @@
#![cfg_attr(feature="dev", feature(plugin))]
#![cfg_attr(feature="dev", plugin(clippy))]
extern crate ansi_term;
extern crate cid;
extern crate crypto as rust_crypto;
extern crate futures;
@ -27,6 +28,7 @@ extern crate futures_cpupool;
extern crate itertools;
extern crate multihash;
extern crate order_stat;
extern crate parking_lot;
extern crate rand;
extern crate rustc_hex;
extern crate semver;

View File

@ -29,7 +29,8 @@ use rlp;
use hash::keccak;
use bigint::prelude::U256;
use bigint::hash::{H256, H520};
use util::{Address, Bytes, Mutex, RwLock};
use util::{Address, Bytes};
use parking_lot::{Mutex, RwLock};
use stats::Corpus;
use ethkey::Signature;

View File

@ -38,7 +38,8 @@ use light::request::Field;
use ethsync::LightSync;
use bigint::prelude::U256;
use util::{Address, Mutex};
use util::Address;
use parking_lot::Mutex;
use v1::helpers::{CallRequest as CallRequestHelper, errors, dispatch};
use v1::types::{BlockNumber, CallRequest, Log};

View File

@ -17,7 +17,7 @@
use std::sync::Arc;
use std::ops::Deref;
use http::Origin;
use util::Mutex;
use parking_lot::Mutex;
use transient_hashmap::TransientHashMap;
use ethstore::random_string;

View File

@ -20,7 +20,8 @@ use std::sync::Arc;
use std::collections::BTreeMap;
use jsonrpc_core;
use bigint::prelude::U256;
use util::{Mutex, RwLock, Address};
use util::Address;
use parking_lot::{Mutex, RwLock};
use ethcore::account_provider::DappId;
use v1::helpers::{ConfirmationRequest, ConfirmationPayload};
use v1::types::{ConfirmationResponse, H160 as RpcH160, Origin, DappId as RpcDappId};
@ -299,7 +300,8 @@ mod test {
use std::thread;
use std::sync::{mpsc, Arc};
use bigint::prelude::U256;
use util::{Address, Mutex};
use util::Address;
use parking_lot::Mutex;
use v1::helpers::{SigningQueue, ConfirmationsQueue, QueueEvent, FilledTransactionRequest, ConfirmationPayload};
use v1::types::ConfirmationResponse;

View File

@ -18,7 +18,7 @@
use std::sync::Arc;
use std::sync::atomic::{self, AtomicBool};
use util::Mutex;
use parking_lot::Mutex;
use jsonrpc_core::futures::future::{self, Either};
use jsonrpc_core::futures::sync::mpsc;

View File

@ -26,7 +26,7 @@ use time::get_time;
use bigint::prelude::U256;
use bigint::hash::{H64, H160, H256};
use util::Address;
use util::Mutex;
use parking_lot::Mutex;
use ethash::SeedHashCompute;
use ethcore::account_provider::{AccountProvider, DappId};

View File

@ -24,7 +24,7 @@ use ethcore::miner::MinerService;
use ethcore::filter::Filter as EthcoreFilter;
use ethcore::client::{BlockChainClient, BlockId};
use bigint::hash::H256;
use util::Mutex;
use parking_lot::Mutex;
use futures::{future, Future, BoxFuture};

View File

@ -40,7 +40,8 @@ use light::on_demand::OnDemand;
use light::client::{LightChainClient, LightChainNotify};
use parity_reactor::Remote;
use bigint::hash::H256;
use util::{RwLock, Mutex, Bytes};
use util::Bytes;
use parking_lot::{RwLock, Mutex};
type Client = Sink<pubsub::Result>;

View File

@ -40,7 +40,7 @@ use ethsync::LightSync;
use rlp::UntrustedRlp;
use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP};
use bigint::prelude::U256;
use util::{RwLock, Mutex};
use parking_lot::{RwLock, Mutex};
use futures::{future, Future, BoxFuture, IntoFuture};
use futures::sync::oneshot;

View File

@ -18,7 +18,7 @@
use std::sync::Arc;
use std::time::Duration;
use util::RwLock;
use parking_lot::RwLock;
use futures::{self, BoxFuture, Future, Stream, Sink};
use jsonrpc_core::{self as core, Error, MetaIoHandler};

View File

@ -24,7 +24,7 @@ use ethkey;
use futures::{future, BoxFuture, Future, IntoFuture};
use parity_reactor::Remote;
use rlp::UntrustedRlp;
use util::Mutex;
use parking_lot::Mutex;
use jsonrpc_core::{futures, Error};
use jsonrpc_pubsub::SubscriptionId;

View File

@ -19,7 +19,7 @@
use std::sync::Arc;
use transient_hashmap::TransientHashMap;
use bigint::prelude::U256;
use util::Mutex;
use parking_lot::Mutex;
use ethcore::account_provider::AccountProvider;

View File

@ -24,7 +24,7 @@ use futures::Future;
use futures_cpupool as pool;
use jsonrpc_core as rpc;
use order_stat;
use util::RwLock;
use parking_lot::RwLock;
pub use self::pool::CpuPool;

View File

@ -20,7 +20,8 @@ use std::collections::{BTreeMap, HashMap};
use std::collections::hash_map::Entry;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Address, Bytes, RwLock, Mutex};
use util::{Address, Bytes};
use parking_lot::{RwLock, Mutex};
use ethcore::error::Error;
use ethcore::client::MiningBlockChainClient;
use ethcore::block::ClosedBlock;

View File

@ -16,8 +16,9 @@
use ethcore::snapshot::{ManifestData, RestorationStatus, SnapshotService};
use util::{Bytes, Mutex};
use util::Bytes;
use bigint::hash::H256;
use parking_lot::Mutex;
/// Mocked snapshot service (used for sync info extensions).
pub struct TestSnapshotService {

View File

@ -18,7 +18,7 @@
use std::collections::BTreeMap;
use bigint::hash::H256;
use util::RwLock;
use parking_lot::RwLock;
use ethsync::{SyncProvider, EthProtocolInfo, SyncStatus, SyncState, PeerInfo, TransactionStats};
/// TestSyncProvider config.

View File

@ -24,7 +24,8 @@ use rlp;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::{Address, Mutex};
use util::Address;
use parking_lot::Mutex;
use ethkey::Secret;
use ethcore::account_provider::AccountProvider;
use ethcore::client::{TestBlockChainClient, EachBlockWith, Executed, TransactionId};

View File

@ -18,7 +18,7 @@
use std::fmt;
use serde::{Serialize, Serializer};
use util::Colour;
use ansi_term::Colour;
use util::bytes::ToPretty;
use v1::types::{U256, TransactionRequest, RichRawTransaction, H160, H256, H520, Bytes, TransactionCondition, Origin};

Some files were not shown because too many files have changed in this diff Show More