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

Commit

Permalink
Merge branch 'master' into dp/fix/prevent-building-block-on-top-of-sa…
Browse files Browse the repository at this point in the history
…me-parent

* master: (24 commits)
  cargo update -p smallvec (#10822)
  replace memzero with zeroize crate (#10816)
  Don't repeat the logic from Default impl (#10813)
  removed additional_params method (#10818)
  Add Constantinople eips to the dev (instant_seal) config (#10809)
  removed redundant fmt::Display implementations (#10806)
  revert changes to .gitlab-ci.yml (#10807)
  Add filtering capability to `parity_pendingTransactions` (issue 8269) (#10506)
  removed EthEngine alias (#10805)
  wait a bit longer in should_check_status_of_request_when_its_resolved (#10808)
  Do not drop the peer with None difficulty (#10772)
  ethcore-bloom-journal updated to 2018 (#10804)
  ethcore-light uses bincode 1.1 (#10798)
  Fix a few typos and unused warnings. (#10803)
  updated project to ansi_term 0.11 (#10799)
  added new ropsten-bootnode and removed old one (#10794)
  updated price-info to edition 2018 (#10801)
  ethcore-network-devp2p uses igd 0.9 (#10797)
  updated parity-local-store to edition 2018 and removed redundant Error type (#10800)
  Cleanup unused vm dependencies (#10787)
  ...
  • Loading branch information
dvdplm committed Jul 1, 2019
2 parents 6e72b51 + f6a3908 commit aa99629
Show file tree
Hide file tree
Showing 103 changed files with 1,543 additions and 964 deletions.
334 changes: 130 additions & 204 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ num_cpus = "1.2"
number_prefix = "0.2"
rpassword = "1.0"
semver = "0.9"
ansi_term = "0.10"
ansi_term = "0.11"
parking_lot = "0.7"
regex = "1.0"
atty = "0.2.8"
Expand Down
3 changes: 1 addition & 2 deletions accounts/ethkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ version = "0.3.0"
authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
byteorder = "1.0"
edit-distance = "2.0"
parity-crypto = "0.4.0"
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
ethereum-types = "0.6.0"
lazy_static = "1.0"
log = "0.4"
parity-util-mem = "0.1"
parity-wordlist = "1.2"
quick-error = "1.2.2"
rand = "0.6"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
tiny-keccak = "1.4"
zeroize = "0.9.1"
5 changes: 2 additions & 3 deletions accounts/ethkey/src/extended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ impl Label for u32 {
fn len() -> usize { 4 }

fn store(&self, target: &mut [u8]) {
use byteorder::{BigEndian, ByteOrder};

BigEndian::write_u32(&mut target[0..4], *self);
let bytes = self.to_be_bytes();
target[0..4].copy_from_slice(&bytes);
}
}

Expand Down
3 changes: 1 addition & 2 deletions accounts/ethkey/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

// #![warn(missing_docs)]

extern crate byteorder;
extern crate edit_distance;
extern crate parity_crypto;
extern crate ethereum_types;
extern crate parity_util_mem;
extern crate parity_wordlist;
#[macro_use]
extern crate quick_error;
Expand All @@ -29,6 +27,7 @@ extern crate rustc_hex;
extern crate secp256k1;
extern crate serde;
extern crate tiny_keccak;
extern crate zeroize;

#[macro_use]
extern crate lazy_static;
Expand Down
18 changes: 12 additions & 6 deletions accounts/ethkey/src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,23 @@ use rustc_hex::ToHex;
use secp256k1::constants::{SECRET_KEY_SIZE as SECP256K1_SECRET_KEY_SIZE};
use secp256k1::key;
use ethereum_types::H256;
use parity_util_mem::Memzero;
use zeroize::Zeroize;
use {Error, SECP256K1};

#[derive(Clone, PartialEq, Eq)]
pub struct Secret {
inner: Memzero<H256>,
inner: H256,
}

impl Drop for Secret {
fn drop(&mut self) {
self.inner.0.zeroize()
}
}

impl ToHex for Secret {
fn to_hex(&self) -> String {
format!("{:x}", *self.inner)
format!("{:x}", self.inner)
}
}

Expand Down Expand Up @@ -61,12 +67,12 @@ impl Secret {
}
let mut h = H256::zero();
h.as_bytes_mut().copy_from_slice(&key[0..32]);
Some(Secret { inner: Memzero::from(h) })
Some(Secret { inner: h })
}

/// Creates zero key, which is invalid for crypto operations, but valid for math operation.
pub fn zero() -> Self {
Secret { inner: Memzero::from(H256::zero()) }
Secret { inner: H256::zero() }
}

/// Imports and validates the key.
Expand Down Expand Up @@ -214,7 +220,7 @@ impl FromStr for Secret {

impl From<[u8; 32]> for Secret {
fn from(k: [u8; 32]) -> Self {
Secret { inner: Memzero::from(H256(k)) }
Secret { inner: H256(k) }
}
}

Expand Down
3 changes: 2 additions & 1 deletion ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version = "1.12.0"
authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
ansi_term = "0.10"
ansi_term = "0.11"
blooms-db = { path = "../util/blooms-db", optional = true }
bn = { git = "https://github.com/paritytech/bn", default-features = false }
byteorder = "1.0"
Expand Down Expand Up @@ -82,6 +82,7 @@ fetch = { path = "../util/fetch" }
kvdb-rocksdb = "0.1.3"
parity-runtime = { path = "../util/runtime" }
rlp_compress = { path = "../util/rlp-compress" }
serde_json = "1.0"
tempdir = "0.3"
trie-standardmap = "0.12.4"

Expand Down
4 changes: 2 additions & 2 deletions ethcore/benches/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ extern crate rustc_hex;
use criterion::{Criterion, Bencher};
use bytes::BytesRef;
use ethcore::builtin::Builtin;
use ethcore::machine::EthereumMachine;
use ethcore::machine::Machine;
use ethereum_types::H160;
use ethcore::ethereum::new_byzantium_test_machine;
use rustc_hex::FromHex;

lazy_static! {
static ref BYZANTIUM_MACHINE: EthereumMachine = new_byzantium_test_machine();
static ref BYZANTIUM_MACHINE: Machine = new_byzantium_test_machine();
}

struct BuiltinBenchmark<'a> {
Expand Down
2 changes: 1 addition & 1 deletion ethcore/blockchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

[dependencies]
ansi_term = "0.10"
ansi_term = "0.11"
blooms-db = { path = "../../util/blooms-db" }
common-types = { path = "../types" }
ethcore-db = { path = "../db" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/light/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ smallvec = "0.6"
futures = "0.1"
rand = "0.6"
itertools = "0.5"
bincode = "0.8.0"
bincode = "1.1"
serde = "1.0"
serde_derive = "1.0"
parking_lot = "0.7"
Expand Down
11 changes: 5 additions & 6 deletions ethcore/light/src/client/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ use std::sync::Arc;
use common_types::encoded;
use common_types::header::Header;
use common_types::receipt::Receipt;
use ethcore::engines::{EthEngine, StateDependentProof};
use ethcore::machine::EthereumMachine;
use ethcore::engines::{Engine, StateDependentProof};
use ethereum_types::H256;
use futures::future::IntoFuture;

Expand All @@ -48,8 +47,8 @@ pub trait ChainDataFetcher: Send + Sync + 'static {
fn epoch_transition(
&self,
_hash: H256,
_engine: Arc<EthEngine>,
_checker: Arc<StateDependentProof<EthereumMachine>>
_engine: Arc<Engine>,
_checker: Arc<StateDependentProof>
) -> Self::Transition;
}

Expand Down Expand Up @@ -77,8 +76,8 @@ impl ChainDataFetcher for Unavailable {
fn epoch_transition(
&self,
_hash: H256,
_engine: Arc<EthEngine>,
_checker: Arc<StateDependentProof<EthereumMachine>>
_engine: Arc<Engine>,
_checker: Arc<StateDependentProof>
) -> Self::Transition {
Err("fetching epoch transition proofs unavailable")
}
Expand Down
15 changes: 7 additions & 8 deletions ethcore/light/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
use std::sync::{Weak, Arc};

use ethcore::client::{ClientReport, EnvInfo, ClientIoMessage};
use ethcore::engines::{epoch, EthEngine, EpochChange, EpochTransition, Proof};
use ethcore::machine::EthereumMachine;
use ethcore::engines::{epoch, Engine, EpochChange, EpochTransition, Proof};
use ethcore::error::{Error, EthcoreResult};
use ethcore::verification::queue::{self, HeaderQueue};
use ethcore::spec::{Spec, SpecHardcodedSync};
Expand Down Expand Up @@ -115,7 +114,7 @@ pub trait LightChainClient: Send + Sync {
fn env_info(&self, id: BlockId) -> Option<EnvInfo>;

/// Get a handle to the consensus engine.
fn engine(&self) -> &Arc<EthEngine>;
fn engine(&self) -> &Arc<Engine>;

/// Query whether a block is known.
fn is_known(&self, hash: &H256) -> bool;
Expand Down Expand Up @@ -160,7 +159,7 @@ impl<T: LightChainClient> AsLightClient for T {
/// Light client implementation.
pub struct Client<T> {
queue: HeaderQueue,
engine: Arc<EthEngine>,
engine: Arc<Engine>,
chain: HeaderChain,
report: RwLock<ClientReport>,
import_lock: Mutex<()>,
Expand Down Expand Up @@ -376,7 +375,7 @@ impl<T: ChainDataFetcher> Client<T> {
}

/// Get a handle to the verification engine.
pub fn engine(&self) -> &Arc<EthEngine> {
pub fn engine(&self) -> &Arc<Engine> {
&self.engine
}

Expand Down Expand Up @@ -468,7 +467,7 @@ impl<T: ChainDataFetcher> Client<T> {
true
}

fn check_epoch_signal(&self, verified_header: &Header) -> Result<Option<Proof<EthereumMachine>>, T::Error> {
fn check_epoch_signal(&self, verified_header: &Header) -> Result<Option<Proof>, T::Error> {
use ethcore::machine::{AuxiliaryRequest, AuxiliaryData};

let mut block: Option<Vec<u8>> = None;
Expand Down Expand Up @@ -514,7 +513,7 @@ impl<T: ChainDataFetcher> Client<T> {
}

// attempts to fetch the epoch proof from the network until successful.
fn write_pending_proof(&self, header: &Header, proof: Proof<EthereumMachine>) -> Result<(), T::Error> {
fn write_pending_proof(&self, header: &Header, proof: Proof) -> Result<(), T::Error> {
let proof = match proof {
Proof::Known(known) => known,
Proof::WithState(state_dependent) => {
Expand Down Expand Up @@ -579,7 +578,7 @@ impl<T: ChainDataFetcher> LightChainClient for Client<T> {
Client::env_info(self, id)
}

fn engine(&self) -> &Arc<EthEngine> {
fn engine(&self) -> &Arc<Engine> {
Client::engine(self)
}

Expand Down
8 changes: 4 additions & 4 deletions ethcore/light/src/net/load_timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ pub struct FileStore(pub PathBuf);
impl SampleStore for FileStore {
fn load(&self) -> HashMap<Kind, VecDeque<u64>> {
File::open(&self.0)
.map_err(|e| Box::new(bincode::ErrorKind::IoError(e)))
.and_then(|mut file| bincode::deserialize_from(&mut file, bincode::Infinite))
.map_err(|e| Box::new(bincode::ErrorKind::Io(e)))
.and_then(|mut file| bincode::deserialize_from(&mut file))
.unwrap_or_else(|_| HashMap::new())
}

fn store(&self, samples: &HashMap<Kind, VecDeque<u64>>) {
let res = File::create(&self.0)
.map_err(|e| Box::new(bincode::ErrorKind::IoError(e)))
.and_then(|mut file| bincode::serialize_into(&mut file, samples, bincode::Infinite));
.map_err(|e| Box::new(bincode::ErrorKind::Io(e)))
.and_then(|mut file| bincode::serialize_into(&mut file, samples));

if let Err(e) = res {
warn!(target: "pip", "Error writing light request timing samples to file: {}", e);
Expand Down
9 changes: 4 additions & 5 deletions ethcore/light/src/on_demand/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use common_types::basic_account::BasicAccount;
use common_types::encoded;
use common_types::receipt::Receipt;
use common_types::transaction::SignedTransaction;
use ethcore::engines::{EthEngine, StateDependentProof};
use ethcore::machine::EthereumMachine;
use ethcore::engines::{Engine, StateDependentProof};
use ethcore::state::{self, ProvedExecution};
use ethereum_types::{H256, U256, Address};
use ethtrie::{TrieError, TrieDB};
Expand Down Expand Up @@ -1038,7 +1037,7 @@ pub struct TransactionProof {
// TODO: it's not really possible to provide this if the header is unknown.
pub env_info: EnvInfo,
/// Consensus engine.
pub engine: Arc<EthEngine>,
pub engine: Arc<Engine>,
}

impl TransactionProof {
Expand Down Expand Up @@ -1081,9 +1080,9 @@ pub struct Signal {
/// Block hash and number to fetch proof for.
pub hash: H256,
/// Consensus engine, used to check the proof.
pub engine: Arc<EthEngine>,
pub engine: Arc<Engine>,
/// Special checker for the proof.
pub proof_check: Arc<StateDependentProof<EthereumMachine>>,
pub proof_check: Arc<StateDependentProof>,
}

impl Signal {
Expand Down
2 changes: 1 addition & 1 deletion ethcore/res/ethereum/ropsten.json
Original file line number Diff line number Diff line change
Expand Up @@ -2654,7 +2654,7 @@
]
},
"nodes": [
"enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303",
"enode://d6cb8cba18828397e22e8852324af7e970b57cadbbd94aba6124790d1895728311b1f274e45d44a7a22b4276726903130a11ac2de19af5bc9294998f948eaad4@144.217.72.209:30303",
"enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303",
"enode://30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606@52.176.7.10:30303",
"enode://865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c@52.176.100.77:30303",
Expand Down
3 changes: 3 additions & 0 deletions ethcore/res/instant_seal.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"eip211Transition": "0x0",
"eip214Transition": "0x0",
"eip658Transition": "0x0",
"eip145Transition": "0x0",
"eip1014Transition": "0x0",
"eip1052Transition": "0x0",
"wasmActivationTransition": "0x0"
},
"genesis": {
Expand Down
3 changes: 1 addition & 2 deletions ethcore/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
ansi_term = "0.10"
derive_more = "0.14.0"
ansi_term = "0.11"
ethcore = { path = ".." }
ethcore-blockchain = { path = "../blockchain" }
ethcore-io = { path = "../../util/io" }
Expand Down
39 changes: 0 additions & 39 deletions ethcore/service/src/error.rs

This file was deleted.

3 changes: 0 additions & 3 deletions ethcore/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ extern crate ethcore_sync as sync;
extern crate ethereum_types;
extern crate kvdb;

extern crate derive_more;
#[macro_use]
extern crate log;
#[macro_use]
Expand All @@ -34,11 +33,9 @@ extern crate ethcore_db;
#[cfg(test)]
extern crate tempdir;

mod error;
mod service;

#[cfg(test)]
extern crate kvdb_rocksdb;

pub use error::Error;
pub use service::{ClientService, PrivateTxService};
Loading

0 comments on commit aa99629

Please sign in to comment.