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/chore/debug-synching-UnlinkedAncientBlo…
Browse files Browse the repository at this point in the history
…ckChain

* master:
  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)
  • Loading branch information
dvdplm committed Jun 28, 2019
2 parents 6bf1ad3 + decc9ea commit 25233d1
Show file tree
Hide file tree
Showing 59 changed files with 1,263 additions and 453 deletions.
281 changes: 97 additions & 184 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: 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
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
6 changes: 3 additions & 3 deletions ethcore/light/src/client/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -47,7 +47,7 @@ pub trait ChainDataFetcher: Send + Sync + 'static {
fn epoch_transition(
&self,
_hash: H256,
_engine: Arc<EthEngine>,
_engine: Arc<Engine>,
_checker: Arc<StateDependentProof>
) -> Self::Transition;
}
Expand Down Expand Up @@ -76,7 +76,7 @@ impl ChainDataFetcher for Unavailable {
fn epoch_transition(
&self,
_hash: H256,
_engine: Arc<EthEngine>,
_engine: Arc<Engine>,
_checker: Arc<StateDependentProof>
) -> Self::Transition {
Err("fetching epoch transition proofs unavailable")
Expand Down
10 changes: 5 additions & 5 deletions ethcore/light/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -114,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 @@ -159,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 @@ -375,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 @@ -578,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
6 changes: 3 additions & 3 deletions ethcore/light/src/on_demand/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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<EthEngine>,
pub engine: Arc<Engine>,
}

impl TransactionProof {
Expand Down Expand Up @@ -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<EthEngine>,
pub engine: Arc<Engine>,
/// Special checker for the proof.
pub proof_check: Arc<StateDependentProof>,
}
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: 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
1 change: 0 additions & 1 deletion 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 Down
22 changes: 11 additions & 11 deletions ethcore/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -61,7 +61,7 @@ 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,
}

/// Just like `OpenBlock`, except that we've applied `Engine::on_close_block`, finished up the non-seal header fields,
Expand Down Expand Up @@ -163,7 +163,7 @@ pub trait Drain {
impl<'x> OpenBlock<'x> {
/// Create a new `OpenBlock` ready for transaction pushing.
pub fn new<'a, I: IntoIterator<Item = ExtendedHeader>>(
engine: &'x dyn EthEngine,
engine: &'x dyn Engine,
factories: Factories,
tracing: bool,
db: StateDB,
Expand Down Expand Up @@ -374,7 +374,7 @@ 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;
Expand Down Expand Up @@ -404,7 +404,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<Bytes>) -> Result<SealedBlock, Error> {
pub fn seal(self, engine: &dyn Engine, seal: Vec<Bytes>) -> Result<SealedBlock, Error> {
let expected_seal_fields = engine.seal_fields(&self.header);
let mut s = self;
if seal.len() != expected_seal_fields {
Expand All @@ -429,7 +429,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<Bytes>,
) -> Result<SealedBlock, Error> {
let mut s = self;
Expand Down Expand Up @@ -472,7 +472,7 @@ pub(crate) fn enact(
header: Header,
transactions: Vec<SignedTransaction>,
uncles: Vec<Header>,
engine: &dyn EthEngine,
engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
Expand Down Expand Up @@ -525,7 +525,7 @@ pub(crate) fn enact(
/// Enact the block given by `block_bytes` using `engine` on the database `db` with given `parent` block header
pub fn enact_verified(
block: PreverifiedBlock,
engine: &dyn EthEngine,
engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
Expand Down Expand Up @@ -554,7 +554,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;
Expand All @@ -571,7 +571,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<u8>,
engine: &dyn EthEngine,
engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
Expand Down Expand Up @@ -624,7 +624,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<u8>,
engine: &dyn EthEngine,
engine: &dyn Engine,
tracing: bool,
db: StateDB,
parent: &Header,
Expand Down
6 changes: 3 additions & 3 deletions ethcore/src/client/ancient_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use std::sync::Arc;

use engines::{EthEngine, EpochVerifier};
use engines::{Engine, EpochVerifier};

use blockchain::BlockChain;
use parking_lot::RwLock;
Expand All @@ -32,12 +32,12 @@ const HEAVY_VERIFY_RATE: f32 = 0.02;
/// epoch.
pub struct AncientVerifier {
cur_verifier: RwLock<Option<Box<dyn EpochVerifier>>>,
engine: Arc<dyn EthEngine>,
engine: Arc<dyn Engine>,
}

impl AncientVerifier {
/// Create a new ancient block verifier with the given engine.
pub fn new(engine: Arc<dyn EthEngine>) -> Self {
pub fn new(engine: Arc<dyn Engine>) -> Self {
AncientVerifier {
cur_verifier: RwLock::new(None),
engine,
Expand Down
12 changes: 6 additions & 6 deletions ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use client::{
IoClient, BadBlocks,
};
use client::bad_blocks;
use engines::{MAX_UNCLE_AGE, EthEngine, EpochTransition, ForkChoice, EngineError, SealingState};
use engines::{MAX_UNCLE_AGE, Engine, EpochTransition, ForkChoice, EngineError, SealingState};
use engines::epoch::PendingTransition;
use error::{
ImportError, ExecutionError, CallError, BlockError,
Expand Down Expand Up @@ -165,7 +165,7 @@ struct Importer {
pub ancient_verifier: AncientVerifier,

/// Ethereum engine to be used during import
pub engine: Arc<dyn EthEngine>,
pub engine: Arc<dyn Engine>,

/// A lru cache of recently detected bad blocks
pub bad_blocks: bad_blocks::BadBlocks,
Expand All @@ -187,7 +187,7 @@ pub struct Client {

chain: RwLock<Arc<BlockChain>>,
tracedb: RwLock<TraceDB<BlockChain>>,
engine: Arc<dyn EthEngine>,
engine: Arc<dyn Engine>,

/// Client configuration
config: ClientConfig,
Expand Down Expand Up @@ -245,7 +245,7 @@ pub struct Client {
impl Importer {
pub fn new(
config: &ClientConfig,
engine: Arc<dyn EthEngine>,
engine: Arc<dyn Engine>,
message_channel: IoChannel<ClientIoMessage>,
miner: Arc<Miner>,
) -> Result<Importer, ::error::Error> {
Expand Down Expand Up @@ -857,7 +857,7 @@ impl Client {
}

/// Returns engine reference.
pub fn engine(&self) -> &dyn EthEngine {
pub fn engine(&self) -> &dyn Engine {
&*self.engine
}

Expand Down Expand Up @@ -1661,7 +1661,7 @@ impl Call for Client {
}

impl EngineInfo for Client {
fn engine(&self) -> &dyn EthEngine {
fn engine(&self) -> &dyn Engine {
Client::engine(self)
}
}
Expand Down
4 changes: 2 additions & 2 deletions ethcore/src/client/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use client::{
Call, StateClient, EngineInfo, AccountData, BlockChain, BlockProducer, SealedBlockImporter, IoClient,
BadBlocks
};
use engines::EthEngine;
use engines::Engine;
use error::{Error, EthcoreResult};
use executed::CallError;
use executive::Executed;
Expand Down Expand Up @@ -627,7 +627,7 @@ impl StateClient for TestBlockChainClient {
}

impl EngineInfo for TestBlockChainClient {
fn engine(&self) -> &dyn EthEngine {
fn engine(&self) -> &dyn Engine {
unimplemented!()
}
}
Expand Down
Loading

0 comments on commit 25233d1

Please sign in to comment.