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

Commit

Permalink
Beta patch release 2.2.3 (#10002)
Browse files Browse the repository at this point in the history
* version: bump beta to 2.2.3

* Fix Bloom migration (#9992)

* Fix wrong block number in blooms migration

* Fix wrong `const` type (usize -> u64) 😬

* Fix daemonize (#10000)

* Revert "prevent silent errors in daemon mode, closes #9367 (#9946)"

This reverts commit 52d5278.

* deps(daemonize): switch back to crates.io

* move daemonize before creating account provider (#10003)

* move daemonize before creating account provider

* daemonize: add a future-proofing comment
  • Loading branch information
5chdn committed Nov 30, 2018
1 parent 78ceec6 commit 6b0a280
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
22 changes: 11 additions & 11 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
Expand Up @@ -2,7 +2,7 @@
description = "Parity Ethereum client"
name = "parity-ethereum"
# NOTE Make sure to update util/version/Cargo.toml as well
version = "2.2.2"
version = "2.2.3"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]

Expand Down Expand Up @@ -83,7 +83,7 @@ fake-fetch = { path = "util/fake-fetch" }
winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }

[target.'cfg(not(windows))'.dependencies]
daemonize = { git = "https://github.com/paritytech/daemonize" }
daemonize = "0.3"

[features]
miner-debug = ["ethcore/miner-debug"]
Expand Down
8 changes: 6 additions & 2 deletions parity/db/rocksdb/blooms.rs
Expand Up @@ -23,6 +23,8 @@ use rlp;
use super::kvdb_rocksdb::DatabaseConfig;
use super::open_database;

const LOG_BLOOMS_ELEMENTS_PER_INDEX: u64 = 16;

pub fn migrate_blooms<P: AsRef<Path>>(path: P, config: &DatabaseConfig) -> Result<(), Error> {
// init
let db = open_database(&path.as_ref().to_string_lossy(), config)?;
Expand All @@ -41,11 +43,12 @@ pub fn migrate_blooms<P: AsRef<Path>>(path: P, config: &DatabaseConfig) -> Resul
key[0] == 3u8 && key[1] == 0u8
})
.map(|(key, group)| {
let number =
let index =
(key[2] as u64) << 24 |
(key[3] as u64) << 16 |
(key[4] as u64) << 8 |
(key[5] as u64);
let number = index * LOG_BLOOMS_ELEMENTS_PER_INDEX;

let blooms = rlp::decode_list::<Bloom>(&group);
(number, blooms)
Expand All @@ -66,11 +69,12 @@ pub fn migrate_blooms<P: AsRef<Path>>(path: P, config: &DatabaseConfig) -> Resul
key[0] == 1u8 && key[1] == 0u8
})
.map(|(key, group)| {
let number =
let index =
(key[2] as u64) |
(key[3] as u64) << 8 |
(key[4] as u64) << 16 |
(key[5] as u64) << 24;
let number = index * LOG_BLOOMS_ELEMENTS_PER_INDEX;

let blooms = rlp::decode_list::<Bloom>(&group);
(number, blooms)
Expand Down
14 changes: 8 additions & 6 deletions parity/run.rs
Expand Up @@ -463,6 +463,14 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:

let passwords = passwords_from_files(&cmd.acc_conf.password_files)?;

// Run in daemon mode.
// Note, that it should be called before we leave any file descriptor open,
// since `daemonize` will close them.
if let Some(pid_file) = cmd.daemon {
info!("Running as a daemon process!");
daemonize(pid_file)?;
}

// prepare account provider
let account_provider = Arc::new(prepare_account_provider(&cmd.spec, &cmd.dirs, &spec.data_dir, cmd.acc_conf, &passwords)?);

Expand Down Expand Up @@ -807,12 +815,6 @@ fn execute_impl<Cr, Rr>(cmd: RunCmd, logger: Arc<RotatingLogger>, on_client_rq:
client.set_exit_handler(on_client_rq);
updater.set_exit_handler(on_updater_rq);

// run in daemon mode
if let Some(pid_file) = cmd.daemon {
info!("Running as a daemon process!");
daemonize(pid_file)?;
}

Ok(RunningClient {
inner: RunningClientInner::Full {
rpc: rpc_direct,
Expand Down
2 changes: 1 addition & 1 deletion util/version/Cargo.toml
Expand Up @@ -3,7 +3,7 @@
[package]
name = "parity-version"
# NOTE: this value is used for Parity Ethereum version string (via env CARGO_PKG_VERSION)
version = "2.2.2"
version = "2.2.3"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"

Expand Down

0 comments on commit 6b0a280

Please sign in to comment.