openethereum/updater/src/lib.rs

56 lines
1.5 KiB
Rust
Raw Normal View History

// Copyright 2015-2017 Parity Technologies (UK) Ltd.
2016-12-11 19:15:58 +01:00
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Updater for Parity executables
extern crate ethabi;
extern crate ethcore;
extern crate ethcore_bytes as bytes;
2018-04-10 12:13:49 +02:00
extern crate ethcore_sync as sync;
extern crate ethereum_types;
Auto-updater improvements (#8078) * updater: refactor updater flow into state machine * updater: delay update randomly within max range * updater: configurable update delay * updater: split polling and updater state machine step * updater: drop state to avoid deadlocking * updater: fix fetch backoff * updater: fix overflow in update delay calculation * updater: configurable update check frequency * updater: fix update policy frequency comparison * updater: use lazy_static for platform and platform_id_hash * updater: refactor operations contract calls into OperationsClient * updater: make updater generic over operations and fetch client * updater: fix compilation * updater: add testing infrastructure and minimal test * updater: fix minor grumbles * updater: add test for successful updater flow * updater: add test for update delay * updater: add test for update check frequency * updater: mock time and rng for deterministic tests * updater: test backoff on failure * updater: add test for backoff short-circuit on new release * updater: refactor to increase readability * updater: cap maximum backoff to one month * updater: add test for detecting already downloaded update * updater: add test for updater disable on fatal errors * updater: add test for pending outdated fetch * updater: test auto install of updates * updater: add test for capability updates * updater: fix capability update * updater: use ethabi to create event topic filter * updater: decrease maximum backoff to 1 day * updater: cap maximum update delay with upcoming fork block number * updater: receive state mutex guard in updater_step * updater: overload execute_upgrade to take state mutex guard * updater: remove unnecessary clone of latest operations info * updater: remove latest operations info clone when triggering fetch
2018-04-03 16:49:23 +02:00
extern crate keccak_hash as hash;
extern crate parity_hash_fetch as hash_fetch;
extern crate parity_version as version;
extern crate parking_lot;
extern crate path;
Auto-updater improvements (#8078) * updater: refactor updater flow into state machine * updater: delay update randomly within max range * updater: configurable update delay * updater: split polling and updater state machine step * updater: drop state to avoid deadlocking * updater: fix fetch backoff * updater: fix overflow in update delay calculation * updater: configurable update check frequency * updater: fix update policy frequency comparison * updater: use lazy_static for platform and platform_id_hash * updater: refactor operations contract calls into OperationsClient * updater: make updater generic over operations and fetch client * updater: fix compilation * updater: add testing infrastructure and minimal test * updater: fix minor grumbles * updater: add test for successful updater flow * updater: add test for update delay * updater: add test for update check frequency * updater: mock time and rng for deterministic tests * updater: test backoff on failure * updater: add test for backoff short-circuit on new release * updater: refactor to increase readability * updater: cap maximum backoff to one month * updater: add test for detecting already downloaded update * updater: add test for updater disable on fatal errors * updater: add test for pending outdated fetch * updater: test auto install of updates * updater: add test for capability updates * updater: fix capability update * updater: use ethabi to create event topic filter * updater: decrease maximum backoff to 1 day * updater: cap maximum update delay with upcoming fork block number * updater: receive state mutex guard in updater_step * updater: overload execute_upgrade to take state mutex guard * updater: remove unnecessary clone of latest operations info * updater: remove latest operations info clone when triggering fetch
2018-04-03 16:49:23 +02:00
extern crate rand;
2017-10-16 17:28:59 +02:00
extern crate semver;
extern crate target_info;
#[macro_use]
extern crate ethabi_contract;
#[macro_use]
extern crate ethabi_derive;
#[macro_use]
Auto-updater improvements (#8078) * updater: refactor updater flow into state machine * updater: delay update randomly within max range * updater: configurable update delay * updater: split polling and updater state machine step * updater: drop state to avoid deadlocking * updater: fix fetch backoff * updater: fix overflow in update delay calculation * updater: configurable update check frequency * updater: fix update policy frequency comparison * updater: use lazy_static for platform and platform_id_hash * updater: refactor operations contract calls into OperationsClient * updater: make updater generic over operations and fetch client * updater: fix compilation * updater: add testing infrastructure and minimal test * updater: fix minor grumbles * updater: add test for successful updater flow * updater: add test for update delay * updater: add test for update check frequency * updater: mock time and rng for deterministic tests * updater: test backoff on failure * updater: add test for backoff short-circuit on new release * updater: refactor to increase readability * updater: cap maximum backoff to one month * updater: add test for detecting already downloaded update * updater: add test for updater disable on fatal errors * updater: add test for pending outdated fetch * updater: test auto install of updates * updater: add test for capability updates * updater: fix capability update * updater: use ethabi to create event topic filter * updater: decrease maximum backoff to 1 day * updater: cap maximum update delay with upcoming fork block number * updater: receive state mutex guard in updater_step * updater: overload execute_upgrade to take state mutex guard * updater: remove unnecessary clone of latest operations info * updater: remove latest operations info clone when triggering fetch
2018-04-03 16:49:23 +02:00
extern crate lazy_static;
#[macro_use]
extern crate log;
2016-12-11 19:15:58 +01:00
Auto-updater improvements (#8078) * updater: refactor updater flow into state machine * updater: delay update randomly within max range * updater: configurable update delay * updater: split polling and updater state machine step * updater: drop state to avoid deadlocking * updater: fix fetch backoff * updater: fix overflow in update delay calculation * updater: configurable update check frequency * updater: fix update policy frequency comparison * updater: use lazy_static for platform and platform_id_hash * updater: refactor operations contract calls into OperationsClient * updater: make updater generic over operations and fetch client * updater: fix compilation * updater: add testing infrastructure and minimal test * updater: fix minor grumbles * updater: add test for successful updater flow * updater: add test for update delay * updater: add test for update check frequency * updater: mock time and rng for deterministic tests * updater: test backoff on failure * updater: add test for backoff short-circuit on new release * updater: refactor to increase readability * updater: cap maximum backoff to one month * updater: add test for detecting already downloaded update * updater: add test for updater disable on fatal errors * updater: add test for pending outdated fetch * updater: test auto install of updates * updater: add test for capability updates * updater: fix capability update * updater: use ethabi to create event topic filter * updater: decrease maximum backoff to 1 day * updater: cap maximum update delay with upcoming fork block number * updater: receive state mutex guard in updater_step * updater: overload execute_upgrade to take state mutex guard * updater: remove unnecessary clone of latest operations info * updater: remove latest operations info clone when triggering fetch
2018-04-03 16:49:23 +02:00
#[cfg(test)]
extern crate tempdir;
#[cfg(test)]
#[macro_use]
extern crate matches;
2016-12-11 19:15:58 +01:00
mod updater;
2016-12-11 22:47:43 +01:00
mod types;
2017-10-16 17:28:59 +02:00
mod service;
2016-12-11 22:47:43 +01:00
pub use service::Service;
2017-10-16 17:28:59 +02:00
pub use types::{ReleaseInfo, OperationsInfo, CapState, VersionInfo, ReleaseTrack};
pub use updater::{Updater, UpdateFilter, UpdatePolicy};