Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into more-duration-ref…
Browse files Browse the repository at this point in the history
…actor
  • Loading branch information
tomaka committed Apr 10, 2018
2 parents 0dfab9a + 86446d7 commit ee18ba2
Show file tree
Hide file tree
Showing 71 changed files with 163 additions and 156 deletions.
72 changes: 36 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ fdlimit = "0.1"
ws2_32-sys = "0.2"
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
ethsync = { path = "sync" }
ethcore = { path = "ethcore" }
ethcore-bytes = { path = "util/bytes" }
ethcore-io = { path = "util/io" }
Expand All @@ -44,7 +43,8 @@ ethcore-miner = { path = "miner" }
ethcore-network = { path = "util/network" }
ethcore-private-tx = { path = "ethcore/private-tx" }
ethcore-service = { path = "ethcore/service" }
ethcore-stratum = { path = "stratum" }
ethcore-stratum = { path = "ethcore/stratum" }
ethcore-sync = { path = "ethcore/sync" }
ethcore-transaction = { path = "ethcore/transaction" }
ethereum-types = "0.3"
node-filter = { path = "ethcore/node_filter" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ patricia-trie = { path = "../util/patricia_trie" }
ethcore-io = { path = "../util/io" }
ethcore-logger = { path = "../logger" }
ethcore-miner = { path = "../miner" }
ethcore-stratum = { path = "../stratum" }
ethcore-stratum = { path = "./stratum" }
ethcore-transaction = { path = "./transaction" }
ethereum-types = "0.3"
memory-cache = { path = "../util/memory_cache" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ error-chain = { version = "0.11", default-features = false }
ethcore = { path = ".." }
ethcore-io = { path = "../../util/io" }
ethcore-private-tx = { path = "../private-tx" }
ethsync = { path = "../../sync" }
ethcore-sync = { path = "../sync" }
kvdb = { path = "../../util/kvdb" }
log = "0.3"
stop-guard = { path = "../../util/stop-guard" }
Expand Down
4 changes: 2 additions & 2 deletions ethcore/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
extern crate ansi_term;
extern crate ethcore;
extern crate ethcore_io as io;
extern crate ethsync;
extern crate kvdb;
extern crate ethcore_private_tx;
extern crate ethcore_sync as sync;
extern crate kvdb;
extern crate stop_guard;

#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion ethcore/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use io::{IoContext, TimerToken, IoHandler, IoService, IoError};
use kvdb::{KeyValueDB, KeyValueDBHandler};
use stop_guard::StopGuard;

use ethsync::PrivateTxHandler;
use sync::PrivateTxHandler;
use ethcore::client::{Client, ClientConfig, ChainNotify, ClientIoMessage};
use ethcore::miner::Miner;
use ethcore::snapshot::service::{Service as SnapshotService, ServiceParams as SnapServiceParams};
Expand Down
5 changes: 2 additions & 3 deletions stratum/Cargo.toml → ethcore/stratum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
ethcore-logger = { path = "../logger" }
ethereum-types = "0.3"
keccak-hash = { path = "../util/hash" }
keccak-hash = { path = "../../util/hash" }
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
jsonrpc-macros = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
jsonrpc-tcp-server = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
Expand All @@ -19,4 +18,4 @@ parking_lot = "0.5"
env_logger = "0.4"
tokio-core = "0.1"
tokio-io = "0.1"
ethcore-logger = { path = "../logger" }
ethcore-logger = { path = "../../logger" }
17 changes: 8 additions & 9 deletions stratum/src/lib.rs → ethcore/stratum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ impl Stratum {
) -> Result<Arc<Stratum>, Error> {

let implementation = Arc::new(StratumImpl {
subscribers: RwLock::new(Vec::new()),
job_que: RwLock::new(HashSet::new()),
subscribers: RwLock::default(),
job_que: RwLock::default(),
dispatcher,
workers: Arc::new(RwLock::new(HashMap::new())),
workers: Arc::new(RwLock::default()),
secret,
notify_counter: RwLock::new(NOTIFY_COUNTER_INITIAL),
});
Expand Down Expand Up @@ -323,7 +323,6 @@ impl MetaExtractor<SocketMetadata> for PeerMetaExtractor {
#[cfg(test)]
mod tests {
use super::*;
use std::str::FromStr;
use std::net::SocketAddr;
use std::sync::Arc;

Expand Down Expand Up @@ -366,15 +365,15 @@ mod tests {

#[test]
fn can_be_started() {
let stratum = Stratum::start(&SocketAddr::from_str("127.0.0.1:19980").unwrap(), Arc::new(VoidManager), None);
let stratum = Stratum::start(&"127.0.0.1:19980".parse().unwrap(), Arc::new(VoidManager), None);
assert!(stratum.is_ok());
}

#[test]
fn records_subscriber() {
init_log();

let addr = SocketAddr::from_str("127.0.0.1:19985").unwrap();
let addr = "127.0.0.1:19985".parse().unwrap();
let stratum = Stratum::start(&addr, Arc::new(VoidManager), None).unwrap();
let request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 1}"#;
dummy_request(&addr, request);
Expand Down Expand Up @@ -419,7 +418,7 @@ mod tests {

#[test]
fn receives_initial_paylaod() {
let addr = SocketAddr::from_str("127.0.0.1:19975").unwrap();
let addr = "127.0.0.1:19975".parse().unwrap();
let _stratum = Stratum::start(&addr, DummyManager::new(), None).expect("There should be no error starting stratum");
let request = r#"{"jsonrpc": "2.0", "method": "mining.subscribe", "params": [], "id": 2}"#;

Expand All @@ -430,7 +429,7 @@ mod tests {

#[test]
fn can_authorize() {
let addr = SocketAddr::from_str("127.0.0.1:19970").unwrap();
let addr = "127.0.0.1:19970".parse().unwrap();
let stratum = Stratum::start(
&addr,
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),
Expand All @@ -448,7 +447,7 @@ mod tests {
fn can_push_work() {
init_log();

let addr = SocketAddr::from_str("127.0.0.1:19995").unwrap();
let addr = "127.0.0.1:19995".parse().unwrap();
let stratum = Stratum::start(
&addr,
Arc::new(DummyManager::build().of_initial(r#"["dummy autorize payload"]"#)),
Expand Down
File renamed without changes.
37 changes: 37 additions & 0 deletions ethcore/sync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
description = "Ethcore blockchain sync"
name = "ethcore-sync"
version = "1.11.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]

[lib]

[dependencies]
ethcore-bytes = { path = "../../util/bytes" }
ethcore-network = { path = "../../util/network" }
ethcore-network-devp2p = { path = "../../util/network-devp2p" }
ethcore-io = { path = "../../util/io" }
ethcore-light = { path = "../light" }
ethcore-transaction = { path = "../transaction" }
ethcore = { path = ".." }
ethereum-types = "0.3"
plain_hasher = { path = "../../util/plain_hasher" }
rlp = { path = "../../util/rlp" }
rustc-hex = "1.0"
keccak-hash = { path = "../../util/hash" }
triehash = { path = "../../util/triehash" }
kvdb = { path = "../../util/kvdb" }
macros = { path = "../../util/macros" }
log = "0.3"
env_logger = "0.4"
rand = "0.4"
heapsize = "0.4"
semver = "0.9"
smallvec = { version = "0.4", features = ["heapsizeof"] }
parking_lot = "0.5"
ipnetwork = "0.12.6"

[dev-dependencies]
ethkey = { path = "../../ethkey" }
kvdb-memorydb = { path = "../../util/kvdb-memorydb" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use ethereum_types::{U256, H256, Address};
use parity_version::{version_data, version};
use bytes::Bytes;
use ansi_term::Colour;
use ethsync::{NetworkConfiguration, validate_node_url, self};
use sync::{NetworkConfiguration, validate_node_url, self};
use ethcore::ethstore::ethkey::{Secret, Public};
use ethcore::client::{VMType};
use ethcore::miner::{MinerOptions, Banning, StratumOptions};
Expand Down Expand Up @@ -738,7 +738,7 @@ impl Configuration {
for line in &lines {
match validate_node_url(line).map(Into::into) {
None => continue,
Some(ethsync::ErrorKind::AddressResolve(_)) => return Err(format!("Failed to resolve hostname of a boot node: {}", line)),
Some(sync::ErrorKind::AddressResolve(_)) => return Err(format!("Failed to resolve hostname of a boot node: {}", line)),
Some(_) => return Err(format!("Invalid node address format given for a boot node: {}", line)),
}
}
Expand Down
2 changes: 1 addition & 1 deletion parity/dapps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use bytes::Bytes;
use dir::default_data_path;
use dir::helpers::replace_home;
use ethcore::client::{Client, BlockChainClient, BlockId, CallContract};
use ethsync::LightSync;
use sync::LightSync;
use futures::{Future, future, IntoFuture};
use futures_cpupool::CpuPool;
use hash_fetch::fetch::Client as FetchClient;
Expand Down
8 changes: 4 additions & 4 deletions parity/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use dir::DatabaseDirectories;
use dir::helpers::replace_home;
use upgrade::{upgrade, upgrade_data_paths};
use migration::migrate;
use ethsync::{validate_node_url, self};
use sync::{validate_node_url, self};
use kvdb::{KeyValueDB, KeyValueDBHandler};
use kvdb_rocksdb::{Database, DatabaseConfig, CompactionProfile};
use path;
Expand Down Expand Up @@ -174,7 +174,7 @@ pub fn to_bootnodes(bootnodes: &Option<String>) -> Result<Vec<String>, String> {
Some(ref x) if !x.is_empty() => x.split(',').map(|s| {
match validate_node_url(s).map(Into::into) {
None => Ok(s.to_owned()),
Some(ethsync::ErrorKind::AddressResolve(_)) => Err(format!("Failed to resolve hostname of a boot node: {}", s)),
Some(sync::ErrorKind::AddressResolve(_)) => Err(format!("Failed to resolve hostname of a boot node: {}", s)),
Some(_) => Err(format!("Invalid node address format given for a boot node: {}", s)),
}
}).collect(),
Expand All @@ -184,8 +184,8 @@ pub fn to_bootnodes(bootnodes: &Option<String>) -> Result<Vec<String>, String> {
}

#[cfg(test)]
pub fn default_network_config() -> ::ethsync::NetworkConfiguration {
use ethsync::{NetworkConfiguration};
pub fn default_network_config() -> ::sync::NetworkConfiguration {
use sync::{NetworkConfiguration};
use super::network::IpFilter;
NetworkConfiguration {
config_path: Some(replace_home(&::dir::default_data_path(), "$BASE/network")),
Expand Down
2 changes: 1 addition & 1 deletion parity/informant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use ethcore::client::{
use ethcore::header::BlockNumber;
use ethcore::snapshot::{RestorationStatus, SnapshotService as SS};
use ethcore::snapshot::service::Service as SnapshotService;
use ethsync::{LightSyncProvider, LightSync, SyncProvider, ManageNetwork};
use sync::{LightSyncProvider, LightSync, SyncProvider, ManageNetwork};
use io::{TimerToken, IoContext, IoHandler};
use isatty::{stdout_isatty};
use light::Cache as LightDataCache;
Expand Down
2 changes: 1 addition & 1 deletion parity/light_helpers/epoch_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use ethcore::engines::{EthEngine, StateDependentProof};
use ethcore::header::Header;
use ethcore::machine::EthereumMachine;
use ethcore::receipt::Receipt;
use ethsync::LightSync;
use sync::LightSync;

use futures::{future, Future};
use futures::future::Either;
Expand Down
2 changes: 1 addition & 1 deletion parity/light_helpers/queue_cull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::sync::Arc;
use std::time::Duration;

use ethcore::client::ClientIoMessage;
use ethsync::LightSync;
use sync::LightSync;
use io::{IoContext, IoHandler, TimerToken};

use light::client::LightChainClient;
Expand Down
Loading

0 comments on commit ee18ba2

Please sign in to comment.