From 591eb76a93a5e9b36308e930813d50dd2a718e7a Mon Sep 17 00:00:00 2001 From: Arkadiy Paronyan Date: Thu, 2 Mar 2017 20:04:17 +0100 Subject: [PATCH 1/4] Enable --warp by default (#4719) * Enable --warp by default * Disable warp if non-standard chain options are selected * Add warnings if warp is specified * Fixed tests --- parity/cli/mod.rs | 8 +++++--- parity/cli/usage.txt | 3 ++- parity/configuration.rs | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index bbd5e0cff..5f062d425 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -119,8 +119,8 @@ usage! { flag_ui_no_validation: bool = false, or |_| None, // -- Networking Options - flag_warp: bool = false, - or |c: &Config| otry!(c.network).warp.clone(), + flag_no_warp: bool = false, + or |c: &Config| otry!(c.network).warp.clone().map(|w| !w), flag_port: u16 = 30303u16, or |c: &Config| otry!(c.network).port.clone(), flag_min_peers: u16 = 25u16, @@ -330,6 +330,7 @@ usage! { // Values with optional default value. flag_base_path: Option, display dir::default_data_path(), or |c: &Config| otry!(c.parity).base_path.clone().map(Some), flag_db_path: Option, display dir::CHAINS_PATH, or |c: &Config| otry!(c.parity).db_path.clone().map(Some), + flag_warp: Option, display true, or |c: &Config| Some(otry!(c.network).warp.clone()), } } @@ -638,7 +639,7 @@ mod tests { flag_ui_no_validation: false, // -- Networking Options - flag_warp: true, + flag_no_warp: false, flag_port: 30303u16, flag_min_peers: 25u16, flag_max_peers: 50u16, @@ -779,6 +780,7 @@ mod tests { flag_etherbase: None, flag_extradata: None, flag_cache: None, + flag_warp: Some(true), // -- Miscellaneous Options flag_version: false, diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt index dee6dd788..01a7b87bd 100644 --- a/parity/cli/usage.txt +++ b/parity/cli/usage.txt @@ -97,7 +97,7 @@ UI Options: development. (default: {flag_ui_no_validation}) Networking Options: - --warp Enable syncing from the snapshot over the network. (default: {flag_warp}) + --no-warp Disable syncing from the snapshot over the network. (default: {flag_no_warp}) --port PORT Override the port on which the node should listen (default: {flag_port}). --min-peers NUM Try to maintain at least NUM peers (default: {flag_min_peers}). @@ -386,6 +386,7 @@ Legacy Options: -w --webapp Does nothing; dapps server is on by default now. --dapps-off Equivalent to --no-dapps. --rpc Does nothing; JSON-RPC is on by default now. + --warp Does nothing; Warp sync is on by default. (default: {flag_warp}) --rpcaddr IP Equivalent to --jsonrpc-interface IP. --rpcport PORT Equivalent to --jsonrpc-port PORT. --rpcapi APIS Equivalent to --jsonrpc-apis APIS. diff --git a/parity/configuration.rs b/parity/configuration.rs index 8a5c64920..6ef3bc660 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -15,12 +15,13 @@ // along with Parity. If not, see . use std::time::Duration; -use std::io::Read; +use std::io::{Read, Write, stderr}; use std::net::SocketAddr; use std::path::{Path, PathBuf}; use std::cmp::max; use cli::{Args, ArgsError}; use util::{Hashable, H256, U256, Uint, Bytes, version_data, Address}; +use util::journaldb::Algorithm; use util::log::Colour; use ethsync::{NetworkConfiguration, is_valid_node_url, AllowIP}; use ethcore::ethstore::ethkey::Secret; @@ -33,7 +34,7 @@ use ethcore_rpc::NetworkSettings; use cache::CacheConfig; use helpers::{to_duration, to_mode, to_block_id, to_u256, to_pending_set, to_price, replace_home, replace_home_for_db, geth_ipc_path, parity_ipc_path, to_bootnodes, to_addresses, to_address, to_gas_limit, to_queue_strategy}; -use params::{SpecType, ResealPolicy, AccountsConfig, GasPricerConfig, MinerExtras}; +use params::{SpecType, ResealPolicy, AccountsConfig, GasPricerConfig, MinerExtras, Pruning, Switch}; use ethcore_logger::Config as LogConfig; use dir::{self, Directories, default_hypervisor_path, default_local_path, default_data_path}; use dapps::Configuration as DappsConfiguration; @@ -115,7 +116,14 @@ impl Configuration { let fat_db = self.args.flag_fat_db.parse()?; let compaction = self.args.flag_db_compaction.parse()?; let wal = !self.args.flag_fast_and_loose; - let warp_sync = self.args.flag_warp; + match self.args.flag_warp { + // Logging is not initialized yet, so we print directly to stderr + Some(true) if fat_db == Switch::On => writeln!(&mut stderr(), "Warning: Warp Sync is disabled because Fat DB is turned on").expect("Error writing to stderr"), + Some(true) if tracing == Switch::On => writeln!(&mut stderr(), "Warning: Warp Sync is disabled because tracing is turned on").expect("Error writing to stderr"), + Some(true) if pruning == Pruning::Specific(Algorithm::Archive) => writeln!(&mut stderr(), "Warning: Warp Sync is disabled because pruning mode is set to archive").expect("Error writing to stderr"), + _ => {}, + }; + let warp_sync = !self.args.flag_no_warp && fat_db != Switch::On && tracing != Switch::On && pruning != Pruning::Specific(Algorithm::Archive); let geth_compatibility = self.args.flag_geth; let ui_address = self.ui_port().map(|port| (self.ui_interface(), port)); let dapps_conf = self.dapps_config(); @@ -1144,7 +1152,7 @@ mod tests { ipc_conf: Default::default(), net_conf: default_network_config(), network_id: None, - warp_sync: false, + warp_sync: true, acc_conf: Default::default(), gas_pricer: Default::default(), miner_extras: Default::default(), From 2862b3c21a9ceb76f93f1c1a0b69397d019a1a26 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 2 Mar 2017 20:24:27 +0100 Subject: [PATCH 2/4] New chains (#4720) * Add Kovan chain. * Fix up --testnet. * Fix tests. * Fix test. * fix test * Fix test. --- ethcore/res/ethereum/kovan.json | 58 +++++++++++++++++++++++++++++++++ ethcore/src/ethereum/mod.rs | 5 ++- parity/cli/usage.txt | 5 ++- parity/configuration.rs | 8 ++--- parity/params.rs | 10 ++++-- 5 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 ethcore/res/ethereum/kovan.json diff --git a/ethcore/res/ethereum/kovan.json b/ethcore/res/ethereum/kovan.json new file mode 100644 index 000000000..7708f0c04 --- /dev/null +++ b/ethcore/res/ethereum/kovan.json @@ -0,0 +1,58 @@ +{ + "name": "Kovan", + "dataDir": "kovan", + "engine": { + "authorityRound": { + "params": { + "gasLimitBoundDivisor": "0x400", + "stepDuration": "4", + "blockReward": "0x4563918244F40000", + "validators" : { + "list": [ + "0x00D6Cc1BA9cf89BD2e58009741f4F7325BAdc0ED", + "0x00427feae2419c15b89d1c21af10d1b6650a4d3d", + "0x4Ed9B08e6354C70fE6F8CB0411b0d3246b424d6c", + "0x0020ee4Be0e2027d76603cB751eE069519bA81A1", + + "0x0010f94b296a852aaac52ea6c5ac72e03afd032d", + + "0x007733a1FE69CF3f2CF989F81C7b4cAc1693387A", + "0x00E6d2b931F55a3f1701c7389d592a7778897879", + "0x00e4a10650e5a6D6001C38ff8E64F97016a1645c", + + "0x00a0a24b9f0e5ec7aa4c7389b8302fd0123194de" + ] + } + } + } + }, + "params": { + "maximumExtraDataSize": "0x20", + "minGasLimit": "0x1388", + "networkID" : "0x2A" + }, + "genesis": { + "seal": { + "authorityRound": { + "step": "0x0", + "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + }, + "difficulty": "0x20000", + "gasLimit": "0x5B8D80" + }, + "accounts": { + "0x0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, + "0x0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, + "0x0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, + "0x0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "0x00521965e7bd230323c423d96c657db5b79d099f": { "balance": "1606938044258990275541962092341162602522202993782792835301376" } + }, + "nodes": [ + "enode://c005dd308256c60fab247813d8bf6d6e81f9cd354287837eb1c2fcf294adaa913a3208e88900ef5c55a8cba7042c301d80503edec2ad3f92a72e241ee6743854@192.241.230.87:30303", + "enode://48caeceb2724f2f71406990aa81efe87f8c53f26441d891473da2ae50cc138f238addc0e46b5aee240db55de8c711daac53d7b32a3f13e30edb86a3ca7c2700b@138.68.143.220:30303", + "enode://85705212fd28ebdd56669fb55e958feb9d81f74fe76c82f867564b6c2995e69f596df0f588eba16f1a43b69ce06485d68231a0c83fed8469b41eba0e390c126f@139.59.146.42:30303", + "enode://2aa81bd0a761cd4f02c934dcf3f81c5b65953e51ab5ba03ceb1f125eb06418a1cdffb1c9d01871aa7bd456f3fce35e745608189ad1164f72b2161634b0c3f6ea@188.166.240.190:30303", + "enode://c5900cdd6d20795d58372f42dfbab9d664c27bb97e9c27972741942736e919122f9bac28e74cbc58e4ff195475ea90d9880b71a37af5b5a8cb41d843f765cff8@174.138.79.48:30303" + ] +} diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index b15c9e4de..9d279274c 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -48,9 +48,12 @@ pub fn new_frontier() -> Spec { load(include_bytes!("../../res/ethereum/frontier /// Create a new Frontier mainnet chain spec without the DAO hardfork. pub fn new_classic() -> Spec { load(include_bytes!("../../res/ethereum/classic.json")) } -/// Create a new Frontier mainnet chain spec without the DAO hardfork. +/// Create a new Expanse mainnet chain spec. pub fn new_expanse() -> Spec { load(include_bytes!("../../res/ethereum/expanse.json")) } +/// Create a new Kovan testnet chain spec. +pub fn new_kovan() -> Spec { load(include_bytes!("../../res/ethereum/kovan.json")) } + /// Create a new Frontier chain spec as though it never changes to Homestead. pub fn new_frontier_test() -> Spec { load(include_bytes!("../../res/ethereum/frontier_test.json")) } diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt index 01a7b87bd..a36d0a68c 100644 --- a/parity/cli/usage.txt +++ b/parity/cli/usage.txt @@ -59,7 +59,7 @@ Operating Options: --chain CHAIN Specify the blockchain type. CHAIN may be either a JSON chain specification file or olympic, frontier, homestead, mainnet, morden, ropsten, classic, expanse, - testnet or dev (default: {flag_chain}). + testnet, kovan or dev (default: {flag_chain}). -d --base-path PATH Specify the base data storage path. (default: {flag_base_path}). --db-path PATH Specify the database directory path @@ -372,8 +372,7 @@ Legacy Options: to be the same as Geth's. Overrides the --ipc-path and --ipcpath options. Alters RPCs to reflect Geth bugs. Includes the personal_ RPC by default. - --testnet Geth-compatible testnet mode. Equivalent to --chain - testnet --keys-path $HOME/parity/testnet-keys. + --testnet Testnet mode. Equivalent to --chain testnet. Overrides the --keys-path option. --import-geth-keys Attempt to import keys from Geth client. --datadir PATH Equivalent to --base-path PATH. diff --git a/parity/configuration.rs b/parity/configuration.rs index 6ef3bc660..b50816482 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -438,7 +438,7 @@ impl Configuration { fn chain(&self) -> String { if self.args.flag_testnet { - "ropsten".to_owned() + "testnet".to_owned() } else { self.args.flag_chain.clone() } @@ -828,8 +828,8 @@ impl Configuration { let secretstore_path = replace_home(&data_path, &self.args.flag_secretstore_path); let ui_path = replace_home(&data_path, &self.args.flag_ui_path); - if self.args.flag_geth && !cfg!(windows) { - let geth_root = if self.args.flag_testnet { path::ethereum::test() } else { path::ethereum::default() }; + if self.args.flag_geth && !cfg!(windows) { + let geth_root = if self.chain() == "testnet".to_owned() { path::ethereum::test() } else { path::ethereum::default() }; ::std::fs::create_dir_all(geth_root.as_path()).unwrap_or_else( |e| warn!("Failed to create '{}' for geth mode: {}", &geth_root.to_str().unwrap(), e)); } @@ -1231,7 +1231,7 @@ mod tests { // then assert_eq!(conf.network_settings(), NetworkSettings { name: "testname".to_owned(), - chain: "ropsten".to_owned(), + chain: "testnet".to_owned(), network_port: 30303, rpc_enabled: true, rpc_interface: "local".to_owned(), diff --git a/parity/params.rs b/parity/params.rs index 4e3256bf1..d9aee81cd 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -29,6 +29,7 @@ pub enum SpecType { Mainnet, Morden, Ropsten, + Kovan, Olympic, Classic, Expanse, @@ -50,7 +51,8 @@ impl str::FromStr for SpecType { "frontier" | "homestead" | "mainnet" => SpecType::Mainnet, "frontier-dogmatic" | "homestead-dogmatic" | "classic" => SpecType::Classic, "morden" | "classic-testnet" => SpecType::Morden, - "ropsten" | "testnet" => SpecType::Ropsten, + "ropsten" => SpecType::Ropsten, + "kovan" | "testnet" => SpecType::Kovan, "olympic" => SpecType::Olympic, "expanse" => SpecType::Expanse, "dev" => SpecType::Dev, @@ -69,6 +71,7 @@ impl fmt::Display for SpecType { SpecType::Olympic => "olympic", SpecType::Classic => "classic", SpecType::Expanse => "expanse", + SpecType::Kovan => "kovan", SpecType::Dev => "dev", SpecType::Custom(ref custom) => custom, }) @@ -84,6 +87,7 @@ impl SpecType { SpecType::Olympic => Ok(ethereum::new_olympic()), SpecType::Classic => Ok(ethereum::new_classic()), SpecType::Expanse => Ok(ethereum::new_expanse()), + SpecType::Kovan => Ok(ethereum::new_kovan()), SpecType::Dev => Ok(Spec::new_instant()), SpecType::Custom(ref filename) => { let file = fs::File::open(filename).map_err(|_| "Could not load specification file.")?; @@ -320,7 +324,8 @@ mod tests { assert_eq!(SpecType::Mainnet, "frontier".parse().unwrap()); assert_eq!(SpecType::Mainnet, "homestead".parse().unwrap()); assert_eq!(SpecType::Mainnet, "mainnet".parse().unwrap()); - assert_eq!(SpecType::Ropsten, "testnet".parse().unwrap()); + assert_eq!(SpecType::Kovan, "testnet".parse().unwrap()); + assert_eq!(SpecType::Kovan, "kovan".parse().unwrap()); assert_eq!(SpecType::Morden, "morden".parse().unwrap()); assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap()); assert_eq!(SpecType::Olympic, "olympic".parse().unwrap()); @@ -341,6 +346,7 @@ mod tests { assert_eq!(format!("{}", SpecType::Olympic), "olympic"); assert_eq!(format!("{}", SpecType::Classic), "classic"); assert_eq!(format!("{}", SpecType::Expanse), "expanse"); + assert_eq!(format!("{}", SpecType::Kovan), "kovan"); assert_eq!(format!("{}", SpecType::Dev), "dev"); assert_eq!(format!("{}", SpecType::Custom("foo/bar".into())), "foo/bar"); } From 036ef7737328dd3e58ff3a0c3e2859f849a492d9 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 2 Mar 2017 21:40:29 +0100 Subject: [PATCH 3/4] s/delete/forget/ for wallets (#4729) --- js/src/views/Wallet/wallet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/views/Wallet/wallet.js b/js/src/views/Wallet/wallet.js index 77f938a78..61d80ce69 100644 --- a/js/src/views/Wallet/wallet.js +++ b/js/src/views/Wallet/wallet.js @@ -240,8 +240,8 @@ class Wallet extends Component { key='delete' label={ } onClick={ this.showDeleteDialog } From 96d74543fc118ec096fd046a03c5258d61ccfe64 Mon Sep 17 00:00:00 2001 From: GitLab Build Bot Date: Thu, 2 Mar 2017 20:52:50 +0000 Subject: [PATCH 4/4] [ci skip] js-precompiled 20170302-204757 --- Cargo.lock | 2 +- js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e38d8aeb4..3d1805576 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1706,7 +1706,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/ethcore/js-precompiled.git#c02649776ec9636511d90f869a19e746a3eb8654" +source = "git+https://github.com/ethcore/js-precompiled.git#f657cb9c7b048caeb559d2b6f13711ea0812bb19" dependencies = [ "parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/js/package.json b/js/package.json index a3d32cd42..29ccc289d 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "0.3.110", + "version": "0.3.111", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ",