[Beta] Backports (#8136)

* Support parity protocol. (#8035)

* updater: apply exponential backoff after download failure (#8059)

* updater: apply exponential backoff after download failure

* updater: reset backoff on new release

* Max code size on Kovan (#8067)

* Enable code size limit on kovan

* Fix formatting.

* Limit incoming connections.  (#8060)

* Limit ingress connections
* Optimized handshakes logging

* WASM libraries bump (#7970)

* update wasmi, parity-wasm, wasm-utils to latest version

* Update to new wasmi & error handling

* also utilize new stack limiter

* fix typo

* replace dependency url

* Cargo.lock update

* add some dos protection (#8084)

* revert removing blooms (#8066)

* Revert "fix traces, removed bloomchain crate, closes #7228, closes #7167"

This reverts commit 1bf62038678295e5586f02a38a0c5aab9a9efe62.

* Revert "fixed broken logs (#7934)"

This reverts commit f8a2e53f3e.

* fixed broken logs

* bring back old lock order

* remove migration v13

* revert CURRENT_VERSION to 12 in migration.rs

* more dos protection (#8104)

* Const time comparison (#8113)

* Use `subtle::slices_equal` for constant time comparison.

Also update the existing version of subtle in `ethcrypto` from
0.1 to 0.5

* Test specifically for InvalidPassword error.

* fix trace filter returning returning unrelated reward calls, closes #8070 (#8098)

* network: init discovery using healthy nodes (#8061)

* network: init discovery using healthy nodes

* network: fix style grumble

* network: fix typo

* Postpone Kovan hard fork (#8137)

* ethcore: postpone Kovan hard fork

* util: update version fork metadata

* Disable UI by default. (#8105)

* dapps: update parity-ui dependencies (#8160)
This commit is contained in:
André Silva
2018-03-19 20:40:56 +00:00
committed by Tomasz Drwięga
parent 2403fc52c1
commit 610f6f1425
82 changed files with 2698 additions and 364 deletions

View File

@@ -478,7 +478,7 @@ usage! {
"--ws-apis=[APIS]",
"Specify the APIs available through the WebSockets interface. APIS is a comma-delimited list of API name. Possible name are web3, eth, pubsub, net, personal, parity, parity_set, traces, rpc, parity_accounts, pubsub, parity_pubsub, shh, shh_pubsub, signer, secretstore.",
ARG arg_ws_origins: (String) = "chrome-extension://*,moz-extension://*", or |c: &Config| c.websockets.as_ref()?.origins.as_ref().map(|vec| vec.join(",")),
ARG arg_ws_origins: (String) = "parity://*,chrome-extension://*,moz-extension://*", or |c: &Config| c.websockets.as_ref()?.origins.as_ref().map(|vec| vec.join(",")),
"--ws-origins=[URL]",
"Specify Origin header values allowed to connect. Special options: \"all\", \"none\".",

View File

@@ -1113,7 +1113,7 @@ impl Configuration {
self.args.flag_geth ||
self.args.flag_no_ui;
!ui_disabled && cfg!(feature = "ui-enabled")
self.args.cmd_ui && !ui_disabled && cfg!(feature = "ui-enabled")
}
fn verifier_settings(&self) -> VerifierSettings {
@@ -1335,14 +1335,14 @@ mod tests {
interface: "127.0.0.1".into(),
port: 8546,
apis: ApiSet::UnsafeContext,
origins: Some(vec!["chrome-extension://*".into(), "moz-extension://*".into()]),
origins: Some(vec!["parity://*".into(),"chrome-extension://*".into(), "moz-extension://*".into()]),
hosts: Some(vec![]),
signer_path: expected.into(),
ui_address: Some("127.0.0.1:8180".into()),
ui_address: None,
dapps_address: Some("127.0.0.1:8545".into()),
support_token_api: true
}, UiConfiguration {
enabled: true,
enabled: false,
interface: "127.0.0.1".into(),
port: 8180,
hosts: Some(vec![]),
@@ -1596,19 +1596,38 @@ mod tests {
let conf1 = parse(&["parity", "--ui-path=signer", "--ui-no-validation"]);
let conf2 = parse(&["parity", "--ui-path=signer", "--ui-port", "3123"]);
let conf3 = parse(&["parity", "--ui-path=signer", "--ui-interface", "test"]);
let conf4 = parse(&["parity", "--ui-path=signer", "--force-ui"]);
let conf5 = parse(&["parity", "--ui-path=signer", "ui"]);
// then
assert_eq!(conf0.directories().signer, "signer".to_owned());
assert_eq!(conf0.ui_config(), UiConfiguration {
enabled: false,
interface: "127.0.0.1".into(),
port: 8180,
hosts: Some(vec![]),
});
assert!(conf4.ws_config().unwrap().hosts.is_some());
assert_eq!(conf4.directories().signer, "signer".to_owned());
assert_eq!(conf4.ui_config(), UiConfiguration {
enabled: true,
interface: "127.0.0.1".into(),
port: 8180,
hosts: Some(vec![]),
});
assert!(conf0.ws_config().unwrap().hosts.is_some());
assert!(conf5.ws_config().unwrap().hosts.is_some());
assert!(conf5.ws_config().unwrap().hosts.is_some());
assert_eq!(conf5.directories().signer, "signer".to_owned());
assert_eq!(conf5.ui_config(), UiConfiguration {
enabled: true,
interface: "127.0.0.1".into(),
port: 8180,
hosts: Some(vec![]),
});
assert!(conf5.ws_config().unwrap().hosts.is_some());
assert_eq!(conf1.directories().signer, "signer".to_owned());
assert_eq!(conf1.ui_config(), UiConfiguration {
enabled: true,
enabled: false,
interface: "127.0.0.1".into(),
port: 8180,
hosts: Some(vec![]),
@@ -1617,7 +1636,7 @@ mod tests {
assert_eq!(conf1.ws_config().unwrap().origins, None);
assert_eq!(conf2.directories().signer, "signer".to_owned());
assert_eq!(conf2.ui_config(), UiConfiguration {
enabled: true,
enabled: false,
interface: "127.0.0.1".into(),
port: 3123,
hosts: Some(vec![]),
@@ -1625,7 +1644,7 @@ mod tests {
assert!(conf2.ws_config().unwrap().hosts.is_some());
assert_eq!(conf3.directories().signer, "signer".to_owned());
assert_eq!(conf3.ui_config(), UiConfiguration {
enabled: true,
enabled: false,
interface: "test".into(),
port: 8180,
hosts: Some(vec![]),

View File

@@ -25,7 +25,7 @@ use migrations;
/// Database is assumed to be at default version, when no version file is found.
const DEFAULT_VERSION: u32 = 5;
/// Current version of database models.
const CURRENT_VERSION: u32 = 13;
const CURRENT_VERSION: u32 = 12;
/// First version of the consolidated database.
const CONSOLIDATION_VERSION: u32 = 9;
/// Defines how many items are migrated to the new version of database at once.
@@ -136,7 +136,6 @@ fn consolidated_database_migrations(compaction_profile: &CompactionProfile) -> R
let mut manager = MigrationManager::new(default_migration_settings(compaction_profile));
manager.add_migration(migrations::TO_V11).map_err(|_| Error::MigrationImpossible)?;
manager.add_migration(migrations::TO_V12).map_err(|_| Error::MigrationImpossible)?;
manager.add_migration(migrations::ToV13::default()).map_err(|_| Error::MigrationImpossible)?;
Ok(manager)
}

View File

@@ -110,7 +110,7 @@ impl From<UiConfiguration> for HttpConfiguration {
impl Default for UiConfiguration {
fn default() -> Self {
UiConfiguration {
enabled: true && cfg!(feature = "ui-enabled"),
enabled: false,
port: 8180,
interface: "127.0.0.1".into(),
hosts: Some(vec![]),
@@ -162,11 +162,11 @@ impl Default for WsConfiguration {
interface: "127.0.0.1".into(),
port: 8546,
apis: ApiSet::UnsafeContext,
origins: Some(vec!["chrome-extension://*".into(), "moz-extension://*".into()]),
origins: Some(vec!["parity://*".into(),"chrome-extension://*".into(), "moz-extension://*".into()]),
hosts: Some(Vec::new()),
signer_path: replace_home(&data_dir, "$BASE/signer").into(),
support_token_api: true,
ui_address: Some("127.0.0.1:8180".into()),
ui_address: None,
dapps_address: Some("127.0.0.1:8545".into()),
}
}

View File

@@ -873,6 +873,11 @@ pub fn execute_impl(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>)
}
pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> Result<(bool, Option<String>), String> {
if cmd.ui_conf.enabled {
warn!("Parity browser interface is deprecated. It's going to be removed in the next version, use standalone Parity Wallet instead.");
warn!("Standalone Parity Wallet: https://github.com/Parity-JS/shell/releases");
}
if cmd.ui && cmd.dapps_conf.enabled {
// Check if Parity is already running
let addr = format!("{}:{}", cmd.ui_conf.interface, cmd.ui_conf.port);