Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/paritytech/parity:
  new blooms database (openethereum#8712)
  ethstore: retry deduplication of wallet file names until success (openethereum#8910)
  Update ropsten.json (openethereum#8926)
  • Loading branch information
ordian committed Jun 20, 2018
2 parents 299876b + 458afcd commit 5712c35
Show file tree
Hide file tree
Showing 83 changed files with 1,242 additions and 2,892 deletions.
24 changes: 19 additions & 5 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
blooms-db = { path = "util/blooms-db" }
log = "0.3"
env_logger = "0.4"
rustc-hex = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
ansi_term = "0.10"
bloomchain = { path = "../util/bloomchain" }
blooms-db = { path = "../util/blooms-db" }
bn = { git = "https://github.com/paritytech/bn", default-features = false }
byteorder = "1.0"
common-types = { path = "types" }
Expand Down Expand Up @@ -67,11 +67,11 @@ keccak-hash = { path = "../util/hash" }
triehash = { path = "../util/triehash" }
unexpected = { path = "../util/unexpected" }
journaldb = { path = "../util/journaldb" }
tempdir = "0.3"
kvdb-rocksdb = { path = "../util/kvdb-rocksdb" }

[dev-dependencies]
tempdir = "0.3"
trie-standardmap = { path = "../util/trie-standardmap" }
kvdb-rocksdb = { path = "../util/kvdb-rocksdb" }

[features]
# Display EVM debug traces.
Expand Down
14 changes: 6 additions & 8 deletions ethcore/light/src/client/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ use std::sync::Arc;
use std::path::Path;

use ethcore::client::ClientIoMessage;
use ethcore::db;
use ethcore::{db, BlockChainDB, BlockChainDBHandler};
use ethcore::error::Error as CoreError;
use ethcore::spec::Spec;
use io::{IoContext, IoError, IoHandler, IoService};
use kvdb::{KeyValueDB, KeyValueDBHandler};
use ethcore::snapshot::{
SnapshotService as _SnapshotService,
service::{
Expand Down Expand Up @@ -82,16 +81,15 @@ impl<T: ChainDataFetcher> Service<T> {
config: ClientConfig,
spec: Spec,
fetcher: T,
db: Arc<KeyValueDB>,
db: Arc<BlockChainDB>,
cache: Arc<Mutex<Cache>>,
restoration_db_handler: Box<KeyValueDBHandler>,
restoration_db_handler: Box<BlockChainDBHandler>,
snapshot_path: &Path,
) -> Result<Self, Error> {

let io_service = IoService::<ClientIoMessage>::start().map_err(Error::Io)?;
let hs = if config.no_hardcoded_sync { HardcodedSync::Deny } else { HardcodedSync::Allow };
let client = Arc::new(Client::new(config,
db,
db.key_value().clone(),
db::COL_LIGHT_CHAIN,
&spec,
fetcher,
Expand Down Expand Up @@ -191,7 +189,7 @@ mod tests {
use client::fetch;
use std::time::Duration;
use parking_lot::Mutex;
use ethcore::db::NUM_COLUMNS;
use ethcore::test_helpers;

use tempdir::TempDir;

Expand Down Expand Up @@ -228,7 +226,7 @@ mod tests {
config: client_db_config,
});

let db = Arc::new(kvdb_memorydb::create(NUM_COLUMNS.unwrap_or(0)));
let db = test_helpers::new_db();
let spec = Spec::new_test();
let cache = Arc::new(Mutex::new(Cache::new(Default::default(), Duration::from_secs(6 * 3600))));

Expand Down
3 changes: 2 additions & 1 deletion ethcore/node_filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ mod test {
use ethcore::spec::Spec;
use ethcore::client::{BlockChainClient, Client, ClientConfig};
use ethcore::miner::Miner;
use ethcore::test_helpers;
use network::{ConnectionDirection, ConnectionFilter, NodeId};
use io::IoChannel;
use super::NodeFilter;
Expand All @@ -127,7 +128,7 @@ mod test {
let data = include_bytes!("../res/node_filter.json");
let tempdir = TempDir::new("").unwrap();
let spec = Spec::load(&tempdir.path(), &data[..]).unwrap();
let client_db = Arc::new(::kvdb_memorydb::create(::ethcore::db::NUM_COLUMNS.unwrap_or(0)));
let client_db = test_helpers::new_db();

let client = Client::new(
ClientConfig::default(),
Expand Down
4 changes: 2 additions & 2 deletions ethcore/res/ethereum/ropsten.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x3",
"forkBlock": 641350,
"forkCanonHash": "0x8033403e9fe5811a7b6d6b469905915de1c59207ce2172cbcf5d6ff14fa6a2eb",
"forkBlock": 3383558,
"forkCanonHash": "0x6b4b80d65951375a70bc1ecf9a270d152dd355454d57869abbae2e42c213e0f3",
"maxCodeSize": 24576,
"maxCodeSizeTransition": 10,
"eip150Transition": 0,
Expand Down
39 changes: 12 additions & 27 deletions ethcore/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ use std::time::Duration;

use ansi_term::Colour;
use io::{IoContext, TimerToken, IoHandler, IoService, IoError};
use kvdb::{KeyValueDB, KeyValueDBHandler};
use stop_guard::StopGuard;

use sync::PrivateTxHandler;
use ethcore::{BlockChainDB, BlockChainDBHandler};
use ethcore::client::{Client, ClientConfig, ChainNotify, ClientIoMessage};
use ethcore::miner::Miner;
use ethcore::snapshot::service::{
Expand Down Expand Up @@ -73,7 +73,7 @@ pub struct ClientService {
client: Arc<Client>,
snapshot: Arc<SnapshotService<FullNodeRestorationParams>>,
private_tx: Arc<PrivateTxService>,
database: Arc<KeyValueDB>,
database: Arc<BlockChainDB>,
_stop_guard: StopGuard,
}

Expand All @@ -82,9 +82,9 @@ impl ClientService {
pub fn start(
config: ClientConfig,
spec: &Spec,
client_db: Arc<KeyValueDB>,
blockchain_db: Arc<BlockChainDB>,
snapshot_path: &Path,
restoration_db_handler: Box<KeyValueDBHandler>,
restoration_db_handler: Box<BlockChainDBHandler>,
_ipc_path: &Path,
miner: Arc<Miner>,
account_provider: Arc<AccountProvider>,
Expand All @@ -97,7 +97,7 @@ impl ClientService {
info!("Configured for {} using {} engine", Colour::White.bold().paint(spec.name.clone()), Colour::Yellow.bold().paint(spec.engine.name()));

let pruning = config.pruning;
let client = Client::new(config, &spec, client_db.clone(), miner.clone(), io_service.channel())?;
let client = Client::new(config, &spec, blockchain_db.clone(), miner.clone(), io_service.channel())?;

let snapshot_params = SnapServiceParams {
engine: spec.engine.clone(),
Expand Down Expand Up @@ -137,7 +137,7 @@ impl ClientService {
client: client,
snapshot: snapshot,
private_tx,
database: client_db,
database: blockchain_db,
_stop_guard: stop_guard,
})
}
Expand Down Expand Up @@ -173,7 +173,7 @@ impl ClientService {
}

/// Get a handle to the database.
pub fn db(&self) -> Arc<KeyValueDB> { self.database.clone() }
pub fn db(&self) -> Arc<BlockChainDB> { self.database.clone() }

/// Shutdown the Client Service
pub fn shutdown(&self) {
Expand Down Expand Up @@ -265,8 +265,8 @@ mod tests {
use ethcore::miner::Miner;
use ethcore::spec::Spec;
use ethcore::db::NUM_COLUMNS;
use kvdb::Error;
use kvdb_rocksdb::{Database, DatabaseConfig, CompactionProfile};
use ethcore::test_helpers;
use kvdb_rocksdb::{DatabaseConfig, CompactionProfile};
use super::*;

use ethcore_private_tx;
Expand All @@ -284,24 +284,9 @@ mod tests {
client_db_config.compaction = CompactionProfile::auto(&client_path);
client_db_config.wal = client_config.db_wal;

let client_db = Arc::new(Database::open(
&client_db_config,
&client_path.to_str().expect("DB path could not be converted to string.")
).unwrap());

struct RestorationDBHandler {
config: DatabaseConfig,
}

impl KeyValueDBHandler for RestorationDBHandler {
fn open(&self, db_path: &Path) -> Result<Arc<KeyValueDB>, Error> {
Ok(Arc::new(Database::open(&self.config, &db_path.to_string_lossy())?))
}
}

let restoration_db_handler = Box::new(RestorationDBHandler {
config: client_db_config,
});
let client_db_handler = test_helpers::restoration_db_handler(client_db_config.clone());
let client_db = client_db_handler.open(&client_path).unwrap();
let restoration_db_handler = test_helpers::restoration_db_handler(client_db_config);

let spec = Spec::new_test();
let service = ClientService::start(
Expand Down
Loading

0 comments on commit 5712c35

Please sign in to comment.