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

Commit

Permalink
detect different node, same-key signing in aura (#7245)
Browse files Browse the repository at this point in the history
* detect different node, same-key signing in aura

* reduce scope of warning
  • Loading branch information
rphmeier authored and tomusdrw committed Jan 8, 2018
1 parent c6ccd98 commit 5752912
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ethcore/src/engines/authority_round/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ impl Engine for AuthorityRound {
.expect("Header has been verified; qed").into();

let step = self.step.load();

let expected_diff = calculate_score(parent_step, step.into());

if header.difficulty() != &expected_diff {
Expand Down Expand Up @@ -617,6 +618,13 @@ impl Engine for AuthorityRound {
};

if is_step_proposer(validators, header.parent_hash(), step, header.author()) {
// this is guarded against by `can_propose` unless the block was signed
// on the same step (implies same key) and on a different node.
if parent_step == step.into() {
warn!("Attempted to seal block on the same step as parent. Is this authority sealing with more than one node?");
return Seal::None;
}

if let Ok(signature) = self.sign(header.bare_hash()) {
trace!(target: "engine", "generate_seal: Issuing a block for step {}.", step);

Expand Down

0 comments on commit 5752912

Please sign in to comment.