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

Commit fe91723

Browse files
committed
Merge branch 'master' into refactor/hashdb-generic
* master: Check whether we need resealing in miner and unwrap has_account in account_provider (#8853) docker: Fix alpine build (#8878) Remove mac os installers etc (#8875) README.md: update the list of dependencies (#8864) Fix concurrent access to signer queue (#8854)
2 parents 4d733bc + 3094ae9 commit fe91723

File tree

31 files changed

+102
-2406
lines changed

31 files changed

+102
-2406
lines changed

README.md

+1-1
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

+4-4
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/src/account_provider/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ impl AccountProvider {
272272
}
273273

274274
/// Checks whether an account with a given address is present.
275-
pub fn has_account(&self, address: Address) -> Result<bool, Error> {
276-
Ok(self.sstore.account_ref(&address).is_ok() && !self.blacklisted_accounts.contains(&address))
275+
pub fn has_account(&self, address: Address) -> bool {
276+
self.sstore.account_ref(&address).is_ok() && !self.blacklisted_accounts.contains(&address)
277277
}
278278

279279
/// Returns addresses of all accounts.

ethcore/src/miner/miner.rs

+20-13
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,20 @@ impl Miner {
700700
// Return if we restarted
701701
prepare_new
702702
}
703+
704+
/// Prepare pending block, check whether sealing is needed, and then update sealing.
705+
fn prepare_and_update_sealing<C: miner::BlockChainClient>(&self, chain: &C) {
706+
use miner::MinerService;
707+
708+
// Make sure to do it after transaction is imported and lock is dropped.
709+
// We need to create pending block and enable sealing.
710+
if self.engine.seals_internally().unwrap_or(false) || !self.prepare_pending_block(chain) {
711+
// If new block has not been prepared (means we already had one)
712+
// or Engine might be able to seal internally,
713+
// we need to update sealing.
714+
self.update_sealing(chain);
715+
}
716+
}
703717
}
704718

705719
const SEALING_TIMEOUT_IN_BLOCKS : u64 = 5;
@@ -766,12 +780,12 @@ impl miner::MinerService for Miner {
766780
transactions.into_iter().map(pool::verifier::Transaction::Unverified).collect(),
767781
);
768782

783+
// --------------------------------------------------------------------------
784+
// | NOTE Code below requires sealing locks. |
785+
// | Make sure to release the locks before calling that method. |
786+
// --------------------------------------------------------------------------
769787
if !results.is_empty() && self.options.reseal_on_external_tx && self.sealing.lock().reseal_allowed() {
770-
// --------------------------------------------------------------------------
771-
// | NOTE Code below requires sealing locks. |
772-
// | Make sure to release the locks before calling that method. |
773-
// --------------------------------------------------------------------------
774-
self.update_sealing(chain);
788+
self.prepare_and_update_sealing(chain);
775789
}
776790

777791
results
@@ -796,14 +810,7 @@ impl miner::MinerService for Miner {
796810
// | Make sure to release the locks before calling that method. |
797811
// --------------------------------------------------------------------------
798812
if imported.is_ok() && self.options.reseal_on_own_tx && self.sealing.lock().reseal_allowed() {
799-
// Make sure to do it after transaction is imported and lock is droped.
800-
// We need to create pending block and enable sealing.
801-
if self.engine.seals_internally().unwrap_or(false) || !self.prepare_pending_block(chain) {
802-
// If new block has not been prepared (means we already had one)
803-
// or Engine might be able to seal internally,
804-
// we need to update sealing.
805-
self.update_sealing(chain);
806-
}
813+
self.prepare_and_update_sealing(chain);
807814
}
808815

809816
imported

ethcore/src/miner/pool_client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'a, C: 'a> pool::client::Client for PoolClient<'a, C> where
124124
pool::client::AccountDetails {
125125
nonce: self.cached_nonces.account_nonce(address),
126126
balance: self.chain.latest_balance(address),
127-
is_local: self.accounts.map_or(false, |accounts| accounts.has_account(*address).unwrap_or(false)),
127+
is_local: self.accounts.map_or(false, |accounts| accounts.has_account(*address)),
128128
}
129129
}
130130

ethcore/src/snapshot/tests/proof_of_authority.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn fixed_to_contract_only() {
214214
secret!("dog42"),
215215
]);
216216

217-
assert!(provider.has_account(*RICH_ADDR).unwrap());
217+
assert!(provider.has_account(*RICH_ADDR));
218218

219219
let client = make_chain(provider, 3, vec![
220220
Transition::Manual(3, vec![addrs[2], addrs[3], addrs[5], addrs[7]]),
@@ -247,7 +247,7 @@ fn fixed_to_contract_to_contract() {
247247
secret!("dog42"),
248248
]);
249249

250-
assert!(provider.has_account(*RICH_ADDR).unwrap());
250+
assert!(provider.has_account(*RICH_ADDR));
251251

252252
let client = make_chain(provider, 3, vec![
253253
Transition::Manual(3, vec![addrs[2], addrs[3], addrs[5], addrs[7]]),

0 commit comments

Comments
 (0)