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 rpc-txpool-error
Browse files Browse the repository at this point in the history
* master:
  [evmbin] fix compilation (#10976)
  Update to latest trie version. (#10972)
  [blooms-db] Fix benchmarks (#10974)
  Fix ethcore/benches build. (#10964)
  tx-pool: accept local tx with higher gas price when pool full (#10901)
  Disable unsyncable expanse chain (#10926)
  Extract Machine from ethcore (#10949)
  removed redundant state_root function from spec, improve spec error types (#10955)
  Add support for Energy Web Foundation's new chains (#10957)
  [evmbin] add more tests to main.rs (#10956)
  Fix compiler warnings in util/io and upgrade to edition 2018 Upgrade mio to latest (#10953)
  unify loading spec && further spec cleanups (#10948)
  refactor: Refactor evmbin CLI (#10742)
  journaldb changes (#10929)
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
  Updated [email protected] key (#10939)
  Change the return type of step_inner function. (#10940)
  • Loading branch information
ordian committed Aug 15, 2019
2 parents 54181d8 + ef47426 commit 50cb305
Show file tree
Hide file tree
Showing 182 changed files with 3,908 additions and 2,517 deletions.
441 changes: 241 additions & 200 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fdlimit = "0.1"
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
jsonrpc-core = "12.0.0"
parity-bytes = "0.1"
client-traits = { path = "ethcore/client-traits" }
common-types = { path = "ethcore/types" }
ethcore = { path = "ethcore", features = ["parity"] }
ethcore-accounts = { path = "accounts", optional = true }
Expand Down Expand Up @@ -72,7 +73,7 @@ ethcore-secretstore = { path = "secret-store", optional = true }

registrar = { path = "util/registrar" }

parity-util-mem = { version = "0.1", features = ["jemalloc-global"] }
parity-util-mem = { version = "0.2.0", features = ["jemalloc-global"] }

[build-dependencies]
rustc_version = "0.2"
Expand Down
77 changes: 49 additions & 28 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,54 @@ Our Bug Bounty Program allows us to recognise and reward members of the Parity c
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFlyIAwBCACe0keNPjgYzZ1Oy/8t3zj/Qw9bHHqrzx7FWy8NbXnYBM19NqOZ
DIP7Oe0DvCaf/uruBskCS0iVstHlEFQ2AYe0Ei0REt9lQdy61GylU/DEB3879IG+
6FO0SnFeYeerv1/hFI2K6uv8v7PyyVDiiJSW0I1KIs2OBwJicTKmWxLAeQsRgx9G
yRGalrVk4KP+6pWTA7k3DxmDZKZyfYV/Ej10NtuzmsemwDbv98HKeomp/kgFOfSy
3AZjeCpctlsNqpjUuXa0/HudmH2WLxZ0fz8XeoRh8XM9UudNIecjrDqmAFrt/btQ
/3guvlzhFCdhYPVGsUusKMECk/JG+Xx1/1ZjABEBAAG0LFBhcml0eSBTZWN1cml0
eSBDb250YWN0IDxzZWN1cml0eUBwYXJpdHkuaW8+iQFUBBMBCAA+FiEE2uUVYCjP
N6B8aTiDXQ8DAY0H3nMFAllyIAwCGwMFCQPCZwAFCwkIBwIGFQgJCgsCBBYCAwEC
HgECF4AACgkQXQ8DAY0H3nM60wgAkS3A36Zc+upiaxU7tumcGv+an17j7gin0sif
+0ELSjVfrXInM6ovai+NhUdcLkJ7tCrKS90fvlaELK5Sg9CXBWCTFccKN4A/B7ey
rOg2NPXUecnyBB/XqQgKYH7ujYlOlqBDXMfz6z8Hj6WToxg9PPMGGomyMGh8AWxM
3yRPFs5RKt0VKgN++5N00oly5Y8ri5pgCidDvCLYMGTVDHFKwkuc9w6BlWlu1R1e
/hXFWUFAP1ffTAul3QwyKhjPn2iotCdxXjvt48KaU8DN4iL7aMBN/ZBKqGS7yRdF
D/JbJyaaJ0ZRvFSTSXy/sWY3z1B5mtCPBxco8hqqNfRkCwuZ6LkBDQRZciAMAQgA
8BP8xrwe12TOUTqL/Vrbxv/FLdhKh53J6TrPKvC2TEEKOrTNo5ahR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58BHBZk8WM2TlaU7VxZ6TYOmP2y3qf6FD6mCcrQ4Fml
E9f0lyVUoI/5Zs9oF0izRk8vkwaY3UvLM7XEY6nM8GnFG8kaiZMYmx26Zo7Uz31G
7EGGZFsrVDXfNhSJyz79Gyn+Lx9jOTdoR0sH/THYIIosE83awMGE6jKeuDYTbVWu
+ZtHQef+pRteki3wvNLJK+kC1y3BtHqDJS9Lqx0s8SCiVozlC+fZfC9hCtU7bXJK
0UJZ4qjSvj6whzfaNgOZAqJpmwgOnd8W/3YJk1DwUeX98FcU38MR23SOkx2EDdDE
77Kdu62vTs/tLmOTuyKBvYPaHaYulYjQTxurG+o8vhHtaL87ARvuq+83dj+nO5z3
5O9vkcVJYWjOEnJe7ZvCTxeLJehpCmHIbyUuDx5P24MWVbyXOxIlxNxTqlub5GlW
rQF6Qsa/0k9TRk7Htbct6fAA0/VahJS0g096MrTH8AxBXDNE8lIoNeGikVlaxK9Z
S+aannlWYIJymZ4FygIPPaRlzhAoXBuJd8OaR5giC7dS1xquxKOiQEXTGsLeGFaI
BZYiIhW7GG4ozvKDqyNm4eg=
=yKcB
-----END PGP PUBLIC KEY BLOCK-----
```
13 changes: 8 additions & 5 deletions ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ authors = ["Parity Technologies <[email protected]>"]
account-db = { path = "account-db" }
ansi_term = "0.11"
blooms-db = { path = "../util/blooms-db", optional = true }
client-traits = { path = "./client-traits" }
common-types = { path = "types" }
crossbeam-utils = "0.6"
env_logger = { version = "0.5", optional = true }
Expand All @@ -31,8 +32,8 @@ ethkey = { path = "../accounts/ethkey" }
evm = { path = "evm" }
trie-vm-factories = { path = "trie-vm-factories" }
futures = "0.1"
hash-db = "0.12.4"
parity-util-mem = "0.1"
hash-db = "0.15.0"
parity-util-mem = "0.2.0"
itertools = "0.5"
journaldb = { path = "../util/journaldb" }
keccak-hash = "0.2.0"
Expand All @@ -44,14 +45,15 @@ lazy_static = "1.2.0"
len-caching-lock = { path = "../util/len-caching-lock" }
log = "0.4"
lru-cache = "0.1"
machine = { path = "./machine" }
macros = { path = "../util/macros" }
memory-cache = { path = "../util/memory-cache" }
num_cpus = "1.2"
parity-bytes = "0.1"
parity-snappy = "0.1"
parking_lot = "0.8"
pod = { path = "pod" }
trie-db = "0.12.4"
trie-db = "0.15.0"
patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" }
rand = "0.6"
rayon = "1.1"
Expand Down Expand Up @@ -84,7 +86,8 @@ parity-runtime = { path = "../util/runtime" }
rlp_compress = { path = "../util/rlp-compress" }
serde_json = "1.0"
tempdir = "0.3"
trie-standardmap = "0.12.4"
trie-standardmap = "0.15.0"
machine = { path = "./machine", features = ["test-helpers"] }

[features]
parity = ["work-notify", "price-info", "stratum"]
Expand All @@ -108,7 +111,7 @@ evm-debug-tests = ["evm-debug", "evm/evm-debug-tests"]
# EVM debug traces are printed.
slow-blocks = []
# Run JSON consensus tests.
json-tests = ["env_logger", "test-helpers"]
json-tests = ["env_logger", "test-helpers", "machine/test-helpers"]
# Skip JSON consensus tests with pending issues.
ci-skip-tests = []
# Run memory/cpu heavy tests.
Expand Down
2 changes: 1 addition & 1 deletion ethcore/account-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"

[dependencies]
ethereum-types = "0.6"
hash-db = "0.12.4"
hash-db = "0.15.0"
keccak-hash = "0.2.0"
keccak-hasher = { path = "../../util/keccak-hasher" }
kvdb = "0.1"
Expand Down
8 changes: 4 additions & 4 deletions ethcore/account-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ derive_more = "0.15.0"
ethereum-types = "0.6.0"
ethtrie = { package = "patricia-trie-ethereum", path = "../../util/patricia-trie-ethereum" }
trie-vm-factories = { path = "../trie-vm-factories" }
hash-db = "0.12.4"
hash-db = "0.15.0"
journaldb = { path = "../../util/journaldb" }
keccak-hash = "0.2.0"
keccak-hasher = { path = "../../util/keccak-hasher" }
kvdb = "0.1.0"
log = "0.4"
lru-cache = "0.1.2"
memory-db = "0.12.4"
memory-db = "0.15.0"
parity-bytes = "0.1.0"
parity-util-mem = "0.1.0"
parity-util-mem = "0.2.0"
parking_lot = "0.8.0"
pod = { path = "../pod" }
rlp = "0.4.0"
serde = { version = "1.0", features = ["derive"] }
trace = { path = "../trace" }
trie-db = "0.12.4"
trie-db = "0.15.0"

[dev-dependencies]
account-db = { path = "../account-db" }
Expand Down
19 changes: 1 addition & 18 deletions ethcore/account-state/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
//! should become general over time to the point where not even a
//! merkle trie is strictly necessary.
use std::collections::{HashMap, HashSet};
use std::collections::HashSet;
use std::sync::Arc;

use ethereum_types::{Address, H256};
use hash_db::{AsHashDB, EMPTY_PREFIX, HashDB, Prefix};
use kvdb::DBValue;
use memory_db::{HashKey, MemoryDB};
use parking_lot::Mutex;
use journaldb::AsKeyedHashDB;
use keccak_hasher::KeccakHasher;

use crate::account::Account;
Expand Down Expand Up @@ -90,10 +89,6 @@ impl ProofCheck {
}
}

impl journaldb::KeyedHashDB for ProofCheck {
fn keys(&self) -> HashMap<H256, i32> { self.0.keys() }
}

impl HashDB<KeccakHasher, DBValue> for ProofCheck {
fn get(&self, key: &H256, prefix: Prefix) -> Option<DBValue> {
self.0.get(key, prefix)
Expand Down Expand Up @@ -146,23 +141,11 @@ pub struct Proving<H> {
proof: Mutex<HashSet<DBValue>>,
}

impl<AH: AsKeyedHashDB + Send + Sync> AsKeyedHashDB for Proving<AH> {
fn as_keyed_hash_db(&self) -> &dyn journaldb::KeyedHashDB { self }
}

impl<AH: AsHashDB<KeccakHasher, DBValue> + Send + Sync> AsHashDB<KeccakHasher, DBValue> for Proving<AH> {
fn as_hash_db(&self) -> &dyn HashDB<KeccakHasher, DBValue> { self }
fn as_hash_db_mut(&mut self) -> &mut dyn HashDB<KeccakHasher, DBValue> { self }
}

impl<H: AsKeyedHashDB + Send + Sync> journaldb::KeyedHashDB for Proving<H> {
fn keys(&self) -> HashMap<H256, i32> {
let mut keys = self.base.as_keyed_hash_db().keys();
keys.extend(self.changed.keys());
keys
}
}

impl<H: AsHashDB<KeccakHasher, DBValue> + Send + Sync> HashDB<KeccakHasher, DBValue> for Proving<H> {
fn get(&self, key: &H256, prefix: Prefix) -> Option<DBValue> {
match self.base.as_hash_db().get(key, prefix) {
Expand Down
8 changes: 5 additions & 3 deletions ethcore/benches/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ extern crate criterion;
#[macro_use]
extern crate lazy_static;

extern crate machine;
extern crate ethcore;
extern crate ethcore_builtin;
extern crate ethereum_types;
extern crate parity_bytes as bytes;
extern crate rustc_hex;

use criterion::{Criterion, Bencher};
use bytes::BytesRef;
use ethcore::builtin::Builtin;
use ethcore::machine::Machine;
use ethcore_builtin::Builtin;
use ethereum_types::H160;
use ethcore::ethereum::new_byzantium_test_machine;
use machine::Machine;
use machine::test_helpers::new_byzantium_test_machine;
use rustc_hex::FromHex;

lazy_static! {
Expand Down
2 changes: 1 addition & 1 deletion ethcore/blockchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ common-types = { path = "../types" }
ethcore-db = { path = "../db" }
ethereum-types = "0.6.0"
keccak-hash = "0.2.0"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
itertools = "0.5"
kvdb = "0.1"
log = "0.4"
Expand Down
12 changes: 12 additions & 0 deletions ethcore/client-traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
description = "Trait definitions relative the ethereum client"
name = "client-traits"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
license = "GPL-3.0"

[dependencies]
ethereum-types = "0.6.0"
common-types = { path = "../types" }

37 changes: 37 additions & 0 deletions ethcore/client-traits/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.

// Parity Ethereum 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 Ethereum 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 Ethereum. If not, see <http://www.gnu.org/licenses/>.

use ethereum_types::{Address, H256};
use common_types::{
header::Header,
encoded,
ids::BlockId,
};

/// Provides various information on a block by it's ID
pub trait BlockInfo {
/// Get raw block header data by block id.
fn block_header(&self, id: BlockId) -> Option<encoded::Header>;

/// Get the best block header.
fn best_block_header(&self) -> Header;

/// Get raw block data by block header hash.
fn block(&self, id: BlockId) -> Option<encoded::Block>;

/// Get address code hash at given block's state.
fn code_hash(&self, address: &Address, id: BlockId) -> Option<H256>;
}
2 changes: 1 addition & 1 deletion ethcore/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2018"
common-types = { path = "../types" }
ethereum-types = "0.6.0"
kvdb = "0.1"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
parking_lot = "0.8"
rlp = "0.4.0"
rlp_derive = { path = "../../util/rlp-derive" }
2 changes: 1 addition & 1 deletion ethcore/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = ["Parity Technologies <[email protected]>"]
bit-set = "0.4"
parity-bytes = "0.1"
ethereum-types = "0.6.0"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
lazy_static = "1.0"
log = "0.4"
vm = { path = "../vm" }
Expand Down
Loading

0 comments on commit 50cb305

Please sign in to comment.