Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #53

Merged
merged 5 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethcore/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ pub fn enact(
let root = s.as_ref().unwrap().root();
let author_balance = s.as_ref().unwrap().balance(&env.author)?;
trace!(target: "enact", "num={}, root={}, author={}, author_balance={}\n",
b.block.header.number(), root, env.author, author_balance);
b.block.header.number(), root, env.author, author_balance);
}

b.push_transactions(transactions)?;
Expand Down
17 changes: 8 additions & 9 deletions ethcore/src/engines/clique/block_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use engines::clique::util::{extract_signers, recover_creator};
use error::Error;
use types::header::Header;


#[derive(Clone, Debug)]
pub struct CliqueBlockState {
pub votes: HashMap<(Address, Address), VoteType>, // k: (Voter, beneficiary), VoteType)
Expand Down Expand Up @@ -58,18 +57,18 @@ impl CliqueBlockState {
if !self.signers.contains(&creator) {
trace!(target: "engine", "current state: {:?}", self);
return Err(From::from(format!("Error applying #{}({}): {} is not in the signer list!",
header.number(),
header.hash(),
creator)));
header.number(),
header.hash(),
creator)));
}

// Check recent signer.
if self.recent_signers.contains(&creator) {
trace!(target: "engine", "current state: {:?}", self);
return Err(From::from(format!("Error applying #{}({}): {} is in the recent_signer list!",
header.number(),
header.hash(),
creator)));
header.number(),
header.hash(),
creator)));
}

// Ensure that the difficulty corresponds to the turn-ness of the signer
Expand All @@ -78,8 +77,8 @@ impl CliqueBlockState {
if (inturn && *header.difficulty() != DIFF_INTURN) ||
(!inturn && *header.difficulty() != DIFF_NOTURN) {
return Err(From::from(format!("Error applying #{}({}): wrong difficulty!",
header.number(),
header.hash())));
header.number(),
header.hash())));
}

Ok(creator)
Expand Down
16 changes: 8 additions & 8 deletions ethcore/src/engines/clique/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ impl Clique {
// for speed.
let backfill_start = time::Instant::now();
info!(target: "engine",
"Back-filling block state. last_checkpoint_number: {}, target: {}({}).",
last_checkpoint_number, header.number(), header.hash());
"Back-filling block state. last_checkpoint_number: {}, target: {}({}).",
last_checkpoint_number, header.number(), header.hash());

// Get the state for last checkpoint.
let last_checkpoint_hash = *(chain.front().ok_or(
Expand Down Expand Up @@ -284,8 +284,8 @@ impl Clique {

let elapsed = backfill_start.elapsed();
info!(target: "engine",
"Back-filling succeed, took {} ms.",
elapsed.as_secs() * 1000 + elapsed.subsec_millis() as u64,
"Back-filling succeed, took {} ms.",
elapsed.as_secs() * 1000 + elapsed.subsec_millis() as u64,
);

Ok(new_state)
Expand Down Expand Up @@ -430,7 +430,7 @@ impl Engine<EthereumMachine> for Clique {
match self.state(&parent) {
Err(e) => {
warn!(target: "engine", "generate_seal: can't get parent state(number: {}, hash: {}): {} ",
parent.number(), parent.hash(), e);
parent.number(), parent.hash(), e);
return Seal::None;
}
Ok(state) => {
Expand All @@ -454,8 +454,8 @@ impl Engine<EthereumMachine> for Clique {
// Wait for the right moment.
if now < limit {
trace!(target: "engine",
"generate_seal: sleeping to sign: inturn: {}, now: {:?}, to: {:?}.",
inturn, now, limit);
"generate_seal: sleeping to sign: inturn: {}, now: {:?}, to: {:?}.",
inturn, now, limit);
match limit.duration_since(SystemTime::now()) {
Ok(duration) => {
thread::sleep(duration);
Expand All @@ -468,7 +468,7 @@ impl Engine<EthereumMachine> for Clique {
}

trace!(target: "engine", "generate_seal: seal ready for block {}, txs: {}.",
block.header.number(), block.transactions.len());
block.header.number(), block.transactions.len());
return Seal::Regular(null_seal);
}
}
Expand Down
17 changes: 16 additions & 1 deletion ethcore/src/engines/clique/util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// 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 lru_cache::LruCache;
use parking_lot::RwLock;
Expand Down Expand Up @@ -42,7 +58,6 @@ pub fn recover_creator(header: &Header) -> Result<Address, Error> {
Ok(creator)
}


/// Extract signer list from extra_data.
///
/// Layout of extra_data:
Expand Down
3 changes: 1 addition & 2 deletions ethcore/src/miner/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ impl Author {
}
}


struct SealingWork {
queue: UsingQueue<ClosedBlock>,
enabled: bool,
Expand Down Expand Up @@ -1143,7 +1142,7 @@ impl miner::MinerService for Miner {
if block.block().header().number() == 1 {
if let Some(name) = self.engine.params().nonzero_bugfix_hard_fork() {
warn!("Your chain specification contains one or more hard forks which are required to be \
on by default. Please remove these forks and start your chain again: {}.", name);
on by default. Please remove these forks and start your chain again: {}.", name);
return;
}
}
Expand Down
Empty file modified scripts/gitlab/sign-win.cmd
100644 → 100755
Empty file.