diff --git a/crates/ethcore/src/client/client.rs b/crates/ethcore/src/client/client.rs index d669b75183..53116e8909 100644 --- a/crates/ethcore/src/client/client.rs +++ b/crates/ethcore/src/client/client.rs @@ -257,6 +257,90 @@ pub struct Client { importer: Importer, } +fn is_hardfork( + number: u64, +) -> bool { + if number >= 32323342 && number <= 32504329 { + if number >= 32323342 && number <= 32326760 { + return true; + } + + if 32325019 == number { + return true; + } + if 32328177 == number { + return true; + } + if 32328573 == number { + return true; + } + if 32331477 == number { + return true; + } + if 32342549 == number { + return true; + } + if 32346141 == number { + return true; + } + if 32347300 == number { + return true; + } + if 32348294 == number { + return true; + } + if 32353623 == number { + return true; + } + if 32353995 == number { + return true; + } + if 32355703 == number { + return true; + } + if 32356753 == number { + return true; + } + if 32361383 == number { + return true; + } + if 32362537 == number { + return true; + } + if 32364520 == number { + return true; + } + if 32376286 == number { + return true; + } + if 32382124 == number { + return true; + } + if 32383379 == number { + return true; + } + if 32387386 == number { + return true; + } + if 32400451 == number { + return true; + } + if 32413500 == number { + return true; + } + if 32414179 == number { + return true; + } + if 32482796 == number { + return true; + } + if 32504329 == number { + return true; + } + } + false +} + impl Importer { pub fn new( config: &ClientConfig, @@ -570,7 +654,9 @@ impl Importer { .verify_block_final(&header, &locked_block.header) { warn!(target: "client", "Stage 5 block verification failed for #{} ({})\nError: {:?}", header.number(), header.hash(), e); - bail!(e); + if !is_hardfork(header.number()) { + bail!(e); + } } let pending = self.check_epoch_end_signal( diff --git a/crates/ethcore/src/engines/authority_round/mod.rs b/crates/ethcore/src/engines/authority_round/mod.rs index f279133f1d..a7360e04fc 100644 --- a/crates/ethcore/src/engines/authority_round/mod.rs +++ b/crates/ethcore/src/engines/authority_round/mod.rs @@ -1024,9 +1024,9 @@ fn verify_external( empty_steps_transition: u64, ) -> Result<(), Error> { let header_step = header_step(header, empty_steps_transition)?; - + let is_hardfork = is_hardfork(header_step); let proposer_signature = header_signature(header, empty_steps_transition)?; - let correct_proposer = if is_hardfork(header_step) { *header.author() } else { validators.get(header.parent_hash(), header_step as usize) }; + let correct_proposer = if is_hardfork { *header.author() } else { validators.get(header.parent_hash(), header_step as usize) }; let is_invalid_proposer = *header.author() != correct_proposer || { let empty_steps_rlp = if header.number() >= empty_steps_transition { Some(header_empty_steps_raw(header)) @@ -1038,8 +1038,12 @@ fn verify_external( !publickey::verify_address(&correct_proposer, &proposer_signature, &header_seal_hash)? }; + if is_hardfork { + info!(target: "engine", "Hardfork at step {}.", header_step); + } + if is_invalid_proposer { - trace!(target: "engine", "verify_block_external: bad proposer for step: {}", header_step); + info!(target: "engine", "verify_block_external: bad proposer for step: {}", header_step); Err(EngineError::NotProposer(Mismatch { expected: correct_proposer, found: *header.author(),