detect different node, same-key signing in aura (#7245)
* detect different node, same-key signing in aura * reduce scope of warning
This commit is contained in:
parent
bb1e03e9cb
commit
8f6f6a068e
@ -485,6 +485,7 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
|||||||
.expect("Header has been verified; qed").into();
|
.expect("Header has been verified; qed").into();
|
||||||
|
|
||||||
let step = self.step.load();
|
let step = self.step.load();
|
||||||
|
|
||||||
let expected_diff = calculate_score(parent_step, step.into());
|
let expected_diff = calculate_score(parent_step, step.into());
|
||||||
|
|
||||||
if header.difficulty() != &expected_diff {
|
if header.difficulty() != &expected_diff {
|
||||||
@ -517,6 +518,13 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if is_step_proposer(validators, header.parent_hash(), step, header.author()) {
|
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()) {
|
if let Ok(signature) = self.sign(header.bare_hash()) {
|
||||||
trace!(target: "engine", "generate_seal: Issuing a block for step {}.", step);
|
trace!(target: "engine", "generate_seal: Issuing a block for step {}.", step);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user