Skip to content

Commit fd88e46

Browse files
author
Andronik Ordian
committed
Merge branch 'master' of https://github.com/paritytech/parity into warp_sync_on_light_client
* 'master' of https://github.com/paritytech/parity: (29 commits) Block 0 is valid in queries (openethereum#8891) fixed osx permissions (openethereum#8901) Atomic create new files with permissions to owner in ethstore (openethereum#8896) Add ETC Cooperative-run load balanced parity node (openethereum#8892) Add support for --chain tobalaba (openethereum#8870) fix some warns on nightly (openethereum#8889) Add new ovh bootnodes and fix port for foundation bootnode 3.2 (openethereum#8886) SecretStore: service pack 1 (openethereum#8435) Handle removed logs in filter changes and add geth compatibility field (openethereum#8796) fixed ipc leak, closes openethereum#8774 (openethereum#8876) scripts: remove md5 checksums (openethereum#8884) hardware_wallet/Ledger `Sign messages` + some refactoring (openethereum#8868) Check whether we need resealing in miner and unwrap has_account in account_provider (openethereum#8853) docker: Fix alpine build (openethereum#8878) Remove mac os installers etc (openethereum#8875) README.md: update the list of dependencies (openethereum#8864) Fix concurrent access to signer queue (openethereum#8854) Tx permission contract improvement (openethereum#8400) Limit the number of transactions in pending set (openethereum#8777) Use sealing.enabled to emit eth_mining information (openethereum#8844) ...
2 parents f0e951b + 05e7c13 commit fd88e46

File tree

121 files changed

+2580
-3518
lines changed

Some content is hidden

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

121 files changed

+2580
-3518
lines changed

Cargo.lock

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ We recommend installing Rust through [rustup](https://www.rustup.rs/). If you do
4848
$ curl https://sh.rustup.rs -sSf | sh
4949
```
5050

51-
Parity also requires `gcc`, `g++`, `libssl-dev`/`openssl`, `libudev-dev` and `pkg-config` packages to be installed.
51+
Parity also requires `gcc`, `g++`, `libssl-dev`/`openssl`, `libudev-dev`, `pkg-config`, `file` and `make` packages to be installed.
5252

5353
- OSX:
5454
```bash

docker/alpine/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM alpine:3.7
1+
FROM alpine:edge
22

33
WORKDIR /build
44

55
# install tools and dependencies
6-
RUN apk add --no-cache gcc musl-dev openssl-dev pkgconfig g++ make curl \
7-
eudev-dev rust cargo git file binutils libusb-dev \
8-
linux-headers
6+
RUN apk add --no-cache gcc musl-dev pkgconfig g++ make curl \
7+
eudev-dev rust cargo git file binutils \
8+
libusb-dev linux-headers perl
99

1010
# show backtraces
1111
ENV RUST_BACKTRACE 1

ethcore/light/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ util-error = { path = "../../util/error" }
4040
snappy = { git = "https://github.com/paritytech/rust-snappy" }
4141

4242
[dev-dependencies]
43+
ethcore = { path = "..", features = ["test-helpers"] }
4344
kvdb-memorydb = { path = "../../util/kvdb-memorydb" }
4445
kvdb-rocksdb = { path = "../../util/kvdb-rocksdb" }
4546
tempdir = "0.3"

ethcore/light/src/net/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ const PROPAGATE_TIMEOUT_INTERVAL: Duration = Duration::from_secs(5);
7171
const RECALCULATE_COSTS_TIMEOUT: TimerToken = 3;
7272
const RECALCULATE_COSTS_INTERVAL: Duration = Duration::from_secs(60 * 60);
7373

74+
/// Max number of transactions in a single packet.
75+
const MAX_TRANSACTIONS_TO_PROPAGATE: usize = 64;
76+
7477
// minimum interval between updates.
7578
const UPDATE_INTERVAL: Duration = Duration::from_millis(5000);
7679

@@ -646,7 +649,7 @@ impl LightProtocol {
646649
fn propagate_transactions(&self, io: &IoContext) {
647650
if self.capabilities.read().tx_relay { return }
648651

649-
let ready_transactions = self.provider.ready_transactions();
652+
let ready_transactions = self.provider.ready_transactions(MAX_TRANSACTIONS_TO_PROPAGATE);
650653
if ready_transactions.is_empty() { return }
651654

652655
trace!(target: "pip", "propagate transactions: {} ready", ready_transactions.len());

ethcore/light/src/net/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ impl Provider for TestProvider {
173173
})
174174
}
175175

176-
fn ready_transactions(&self) -> Vec<PendingTransaction> {
177-
self.0.client.ready_transactions()
176+
fn ready_transactions(&self, max_len: usize) -> Vec<PendingTransaction> {
177+
self.0.client.ready_transactions(max_len)
178178
}
179179
}
180180

ethcore/light/src/provider.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub trait Provider: Send + Sync {
125125
fn header_proof(&self, req: request::CompleteHeaderProofRequest) -> Option<request::HeaderProofResponse>;
126126

127127
/// Provide pending transactions.
128-
fn ready_transactions(&self) -> Vec<PendingTransaction>;
128+
fn ready_transactions(&self, max_len: usize) -> Vec<PendingTransaction>;
129129

130130
/// Provide a proof-of-execution for the given transaction proof request.
131131
/// Returns a vector of all state items necessary to execute the transaction.
@@ -280,8 +280,8 @@ impl<T: ProvingBlockChainClient + ?Sized> Provider for T {
280280
.map(|(_, proof)| ::request::ExecutionResponse { items: proof })
281281
}
282282

283-
fn ready_transactions(&self) -> Vec<PendingTransaction> {
284-
BlockChainClient::ready_transactions(self)
283+
fn ready_transactions(&self, max_len: usize) -> Vec<PendingTransaction> {
284+
BlockChainClient::ready_transactions(self, max_len)
285285
.into_iter()
286286
.map(|tx| tx.pending().clone())
287287
.collect()
@@ -367,9 +367,12 @@ impl<L: AsLightClient + Send + Sync> Provider for LightProvider<L> {
367367
None
368368
}
369369

370-
fn ready_transactions(&self) -> Vec<PendingTransaction> {
370+
fn ready_transactions(&self, max_len: usize) -> Vec<PendingTransaction> {
371371
let chain_info = self.chain_info();
372-
self.txqueue.read().ready_transactions(chain_info.best_block_number, chain_info.best_block_timestamp)
372+
let mut transactions = self.txqueue.read()
373+
.ready_transactions(chain_info.best_block_number, chain_info.best_block_timestamp);
374+
transactions.truncate(max_len);
375+
transactions
373376
}
374377
}
375378

ethcore/node_filter/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ethabi-contract = "5.0"
1919
lru-cache = "0.1"
2020

2121
[dev-dependencies]
22+
ethcore = { path = "..", features = ["test-helpers"] }
2223
kvdb-memorydb = { path = "../../util/kvdb-memorydb" }
2324
ethcore-io = { path = "../../util/io" }
2425
tempdir = "0.3"

0 commit comments

Comments
 (0)