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

Commit 6eae372

Browse files
authored
Backports to 2.0.0-beta (#9094)
* parity-version: betalize 2.0 * Multiple improvements to discovery ping handling (#8771) * discovery: Only add nodes to routing table after receiving pong. Previously the discovery algorithm would add nodes to the routing table before confirming that the endpoint is participating in the protocol. This now tracks in-flight pings and adds to the routing table only after receiving a response. * discovery: Refactor packet creation into its own function. This function is useful inside unit tests. * discovery: Additional testing for new add_node behavior. * discovery: Track expiration of pings to non-yet-in-bucket nodes. Now that we may ping nodes before adding to a k-bucket, the timeout tracking must be separate from BucketEntry. * discovery: Verify echo hash on pong packets. Stores packet hash with in-flight requests and matches with pong response. * discovery: Track timeouts on FIND_NODE requests. * discovery: Retry failed pings with exponential backoff. UDP packets may get dropped, so instead of immediately booting nodes that fail to respond to a ping, retry 4 times with exponential backoff. * !fixup Use slice instead of Vec for request_backoff. * Add separate database directory for light client (#8927) (#9064) * Add seperate default DB path for light client (#8927) * Improve readability * Revert "Replace `std::env::home_dir` with `dirs::home_dir` (#9077)" (#9097) * Revert "Replace `std::env::home_dir` with `dirs::home_dir` (#9077)" This reverts commit 7e77932. * Restore some of the changes * Update parity-common * Offload cull to IoWorker. (#9099) * Fix work-notify. (#9104) * Update hidapi, fixes #7542 (#9108) * docker: add cmake dependency (#9111) * Update light client hardcoded headers (#9098) * Insert Kovan hardcoded headers until #7690241 * Insert Kovan hardcoded headers until block 7690241 * Insert Ropsten hardcoded headers until #3612673 * Insert Mainnet hardcoded headers until block 5941249 * Make sure to produce full blocks. (#9115) * Insert ETC (classic) hardcoded headers until block #6170625 (#9121) * fix verification in ethcore-sync collect_blocks (#9135) * Completely remove all dapps struct from rpc (#9107) * Completely remove all dapps struct from rpc * Remove unused pub use * `evm bench` fix broken dependencies (#9134) * `evm bench` use valid dependencies Benchmarks of the `evm` used stale versions of a couple a crates that this commit fixes! * fix warnings * Update snapcraft.yaml (#9132)
1 parent 484ecfa commit 6eae372

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3941
-455
lines changed

Cargo.lock

Lines changed: 15 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ futures-cpupool = "0.1"
3232
fdlimit = "0.1"
3333
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
3434
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.11" }
35-
ethcore = { path = "ethcore", features = ["work-notify", "price-info", "stratum"] }
35+
ethcore = { path = "ethcore", features = ["parity"] }
3636
parity-bytes = { git = "https://github.com/paritytech/parity-common" }
3737
ethcore-io = { path = "util/io" }
3838
ethcore-light = { path = "ethcore/light" }
@@ -88,6 +88,7 @@ winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }
8888
daemonize = { git = "https://github.com/paritytech/daemonize" }
8989

9090
[features]
91+
miner-debug = ["ethcore/miner-debug"]
9192
json-tests = ["ethcore/json-tests"]
9293
test-heavy = ["ethcore/test-heavy"]
9394
evm-debug = ["ethcore/evm-debug"]

docker/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WORKDIR /build
55
# install tools and dependencies
66
RUN apk add --no-cache gcc musl-dev pkgconfig g++ make curl \
77
eudev-dev rust cargo git file binutils \
8-
libusb-dev linux-headers perl
8+
libusb-dev linux-headers perl cmake
99

1010
# show backtraces
1111
ENV RUST_BACKTRACE 1

docker/centos/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WORKDIR /build
33

44
# install tools and dependencies
55
RUN yum -y update&& \
6-
yum install -y git make gcc-c++ gcc file binutils
6+
yum install -y git make gcc-c++ gcc file binutils cmake
77

88
# install rustup
99
RUN curl -sSf https://static.rust-lang.org/rustup.sh -o rustup.sh &&\

docker/hub/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN apt-get update && \
1313
# add-apt-repository
1414
software-properties-common \
1515
make \
16+
cmake \
1617
curl \
1718
wget \
1819
git \

docker/ubuntu-aarch64/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN apt-get -y update && \
66
apt-get install -y --force-yes --no-install-recommends \
77
curl git make g++ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
88
libc6-arm64-cross libc6-dev-arm64-cross wget file ca-certificates \
9-
binutils-aarch64-linux-gnu \
9+
binutils-aarch64-linux-gnu cmake \
1010
&& \
1111
apt-get clean
1212

docker/ubuntu-arm/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN apt-get -y update && \
66
apt-get install -y --force-yes --no-install-recommends \
77
curl git make g++ gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
88
libc6-dev-armhf-cross wget file ca-certificates \
9-
binutils-arm-linux-gnueabihf \
9+
binutils-arm-linux-gnueabihf cmake \
1010
&& \
1111
apt-get clean
1212

docker/ubuntu/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN apt-get update && \
66
apt-get install -y \
77
g++ \
88
build-essential \
9+
cmake \
910
curl \
1011
git \
1112
file \

ethcore/Cargo.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ tempdir = "0.3"
8080
trie-standardmap = { git = "https://github.com/paritytech/parity-common" }
8181

8282
[features]
83+
parity = ["work-notify", "price-info", "stratum"]
84+
# Large optional features that are enabled by default for Parity,
85+
# but might be omitted for other dependent crates.
86+
work-notify = ["ethcore-miner/work-notify"]
87+
price-info = ["ethcore-miner/price-info"]
88+
stratum = ["ethcore-stratum"]
89+
90+
# Disables seal verification for mined blocks.
91+
# This allows you to submit any seal via RPC to test and benchmark
92+
# how fast pending block get's created while running on the mainnet.
93+
miner-debug = []
8394
# Display EVM debug traces.
8495
evm-debug = ["evm/evm-debug"]
8596
# Display EVM debug traces when running tests.
@@ -97,6 +108,3 @@ test-heavy = []
97108
benches = []
98109
# Compile test helpers
99110
test-helpers = ["tempdir"]
100-
work-notify = ["ethcore-miner/work-notify"]
101-
price-info = ["ethcore-miner/price-info"]
102-
stratum = ["ethcore-stratum"]

ethcore/benches/evm.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@
1616

1717
#![feature(test)]
1818

19-
extern crate test;
20-
extern crate ethcore_util as util;
21-
extern crate rand;
2219
extern crate bn;
23-
extern crate parity_crypto;
20+
extern crate ethereum_types;
2421
extern crate ethkey;
22+
extern crate parity_crypto;
23+
extern crate rand;
2524
extern crate rustc_hex;
26-
extern crate ethcore_bigint;
25+
extern crate test;
2726

28-
use self::test::{Bencher};
29-
use rand::{StdRng};
27+
use self::test::Bencher;
28+
use rand::StdRng;
3029

3130
#[bench]
3231
fn bn_128_pairing(b: &mut Bencher) {
@@ -62,8 +61,7 @@ fn bn_128_mul(b: &mut Bencher) {
6261
fn sha256(b: &mut Bencher) {
6362
use parity_crypto::digest::sha256;
6463

65-
let mut input: [u8; 256] = [0; 256];
66-
let mut out = [0; 32];
64+
let input = [0_u8; 256];
6765

6866
b.iter(|| {
6967
sha256(&input);
@@ -74,7 +72,7 @@ fn sha256(b: &mut Bencher) {
7472
fn ecrecover(b: &mut Bencher) {
7573
use rustc_hex::FromHex;
7674
use ethkey::{Signature, recover as ec_recover};
77-
use ethcore_bigint::hash::H256;
75+
use ethereum_types::H256;
7876
let input = FromHex::from_hex("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b650acf9d3f5f0a2c799776a1254355d5f4061762a237396a99a0e0e3fc2bcd6729514a0dacb2e623ac4abd157cb18163ff942280db4d5caad66ddf941ba12e03").unwrap();
7977
let hash = H256::from_slice(&input[0..32]);
8078
let v = H256::from_slice(&input[32..64]);

0 commit comments

Comments
 (0)