* Parity Ethereum (EthCore) Client Application
@@ -330,7 +353,7 @@ Example (generic documentation comment):
///
```
-## 5. Toolchain
+## 6. Toolchain
In addition to the Parity Ethereum client, there are additional tools in this repository available:
@@ -342,7 +365,7 @@ In addition to the Parity Ethereum client, there are additional tools in this re
The following tool is available in a separate repository:
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi)
-## 6. Community
+## 7. Community
### Join the chat!
@@ -355,7 +378,7 @@ Questions? Get in touch with us on Gitter:
Alternatively, join our community on Matrix:
[![Riot: +Parity](https://img.shields.io/badge/riot-%2Bparity%3Amatrix.parity.io-orange.svg)](https://riot.im/app/#/group/+parity:matrix.parity.io)
-## 7. Contributing
+## 8. Contributing
An introduction has been provided in the ["So You Want to be a Core Developer" presentation slides by Hernando Castano](http://tiny.cc/contrib-to-parity-eth). Additional guidelines are provided in [CONTRIBUTING](./.github/CONTRIBUTING.md).
@@ -363,6 +386,6 @@ An introduction has been provided in the ["So You Want to be a Core Developer" p
[CODE_OF_CONDUCT](./.github/CODE_OF_CONDUCT.md)
-## 8. License
+## 9. License
[LICENSE](./LICENSE)
diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml
index a66a74de05a..3806b0c3baa 100644
--- a/accounts/ethkey/Cargo.toml
+++ b/accounts/ethkey/Cargo.toml
@@ -11,11 +11,11 @@ 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"
+parity-wordlist = "1.3"
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"
diff --git a/accounts/ethkey/src/lib.rs b/accounts/ethkey/src/lib.rs
index 2312f2bcd31..4f55f056d07 100644
--- a/accounts/ethkey/src/lib.rs
+++ b/accounts/ethkey/src/lib.rs
@@ -19,7 +19,6 @@
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;
@@ -28,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;
diff --git a/accounts/ethkey/src/secret.rs b/accounts/ethkey/src/secret.rs
index 25136ee8330..c850fa70ee8 100644
--- a/accounts/ethkey/src/secret.rs
+++ b/accounts/ethkey/src/secret.rs
@@ -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,
+ 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)
}
}
@@ -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.
@@ -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) }
}
}
diff --git a/accounts/ethstore/src/json/crypto.rs b/accounts/ethstore/src/json/crypto.rs
index 34664f98b0e..a7315d7e5c9 100644
--- a/accounts/ethstore/src/json/crypto.rs
+++ b/accounts/ethstore/src/json/crypto.rs
@@ -41,7 +41,7 @@ impl str::FromStr for Crypto {
impl From for String {
fn from(c: Crypto) -> Self {
- serde_json::to_string(&c).expect("serialization cannot fail, cause all crypto keys are strings")
+ serde_json::to_string(&c).expect("Serialization cannot fail, because all crypto keys are strings")
}
}
diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml
index b35bad357ff..9c315fffbbc 100644
--- a/ethcore/Cargo.toml
+++ b/ethcore/Cargo.toml
@@ -10,7 +10,6 @@ authors = ["Parity Technologies "]
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"
common-types = { path = "types" }
crossbeam = "0.4"
derive_more = "0.14.0"
@@ -82,6 +81,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"
diff --git a/ethcore/blockchain/src/best_block.rs b/ethcore/blockchain/src/best_block.rs
index 20f247391dc..cddb798358d 100644
--- a/ethcore/blockchain/src/best_block.rs
+++ b/ethcore/blockchain/src/best_block.rs
@@ -24,7 +24,8 @@ use common_types::header::Header;
/// For GHOST fork-choice rule it would typically describe the block with highest
/// combined difficulty (usually the block with the highest block number).
///
-/// Sometimes refered as 'latest block'.
+/// Sometimes referred as 'latest block'.
+#[derive(Debug)]
pub struct BestBlock {
/// Best block decoded header.
pub header: Header,
@@ -35,7 +36,7 @@ pub struct BestBlock {
}
/// Best ancient block info. If the blockchain has a gap this keeps track of where it starts.
-#[derive(Default)]
+#[derive(Debug, Default)]
pub struct BestAncientBlock {
/// Best block hash.
pub hash: H256,
diff --git a/ethcore/blockchain/src/blockchain.rs b/ethcore/blockchain/src/blockchain.rs
index dbe18f25310..f1350f957f0 100644
--- a/ethcore/blockchain/src/blockchain.rs
+++ b/ethcore/blockchain/src/blockchain.rs
@@ -652,10 +652,7 @@ impl BlockChain {
// and write them
if let (Some(hash), Some(number)) = (best_ancient, best_ancient_number) {
let mut best_ancient_block = bc.best_ancient_block.write();
- *best_ancient_block = Some(BestAncientBlock {
- hash: hash,
- number: number,
- });
+ *best_ancient_block = Some(BestAncientBlock { hash, number });
}
}
diff --git a/ethcore/db/src/keys.rs b/ethcore/db/src/keys.rs
index ceab94211ec..d7db42bf6c1 100644
--- a/ethcore/db/src/keys.rs
+++ b/ethcore/db/src/keys.rs
@@ -205,7 +205,7 @@ pub struct TransactionAddress {
}
/// Contains all block receipts.
-#[derive(Clone, RlpEncodableWrapper, RlpDecodableWrapper, MallocSizeOf)]
+#[derive(Debug, Clone, RlpEncodableWrapper, RlpDecodableWrapper, MallocSizeOf)]
pub struct BlockReceipts {
/// Block receipts
pub receipts: Vec,
@@ -214,9 +214,7 @@ pub struct BlockReceipts {
impl BlockReceipts {
/// Create new block receipts wrapper.
pub fn new(receipts: Vec) -> Self {
- BlockReceipts {
- receipts: receipts
- }
+ BlockReceipts { receipts }
}
}
diff --git a/ethcore/light/src/client/fetch.rs b/ethcore/light/src/client/fetch.rs
index dd052917fc5..373f6f0bd0b 100644
--- a/ethcore/light/src/client/fetch.rs
+++ b/ethcore/light/src/client/fetch.rs
@@ -21,7 +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::engines::{Engine, StateDependentProof};
use ethereum_types::H256;
use futures::future::IntoFuture;
@@ -47,7 +47,7 @@ pub trait ChainDataFetcher: Send + Sync + 'static {
fn epoch_transition(
&self,
_hash: H256,
- _engine: Arc,
+ _engine: Arc,
_checker: Arc
) -> Self::Transition;
}
@@ -76,7 +76,7 @@ impl ChainDataFetcher for Unavailable {
fn epoch_transition(
&self,
_hash: H256,
- _engine: Arc,
+ _engine: Arc,
_checker: Arc
) -> Self::Transition {
Err("fetching epoch transition proofs unavailable")
diff --git a/ethcore/light/src/client/mod.rs b/ethcore/light/src/client/mod.rs
index c6e0925dbac..bcabd809c5c 100644
--- a/ethcore/light/src/client/mod.rs
+++ b/ethcore/light/src/client/mod.rs
@@ -19,7 +19,7 @@
use std::sync::{Weak, Arc};
use ethcore::client::{ClientReport, EnvInfo, ClientIoMessage};
-use ethcore::engines::{epoch, EthEngine, EpochChange, EpochTransition, Proof};
+use ethcore::engines::{epoch, Engine, EpochChange, EpochTransition, Proof};
use ethcore::error::{Error, EthcoreResult};
use ethcore::verification::queue::{self, HeaderQueue};
use ethcore::spec::{Spec, SpecHardcodedSync};
@@ -114,7 +114,7 @@ pub trait LightChainClient: Send + Sync {
fn env_info(&self, id: BlockId) -> Option;
/// Get a handle to the consensus engine.
- fn engine(&self) -> &Arc;
+ fn engine(&self) -> &Arc;
/// Query whether a block is known.
fn is_known(&self, hash: &H256) -> bool;
@@ -159,7 +159,7 @@ impl AsLightClient for T {
/// Light client implementation.
pub struct Client {
queue: HeaderQueue,
- engine: Arc,
+ engine: Arc,
chain: HeaderChain,
report: RwLock,
import_lock: Mutex<()>,
@@ -375,7 +375,7 @@ impl Client {
}
/// Get a handle to the verification engine.
- pub fn engine(&self) -> &Arc {
+ pub fn engine(&self) -> &Arc {
&self.engine
}
@@ -578,7 +578,7 @@ impl LightChainClient for Client {
Client::env_info(self, id)
}
- fn engine(&self) -> &Arc {
+ fn engine(&self) -> &Arc {
Client::engine(self)
}
diff --git a/ethcore/light/src/on_demand/request.rs b/ethcore/light/src/on_demand/request.rs
index 380a7c93335..b2bf39951f3 100644
--- a/ethcore/light/src/on_demand/request.rs
+++ b/ethcore/light/src/on_demand/request.rs
@@ -24,7 +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::engines::{Engine, StateDependentProof};
use ethcore::state::{self, ProvedExecution};
use ethereum_types::{H256, U256, Address};
use ethtrie::{TrieError, TrieDB};
@@ -1037,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,
+ pub engine: Arc,
}
impl TransactionProof {
@@ -1080,7 +1080,7 @@ pub struct Signal {
/// Block hash and number to fetch proof for.
pub hash: H256,
/// Consensus engine, used to check the proof.
- pub engine: Arc,
+ pub engine: Arc,
/// Special checker for the proof.
pub proof_check: Arc,
}
diff --git a/ethcore/res/instant_seal.json b/ethcore/res/instant_seal.json
index 3ec998f0e5c..0a46f07ff67 100644
--- a/ethcore/res/instant_seal.json
+++ b/ethcore/res/instant_seal.json
@@ -24,6 +24,9 @@
"eip211Transition": "0x0",
"eip214Transition": "0x0",
"eip658Transition": "0x0",
+ "eip145Transition": "0x0",
+ "eip1014Transition": "0x0",
+ "eip1052Transition": "0x0",
"wasmActivationTransition": "0x0"
},
"genesis": {
diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs
index d672668f733..7eb81f4238d 100644
--- a/ethcore/src/block.rs
+++ b/ethcore/src/block.rs
@@ -22,13 +22,13 @@
//! and can be appended to with transactions and uncles.
//!
//! When ready, `OpenBlock` can be closed and turned into a `ClosedBlock`. A `ClosedBlock` can
-//! be reopend again by a miner under certain circumstances. On block close, state commit is
+//! be re-opend again by a miner under certain circumstances. On block close, state commit is
//! performed.
//!
//! `LockedBlock` is a version of a `ClosedBlock` that cannot be reopened. It can be sealed
//! using an engine.
//!
-//! `ExecutedBlock` is an underlaying data structure used by all structs above to store block
+//! `ExecutedBlock` is an underlying data structure used by all structs above to store block
//! related info.
use std::{cmp, ops};
@@ -38,7 +38,7 @@ use std::sync::Arc;
use bytes::Bytes;
use ethereum_types::{H256, U256, Address, Bloom};
-use engines::EthEngine;
+use engines::Engine;
use error::{Error, BlockError};
use factory::Factories;
use state_db::StateDB;
@@ -52,7 +52,7 @@ use vm::{EnvInfo, LastHashes};
use hash::keccak;
use rlp::{RlpStream, Encodable, encode_list};
use types::transaction::{SignedTransaction, Error as TransactionError};
-use types::header::{Header, ExtendedHeader};
+use types::header::Header;
use types::receipt::{Receipt, TransactionOutcome};
/// Block that is ready for transactions to be added.
@@ -61,7 +61,8 @@ use types::receipt::{Receipt, TransactionOutcome};
/// maintain the system `state()`. We also archive execution receipts in preparation for later block creation.
pub struct OpenBlock<'x> {
block: ExecutedBlock,
- engine: &'x dyn EthEngine,
+ engine: &'x dyn Engine,
+ parent: Header,
}
/// Just like `OpenBlock`, except that we've applied `Engine::on_close_block`, finished up the non-seal header fields,
@@ -72,6 +73,7 @@ pub struct OpenBlock<'x> {
pub struct ClosedBlock {
block: ExecutedBlock,
unclosed_state: State,
+ parent: Header,
}
/// Just like `ClosedBlock` except that we can't reopen it and it's faster.
@@ -102,7 +104,7 @@ pub struct ExecutedBlock {
pub receipts: Vec,
/// Hashes of already executed transactions.
pub transactions_set: HashSet,
- /// Underlaying state.
+ /// Underlying state.
pub state: State,
/// Transaction traces.
pub traces: Tracing,
@@ -119,13 +121,13 @@ impl ExecutedBlock {
uncles: Default::default(),
receipts: Default::default(),
transactions_set: Default::default(),
- state: state,
+ state,
traces: if tracing {
Tracing::enabled()
} else {
Tracing::Disabled
},
- last_hashes: last_hashes,
+ last_hashes,
}
}
@@ -162,8 +164,8 @@ pub trait Drain {
impl<'x> OpenBlock<'x> {
/// Create a new `OpenBlock` ready for transaction pushing.
- pub fn new<'a, I: IntoIterator- >(
- engine: &'x dyn EthEngine,
+ pub fn new<'a>(
+ engine: &'x dyn Engine,
factories: Factories,
tracing: bool,
db: StateDB,
@@ -173,14 +175,11 @@ impl<'x> OpenBlock<'x> {
gas_range_target: (U256, U256),
extra_data: Bytes,
is_epoch_begin: bool,
- ancestry: I,
) -> Result {
let number = parent.number() + 1;
let state = State::from_existing(db, parent.state_root().clone(), engine.account_start_nonce(number), factories)?;
- let mut r = OpenBlock {
- block: ExecutedBlock::new(state, last_hashes, tracing),
- engine: engine,
- };
+
+ let mut r = OpenBlock { block: ExecutedBlock::new(state, last_hashes, tracing), engine, parent: parent.clone() };
r.block.header.set_parent_hash(parent.hash());
r.block.header.set_number(number);
@@ -195,7 +194,7 @@ impl<'x> OpenBlock<'x> {
engine.populate_from_parent(&mut r.block.header, parent);
engine.machine().on_new_block(&mut r.block)?;
- engine.on_new_block(&mut r.block, is_epoch_begin, &mut ancestry.into_iter())?;
+ engine.on_new_block(&mut r.block, is_epoch_begin)?;
Ok(r)
}
@@ -297,19 +296,20 @@ impl<'x> OpenBlock<'x> {
/// Turn this into a `ClosedBlock`.
pub fn close(self) -> Result {
let unclosed_state = self.block.state.clone();
+ let parent = self.parent.clone();
let locked = self.close_and_lock()?;
Ok(ClosedBlock {
block: locked.block,
unclosed_state,
+ parent,
})
}
/// Turn this into a `LockedBlock`.
pub fn close_and_lock(self) -> Result {
let mut s = self;
-
- s.engine.on_close_block(&mut s.block)?;
+ s.engine.on_close_block(&mut s.block, &s.parent)?;
s.block.state.commit()?;
s.block.header.set_transactions_root(ordered_trie_root(s.block.transactions.iter().map(|e| e.rlp_bytes())));
@@ -374,14 +374,12 @@ impl ClosedBlock {
}
/// Given an engine reference, reopen the `ClosedBlock` into an `OpenBlock`.
- pub fn reopen(self, engine: &dyn EthEngine) -> OpenBlock {
+ pub fn reopen(self, engine: &dyn Engine) -> OpenBlock {
// revert rewards (i.e. set state back at last transaction's state).
let mut block = self.block;
block.state = self.unclosed_state;
- OpenBlock {
- block: block,
- engine: engine,
- }
+ let parent = self.parent;
+ OpenBlock { block, engine, parent }
}
}
@@ -404,7 +402,7 @@ impl LockedBlock {
/// Provide a valid seal in order to turn this into a `SealedBlock`.
///
/// NOTE: This does not check the validity of `seal` with the engine.
- pub fn seal(self, engine: &dyn EthEngine, seal: Vec) -> Result {
+ pub fn seal(self, engine: &dyn Engine, seal: Vec) -> Result {
let expected_seal_fields = engine.seal_fields(&self.header);
let mut s = self;
if seal.len() != expected_seal_fields {
@@ -429,7 +427,7 @@ impl LockedBlock {
/// TODO(https://github.com/paritytech/parity-ethereum/issues/10407): This is currently only used in POW chain call paths, we should really merge it with seal() above.
pub fn try_seal(
self,
- engine: &dyn EthEngine,
+ engine: &dyn Engine,
seal: Vec,
) -> Result {
let mut s = self;
@@ -472,14 +470,13 @@ pub(crate) fn enact(
header: Header,
transactions: Vec,
uncles: Vec,
- engine: &dyn EthEngine,
+ engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
last_hashes: Arc,
factories: Factories,
is_epoch_begin: bool,
- ancestry: &mut dyn Iterator
- ,
) -> Result {
// For trace log
let trace_state = if log_enabled!(target: "enact", ::log::Level::Trace) {
@@ -501,7 +498,6 @@ pub(crate) fn enact(
(3141562.into(), 31415620.into()),
vec![],
is_epoch_begin,
- ancestry,
)?;
if let Some(ref s) = trace_state {
@@ -522,17 +518,16 @@ pub(crate) fn enact(
b.close_and_lock()
}
-/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header
+/// Enact the block given by `block_bytes` using `engine` on the database `db` with the given `parent` block header
pub fn enact_verified(
block: PreverifiedBlock,
- engine: &dyn EthEngine,
+ engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
last_hashes: Arc,
factories: Factories,
is_epoch_begin: bool,
- ancestry: &mut dyn Iterator
- ,
) -> Result {
enact(
@@ -546,7 +541,6 @@ pub fn enact_verified(
last_hashes,
factories,
is_epoch_begin,
- ancestry,
)
}
@@ -554,7 +548,7 @@ pub fn enact_verified(
mod tests {
use test_helpers::get_temp_state_db;
use super::*;
- use engines::EthEngine;
+ use engines::Engine;
use vm::LastHashes;
use error::Error;
use factory::Factories;
@@ -571,7 +565,7 @@ mod tests {
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header
fn enact_bytes(
block_bytes: Vec,
- engine: &dyn EthEngine,
+ engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
@@ -608,7 +602,6 @@ mod tests {
(3141562.into(), 31415620.into()),
vec![],
false,
- None,
)?;
b.populate_from(&header);
@@ -624,7 +617,7 @@ mod tests {
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header. Seal the block aferwards
fn enact_and_seal(
block_bytes: Vec,
- engine: &dyn EthEngine,
+ engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
@@ -643,7 +636,7 @@ mod tests {
let genesis_header = spec.genesis_header();
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
let last_hashes = Arc::new(vec![genesis_header.hash()]);
- let b = OpenBlock::new(&*spec.engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
+ let b = OpenBlock::new(&*spec.engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false).unwrap();
let b = b.close_and_lock().unwrap();
let _ = b.seal(&*spec.engine, vec![]);
}
@@ -657,7 +650,7 @@ mod tests {
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
let last_hashes = Arc::new(vec![genesis_header.hash()]);
- let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap()
+ let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false).unwrap()
.close_and_lock().unwrap().seal(engine, vec![]).unwrap();
let orig_bytes = b.rlp_bytes();
let orig_db = b.drain().state.drop().1;
@@ -682,7 +675,7 @@ mod tests {
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
let last_hashes = Arc::new(vec![genesis_header.hash()]);
- let mut open_block = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
+ let mut open_block = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false).unwrap();
let mut uncle1_header = Header::new();
uncle1_header.set_extra_data(b"uncle1".to_vec());
let mut uncle2_header = Header::new();
diff --git a/ethcore/src/builtin.rs b/ethcore/src/builtin.rs
index bae1c75da36..6a52c9cdd42 100644
--- a/ethcore/src/builtin.rs
+++ b/ethcore/src/builtin.rs
@@ -19,7 +19,6 @@
use std::cmp::{max, min};
use std::io::{self, Read};
-use byteorder::{ByteOrder, BigEndian};
use parity_crypto::digest;
use num::{BigUint, Zero, One};
@@ -369,7 +368,9 @@ impl Impl for ModexpImpl {
// but so would running out of addressable memory!
let mut read_len = |reader: &mut io::Chain<&[u8], io::Repeat>| {
reader.read_exact(&mut buf[..]).expect("reading from zero-extended memory cannot fail; qed");
- BigEndian::read_u64(&buf[24..]) as usize
+ let mut len_bytes = [0u8; 8];
+ len_bytes.copy_from_slice(&buf[24..]);
+ u64::from_be_bytes(len_bytes) as usize
};
let base_len = read_len(&mut reader);
diff --git a/ethcore/src/client/ancient_import.rs b/ethcore/src/client/ancient_import.rs
index 9dc5e97b9f8..f89afa13a3f 100644
--- a/ethcore/src/client/ancient_import.rs
+++ b/ethcore/src/client/ancient_import.rs
@@ -18,7 +18,7 @@
use std::sync::Arc;
-use engines::{EthEngine, EpochVerifier};
+use engines::{Engine, EpochVerifier};
use blockchain::BlockChain;
use parking_lot::RwLock;
@@ -32,12 +32,12 @@ const HEAVY_VERIFY_RATE: f32 = 0.02;
/// epoch.
pub struct AncientVerifier {
cur_verifier: RwLock